##// 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:

r6766:f0ec7be7 default
r6774:f92d0806 default
Show More
compare_cs.html
143 lines | 5.0 KiB | text/html | HtmlLexer
## Changesets table !
<div>
%if not c.cs_ranges:
<span class="empty_data">${_('No changesets')}</span>
%else:
%if c.ancestors:
<div class="ancestor">
%if len(c.ancestors) > 1:
<div class="text-danger">
${_('Criss cross merge situation with multiple merge ancestors detected!')}
</div>
<div>
${_('Please merge the target branch to your branch before creating a pull request.')}
</div>
%endif
<div>
${_('Merge Ancestor')}:
%for ancestor in c.ancestors:
${h.link_to(h.short_id(ancestor),h.url('changeset_home',repo_name=c.repo_name,revision=ancestor), class_="changeset_hash")}
%endfor
</div>
</div>
%endif
<div id="graph_nodes">
<canvas id="graph_canvas"></canvas>
</div>
<div id="graph_content_pr">
<table class="table compare_view_commits">
%for cnt, cs in enumerate(reversed(c.cs_ranges)):
<tr id="chg_${cnt+1}" class="${'mergerow' if len(cs.parents) > 1 else ''}">
<td>
%if cs.raw_id in c.cs_statuses:
<i class="icon-circle changeset-status-${c.cs_statuses[cs.raw_id][0]}" title="${_('Changeset status: %s') % c.cs_statuses[cs.raw_id][1]}"></i>
%endif
%if c.cs_comments.get(cs.raw_id):
<div class="comments-container">
<div class="comments-cnt" title="${_('Changeset has comments')}">
<a href="${c.cs_comments[cs.raw_id][0].url()}">
${len(c.cs_comments[cs.raw_id])}
<i class="icon-comment"></i>
</a>
</div>
</div>
%endif
</td>
<td class="changeset-logical-index">
<%
num_cs = len(c.cs_ranges)
index = num_cs - cnt
if index == 1:
title = _('First (oldest) changeset in this list')
elif index == num_cs:
title = _('Last (most recent) changeset in this list')
else:
title = _('Position in this list of changesets')
%>
<span data-toggle="tooltip" title="${title}">
${index}
</span>
</td>
<td><span data-toggle="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
<td class="author">
${h.gravatar(h.email_or_none(cs.author), size=16)}
<span data-toggle="tooltip" title="${cs.author}" class="user">${h.person(cs.author)}</span>
</td>
<td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id), class_='changeset_hash')}</td>
<td>
%if cs.branch:
<span class="branchtag">${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.cs_repo.repo_name,branch=cs.branch))}</span>
%endif
</td>
<td class="expand_commit" title="${_('Expand commit message')}">
<i class="icon-align-left"></i>
</td>
<td class="mid">
<div class="pull-right">
%for tag in cs.tags:
<span class="tagtag" title="${_('Tag %s') % tag}">
${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
</span>
%endfor
</div>
<div class="message">${h.urlify_text(cs.message, c.repo_name)}</div>
</td>
</tr>
%endfor
</table>
</div>
%if c.is_ajax_preview:
<h5>
## links should perhaps use ('rev', c.a_rev) instead ...
${h.link_to(_('Show merge diff'),
h.url('compare_url',
repo_name=c.a_repo.repo_name,
org_ref_type=c.a_ref_type, org_ref_name=c.a_ref_name,
other_repo=c.cs_repo.repo_name,
other_ref_type=c.cs_ref_type, other_ref_name=c.cs_ref_name,
merge='1')
)}
</h5>
%endif
%if c.cs_ranges_org is not None:
## TODO: list actual changesets?
<div>
${h.link_to_ref(c.cs_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev)}
${_('is')}
<a href="${c.swap_url}">${_('%s changesets') % (len(c.cs_ranges_org))}</a>
${_('behind')}
${h.link_to_ref(c.a_repo.repo_name, c.a_ref_type, c.a_ref_name)}
</div>
%endif
%endif
</div>
%if c.is_ajax_preview:
<div id="jsdata" style="display:none">${h.js(c.jsdata)}</div>
%else:
<script type="text/javascript" src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script>
%endif
<script type="text/javascript">
var jsdata = ${h.js(c.jsdata)};
var graph = new BranchRenderer('graph_canvas', 'graph_content_pr', 'chg_');
$(document).ready(function(){
graph.render(jsdata);
$('.expand_commit').click(function(e){
$(this).next('.mid').find('.message').toggleClass('expanded');
graph.render(jsdata);
});
});
$(window).resize(function(){
graph.render(jsdata);
});
</script>