reformat changes as table and show relative time
[MojoFacets.git] / templates / changes / index.html.ep
1 % layout 'ui';
2 <h2><%= $message %></h2>
3
4 <form class=action_filter>
5 <input type=submit value="Filter changes">
6 <ul>
7 % foreach my $type ( sort keys %$actions ) {
8 <li><label>
9 <input type=checkbox name=action_filter value="<%= $type %>">
10 <%= $type %><span class=count><%= $actions->{$type} %></span>
11 </label>
12 % }
13 </ul>
14 <input type=submit value="Filter changes">
15 </form>
16
17 <table>
18 <tr><th>action</th><th>timestamp</th></tr>
19 % foreach my $change ( @$changes ) {
20 <tr><td>
21 <a href="<%= url_for( controller => 'changes', action => 'view' )->query( uid => $change->{uid} ) %>"><%= $change->{action} %></a>
22 </td><td>
23 <tt class=ts><%= $change->{t} %></tt>
24 </td></tr>
25 % }
26 </table>
27
28 % my $more = ( $#$changes ) * 10;
29 Show <a href="<%= url_for( controller => 'changes', action => 'index' )->query( max => $more ) %>"><%= $more %> changes</a>
30
31 <script type="text/javascript" src="/js/date_pretty.js"></script>
32 <script type="text/javascript">
33 $(document).ready( function(){
34         console.debug('convert timestamps');
35         $('tt.ts').each( function(){
36                 $(this).text( date_pretty( new Date(this.textContent * 1000) ) );
37         });
38 });
39 </script>