Now can edit a category

This commit is contained in:
2017-09-22 12:50:25 +07:00
parent 8b78715cd4
commit 0b1c3f3370
3 changed files with 30 additions and 33 deletions

View File

@@ -1,20 +0,0 @@
{% extends "base.html" %}
{% block title %}Ubah Kategori{% endblock %}
{% block body %}
<main class="documentation">
<section>
<form method="post">
<div class="flex four-600 two">
<h1>Kategori
</h1>
<h1>
<input type="text" name="category" value="{{ category.category }}">
</h1>
</form>
</section>
</main>
{% endblock %}

View File

@@ -5,7 +5,7 @@
{% block body %}
<main class="documentation">
<section>
<h1>Kategori</h1>
<h1><a href="/posts/category">Kategori</a></h1>
<div class="flex two-600 full grow">
@@ -17,29 +17,34 @@
<label for="category">Nama</label>
</div>
<div class="two-third-600 full">
<input type="text" name="category">
<input type="text" name="category" value="{{ value.category }}">
</div>
<div class="third-600 full">
<label for="background">Background</label>
</div>
<div class="two-third-600 full">
<input type="color" name="background">
<input type="color" name="background" value="{{ value.background }}">
</div>
<div class="third-600 full">
<label for="foreground">Teks</label>
</div>
<div class="two-third-600 full">
<input type="color" name="foreground">
<input type="color" name="foreground" value="{{ value.foreground }}">
</div>
<input type="hidden" name="_method" value="post">
<input type="hidden" name="_method" value="{{ method }}">
<input type="hidden" name="_addon" value="kategori">
<input type="hidden" name="_token" value="{{ token }}">
<button type="submit" class="pseudo full">
{% if method == 'post' %}
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
<span style="font-size:smaller;">Tambah</span>
{% else %}
<i class="fa fa-edit fa-fw" aria-hidden="true"></i>
<span style="font-size:smaller;">Ubah</span>
{% endif %}
</button>
</div>
</form>
@@ -58,7 +63,7 @@
<div class="flex two-600 full grow" style="margin:0;">
<div>
<a href="#" class="pseudo button full">
<a href="/posts/category/{{ cat.id }}" class="pseudo button full">
<i class="fa fa-edit fa-fw"></i>
<span style="font-size:smaller;">Ubah</span>
</a>