Beautify the web

This commit is contained in:
2017-09-12 14:30:42 +07:00
parent 1f62a24c80
commit 5b1b546dc5
12 changed files with 6048 additions and 208 deletions

View File

@@ -3,123 +3,151 @@
{% block title %}Ubah Pengumuman{% endblock %}
{% block body %}
<form method="post">
<h3>Pengumuman {{ post.id }}</h3>
<main class="documentation">
<section>
<h1>Pengumuman {{ post.id }}</h1>
<label for="category">Kategori: </label>
<select name="category">
{% for cat in categories %}
<option value="{{ cat.id }}"
{% if post.category == cat.id %}
selected
{% endif %}
>
{{ cat.category }}
</option>
{% endfor %}
</select>
<input type="hidden" name="old_category" value="{{ post.category }}">
<br>
<label for="content">Konten: </label>
<textarea name="content" rows="3" cols="30" maxlength="255">{{ post.content }}</textarea>
<input type="hidden" name="old_content" value="{{ post.content }}">
<br>
<label>Dibuat pada: </label>
<span>
{{ post.created_at }}
</span>
<br>
<label>Dibuat oleh: </label>
<span>
{{ creator.full_name }}
</span>
<br>
<label for="valid_at">Berlaku dari: </label>
<input type="date" name="valid_at" value="{{ post.valid_at }}">
<input type="hidden" name="old_valid_at" value="{{ post.valid_at }}">
<br>
<label for="expired_at">Berlaku sampai: </label>
<input type="date" name="expired_at" value="{{ post.expired_at }}">
<input type="hidden" name="old_expired_at" value="{{ post.expired_at }}">
<br>
<label>Diubah pada: </label>
<span>
{% if post.edited_at is empty %}
-
{% else %}
{{ post.edited_at }}
{% endif %}
</span>
<input type="hidden" name="edited_at" value="{{ timestamp }}">
<br>
<label for="editor_name">Diubah oleh: </label>
<span>
{% if post.editor is empty %}
-
{% else %}
{{ editor.full_name }}
{% endif %}
</span>
<input type="hidden" name="editor" value="{{ editor_now.id }}">
<br>
<label>Status: </label>
<span>
{% if post.status == 1 %}
Aktif
{% elseif post.status == 2 %}
Belum aktif
{% else %}
Nonaktif
{% endif %}
</span>
<!-- Current Timestamp -->
<input type="hidden" name="_currts" value="{{ timestamp }}" disabled>
<!-- Method -->
<input type="hidden" name="_method" value="put">
<!-- Token -->
<input type="hidden" name="_token" value="{{ token }}">
<br>
<button type="submit"
{% if (post.status == 0 or post.status == 3 or editor_now.id != creator.id) %}
disabled
{% endif %}
>
Ubah
</button>
</form>
{% if (post.status == 1 and editor_now.id == creator.id) %}
<form method="post">
<input type="hidden" name="id" value="{{ post.id }}">
<div class="flex five grow">
<aside class="two-fifth-600 full">
<div class="stack">
<label>Dibuat pada: </label>
<span>
{{ post.created_at }}
</span>
</div>
<div class="stack">
<label>Dibuat oleh: </label>
<span>
{{ creator.full_name }}
</span>
</div>
<div class="stack">
<label>Diubah pada: </label>
<span>
{% if post.edited_at is empty %}
-
{% else %}
{{ post.edited_at }}
{% endif %}
</span>
<input type="hidden" name="edited_at" value="{{ timestamp }}">
</div>
<div class="stack">
<label>Diubah oleh: </label>
<span>
{% if post.editor is empty %}
-
{% else %}
{{ editor.full_name }}
{% endif %}
</span>
<input type="hidden" name="editor" value="{{ editor_now.id }}">
</div>
<div class="stack">
<label>Status: </label>
<span>
{% if post.status == 1 %}
Aktif
{% elseif post.status == 2 %}
Belum aktif
{% else %}
Nonaktif
{% endif %}
</span>
</div>
</aside>
<!-- Method -->
<input type="hidden" name="_method" value="delete">
<div class="three-fifth-600 full">
<div class="stack">
<div class="stack">
<label for="category">Kategori: </label>
</div>
<div class="stack">
<select name="category">
{% for cat in categories %}
<option value="{{ cat.id }}"
{% if post.category == cat.id %}
selected
{% endif %}
>
{{ cat.category }}
</option>
{% endfor %}
</select>
</div>
<input type="hidden" name="old_category" value="{{ post.category }}">
</div>
<!-- Token -->
<input type="hidden" name="_token" value="{{ token }}">
<div class="stack">
<div class="stack">
<label for="content">Konten: </label>
</div>
<div class="stack">
<textarea name="content" rows="3" maxlength="255">{{ post.content }}</textarea>
</div>
<input type="hidden" name="old_content" value="{{ post.content }}">
</div>
<button type="submit">Nonaktifkan</button>
<div class="stack">
<div class="stack">
<label for="valid_at">Berlaku dari: </label>
</div>
<div class="stack">
<input type="date" name="valid_at" value="{{ post.valid_at }}">
</div>
<input type="hidden" name="old_valid_at" value="{{ post.valid_at }}">
</div>
<div class="stack">
<div class="stack">
<label for="expired_at">Berlaku sampai: </label>
</div>
<div class="stack">
<input type="date" name="expired_at" value="{{ post.expired_at }}">
</div>
<input type="hidden" name="old_expired_at" value="{{ post.expired_at }}">
</div>
<!-- Current Timestamp -->
<input type="hidden" name="_currts" value="{{ timestamp }}" disabled>
<!-- Method -->
<input type="hidden" name="_method" value="put">
<!-- Token -->
<input type="hidden" name="_token" value="{{ token }}">
<div class="off-four-fifth-600 full">
<button class="fifth" type="submit"
{% if (post.status == 0 or post.status == 3 or editor_now.id != creator.id) %}
disabled
{% endif %}>
<i class="fa fa-edit fa-fw" aria-hidden="true"></i>
</button>
</div>
</div>
</div>
</form>
{% endif %}
{% if (post.status == 1 and editor_now.id == creator.id) %}
<div class="flex five grow">
<div class="off-two-fifth-600">
<form method="post">
<input type="hidden" name="id" value="{{ post.id }}">
<!-- Method -->
<input type="hidden" name="_method" value="delete">
<!-- Token -->
<input type="hidden" name="_token" value="{{ token }}">
<div class="off-four-fifth-600 full">
<button type="submit" class="error fifth">
<i class="fa fa-times-circle-o fa-fw" aria-hidden="true"></i>
</button>
</div>
</form>
</div>
</div>
{% endif %}
</section>
</main>
{% endblock %}

