Administrator can remove posts

This commit is contained in:
2017-09-09 14:07:53 +07:00
parent 086edebd41
commit 94d4a76ec6
4 changed files with 52 additions and 4 deletions

View File

@@ -74,7 +74,7 @@
{{ editor.full_name }}
{% endif %}
</span>
<input type="hidden" name="editor" value="{{ editor_now }}">
<input type="hidden" name="editor" value="{{ editor_now.id }}">
<br>
@@ -101,7 +101,7 @@
<br>
<button type="submit"
{% if (post.status == 0 or post.status == 3 or editor_now != creator.id) %}
{% if (post.status == 0 or post.status == 3 or editor_now.id != creator.id) %}
disabled
{% endif %}
>
@@ -109,7 +109,7 @@
</button>
</form>
{% if (post.status == 1 and editor_now == creator.id) %}
{% if (post.status == 1 and editor_now.id == creator.id) %}
<form method="post">
<input type="hidden" name="id" value="{{ post.id }}">
@@ -122,4 +122,18 @@
<button type="submit">Nonaktifkan</button>
</form>
{% endif %}
{% if editor_now.privilage == 1 %}
<form method="post">
<input type="hidden" name="id" value="{{ post.id }}">
<!-- Method -->
<input type="hidden" name="_method" value="remove">
<!-- Token -->
<input type="hidden" name="_token" value="{{ token }}">
<button type="submit" style="background-color: red; color: #FFF;">Remove</button>
</form>
{% endif %}
{% endblock %}

View File

@@ -27,6 +27,8 @@
{% endif %}
{% endfor %}
<br />
{% if status %}
<a href="/posts/entry">+ Tambah Pengumuman</a>
<a href="/posts/category">+ Tambah Kategori</a>