-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
167 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<H1>Article :: {{ article.id }}</H1> | ||
|
||
<input type="hidden" id="csrftoken" value="{{csrftoken}}"> | ||
|
||
<table id="article" class="table table-striped table-bordered"> | ||
<tbody> | ||
{% if not create %} | ||
<tr> | ||
<th>ID</th> | ||
<td> | ||
{{ article.id }} | ||
</td> | ||
</tr> | ||
{% endif %} | ||
<tr> | ||
<th>Title</th> | ||
<td> | ||
<input type="text" name="title" value="{{ article.title }}" class="form-control form-control-sm"> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Content</th> | ||
<td> | ||
<textarea name="content" class="form-control form-control-sm">{{ article.content }}</textarea> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Full Content</th> | ||
<td> | ||
<textarea name="contentfull" class="form-control form-control-sm">{{ article.contentfull }}</textarea> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Created</th> | ||
<td> | ||
{% if not create %} | ||
{{ article.created }} ({{ article.created | date }}) | ||
{% else %} | ||
{{ time }} ({{ time | date }}) | ||
{% endif %} | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Visible From</th> | ||
<td> | ||
<input type="text" name="visiblefrom" value="{{ article.visiblefrom }}" class="form-control form-control-sm"> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Visible Until</th> | ||
<td> | ||
<input type="text" name="visibleuntil" value="{{ article.visibleuntil }}" class="form-control form-control-sm"> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<script src="{{ url('/assets/admin_article.js') }}"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<H1>Article List</H1> | ||
|
||
<input type="hidden" id="csrftoken" value="{{csrftoken}}"> | ||
<input class="form-control" data-search-top="table#articlelist" value="" placeholder="Search..."><br> | ||
|
||
<div class="float-right"> | ||
<a class="btn btn-block btn-success" href="{{ url('/admin/articles/create') }}">Add Article</a> | ||
</div> | ||
<br><br> | ||
|
||
<table id="articlelist" class="table table-striped table-bordered"> | ||
<thead> | ||
<tr> | ||
<th class="id">ID</th> | ||
<th class="title">Title</th> | ||
<th class="content">Content</th> | ||
<th class="visible">Visible</th> | ||
<th class="actions">Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for article in articles %} | ||
<tr data-searchable-value="{{ article.title }}"> | ||
<td class="id"> | ||
{{ article.id }} | ||
</td> | ||
<td class="title"> | ||
{{ article.title }} | ||
</td> | ||
<td class="content"> | ||
{{ article.content }} | ||
</td> | ||
<td class="visible"> | ||
{% set visible = article.visiblefrom < time and (article.visibleuntil == -1 or article.visibleuntil > time) %} | ||
|
||
<span class="value badge {% if visible %}badge-success{% else %}badge-danger{% endif %}"> | ||
{{ visible | yesno }} | ||
</span> | ||
</td> | ||
<td class="actions"> | ||
{% if userinfo.email != user.email %} | ||
<a href="{{ url('/admin/articles/' ~ article.id) }}" class="btn btn-sm btn-success">View/Edit</a> | ||
<button data-action="deletearticle" data-id="{{ article.id }}" class="btn btn-sm btn-danger">Delete</a> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
{% embed 'blocks/modal_confirm.tpl' with {'id': 'confirmDelete'} only %} | ||
{% block title %} | ||
Delete Article | ||
{% endblock %} | ||
|
||
{% block body %} | ||
Are you sure you want to delete this Article? | ||
{% endblock %} | ||
{% endembed %} | ||
|
||
<script src="{{ url('/assets/admin_articles.js') }}"></script> |