View File

@@ -48,7 +48,9 @@
<br>
<button type="submit" class="success">Unggah</button>
<button type="submit">
<i class="fa fa-check fa-fw"></i>
</button>
</div>
</form>
</section>

View File

@@ -3,9 +3,12 @@
{% block title %}Kategori{% endblock %}
{% block body %}
<p>List Kategori:</p>
<ul>
{% for cat in categories %}
<main class="documentation">
<section>
<h1>Kategori</h1>
<h2>List</h2>
<ul>
{% for cat in categories %}
<li>{{ cat.category }}
<form method="post">
<input type="hidden" name="id" value="{{ cat.id }}">
@@ -14,33 +17,41 @@
{% elseif cat.status == 0 %}
<input type="hidden" name="_method" value="put">
{% endif %}
<input type="hidden" name="_addon" value="kategori">
<input type="hidden" name="_token" value="{{ token }}">
<button type="submit" class="shyButton error">
{% if cat.status == 1 %}
<button type="submit">Nonaktifkan</button>
Nonaktifkan
{% elseif cat.status == 0 %}
<button type="submit">Aktifkan</button>
{% else %}
<code>Nonaktif</code>
Aktifkan
{% endif %}
</button>
</form>
</li><br>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
<form method="post">
<label for="category">Nama Kategori: </label>
<input type="text" name="category" value="" placeholder="Kategori">
<form method="post">
<h2>Tambah</h2>
<div class="flex three grow">
<div class="third-600 full">
<input type="text" name="category" value="" placeholder="Kategori">
</div>
<div class="third-600 none"></div>
<div class="third-600 none"></div>
<input type="hidden" name="_method" value="post">
<input type="hidden" name="_addon" value="kategori">
<input type="hidden" name="_token" value="{{ token }}">
<input type="hidden" name="_method" value="post">
<input type="hidden" name="_addon" value="kategori">
<input type="hidden" name="_token" value="{{ token }}">
<button type="submit">Tambah</button>
</form>
</form>
<div>
<button type="submit" class="third-600 full">
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
</button>
</div>
</div>
</form>
</section>
</main>
{% endblock %}

