Show relative time in log list + fix locale for handlebar formatTime/formatRelative

This commit is contained in:
Alexandre Aubin 2018-07-23 17:11:02 +00:00
parent 92c97487a8
commit eee196e090
3 changed files with 8 additions and 5 deletions

View file

@ -121,9 +121,7 @@
c.view('tools/tools_logs', { c.view('tools/tools_logs', {
"data": data, "data": data,
formatDate: function() { "locale": y18n.locale
return this.started_at.getDate();
}
}); });
}); });
}); });
@ -148,7 +146,8 @@
} }
c.view('tools/tools_log', { c.view('tools/tools_log', {
"log": log, "log": log,
"next_number": log.logs.length == number ? number * 10:false "next_number": log.logs.length == number ? number * 10:false,
"locale": y18n.locale
}); });
}); });
}); });

View file

@ -13,6 +13,7 @@
<div class="separator"></div> <div class="separator"></div>
{{#intl locales=locale}}
{{#if log.metadata}} {{#if log.metadata}}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
@ -60,3 +61,4 @@
{{/log.logs}}</pre> {{/log.logs}}</pre>
</div> </div>
</div> </div>
{{/intl}}

View file

@ -6,6 +6,7 @@
<div class="separator"></div> <div class="separator"></div>
{{#intl locales=locale}}
{{#if data}} {{#if data}}
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
{{#data}} {{#data}}
@ -21,7 +22,7 @@
<div id="collapse-{{key}}" class="panel-collapse{{#if @first}}{{else}} collapse{{/if}}" role="tabpanel" aria-labelledby="heading-{{key}}"> <div id="collapse-{{key}}" class="panel-collapse{{#if @first}}{{else}} collapse{{/if}}" role="tabpanel" aria-labelledby="heading-{{key}}">
<div class="list-group"> <div class="list-group">
{{#value}} {{#value}}
<a href="#/tools/logs/{{ name }}" class="list-group-item"><small>{{ started_at }}</small> {{ description }}</a> <a href="#/tools/logs/{{ name }}" class="list-group-item" title='{{formatTime started_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}'><small style="margin-right:20px;" >{{formatRelative started_at}}</small> {{ description }}</a>
{{/value}} {{/value}}
</div> </div>
</div> </div>
@ -30,3 +31,4 @@
{{/data}} {{/data}}
</div> </div>
{{/if}} {{/if}}
{{/intl}}