git-arr/views/commit-list.html
Alberto Bertogli e1349d418c views: In the summary, make the sections toggable
As an experiment, make the sections of the summary to be toggable. This
can help readability, although it's unclear if it's worth the additional
complexity and could be removed later.
2017-08-27 19:43:36 +01:00

48 lines
1.1 KiB
HTML

% def refs_to_html(refs):
% for ref in refs:
% c = ref.split('/', 2)
% if len(c) != 3:
% return
% end
% if c[1] == 'heads':
<span class="refs head">{{c[2]}}</span>
% elif c[1] == 'tags':
% if c[2].endswith('^{}'):
% c[2] = c[2][:-3]
% end
<span class="refs tag">{{c[2]}}</span>
% end
% end
% end
<table class="nice commits" id="commits">
% refs = repo.refs()
% if not defined("commits"):
% commits = repo.commits(start_ref, limit = limit, offset = offset)
% end
% for c in commits:
<tr>
<td class="date">
<span title="{{c.author_date.str}}">{{c.author_date.utc.date()}}</span>
</td>
<td class="subject">
<a href="{{repo_root}}/c/{{c.id}}/"
title="{{c.subject}}">
{{shorten(c.subject)}}</a>
</td>
<td class="author">
<span title="{{c.author_name}}">{{shorten(c.author_name, 26)}}</span>
</td>
% if c.id in refs:
<td>
% refs_to_html(refs[c.id])
</td>
% end
</tr>
% end
</table>