changeset.mako
302 lines
| 13.1 KiB
| application/x-mako
|
MakoHtmlLexer
r1282 | ## -*- coding: utf-8 -*- | |||
<%inherit file="/base/base.mako"/> | ||||
r3882 | <%namespace name="base" file="/base/base.mako"/> | |||
r1282 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> | |||
r3882 | <%namespace name="file_base" file="/files/base.mako"/> | |||
r1282 | ||||
<%def name="title()"> | ||||
r3882 | ${_('{} Commit').format(c.repo_name)} - ${h.show_id(c.commit)} | |||
r1282 | %if c.rhodecode_name: | |||
· ${h.branding(c.rhodecode_name)} | ||||
%endif | ||||
</%def> | ||||
<%def name="menu_bar_nav()"> | ||||
${self.menu_items(active='repositories')} | ||||
</%def> | ||||
<%def name="menu_bar_subnav()"> | ||||
r3742 | ${self.repo_menu(active='commits')} | |||
r1282 | </%def> | |||
<%def name="main()"> | ||||
r3882 | <script type="text/javascript"> | |||
r1282 | // TODO: marcink switch this to pyroutes | |||
r1951 | AJAX_COMMENT_DELETE_URL = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,comment_id='__COMMENT_ID__')}"; | |||
r1282 | templateContext.commit_data.commit_id = "${c.commit.raw_id}"; | |||
</script> | ||||
r3882 | ||||
r1282 | <div class="box"> | |||
r3882 | <div class="summary"> | |||
<div class="fieldset"> | ||||
<div class="left-content"> | ||||
r4026 | <% | |||
rc_user = h.discover_user(c.commit.author_email) | ||||
%> | ||||
r3882 | <div class="left-content-avatar"> | |||
r4026 | ${base.gravatar(c.commit.author_email, 30, tooltip=True, user=rc_user)} | |||
r3882 | </div> | |||
<div class="left-content-message"> | ||||
<div class="fieldset collapsable-content no-hide" data-toggle="summary-details"> | ||||
<div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div> | ||||
</div> | ||||
r2129 | ||||
r3882 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none"> | |||
<div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> | ||||
</div> | ||||
<div class="fieldset" data-toggle="summary-details"> | ||||
<div class=""> | ||||
<table> | ||||
r4026 | <tr class="file_author"> | |||
r1738 | ||||
r3882 | <td> | |||
r4026 | <span class="user commit-author">${h.link_to_user(rc_user or c.commit.author)}</span> | |||
r3882 | <span class="commit-date">- ${h.age_component(c.commit.date)}</span> | |||
</td> | ||||
r1738 | ||||
r3882 | <td> | |||
## second cell for consistency with files | ||||
</td> | ||||
</tr> | ||||
</table> | ||||
Liviu
|
r3685 | </div> | ||
r2129 | </div> | |||
Liviu
|
r3685 | |||
r3882 | </div> | |||
</div> | ||||
Liviu
|
r3685 | |||
r3882 | <div class="right-content"> | |||
<div data-toggle="summary-details"> | ||||
<div class="tags tags-main"> | ||||
<code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a></code> | ||||
<i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> | ||||
${file_base.refs(c.commit)} | ||||
## phase | ||||
% if hasattr(c.commit, 'phase') and getattr(c.commit, 'phase') != 'public': | ||||
<span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}"> | ||||
<i class="icon-info"></i>${c.commit.phase} | ||||
</span> | ||||
% endif | ||||
r1282 | ||||
r3882 | ## obsolete commits | |||
% if getattr(c.commit, 'obsolete', False): | ||||
<span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}"> | ||||
${_('obsolete')} | ||||
</span> | ||||
% endif | ||||
## hidden commits | ||||
% if getattr(c.commit, 'hidden', False): | ||||
<span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}"> | ||||
${_('hidden')} | ||||
</span> | ||||
% endif | ||||
</div> | ||||
%if c.statuses: | ||||
<div class="tag status-tag-${c.statuses[0]} pull-right"> | ||||
<i class="icon-circle review-status-${c.statuses[0]}"></i> | ||||
<div class="pull-right">${h.commit_status_lbl(c.statuses[0])}</div> | ||||
</div> | ||||
%endif | ||||
</div> | ||||
</div> | ||||
</div> | ||||
<div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | ||||
Liviu
|
r3685 | <div class="left-label-summary"> | ||
r3882 | <p>${_('Commit navigation')}:</p> | |||
Liviu
|
r3685 | <div class="right-label-summary"> | ||
r3882 | <span id="parent_link" class="tag tagtag"> | |||
<a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a> | ||||
</span> | ||||
<span id="child_link" class="tag tagtag"> | ||||
<a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a> | ||||
</span> | ||||
r1282 | </div> | |||
</div> | ||||
</div> | ||||
r3882 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |||
Liviu
|
r3685 | <div class="left-label-summary"> | ||
<p>${_('Diff options')}:</p> | ||||
<div class="right-label-summary"> | ||||
r1282 | <div class="diff-actions"> | |||
r4026 | <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}"> | |||
r1282 | ${_('Raw Diff')} | |||
</a> | ||||
| | ||||
r4026 | <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}"> | |||
r1282 | ${_('Patch Diff')} | |||
</a> | ||||
| | ||||
r4026 | <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}"> | |||
r1282 | ${_('Download Diff')} | |||
</a> | ||||
</div> | ||||
Liviu
|
r3685 | </div> | ||
r1282 | </div> | |||
</div> | ||||
r3882 | <div class="clear-fix"></div> | |||
<div class="btn-collapse" data-toggle="summary-details"> | ||||
${_('Show More')} | ||||
r1282 | </div> | |||
r3882 | </div> | |||
r1385 | ||||
r1282 | <div class="cs_files"> | |||
<%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> | ||||
r3100 | ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])} | |||
r1282 | ${cbdiffs.render_diffset( | |||
Bartłomiej Wołyńczyk
|
r2685 | c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )} | ||
r1282 | </div> | |||
r3884 | ## template for inline comment form | |||
<%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | ||||
## comments heading with count | ||||
r3882 | <div class="comments-heading"> | |||
<i class="icon-comment"></i> | ||||
${_('Comments')} ${len(c.comments)} | ||||
</div> | ||||
r1282 | ## render comments | |||
r1332 | ${comment.generate_comments(c.comments)} | |||
r1282 | ||||
## main comment form and it status | ||||
r1951 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id), | |||
r1282 | h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))} | |||
</div> | ||||
## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS | ||||
<script type="text/javascript"> | ||||
$(document).ready(function() { | ||||
var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10); | ||||
if($('#trimmed_message_box').height() === boxmax){ | ||||
$('#message_expand').show(); | ||||
} | ||||
$('#message_expand').on('click', function(e){ | ||||
$('#trimmed_message_box').css('max-height', 'none'); | ||||
$(this).hide(); | ||||
}); | ||||
$('.show-inline-comments').on('click', function(e){ | ||||
var boxid = $(this).attr('data-comment-id'); | ||||
var button = $(this); | ||||
if(button.hasClass("comments-visible")) { | ||||
$('#{0} .inline-comments'.format(boxid)).each(function(index){ | ||||
$(this).hide(); | ||||
}); | ||||
button.removeClass("comments-visible"); | ||||
} else { | ||||
$('#{0} .inline-comments'.format(boxid)).each(function(index){ | ||||
$(this).show(); | ||||
}); | ||||
button.addClass("comments-visible"); | ||||
} | ||||
}); | ||||
// next links | ||||
$('#child_link').on('click', function(e){ | ||||
// fetch via ajax what is going to be the next link, if we have | ||||
// >1 links show them to user to choose | ||||
if(!$('#child_link').hasClass('disabled')){ | ||||
$.ajax({ | ||||
r1951 | url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}', | |||
r1282 | success: function(data) { | |||
if(data.results.length === 0){ | ||||
$('#child_link').html("${_('No Child Commits')}").addClass('disabled'); | ||||
} | ||||
if(data.results.length === 1){ | ||||
var commit = data.results[0]; | ||||
r1951 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); | |||
r1282 | } | |||
else if(data.results.length === 2){ | ||||
$('#child_link').addClass('disabled'); | ||||
$('#child_link').addClass('double'); | ||||
r3852 | ||||
r1282 | var _html = ''; | |||
r3852 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> ' | |||
.replace('__branch__', data.results[0].branch) | ||||
r1282 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |||
.replace('__title__', data.results[0].message) | ||||
r1951 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); | |||
r1283 | _html +=' | '; | |||
r3852 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> ' | |||
.replace('__branch__', data.results[1].branch) | ||||
r1282 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |||
.replace('__title__', data.results[1].message) | ||||
r1951 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); | |||
r1282 | $('#child_link').html(_html); | |||
} | ||||
} | ||||
}); | ||||
e.preventDefault(); | ||||
} | ||||
}); | ||||
// prev links | ||||
$('#parent_link').on('click', function(e){ | ||||
// fetch via ajax what is going to be the next link, if we have | ||||
// >1 links show them to user to choose | ||||
if(!$('#parent_link').hasClass('disabled')){ | ||||
$.ajax({ | ||||
r1951 | url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}', | |||
r1282 | success: function(data) { | |||
if(data.results.length === 0){ | ||||
$('#parent_link').html('${_('No Parent Commits')}').addClass('disabled'); | ||||
} | ||||
if(data.results.length === 1){ | ||||
var commit = data.results[0]; | ||||
r1951 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); | |||
r1282 | } | |||
else if(data.results.length === 2){ | ||||
$('#parent_link').addClass('disabled'); | ||||
$('#parent_link').addClass('double'); | ||||
r3852 | ||||
r1282 | var _html = ''; | |||
r3852 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>' | |||
.replace('__branch__', data.results[0].branch) | ||||
r1282 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |||
.replace('__title__', data.results[0].message) | ||||
r1951 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); | |||
r1283 | _html +=' | '; | |||
r3852 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>' | |||
.replace('__branch__', data.results[1].branch) | ||||
r1282 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |||
.replace('__title__', data.results[1].message) | ||||
r1951 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); | |||
r1282 | $('#parent_link').html(_html); | |||
} | ||||
} | ||||
}); | ||||
e.preventDefault(); | ||||
} | ||||
}); | ||||
// browse tree @ revision | ||||
$('#files_link').on('click', function(e){ | ||||
r1927 | window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}'; | |||
r1282 | e.preventDefault(); | |||
}); | ||||
}) | ||||
</script> | ||||
</%def> | ||||