Added function to entry remove categories

This commit is contained in:
2017-09-06 11:50:45 +07:00
parent 01ce24fd39
commit 1ee4ca3730
4 changed files with 117 additions and 39 deletions

View File

@@ -0,0 +1,36 @@
{% extends "base.html" %}
{% block title %}Kategori{% endblock %}
{% block body %}
<p>List Kategori:</p>
<ul>
{% for cat in categories %}
<li>{{ cat.category }}
<form method="post">
<input type="hidden" name="id" value="{{ cat.id }}">
<input type="hidden" name="_method" value="delete">
<input type="hidden" name="_addon" value="kategori">
<input type="hidden" name="_token" value="{{ token }}">
<button type="submit">Remove</button>
</form>
</li><br>
{% endfor %}
</ul>
<form method="post">
<label for="category">Tambah</label>
<input type="text" name="category" value="" placeholder="Kategori">
<input type="hidden" name="_method" value="post">
<input type="hidden" name="_addon" value="kategori">
<input type="hidden" name="_token" value="{{ token }}">
<button type="submit">Entry</button>
</form>
</form>
{% endblock %}

View File

@@ -24,6 +24,7 @@
{% if status %}
<a href="/posts/entry">+ Tambah Pengumuman</a>
<a href="/posts/category">+ Tambah Kategori</a>
<a href="/logout">Logout</a>
{% endif %}
{% endblock %}