more updates to match new code, new entry for testing
This commit is contained in:
parent
46751d66ca
commit
008d2d760c
140 changed files with 17228 additions and 12 deletions
26
themes/yesplease/templates/_components.tmpl
Normal file
26
themes/yesplease/templates/_components.tmpl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<%doc>
|
||||
Mako defs which generate formatted output or HTML components.
|
||||
|
||||
This can be used as a namespace in other templates.
|
||||
</%doc>
|
||||
<%! from uuid import uuid4 %>
|
||||
|
||||
<%def name="fancy_date(date_value)">
|
||||
<%doc>
|
||||
Show the date in plain language as relative to now. Eg "1 year ago".
|
||||
|
||||
This requires the moment.js library.
|
||||
</%doc>
|
||||
|
||||
<% id_ = uuid4() %>
|
||||
<span id="${id_}">
|
||||
|
||||
</span>
|
||||
<script>
|
||||
(function(){
|
||||
var el = document.getElementById("${id_}");
|
||||
var fromNow = moment("${date_value.isoformat()}").fromNow();
|
||||
el.innerHTML = fromNow;
|
||||
})();
|
||||
</script>
|
||||
</%def>
|
||||
Loading…
Add table
Add a link
Reference in a new issue