lepisi-pengumuman/App/Views/Data/edit_pengumuman.html

154 lines
6.2 KiB
HTML

{% extends "base.html" %}
{% block title %}Ubah Pengumuman{% endblock %}
{% block body %}
<main class="documentation">
<section>
<h1>Pengumuman {{ post.id }}</h1>
<form method="post">
<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>
<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>
<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>
<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>
{% 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 %}