View File

@@ -3,15 +3,20 @@
{% block title %}Pengumuman{% endblock %}
{% block nav %}
<input type="checkbox" id="bmenug" class="show">
<label for="bmenug" class="burger pseudo button"><i class="fa fa-bars" aria-hidden="true"></i></label>
<div class="menu">
{% if privilage != "" %}
<a href="/posts/entry" class="pseudo button">+ Pengumuman</a>
<a href="/posts/entry" class="pseudo button" data-tooltip="Pengumuman Baru"><i class="fa fa-newspaper-o" aria-hidden="true"></i></a>
{% if privilage == 1 %}
<a href="/posts/category" class="pseudo button">+ Kategori</a>
<a href="/posts/category" class="pseudo button" data-tooltip="Kategori"><i class="fa fa-list-ul" aria-hidden="true"></i></a>
<a href="/register" class="pseudo button" data-tooltip="User Baru"><i class="fa fa-user-plus" aria-hidden="true"></i></a>
{% endif %}
<a href="/logout" class="button error">Keluar</a>
<a href="/logout" class="pseudo button" data-tooltip="Keluar"><i class="fa fa-sign-out" aria-hidden="true"></i></a>
{% else %}
<a href="/login" class="button">Masuk</a>
<a href="/login" class="pseudo button" data-tooltip="Masuk">
<i class="fa fa-sign-in" aria-hidden="true"></i>
</a>
{% endif %}
</div>
{% endblock %}
@@ -22,23 +27,27 @@
<h1>List Pengumuman</h1>
{% for post in posts %}
{% if post.id %}
<h2>Pengumuman {{ post.id }}</h2>
<h2>
Pengumuman {{ post.id }}
<span class="shyFont">
{% if status %}
{% if post.status == 1 %}
<a href="/posts/edit/{{ post.id }}" data-tooltip="Ubah">
<i class="fa fa-edit" aria-hidden="true"></i>
</a>
{% elseif post.status == 2 %}
<a href="/posts/edit/{{ post.id }}" data-tooltip="Ubah (Belum aktif)">
<strike><i class="fa fa-edit" aria-hidden="true"></i></strike>
</a> (Belum aktif)
{% else %}
<strike data-tooltip="Tidak dapat diubah (Tidak aktif)"><i class="fa fa-edit" aria-hidden="true"></i></strike>
(Nonaktif)
{% endif %}
{% endif %}
</span>
</h2>
{{ post.content | raw }}
<br />
{% if status %}
{% if post.status == 1 %}
<a href="/posts/edit/{{ post.id }}">
Edit
</a>
{% elseif post.status == 2 %}
<a href="/posts/edit/{{ post.id }}">
<strike>Edit</strike>
</a> (Belum aktif)
{% else %}
<strike>Edit</strike>
(Nonaktif)
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</section>