Added edit validation

This commit is contained in:
2017-09-06 11:19:44 +07:00
parent a34ce9d0eb
commit 01ce24fd39
2 changed files with 12 additions and 6 deletions

View File

@@ -40,7 +40,14 @@
<br>
<label for="expired_at">Berlaku sampai: </label>
<label>Berlaku dari: </label>
<span>
{{ post.valid_at }}
</span>
<br>
<label>Berlaku sampai: </label>
<span>
{{ post.expired_at }}
</span>
@@ -49,7 +56,7 @@
<label>Diubah pada: </label>
<span>
{% if post.edited_at == "0000-00-00 00:00:00" %}
{% if post.edited_at is empty %}
Tidak pernah
{% else %}
{{ post.edited_at }}
@@ -61,7 +68,7 @@
<label for="editor_name">Diubah oleh: </label>
<span>
{% if post.editor == "0" %}
{% if post.editor is empty %}
-
{% else %}
{{ editor.name }}
@@ -92,7 +99,7 @@
<br>
<button type="submit"
{% if post.status == 0 %}
{% if (post.status == 0 and post.valid_at <= timestamp or editor_now != creator.id) %}
disabled
{% endif %}
>