##// END OF EJS Templates
api: comment_pull_request, added commit_id parameter to validate status changed on particular commit....
api: comment_pull_request, added commit_id parameter to validate status changed on particular commit. - when using the API and creating a comment with status change it's now possible to pass in commit_id, this will allow validation if status change of pull_request is allowed based on the given commit_id. This solves the case when long running test sends approval of pull request which was already updated several times. The commit_id will now validate for which state the approval was made, and prevent accidental aproval of outdated pull requests.

File last commit:

r1268:7eb711c7 default
r1269:26e59d48 default
Show More
diffs.html
691 lines | 27.1 KiB | text/html | HtmlLexer
dan
diffs: replace compare controller with new html based diffs:...
r1030 <%def name="diff_line_anchor(filename, line, type)"><%
return '%s_%s_%i' % (h.safeid(filename), type, line)
%></%def>
<%def name="action_class(action)"><%
return {
'-': 'cb-deletion',
'+': 'cb-addition',
' ': 'cb-context',
}.get(action, 'cb-empty')
%></%def>
<%def name="op_class(op_id)"><%
return {
DEL_FILENODE: 'deletion', # file deleted
BIN_FILENODE: 'warning' # binary diff hidden
}.get(op_id, 'addition')
%></%def>
<%def name="link_for(**kw)"><%
new_args = request.GET.mixed()
new_args.update(kw)
return h.url('', **new_args)
%></%def>
dan
ux: make the diffset header more pronounced and show commit details...
r1138 <%def name="render_diffset(diffset, commit=None,
dan
diffs: replace compare controller with new html based diffs:...
r1030
# collapse all file diff entries when there are more than this amount of files in the diff
collapse_when_files_over=20,
# collapse lines in the diff when more than this amount of lines changed in the file diff
lines_changed_limit=500,
dan
diffs: add ruler to diff output to show eg. 80 char line
r1134
# add a ruler at to the output
ruler_at_chars=0,
dan
ux: make the diffset header more pronounced and show commit details...
r1138
dan
diffs: add new diffs to pull request page
r1159 # show inline comments
dan
diffs: add comments to changeset diffs
r1143 use_comments=False,
dan
diffs: add new diffs to pull request page
r1159 # disable new comments
disable_new_comments=False,
pull-requests: updated versioning support....
r1268 # special file-comments that were deleted in previous versions
# it's used for showing outdated comments for deleted files in a PR
deleted_files_comments=None
dan
diffs: replace compare controller with new html based diffs:...
r1030 )">
dan
diffs: add comments to changeset diffs
r1143
%if use_comments:
<div id="cb-comments-inline-container-template" class="js-template">
${inline_comments_container([])}
</div>
<div class="js-template" id="cb-comment-inline-form-template">
<div class="comment-inline-form ac">
%if c.rhodecode_user.username != h.DEFAULT_USER:
${h.form('#', method='get')}
<div id="edit-container_{1}" class="clearfix">
<div class="comment-title pull-left">
${_('Create a comment on line {1}.')}
</div>
<div class="comment-help pull-right">
${(_('Comments parsed using %s syntax with %s support.') % (
('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())),
('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user'))
)
)|n
}
</div>
<div style="clear: both"></div>
<textarea id="text_{1}" name="text" class="comment-block-ta ac-input"></textarea>
</div>
<div id="preview-container_{1}" class="clearfix" style="display: none;">
<div class="comment-help">
${_('Comment preview')}
</div>
<div id="preview-box_{1}" class="preview-box"></div>
</div>
<div class="comment-footer">
<div class="action-buttons">
<input type="hidden" name="f_path" value="{0}">
<input type="hidden" name="line" value="{1}">
<button id="preview-btn_{1}" class="btn btn-secondary">${_('Preview')}</button>
<button id="edit-btn_{1}" class="btn btn-secondary" style="display: none;">${_('Edit')}</button>
${h.submit('save', _('Comment'), class_='btn btn-success save-inline-form')}
</div>
<div class="comment-button">
<button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
${_('Cancel')}
</button>
</div>
${h.end_form()}
</div>
%else:
${h.form('', class_='inline-form comment-form-login', method='get')}
<div class="pull-left">
<div class="comment-help pull-right">
${_('You need to be logged in to comment.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a>
</div>
</div>
<div class="comment-button pull-right">
<button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
${_('Cancel')}
</button>
</div>
<div class="clearfix"></div>
${h.end_form()}
%endif
</div>
</div>
%endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 <%
collapse_all = len(diffset.files) > collapse_when_files_over
%>
dan
diffs: move diffmode to template global context and add it to session...
r1137 %if c.diffmode == 'sideside':
dan
diffs: replace compare controller with new html based diffs:...
r1030 <style>
.wrapper {
max-width: 1600px !important;
}
</style>
%endif
dan
diffs: add ruler to diff output to show eg. 80 char line
r1134 %if ruler_at_chars:
<style>
.diff table.cb .cb-content:after {
content: "";
border-left: 1px solid blue;
position: absolute;
top: 0;
height: 18px;
opacity: .2;
z-index: 10;
pull-requests: updated versioning support....
r1268 //## +5 to account for diff action (+/-)
dan
diffs: add ruler to diff output to show eg. 80 char line
r1134 left: ${ruler_at_chars + 5}ch;
</style>
%endif
dan
diffs: add new diffs to pull request page
r1159 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
dan
ux: make the diffset header more pronounced and show commit details...
r1138 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
%if commit:
<div class="pull-right">
dan
diffs: add repo_name as parameter of diffset - fixes bug...
r1142 <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}">
dan
ux: make the diffset header more pronounced and show commit details...
r1138 ${_('Browse Files')}
dan
diffs: replace compare controller with new html based diffs:...
r1030 </a>
</div>
dan
ux: make the diffset header more pronounced and show commit details...
r1138 %endif
<h2 class="clearinner">
%if commit:
<a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
${h.age_component(commit.date)} -
%endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if diffset.limited_diff:
pull-requests: updated versioning support....
r1268 ${_('The requested commit is too big and content was truncated.')}
dan
ux: make the diffset header more pronounced and show commit details...
r1138
${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
<a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %else:
${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
'%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}}
%endif
pull-requests: updated versioning support....
r1268
<% at_ver = getattr(c, 'at_version_num', None) %>
% if at_ver:
<div class="pull-right">
${_('Changes at version %d') % at_ver}
</div>
% endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 </h2>
</div>
%if not diffset.files:
<p class="empty_data">${_('No files')}</p>
%endif
<div class="filediffs">
%for i, filediff in enumerate(diffset.files):
diffs: compare overhaul....
r1259
<%
lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted']
over_lines_changed_limit = lines_changed > lines_changed_limit
%>
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
dan
diffs: replace compare controller with new html based diffs:...
r1030 <div
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 class="filediff"
dan
diffs: replace compare controller with new html based diffs:...
r1030 data-f-path="${filediff['patch']['filename']}"
dan
diffs: add comments to changeset diffs
r1143 id="a_${h.FID('', filediff['patch']['filename'])}">
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
<div class="filediff-collapse-indicator"></div>
dan
diffs: replace compare controller with new html based diffs:...
r1030 ${diff_ops(filediff)}
</label>
dan
diffs: add comments to changeset diffs
r1143 ${diff_menu(filediff, use_comments=use_comments)}
dan
diffs: move diffmode to template global context and add it to session...
r1137 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if not filediff.hunks:
%for op_id, op_text in filediff['patch']['stats']['ops'].items():
<tr>
pull-requests: updated versioning support....
r1268 <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if op_id == DEL_FILENODE:
${_('File was deleted')}
%elif op_id == BIN_FILENODE:
${_('Binary file hidden')}
%else:
${op_text}
%endif
</td>
</tr>
%endfor
%endif
%if filediff.patch['is_limited_diff']:
<tr class="cb-warning cb-collapser">
dan
ux: fix bug where limited diff message wasn't spanning entire table
r1186 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
dan
diffs: replace compare controller with new html based diffs:...
r1030 ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
</td>
</tr>
pull-requests: updated versioning support....
r1268 %else:
%if over_lines_changed_limit:
<tr class="cb-warning cb-collapser">
<td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
<a href="#" class="cb-expand"
onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
</a>
<a href="#" class="cb-collapse"
onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
</a>
</td>
</tr>
%endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
pull-requests: updated versioning support....
r1268
dan
diffs: replace compare controller with new html based diffs:...
r1030 %for hunk in filediff.hunks:
<tr class="cb-hunk">
dan
ux: add hidden comments indicators plus style tweaks...
r1157 <td ${c.diffmode == 'unified' and 'colspan=3' or ''}>
dan
diffs: replace compare controller with new html based diffs:...
r1030 ## TODO: dan: add ajax loading of more context here
## <a href="#">
<i class="icon-more"></i>
## </a>
</td>
dan
ux: add hidden comments indicators plus style tweaks...
r1157 <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}>
dan
diffs: replace compare controller with new html based diffs:...
r1030 @@
-${hunk.source_start},${hunk.source_length}
+${hunk.target_start},${hunk.target_length}
${hunk.section_header}
</td>
</tr>
dan
diffs: move diffmode to template global context and add it to session...
r1137 %if c.diffmode == 'unified':
dan
diffs: add comments to changeset diffs
r1143 ${render_hunk_lines_unified(hunk, use_comments=use_comments)}
dan
diffs: move diffmode to template global context and add it to session...
r1137 %elif c.diffmode == 'sideside':
dan
diffs: add comments to changeset diffs
r1143 ${render_hunk_lines_sideside(hunk, use_comments=use_comments)}
dan
diffs: replace compare controller with new html based diffs:...
r1030 %else:
<tr class="cb-line">
<td>unknown diff mode</td>
</tr>
%endif
%endfor
inline-comments: render outdated comments that don't fit to current context....
r1260
pull-requests: updated versioning support....
r1268 ## outdated comments that do not fit into currently displayed lines
% for lineno, comments in filediff.left_comments.items():
%if c.diffmode == 'unified':
<tr class="cb-line">
<td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context">
${inline_comments_container(comments)}
</td>
</tr>
%elif c.diffmode == 'sideside':
<tr class="cb-line">
<td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context"></td>
<td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context">
${inline_comments_container(comments)}
</td>
</tr>
%endif
% endfor
</table>
</div>
%endfor
## outdated comments that are made for a file that has been deleted
% for filename, comments_dict in (deleted_files_comments or {}).items():
inline-comments: render outdated comments that don't fit to current context....
r1260
pull-requests: updated versioning support....
r1268 <div class="filediffs filediff-outdated" style="display: none">
<input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filename)}" type="checkbox">
<div class="filediff" data-f-path="${filename}" id="a_${h.FID('', filename)}">
<label for="filediff-collapse-${id(filename)}" class="filediff-heading">
<div class="filediff-collapse-indicator"></div>
<span class="pill">
## file was deleted
<strong>${filename}</strong>
</span>
<span class="pill-group" style="float: left">
## file op, doesn't need translation
<span class="pill" op="removed">removed in this version</span>
</span>
<a class="pill filediff-anchor" href="#a_${h.FID('', filename)}">¶</a>
<span class="pill-group" style="float: right">
<span class="pill" op="deleted">-${comments_dict['stats']}</span>
</span>
</label>
<table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
<tr>
% if c.diffmode == 'unified':
<td></td>
%endif
<td></td>
<td class="cb-text cb-${op_class(BIN_FILENODE)}" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=5'}>
${_('File was deleted in this version, and outdated comments were made on it')}
</td>
</tr>
%if c.diffmode == 'unified':
<tr class="cb-line">
<td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context">
${inline_comments_container(comments_dict['comments'])}
</td>
</tr>
%elif c.diffmode == 'sideside':
<tr class="cb-line">
inline-comments: render outdated comments that don't fit to current context....
r1260 <td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context"></td>
<td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context">
pull-requests: updated versioning support....
r1268 ${inline_comments_container(comments_dict['comments'])}
inline-comments: render outdated comments that don't fit to current context....
r1260 </td>
pull-requests: updated versioning support....
r1268 </tr>
%endif
</table>
</div>
</div>
% endfor
inline-comments: render outdated comments that don't fit to current context....
r1260
dan
diffs: replace compare controller with new html based diffs:...
r1030 </div>
</%def>
<%def name="diff_ops(filediff)">
<%
stats = filediff['patch']['stats']
from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE
%>
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill">
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if filediff.source_file_path and filediff.target_file_path:
%if filediff.source_file_path != filediff.target_file_path: # file was renamed
<strong>${filediff.target_file_path}</strong> ⬅ <del>${filediff.source_file_path}</del>
%else:
## file was modified
<strong>${filediff.source_file_path}</strong>
%endif
%else:
%if filediff.source_file_path:
## file was deleted
<strong>${filediff.source_file_path}</strong>
%else:
## file was added
<strong>${filediff.target_file_path}</strong>
%endif
%endif
</span>
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill-group" style="float: left">
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if filediff.patch['is_limited_diff']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
%if RENAMED_FILENODE in stats['ops']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="renamed">renamed</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
%if NEW_FILENODE in stats['ops']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="created">created</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if filediff['target_mode'].startswith('120'):
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="symlink">symlink</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %else:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
%endif
%if DEL_FILENODE in stats['ops']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="removed">removed</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
%if CHMOD_FILENODE in stats['ops']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="mode">
dan
diffs: replace compare controller with new html based diffs:...
r1030 ${nice_mode(filediff['source_mode'])} âž¡ ${nice_mode(filediff['target_mode'])}
</span>
%endif
</span>
dan
diffs: add comments to changeset diffs
r1143 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">¶</a>
dan
diffs: replace compare controller with new html based diffs:...
r1030
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill-group" style="float: right">
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if BIN_FILENODE in stats['ops']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="binary">binary</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if MOD_FILENODE in stats['ops']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="modified">modified</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
%endif
dan
diffs: add commit id argument and use id of filediff for identifying...
r1135 %if stats['added']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="added">+${stats['added']}</span>
dan
diffs: add commit id argument and use id of filediff for identifying...
r1135 %endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if stats['deleted']:
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <span class="pill" op="deleted">-${stats['deleted']}</span>
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
</span>
</%def>
<%def name="nice_mode(filemode)">
${filemode.startswith('100') and filemode[3:] or filemode}
</%def>
dan
diffs: add comments to changeset diffs
r1143 <%def name="diff_menu(filediff, use_comments=False)">
dan
diffs: rename .diff to .filediff and use .diffset for grouping...
r1136 <div class="filediff-menu">
dan
diffs: replace compare controller with new html based diffs:...
r1030 %if filediff.diffset.source_ref:
%if filediff.patch['operation'] in ['D', 'M']:
<a
class="tooltip"
dan
diffs: add repo_name as parameter of diffset - fixes bug...
r1142 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
dan
diffs: replace compare controller with new html based diffs:...
r1030 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
>
${_('Show file before')}
pull-requests: updated versioning support....
r1268 </a> |
dan
diffs: replace compare controller with new html based diffs:...
r1030 %else:
dan
ux: make show file after/before links unclickable and black if...
r1031 <span
dan
diffs: replace compare controller with new html based diffs:...
r1030 class="tooltip"
title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
>
${_('Show file before')}
pull-requests: updated versioning support....
r1268 </span> |
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
%if filediff.patch['operation'] in ['A', 'M']:
<a
class="tooltip"
diffs: fixed other file source when using pull requests. It must use...
r1194 href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
dan
diffs: replace compare controller with new html based diffs:...
r1030 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
>
${_('Show file after')}
pull-requests: updated versioning support....
r1268 </a> |
dan
diffs: replace compare controller with new html based diffs:...
r1030 %else:
dan
ux: make show file after/before links unclickable and black if...
r1031 <span
dan
diffs: replace compare controller with new html based diffs:...
r1030 class="tooltip"
title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
>
${_('Show file after')}
pull-requests: updated versioning support....
r1268 </span> |
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
<a
class="tooltip"
title="${h.tooltip(_('Raw diff'))}"
dan
diffs: add repo_name as parameter of diffset - fixes bug...
r1142 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
dan
diffs: replace compare controller with new html based diffs:...
r1030 >
${_('Raw diff')}
pull-requests: updated versioning support....
r1268 </a> |
dan
diffs: replace compare controller with new html based diffs:...
r1030 <a
class="tooltip"
title="${h.tooltip(_('Download diff'))}"
dan
diffs: add repo_name as parameter of diffset - fixes bug...
r1142 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
dan
diffs: replace compare controller with new html based diffs:...
r1030 >
${_('Download diff')}
</a>
pull-requests: updated versioning support....
r1268 % if use_comments:
|
% endif
dan
diffs: add comments to changeset diffs
r1143
## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks)
%if hasattr(c, 'ignorews_url'):
${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))}
%endif
%if hasattr(c, 'context_url'):
${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))}
%endif
%if use_comments:
dan
ux: add hidden comments indicators plus style tweaks...
r1157 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
dan
diffs: add comments to changeset diffs
r1143 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
</a>
%endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 %endif
</div>
</%def>
dan
diffs: add comments to changeset diffs
r1143 <%namespace name="commentblock" file="/changeset/changeset_file_comment.html"/>
<%def name="inline_comments_container(comments)">
<div class="inline-comments">
%for comment in comments:
${commentblock.comment_block(comment, inline=True)}
%endfor
pull-requests: added version browsing for pull requests....
r1192
pull-requests: updated versioning support....
r1268 % if comments and comments[-1].outdated:
<span class="btn btn-secondary cb-comment-add-button comment-outdated}"
style="display: none;}">
dan
diffs: add comments to changeset diffs
r1143 ${_('Add another comment')}
</span>
pull-requests: updated versioning support....
r1268 % else:
<span onclick="return Rhodecode.comments.createComment(this)"
class="btn btn-secondary cb-comment-add-button">
${_('Add another comment')}
</span>
% endif
pull-requests: added version browsing for pull requests....
r1192
dan
diffs: add comments to changeset diffs
r1143 </div>
</%def>
<%def name="render_hunk_lines_sideside(hunk, use_comments=False)">
dan
diffs: replace compare controller with new html based diffs:...
r1030 %for i, line in enumerate(hunk.sideside):
<%
old_line_anchor, new_line_anchor = None, None
if line.original.lineno:
old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o')
if line.modified.lineno:
new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n')
%>
diffs: compare overhaul....
r1259
dan
diffs: replace compare controller with new html based diffs:...
r1030 <tr class="cb-line">
dan
ux: add hidden comments indicators plus style tweaks...
r1157 <td class="cb-data ${action_class(line.original.action)}"
data-line-number="${line.original.lineno}"
>
<div>
%if line.original.comments:
<i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
%endif
</div>
</td>
dan
diffs: replace compare controller with new html based diffs:...
r1030 <td class="cb-lineno ${action_class(line.original.action)}"
data-line-number="${line.original.lineno}"
%if old_line_anchor:
id="${old_line_anchor}"
%endif
>
%if line.original.lineno:
<a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
%endif
</td>
<td class="cb-content ${action_class(line.original.action)}"
data-line-number="o${line.original.lineno}"
dan
diffs: add comments to changeset diffs
r1143 >
%if use_comments and line.original.lineno:
${render_add_comment_button()}
%endif
<span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
%if use_comments and line.original.lineno and line.original.comments:
${inline_comments_container(line.original.comments)}
%endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 </td>
dan
ux: add hidden comments indicators plus style tweaks...
r1157 <td class="cb-data ${action_class(line.modified.action)}"
data-line-number="${line.modified.lineno}"
>
<div>
%if line.modified.comments:
<i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
%endif
</div>
</td>
dan
diffs: replace compare controller with new html based diffs:...
r1030 <td class="cb-lineno ${action_class(line.modified.action)}"
data-line-number="${line.modified.lineno}"
%if new_line_anchor:
id="${new_line_anchor}"
%endif
>
%if line.modified.lineno:
<a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
%endif
dan
ux: add hidden comments indicators plus style tweaks...
r1157 </td>
dan
diffs: replace compare controller with new html based diffs:...
r1030 <td class="cb-content ${action_class(line.modified.action)}"
data-line-number="n${line.modified.lineno}"
>
dan
diffs: add comments to changeset diffs
r1143 %if use_comments and line.modified.lineno:
${render_add_comment_button()}
%endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
dan
diffs: add comments to changeset diffs
r1143 %if use_comments and line.modified.lineno and line.modified.comments:
${inline_comments_container(line.modified.comments)}
%endif
dan
diffs: replace compare controller with new html based diffs:...
r1030 </td>
</tr>
%endfor
</%def>
dan
diffs: add comments to changeset diffs
r1143 <%def name="render_hunk_lines_unified(hunk, use_comments=False)">
%for old_line_no, new_line_no, action, content, comments in hunk.unified:
dan
diffs: replace compare controller with new html based diffs:...
r1030 <%
old_line_anchor, new_line_anchor = None, None
if old_line_no:
old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o')
if new_line_no:
new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n')
%>
<tr class="cb-line">
dan
ux: add hidden comments indicators plus style tweaks...
r1157 <td class="cb-data ${action_class(action)}">
<div>
%if comments:
<i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
%endif
</div>
</td>
dan
diffs: replace compare controller with new html based diffs:...
r1030 <td class="cb-lineno ${action_class(action)}"
data-line-number="${old_line_no}"
%if old_line_anchor:
id="${old_line_anchor}"
%endif
>
%if old_line_anchor:
<a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
%endif
</td>
<td class="cb-lineno ${action_class(action)}"
data-line-number="${new_line_no}"
%if new_line_anchor:
id="${new_line_anchor}"
%endif
>
%if new_line_anchor:
<a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
%endif
</td>
<td class="cb-content ${action_class(action)}"
data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}"
dan
diffs: add comments to changeset diffs
r1143 >
%if use_comments:
${render_add_comment_button()}
%endif
<span class="cb-code">${action} ${content or '' | n}</span>
%if use_comments and comments:
${inline_comments_container(comments)}
%endif
</td>
dan
diffs: replace compare controller with new html based diffs:...
r1030 </tr>
%endfor
</%def>
dan
ux: make the diffset header more pronounced and show commit details...
r1138
dan
diffs: add comments to changeset diffs
r1143 <%def name="render_add_comment_button()">
pull-requests: updated versioning support....
r1268 <button class="btn btn-small btn-primary cb-comment-box-opener" onclick="return Rhodecode.comments.createComment(this)">
<span><i class="icon-comment"></i></span>
</button>
dan
diffs: add comments to changeset diffs
r1143 </%def>
dan
ux: make the diffset header more pronounced and show commit details...
r1138
<%def name="render_diffset_menu()">
diffs: added wide-mode button to expand large diffs.
r1193
dan
ux: make the diffset header more pronounced and show commit details...
r1138 <div class="diffset-menu clearinner">
<div class="pull-right">
<div class="btn-group">
diffs: compare overhaul....
r1259
dan
ux: make the diffset header more pronounced and show commit details...
r1138 <a
class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip"
title="${_('View side by side')}"
href="${h.url_replace(diffmode='sideside')}">
<span>${_('Side by Side')}</span>
</a>
<a
class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip"
title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}">
<span>${_('Unified')}</span>
</a>
</div>
</div>
diffs: compare overhaul....
r1259
dan
ux: make the diffset header more pronounced and show commit details...
r1138 <div class="pull-left">
<div class="btn-group">
<a
class="btn"
href="#"
diffs: compare overhaul....
r1259 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All Files')}</a>
dan
ux: make the diffset header more pronounced and show commit details...
r1138 <a
class="btn"
href="#"
diffs: compare overhaul....
r1259 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All Files')}</a>
diffs: added wide-mode button to expand large diffs.
r1193 <a
class="btn"
href="#"
diffs: compare overhaul....
r1259 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode Diff')}</a>
dan
ux: make the diffset header more pronounced and show commit details...
r1138 </div>
</div>
</div>
dan
changeset: add new diffs to changeset controller
r1139 </%def>