tp_servicedesk/ui/views/kb/index.html

63 lines
2.1 KiB
HTML
Raw Normal View History

2025-02-09 21:23:06 +00:00
<h1 class="title">Knowledge Base</h1>
<include href="/ui/session/error.html"></include>
<p><a class="button" href="/kb/create">create kb article</a></p>
2025-02-09 21:23:06 +00:00
<hr>
2025-02-11 09:26:53 +00:00
<div class="block">
<form method="GET" action="/kb">
<div class="level">
<div class="level-item">
<check if="{{ isset(@GET.search)}}">
<true>
<input class="input" type="text" name="search" placeholder="Search by title..."
value="{{ HTMLPurifier::instance()->purify( @GET.search) }}">
</true>
<false>
<input class="input" type="text" name="search" placeholder="Search by title...">
</false>
</check>
2025-02-11 09:26:53 +00:00
</div>
<div class="level-right">
<div class="select">
<select name="tag">
<option value="">--Filter by Tag</option>
<!-- TODO: load list of all tags-->
</select>
</div>
</div>
<div class="level-right">
<button class="button is-primary" type="submit">Search</button>
</div>
</div>
</form>
</div>
2025-02-09 21:23:06 +00:00
2025-02-11 09:26:53 +00:00
<check if="{{@articles}}">
<table class="table is-fullwidth is-bordered">
<thead>
2025-03-23 10:33:02 +00:00
<tr class="has-background-info">
2025-02-11 09:26:53 +00:00
<th>id</th><th>title</th><th>created_at</th>
<th></th>
2025-02-09 21:23:06 +00:00
</tr>
2025-02-11 09:26:53 +00:00
</thead>
<tbody>
<repeat group="{{@articles}}" value="{{@article}}">
<tr>
2025-03-23 10:33:02 +00:00
<td>{{@article.id}}</td>
<td><a href="/kb/{{@article.id}}">{{@article.title}}</a></td>
2025-02-11 09:26:53 +00:00
<td>{{@article.created_at}}</td>
<td>
<a href="/kb/{{@article.id}}/edit"><i class="fa fa-edit"></i></a>
</td>
</tr>
</repeat>
</tbody>
</table>
</check>
<check if="!@articles">
<div class="notification is-info is-light">
<p>No articles found.</p>
</div>
</check>