Added MDE (issue #4)

This commit is contained in:
2017-09-15 13:56:24 +07:00
parent 0f011f2545
commit ec548a46b7
21 changed files with 4351 additions and 44 deletions

View File

@@ -13,7 +13,7 @@
<div class="stack">
<label>Dibuat pada: </label>
<span>
{{ post.created_at }}
{{ post.created_at|date("d-m-Y") }}
</span>
</div>
<div class="stack">
@@ -28,7 +28,7 @@
{% if post.edited_at is empty %}
-
{% else %}
{{ post.edited_at }}
{{ post.edited_at|date("d-m-Y") }}
{% endif %}
</span>
<input type="hidden" name="edited_at" value="{{ timestamp }}">
@@ -84,7 +84,7 @@
<label for="content">Konten: </label>
</div>
<div class="stack">
<textarea name="content" rows="3" maxlength="255">{{ post.content }}</textarea>
<textarea id="smde" name="content" rows="3" maxlength="255">{{ post.content }}</textarea>
</div>
<input type="hidden" name="old_content" value="{{ post.content }}">
</div>
@@ -94,9 +94,9 @@
<label for="valid_at">Berlaku dari: </label>
</div>
<div class="stack">
<input id="left" name="valid_at" value="{{ post.valid_at }}">
<input id="left" name="valid_at" value="{{ post.valid_at|date("d-m-Y") }}">
</div>
<input type="hidden" name="old_valid_at" value="{{ post.valid_at }}">
<input type="hidden" name="old_valid_at" value="{{ post.valid_at|date("d-m-Y") }}">
</div>
<div class="stack">
@@ -104,16 +104,13 @@
<label for="expired_at">Berlaku sampai: </label>
</div>
<div class="stack">
<input id="right" name="expired_at" value="{{ post.expired_at }}">
<input id="right" name="expired_at" value="{{ post.expired_at|date("d-m-Y") }}">
</div>
<input type="hidden" name="old_expired_at" value="{{ post.expired_at }}">
<input type="hidden" name="old_expired_at" value="{{ post.expired_at|date("d-m-Y") }}">
</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">
@@ -122,31 +119,12 @@
disabled
{% endif %}>
<i class="fa fa-edit fa-fw" aria-hidden="true"></i>
<span style="font-size:smaller;">Ubah</span>
</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>
@@ -159,5 +137,7 @@
dateValidator: rome.val.afterEq(left),
time: false
});
var simplemde = new SimpleMDE({ element: document.getElementById("smde") });
</script>
{% endblock %}