summaryrefslogtreecommitdiff
path: root/management/manager
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-17 15:04:29 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-17 15:04:29 -0700
commite82ae68634df85b06ff816525aa64a72ac9d8771 (patch)
tree919d8064fa2f12899486b907d9c0a878f8423cb3 /management/manager
parent48f47310204df4cb1bdb5ee8db761ab942b20527 (diff)
adding partial time helper and hard coding date & time inputs
Diffstat (limited to 'management/manager')
-rw-r--r--management/manager/manager.go22
1 files changed, 16 insertions, 6 deletions
diff --git a/management/manager/manager.go b/management/manager/manager.go
index 75680d7..46ee82a 100644
--- a/management/manager/manager.go
+++ b/management/manager/manager.go
@@ -13,15 +13,25 @@ const managerHTML = `
<form method="post" action="/admin/edit" enctype="multipart/form-data">
<input type="hidden" name="id" value="{{.ID}}"/>
<input type="hidden" name="type" value="{{.Kind}}"/>
- <input type="hidden" name="timestamp" value="" />
- <input type="hidden" name="updated" value="" />
+ <input type="hidden" name="timestamp" class="timestamp __ponzu" value="" />
+ <input type="hidden" name="updated" class="updated __ponzu" value="" />
{{ .Editor }}
</form>
<script>
- // remove all bad chars from all inputs in the form, except file fields
- $('form input:not([type=file]), form textarea').on('blur', function(e) {
- var val = e.target.value;
- e.target.value = replaceBadChars(val);
+ $(function() {
+ // remove all bad chars from all inputs in the form, except file fields
+ $('form input:not([type=file]), form textarea').on('blur', function(e) {
+ var val = e.target.value;
+ e.target.value = replaceBadChars(val);
+ });
+
+ // set time time and date inputs using the hidden timestamp input.
+ // if it is empty, set it to now and use that value for time and date
+ var publish_time = $('input.__ponzu.time'),
+ publish_date = $('input.__ponzu.date'),
+ now = new Date();
+
+ // set updated value to now
});
</script>
</div>