##// END OF EJS Templates
summary: use shared changelog_table implementation on summary page...
summary: use shared changelog_table implementation on summary page The main purpose of this change is to simplify code and avoid duplication. Using the shared implementation also happens to give a slightly different view of the changesets. There will be no table headers, the columns are shown in different order, author gravatars are shown, commit messages can be expanded, and there is slightly different styling. Small remaining amounts of template code is moved from changelog_summary_data.html to summary.html. Patch modified by Mads Kiilerich.

File last commit:

r6771:4f344714 default
r6774:f92d0806 default
Show More
changelog_table.html
120 lines | 5.1 KiB | text/html | HtmlLexer
## Render changelog table with id 'changesets' with the range of changesets,
## statuses, and comments.
## Optionally, pass a js snippet to run whenever a table resize is triggered.
<%def name="changelog(repo_name, cs_range, cs_statuses, cs_comments, show_checkbox=False, show_branch=True, resize_js='')">
<table class="table" id="changesets">
<tbody>
%for cnt,cs in enumerate(cs_range):
<tr id="chg_${cnt+1}" class="${'mergerow' if len(cs.parents) > 1 else ''}">
%if show_checkbox:
<td class="checkbox-column">
${h.checkbox(cs.raw_id,class_="changeset_range")}
</td>
%endif
<td class="status">
%if cs_statuses.get(cs.raw_id):
%if cs_statuses.get(cs.raw_id)[2]:
<a data-toggle="tooltip"
title="${_('Changeset status: %s by %s\nClick to open associated pull request %s') % (cs_statuses.get(cs.raw_id)[1], cs_statuses.get(cs.raw_id)[5].username, cs_statuses.get(cs.raw_id)[4])}"
href="${h.url('pullrequest_show',repo_name=cs_statuses.get(cs.raw_id)[3],pull_request_id=cs_statuses.get(cs.raw_id)[2])}">
<i class="icon-circle changeset-status-${cs_statuses.get(cs.raw_id)[0]}"></i>
</a>
%else:
<a data-toggle="tooltip"
title="${_('Changeset status: %s by %s') % (cs_statuses.get(cs.raw_id)[1], cs_statuses.get(cs.raw_id)[5].username)}"
href="${cs_comments[cs.raw_id][0].url()}">
<i class="icon-circle changeset-status-${cs_statuses.get(cs.raw_id)[0]}"></i>
</a>
%endif
%endif
</td>
<td class="author" data-toggle="tooltip" title="${cs.author}">
${h.gravatar(h.email_or_none(cs.author), size=16)}
<span class="user">${h.person(cs.author)}</span>
</td>
<td class="hash">
${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id), class_='changeset_hash')}
</td>
<td class="date">
<div data-toggle="tooltip" title="${h.fmt_date(cs.date)}">${h.age(cs.date,True)}</div>
</td>
<% message_lines = cs.message.splitlines() %>
%if len(message_lines) > 1:
<td class="expand_commit" title="${_('Expand commit message')}">
<i class="icon-align-left"></i>
</td>
%else:
<td></td>
%endif
<td class="mid">
<div class="log-container">
<div class="message">
<div class="message-firstline">${h.urlify_text(message_lines[0], c.repo_name,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))}</div>
%if len(message_lines) > 1:
<div class="message-full hidden">${h.urlify_text(cs.message, repo_name)}</div>
%endif
</div>
<div class="extra-container">
%if cs_comments.get(cs.raw_id):
<a class="comments-container comments-cnt" href="${cs_comments[cs.raw_id][0].url()}" data-toggle="tooltip" title="${_('%s comments') % len(cs_comments[cs.raw_id])}">
${len(cs_comments[cs.raw_id])}
<i class="icon-comment-discussion"></i>
</a>
%endif
%if cs.bumped:
<span class="bumpedtag" title="Bumped">
Bumped
</span>
%endif
%if cs.divergent:
<span class="divergenttag" title="Divergent">
Divergent
</span>
%endif
%if cs.extinct:
<span class="extincttag" title="Extinct">
Extinct
</span>
%endif
%if cs.unstable:
<span class="unstabletag" title="Unstable">
Unstable
</span>
%endif
%if cs.phase:
<span class="phasetag" title="Phase">
${cs.phase}
</span>
%endif
%for book in cs.bookmarks:
<span class="booktag" title="${_('Bookmark %s') % book}">
${h.link_to(book,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))}
</span>
%endfor
%for tag in cs.tags:
<span class="tagtag" title="${_('Tag %s') % tag}">
${h.link_to(tag,h.url('changeset_home',repo_name=repo_name,revision=cs.raw_id))}
</span>
%endfor
%if show_branch and cs.branch:
<span class="branchtag" title="${_('Branch %s' % cs.branch)}">
${h.link_to(cs.branch,h.url('changelog_home',repo_name=repo_name,branch=cs.branch))}
</span>
%endif
</div>
</div>
</td>
</tr>
%endfor
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
$('#changesets .expand_commit').on('click',function(e){
$(this).next('.mid').find('.message > div').toggleClass('hidden');
${resize_js};
});
});
</script>
</%def>