Skip to content

Commit

Permalink
show timestamps in humantime
Browse files Browse the repository at this point in the history
  • Loading branch information
luto committed Nov 3, 2014
1 parent 5de6f58 commit b10f66e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions tpls/list.tpl
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
{% macro shownote(note) %}
{% macro shownote(note, top) %}

{% if 'chapter' in note.tags %}
<h2><span>{{note.timestamp}}</span> {{note.title}}</h2>
<h2><span>{{note.timestamp | htime}}</span> {{note.title}}</h2>
{% else %}
{% if note.url %}
<a href="{{note.url}}" data-tooltip="{{note.timestamp}}">{{note.title}}</a>
<a href="{{note.url}}" data-tooltip="{{note.timestamp | htime}}">{{note.title}}</a>
{% else %}
<span data-tooltip="{{note.timestamp}}">{{note.title}}</span>
<span data-tooltip="{{note.timestamp | htime}}">{{note.title}}</span>
{% endif %}
{% endif %}

<ul>
{% for subnote in note.shownotes %}
<li>
{{ shownote(subnote) }}
{{ shownote(subnote, false) }}
</li>
{% endfor %}
</ul>

{% endmacro %}

<div class="document-list">
{% for note in shownotes %}
{{ shownote(note, true) }}
{% endfor %}

{% for note in shownotes %}
{{ shownote(note, true) }}
{% endfor %}

</div>
2 changes: 1 addition & 1 deletion tpls/osf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ HEADER
/HEADER

{% macro shownote(note) -%}
{{note.timestamp}} {{note.title}}
{{note.timestamp | htime}} {{note.title}}
{%- if note.url %} <{{note.url}}> {%- endif -%}
{%- for tag in note.tags %} #{{ tag }} {%- endfor -%}

Expand Down

0 comments on commit b10f66e

Please sign in to comment.