##// END OF EJS Templates
release: Finish preparation for 4.18.0
release: Finish preparation for 4.18.0

File last commit:

r4140:eb578430 default
r4182:f37a3126 v4.18.0 stable
Show More
diffs.mako
1181 lines | 46.8 KiB | application/x-mako | MakoHtmlLexer
comments: allow submitting id of comment which submitted comment resolved....
r1325 <%namespace name="commentblock" file="/changeset/changeset_file_comment.mako"/>
diffs: make line anchors commit aware. This fixes duplicate anchor problem on range diffs.
r3131 <%def name="diff_line_anchor(commit, filename, line, type)"><%
return '%s_%s_%i' % (h.md5_safe(commit+filename), type, line)
templating: use .mako as extensions for template files.
r1282 %></%def>
html: fixed found syntax problems
r1283 <%def name="action_class(action)">
<%
templating: use .mako as extensions for template files.
r1282 return {
'-': 'cb-deletion',
'+': 'cb-addition',
' ': 'cb-context',
}.get(action, 'cb-empty')
html: fixed found syntax problems
r1283 %>
</%def>
templating: use .mako as extensions for template files.
r1282
html: fixed found syntax problems
r1283 <%def name="op_class(op_id)">
<%
templating: use .mako as extensions for template files.
r1282 return {
DEL_FILENODE: 'deletion', # file deleted
BIN_FILENODE: 'warning' # binary diff hidden
}.get(op_id, 'addition')
html: fixed found syntax problems
r1283 %>
</%def>
templating: use .mako as extensions for template files.
r1282
routing: remove usage of url.current from pylons.
r2104
templating: use .mako as extensions for template files.
r1282
<%def name="render_diffset(diffset, commit=None,
# 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,
# add a ruler at to the output
ruler_at_chars=0,
# show inline comments
use_comments=False,
# disable new comments
disable_new_comments=False,
# special file-comments that were deleted in previous versions
# it's used for showing outdated comments for deleted files in a PR
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 deleted_files_comments=None,
# for cache purpose
pull-requests: allow to show range diff in pr view
r3124 inline_comments=None,
templating: use .mako as extensions for template files.
r1282
comments: re-implemented diff and comments/todos in pull-requests.
r3884 # additional menu for PRs
pull-requests: expose TODO box in dedicated panel...
r4140 pull_request_menu=None,
# show/hide todo next to comments
show_todos=True,
comments: re-implemented diff and comments/todos in pull-requests.
r3884
templating: use .mako as extensions for template files.
r1282 )">
ui: new commits page....
r3882
<%
diffset_container_id = h.md5(diffset.target_ref)
collapse_all = len(diffset.files) > collapse_when_files_over
%>
templating: use .mako as extensions for template files.
r1282 %if use_comments:
<div id="cb-comments-inline-container-template" class="js-template">
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 ${inline_comments_container([], inline_comments)}
templating: use .mako as extensions for template files.
r1282 </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:
comments: allow submitting id of comment which submitted comment resolved....
r1325 ## render template for inline comments
${commentblock.comment_form(form_type='inline')}
templating: use .mako as extensions for template files.
r1282 %else:
${h.form('', class_='inline-form comment-form-login', method='get')}
<div class="pull-left">
<div class="comment-help pull-right">
routing: remove usage of url.current from pylons.
r2104 ${_('You need to be logged in to leave comments.')} <a href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">${_('Login now')}</a>
templating: use .mako as extensions for template files.
r1282 </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
users: use new session store for temporary settings for users....
r3088 %if c.user_session_attrs["diffmode"] == 'sideside':
templating: use .mako as extensions for template files.
r1282 <style>
.wrapper {
max-width: 1600px !important;
}
</style>
%endif
%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;
//## +5 to account for diff action (+/-)
left: ${ruler_at_chars + 5}ch;
</style>
%endif
<div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
ui: new commits page....
r3882
<div style="height: 20px; line-height: 20px">
## expand/collapse action
<div class="pull-left">
<a class="${'collapsed' if collapse_all else ''}" href="#expand-files" onclick="toggleExpand(this, '${diffset_container_id}'); return false">
% if collapse_all:
<i class="icon-plus-squared-alt icon-no-margin"></i>${_('Expand all files')}
% else:
<i class="icon-minus-squared-alt icon-no-margin"></i>${_('Collapse all files')}
% endif
</a>
</div>
## todos
pull-requests: expose TODO box in dedicated panel...
r4140 % if show_todos and getattr(c, 'at_version', None):
comments: re-implemented diff and comments/todos in pull-requests.
r3884 <div class="pull-right">
<i class="icon-flag-filled" style="color: #949494">TODOs:</i>
${_('not available in this view')}
</div>
pull-requests: expose TODO box in dedicated panel...
r4140 % elif show_todos:
ui: new commits page....
r3882 <div class="pull-right">
<div class="comments-number" style="padding-left: 10px">
% if hasattr(c, 'unresolved_comments') and hasattr(c, 'resolved_comments'):
<i class="icon-flag-filled" style="color: #949494">TODOs:</i>
% if c.unresolved_comments:
<a href="#show-todos" onclick="$('#todo-box').toggle(); return false">
${_('{} unresolved').format(len(c.unresolved_comments))}
</a>
% else:
${_('0 unresolved')}
% endif
comments: re-implemented diff and comments/todos in pull-requests.
r3884 ${_('{} Resolved').format(len(c.resolved_comments))}
ui: new commits page....
r3882 % endif
templating: use .mako as extensions for template files.
r1282 </div>
ui: new commits page....
r3882 </div>
diffs: added handy quick file selector in diffs views.
r3100 % endif
templating: use .mako as extensions for template files.
r1282
ui: new commits page....
r3882 ## comments
<div class="pull-right">
<div class="comments-number" style="padding-left: 10px">
% if hasattr(c, 'comments') and hasattr(c, 'inline_cnt'):
<i class="icon-comment" style="color: #949494">COMMENTS:</i>
% if c.comments:
<a href="#comments">${_ungettext("{} General", "{} General", len(c.comments)).format(len(c.comments))}</a>,
% else:
${_('0 General')}
% endif
% if c.inline_cnt:
<a href="#" onclick="return Rhodecode.comments.nextComment();"
id="inline-comments-counter">${_ungettext("{} Inline", "{} Inline", c.inline_cnt).format(c.inline_cnt)}
</a>
% else:
${_('0 Inline')}
% endif
% endif
comments: re-implemented diff and comments/todos in pull-requests.
r3884
% if pull_request_menu:
<%
outdated_comm_count_ver = pull_request_menu['outdated_comm_count_ver']
%>
% if outdated_comm_count_ver:
<a href="#" onclick="showOutdated(); Rhodecode.comments.nextOutdatedComment(); return false;">
(${_("{} Outdated").format(outdated_comm_count_ver)})
</a>
<a href="#" class="showOutdatedComments" onclick="showOutdated(this); return false;"> | ${_('show outdated')}</a>
<a href="#" class="hideOutdatedComments" style="display: none" onclick="hideOutdated(this); return false;"> | ${_('hide outdated')}</a>
% else:
(${_("{} Outdated").format(outdated_comm_count_ver)})
% endif
% endif
ui: new commits page....
r3882 </div>
</div>
templating: use .mako as extensions for template files.
r1282 </div>
ui: new commits page....
r3882 % if diffset.limited_diff:
<div class="diffset-heading ${(diffset.limited_diff and 'diffset-heading-warning' or '')}">
<h2 class="clearinner">
${_('The requested changes are too big and content was truncated.')}
<a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
</h2>
</div>
## commit range header for each individual diff
% elif commit and hasattr(c, 'commit_ranges') and len(c.commit_ranges) > 1:
<div class="diffset-heading ${(diffset.limited_diff and 'diffset-heading-warning' or '')}">
<div class="clearinner">
<a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.route_path('repo_commit',repo_name=diffset.repo_name,commit_id=commit.raw_id)}">${('r%s:%s' % (commit.idx,h.short_id(commit.raw_id)))}</a>
</div>
</div>
% endif
<div id="todo-box">
% if hasattr(c, 'unresolved_comments') and c.unresolved_comments:
% for co in c.unresolved_comments:
<a class="permalink" href="#comment-${co.comment_id}"
onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))">
<i class="icon-flag-filled-red"></i>
${co.comment_id}</a>${('' if loop.last else ',')}
% endfor
% endif
</div>
path-permissions: Initial support for path-based permissions
r2618 %if diffset.has_hidden_changes:
<p class="empty_data">${_('Some changes may be hidden')}</p>
%elif not diffset.files:
templating: use .mako as extensions for template files.
r1282 <p class="empty_data">${_('No files')}</p>
%endif
<div class="filediffs">
diffs: sticky top-file bar + context aware file labels....
r3126
pr-diffs: fixed a case when there are outdated comments and we're doing a rebase compare.
r1374 ## initial value could be marked as False later on
<% over_lines_changed_limit = False %>
templating: use .mako as extensions for template files.
r1282 %for i, filediff in enumerate(diffset.files):
<%
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 lines_changed = filediff.patch['stats']['added'] + filediff.patch['stats']['deleted']
templating: use .mako as extensions for template files.
r1282 over_lines_changed_limit = lines_changed > lines_changed_limit
%>
diffs: sticky top-file bar + context aware file labels....
r3126 ## anchor with support of sticky header
<div class="anchor" id="a_${h.FID(filediff.raw_id, filediff.patch['filename'])}"></div>
comments: allow commenting on empty files without content.
r3081
ui: new commits page....
r3882 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state collapse-${diffset_container_id}" id="filediff-collapse-${id(filediff)}" type="checkbox" onchange="updateSticky();">
templating: use .mako as extensions for template files.
r1282 <div
class="filediff"
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 data-f-path="${filediff.patch['filename']}"
diffs: sticky top-file bar + context aware file labels....
r3126 data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}"
comments: allow commenting on empty files without content.
r3081 >
<label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
ui: new commits page....
r3882 <div class="filediff-collapse-indicator icon-"></div>
comments: allow commenting on empty files without content.
r3081 ${diff_ops(filediff)}
</label>
diffs: sticky top-file bar + context aware file labels....
r3126
comments: allow commenting on empty files without content.
r3081 ${diff_menu(filediff, use_comments=use_comments)}
diffs: sticky top-file bar + context aware file labels....
r3126 <table data-f-path="${filediff.patch['filename']}" data-anchor-id="${h.FID(filediff.raw_id, filediff.patch['filename'])}" class="code-visible-block cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
comments: allow commenting on empty files without content.
r3081
## new/deleted/empty content case
% if not filediff.hunks:
## Comment container, on "fakes" hunk that contains all data to render comments
diffs: make line anchors commit aware. This fixes duplicate anchor problem on range diffs.
r3131 ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], filediff.hunk_ops, use_comments=use_comments, inline_comments=inline_comments)}
comments: allow commenting on empty files without content.
r3081 % endif
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if filediff.limited_diff:
templating: use .mako as extensions for template files.
r1282 <tr class="cb-warning cb-collapser">
users: use new session store for temporary settings for users....
r3088 <td class="cb-text" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=6')}>
dan
Diffs: fixed missing limited diff container display on large diffs
r3370 ${_('The requested commit or file is too big and content was truncated.')} <a href="${h.current_route_path(request, fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
templating: use .mako as extensions for template files.
r1282 </td>
</tr>
%else:
%if over_lines_changed_limit:
dan
Diffs: fixed missing limited diff container display on large diffs
r3370 <tr class="cb-warning cb-collapser">
<td class="cb-text" ${(c.user_session_attrs["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'); updateSticky(); return false;">${_('Show them')}
</a>
<a href="#" class="cb-collapse"
onclick="$(this).closest('table').addClass('cb-collapsed'); updateSticky(); return false;">${_('Hide them')}
</a>
</td>
</tr>
templating: use .mako as extensions for template files.
r1282 %endif
%endif
comments: allow commenting on empty files without content.
r3081 % for hunk in filediff.hunks:
<tr class="cb-hunk">
users: use new session store for temporary settings for users....
r3088 <td ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=3' or '')}>
comments: allow commenting on empty files without content.
r3081 ## TODO: dan: add ajax loading of more context here
## <a href="#">
<i class="icon-more"></i>
## </a>
</td>
users: use new session store for temporary settings for users....
r3088 <td ${(c.user_session_attrs["diffmode"] == 'sideside' and 'colspan=5' or '')}>
comments: allow commenting on empty files without content.
r3081 @@
-${hunk.source_start},${hunk.source_length}
+${hunk.target_start},${hunk.target_length}
${hunk.section_header}
</td>
</tr>
diffs: make line anchors commit aware. This fixes duplicate anchor problem on range diffs.
r3131 ${render_hunk_lines(filediff, c.user_session_attrs["diffmode"], hunk, use_comments=use_comments, inline_comments=inline_comments)}
comments: allow commenting on empty files without content.
r3081 % endfor
templating: use .mako as extensions for template files.
r1282
comments: ensure we ALWAYS display unmatched comments.
r3080 <% unmatched_comments = (inline_comments or {}).get(filediff.patch['filename'], {}) %>
templating: use .mako as extensions for template files.
r1282 ## outdated comments that do not fit into currently displayed lines
comments: ensure we ALWAYS display unmatched comments.
r3080 % for lineno, comments in unmatched_comments.items():
templating: use .mako as extensions for template files.
r1282
users: use new session store for temporary settings for users....
r3088 %if c.user_session_attrs["diffmode"] == 'unified':
comments: ensure we ALWAYS display unmatched comments.
r3080 % if loop.index == 0:
<tr class="cb-hunk">
<td colspan="3"></td>
<td>
<div>
pull-requests: expose TODO box in dedicated panel...
r4140 ${_('Unmatched/outdated inline comments below')}
comments: ensure we ALWAYS display unmatched comments.
r3080 </div>
</td>
</tr>
% endif
<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">
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 ${inline_comments_container(comments, inline_comments)}
comments: ensure we ALWAYS display unmatched comments.
r3080 </td>
</tr>
users: use new session store for temporary settings for users....
r3088 %elif c.user_session_attrs["diffmode"] == 'sideside':
comments: ensure we ALWAYS display unmatched comments.
r3080 % if loop.index == 0:
diffs: small UI fixes
r3083 <tr class="cb-comment-info">
comments: ensure we ALWAYS display unmatched comments.
r3080 <td colspan="2"></td>
diffs: small UI fixes
r3083 <td class="cb-line">
<div>
pull-requests: expose TODO box in dedicated panel...
r4140 ${_('Unmatched/outdated inline comments below')}
diffs: small UI fixes
r3083 </div>
</td>
<td colspan="2"></td>
<td class="cb-line">
comments: ensure we ALWAYS display unmatched comments.
r3080 <div>
pull-requests: expose TODO box in dedicated panel...
r4140 ${_('Unmatched/outdated comments below')}
comments: ensure we ALWAYS display unmatched comments.
r3080 </div>
</td>
</tr>
% endif
<tr class="cb-line">
<td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context">
% if lineno.startswith('o'):
${inline_comments_container(comments, inline_comments)}
% endif
</td>
templating: use .mako as extensions for template files.
r1282
comments: ensure we ALWAYS display unmatched comments.
r3080 <td class="cb-data cb-context"></td>
<td class="cb-lineno cb-context"></td>
<td class="cb-content cb-context">
% if lineno.startswith('n'):
${inline_comments_container(comments, inline_comments)}
% endif
</td>
</tr>
%endif
templating: use .mako as extensions for template files.
r1282
% 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():
diffs: fixed outdated files in pull-requests re-using the filediff raw_id for anchor generation....
r3937
pull-requests: fixed case of unresolved comments attached to removed file in pr....
r2808 <%
display_state = 'display: none'
open_comments_in_file = [x for x in comments_dict['comments'] if x.outdated is False]
if open_comments_in_file:
display_state = ''
diffs: fixed outdated files in pull-requests re-using the filediff raw_id for anchor generation....
r3830 fid = str(id(filename))
pull-requests: fixed case of unresolved comments attached to removed file in pr....
r2808 %>
<div class="filediffs filediff-outdated" style="${display_state}">
ui: new commits page....
r3882 <input ${(collapse_all and 'checked' or '')} class="filediff-collapse-state collapse-${diffset_container_id}" id="filediff-collapse-${id(filename)}" type="checkbox" onchange="updateSticky();">
diffs: fixed outdated files in pull-requests re-using the filediff raw_id for anchor generation....
r3830 <div class="filediff" data-f-path="${filename}" id="a_${h.FID(fid, filename)}">
templating: use .mako as extensions for template files.
r1282 <label for="filediff-collapse-${id(filename)}" class="filediff-heading">
comments: re-implemented diff and comments/todos in pull-requests.
r3884 <div class="filediff-collapse-indicator icon-"></div>
diffs: fixed outdated files in pull-requests re-using the filediff raw_id for anchor generation....
r3830
templating: use .mako as extensions for template files.
r1282 <span class="pill">
## file was deleted
ui: new commits page....
r3882 ${filename}
templating: use .mako as extensions for template files.
r1282 </span>
ui: new commits page....
r3882 <span class="pill-group pull-left" >
templating: use .mako as extensions for template files.
r1282 ## file op, doesn't need translation
<span class="pill" op="removed">removed in this version</span>
</span>
diffs: fixed outdated files in pull-requests re-using the filediff raw_id for anchor generation....
r3830 <a class="pill filediff-anchor" href="#a_${h.FID(fid, filename)}"></a>
ui: new commits page....
r3882 <span class="pill-group pull-right">
templating: use .mako as extensions for template files.
r1282 <span class="pill" op="deleted">-${comments_dict['stats']}</span>
</span>
</label>
ui: new commits page....
r3882 <table class="cb cb-diff-${c.user_session_attrs["diffmode"]} code-highlight ${(over_lines_changed_limit and 'cb-collapsed' or '')}">
templating: use .mako as extensions for template files.
r1282 <tr>
users: use new session store for temporary settings for users....
r3088 % if c.user_session_attrs["diffmode"] == 'unified':
templating: use .mako as extensions for template files.
r1282 <td></td>
%endif
<td></td>
users: use new session store for temporary settings for users....
r3088 <td class="cb-text cb-${op_class(BIN_FILENODE)}" ${(c.user_session_attrs["diffmode"] == 'unified' and 'colspan=4' or 'colspan=5')}>
pull-requests: fixed case of unresolved comments attached to removed file in pr....
r2808 ${_('File was deleted in this version. There are still outdated/unresolved comments attached to it.')}
templating: use .mako as extensions for template files.
r1282 </td>
</tr>
users: use new session store for temporary settings for users....
r3088 %if c.user_session_attrs["diffmode"] == 'unified':
templating: use .mako as extensions for template files.
r1282 <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">
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 ${inline_comments_container(comments_dict['comments'], inline_comments)}
templating: use .mako as extensions for template files.
r1282 </td>
</tr>
users: use new session store for temporary settings for users....
r3088 %elif c.user_session_attrs["diffmode"] == 'sideside':
templating: use .mako as extensions for template files.
r1282 <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">
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 ${inline_comments_container(comments_dict['comments'], inline_comments)}
templating: use .mako as extensions for template files.
r1282 </td>
</tr>
%endif
</table>
</div>
</div>
% endfor
</div>
</div>
</%def>
<%def name="diff_ops(filediff)">
<%
from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
diffs: support mercurial copy in diffs details.
r1582 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE
templating: use .mako as extensions for template files.
r1282 %>
<span class="pill">
ui: new commits page....
r3882 <i class="icon-file-text"></i>
templating: use .mako as extensions for template files.
r1282 %if filediff.source_file_path and filediff.target_file_path:
html: fixed found syntax problems
r1283 %if filediff.source_file_path != filediff.target_file_path:
diffs: support mercurial copy in diffs details.
r1582 ## file was renamed, or copied
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
ui: new commits page....
r3882 ${filediff.target_file_path}<del>${filediff.source_file_path}</del>
diffs: show copy-to-clipboard next to diff files
r2120 <% final_path = filediff.target_file_path %>
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %elif COPIED_FILENODE in filediff.patch['stats']['ops']:
ui: new commits page....
r3882 ${filediff.target_file_path}${filediff.source_file_path}
diffs: show copy-to-clipboard next to diff files
r2120 <% final_path = filediff.target_file_path %>
diffs: support mercurial copy in diffs details.
r1582 %endif
templating: use .mako as extensions for template files.
r1282 %else:
## file was modified
ui: new commits page....
r3882 ${filediff.source_file_path}
diffs: show copy-to-clipboard next to diff files
r2120 <% final_path = filediff.source_file_path %>
templating: use .mako as extensions for template files.
r1282 %endif
%else:
%if filediff.source_file_path:
## file was deleted
ui: new commits page....
r3882 ${filediff.source_file_path}
diffs: show copy-to-clipboard next to diff files
r2120 <% final_path = filediff.source_file_path %>
templating: use .mako as extensions for template files.
r1282 %else:
## file was added
ui: new commits page....
r3882 ${filediff.target_file_path}
diffs: show copy-to-clipboard next to diff files
r2120 <% final_path = filediff.target_file_path %>
templating: use .mako as extensions for template files.
r1282 %endif
%endif
diffs: show copy-to-clipboard next to diff files
r2120 <i style="color: #aaa" class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${final_path}" title="${_('Copy the full path')}" onclick="return false;"></i>
templating: use .mako as extensions for template files.
r1282 </span>
dan
diffs: made pills display on single side. Better UX and readability.
r3116 ## anchor link
pull-requests: allow to show range diff in pr view
r3124 <a class="pill filediff-anchor" href="#a_${h.FID(filediff.raw_id, filediff.patch['filename'])}"></a>
dan
diffs: made pills display on single side. Better UX and readability.
r3116
ui: new commits page....
r3882 <span class="pill-group pull-right">
dan
diffs: made pills display on single side. Better UX and readability.
r3116
## ops pills
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if filediff.limited_diff:
templating: use .mako as extensions for template files.
r1282 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
%endif
diffs: support mercurial copy in diffs details.
r1582
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if NEW_FILENODE in filediff.patch['stats']['ops']:
templating: use .mako as extensions for template files.
r1282 <span class="pill" op="created">created</span>
%if filediff['target_mode'].startswith('120'):
<span class="pill" op="symlink">symlink</span>
%else:
<span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
%endif
%endif
dan
diffs: made pills display on single side. Better UX and readability.
r3116 %if RENAMED_FILENODE in filediff.patch['stats']['ops']:
<span class="pill" op="renamed">renamed</span>
%endif
%if COPIED_FILENODE in filediff.patch['stats']['ops']:
<span class="pill" op="copied">copied</span>
%endif
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if DEL_FILENODE in filediff.patch['stats']['ops']:
templating: use .mako as extensions for template files.
r1282 <span class="pill" op="removed">removed</span>
%endif
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if CHMOD_FILENODE in filediff.patch['stats']['ops']:
templating: use .mako as extensions for template files.
r1282 <span class="pill" op="mode">
${nice_mode(filediff['source_mode'])}${nice_mode(filediff['target_mode'])}
</span>
%endif
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if BIN_FILENODE in filediff.patch['stats']['ops']:
templating: use .mako as extensions for template files.
r1282 <span class="pill" op="binary">binary</span>
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if MOD_FILENODE in filediff.patch['stats']['ops']:
dan
diffs: made pills display on single side. Better UX and readability.
r3116 <span class="pill" op="modified">modified</span>
templating: use .mako as extensions for template files.
r1282 %endif
%endif
dan
diffs: made pills display on single side. Better UX and readability.
r3116
<span class="pill" op="added">${('+' if filediff.patch['stats']['added'] else '')}${filediff.patch['stats']['added']}</span>
<span class="pill" op="deleted">${((h.safe_int(filediff.patch['stats']['deleted']) or 0) * -1)}</span>
templating: use .mako as extensions for template files.
r1282 </span>
</%def>
<%def name="nice_mode(filemode)">
diffs: added handy quick file selector in diffs views.
r3100 ${(filemode.startswith('100') and filemode[3:] or filemode)}
templating: use .mako as extensions for template files.
r1282 </%def>
<%def name="diff_menu(filediff, use_comments=False)">
<div class="filediff-menu">
compare: fixed case of cross repo compare before links not working.
r3146
%if filediff.diffset.source_ref:
## FILE BEFORE CHANGES
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if filediff.operation in ['D', 'M']:
templating: use .mako as extensions for template files.
r1282 <a
class="tooltip"
compare: fixed case of cross repo compare before links not working.
r3146 href="${h.route_path('repo_files',repo_name=filediff.diffset.target_repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}"
templating: use .mako as extensions for template files.
r1282 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
>
${_('Show file before')}
</a> |
%else:
<span
class="tooltip"
compare: fixed case of cross repo compare before links not working.
r3146 title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
templating: use .mako as extensions for template files.
r1282 >
${_('Show file before')}
</span> |
%endif
compare: fixed case of cross repo compare before links not working.
r3146
## FILE AFTER CHANGES
diffs: simplified the datastructure of fillediff. Hopefully this...
r1844 %if filediff.operation in ['A', 'M']:
templating: use .mako as extensions for template files.
r1282 <a
class="tooltip"
files: ported repository files controllers to pyramid views.
r1927 href="${h.route_path('repo_files',repo_name=filediff.diffset.source_repo_name,commit_id=filediff.diffset.target_ref,f_path=filediff.target_file_path)}"
templating: use .mako as extensions for template files.
r1282 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
>
${_('Show file after')}
dan
diffs: introducing diff menu for whitespace toggle and context changes
r3134 </a>
templating: use .mako as extensions for template files.
r1282 %else:
<span
class="tooltip"
compare: fixed case of cross repo compare before links not working.
r3146 title="${h.tooltip(_('File not present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
templating: use .mako as extensions for template files.
r1282 >
dan
diffs: introducing diff menu for whitespace toggle and context changes
r3134 ${_('Show file after')}
</span>
templating: use .mako as extensions for template files.
r1282 %endif
dan
diffs: introducing diff menu for whitespace toggle and context changes
r3134
compare: fixed case of cross repo compare before links not working.
r3146 % if use_comments:
|
<a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
<span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
</a>
% endif
dan
diffs: introducing diff menu for whitespace toggle and context changes
r3134
compare: fixed case of cross repo compare before links not working.
r3146 %endif
templating: use .mako as extensions for template files.
r1282 </div>
</%def>
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 <%def name="inline_comments_container(comments, inline_comments)">
templating: use .mako as extensions for template files.
r1282 <div class="inline-comments">
%for comment in comments:
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 ${commentblock.comment_block(comment, inline=True)}
templating: use .mako as extensions for template files.
r1282 %endfor
% if comments and comments[-1].outdated:
ui: new commits page....
r3882 <span class="btn btn-secondary cb-comment-add-button comment-outdated}" style="display: none;}">
templating: use .mako as extensions for template files.
r1282 ${_('Add another comment')}
</span>
% else:
ui: new commits page....
r3882 <span onclick="return Rhodecode.comments.createComment(this)" class="btn btn-secondary cb-comment-add-button">
templating: use .mako as extensions for template files.
r1282 ${_('Add another comment')}
</span>
% endif
</div>
</%def>
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 <%!
comments: ensure we ALWAYS display unmatched comments.
r3080 def get_comments_for(diff_type, comments, filename, line_version, line_number):
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 if hasattr(filename, 'unicode_path'):
filename = filename.unicode_path
templating: use .mako as extensions for template files.
r1282
dan
py3: remove usage of basestring
r3425 if not isinstance(filename, (unicode, str)):
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 return None
comments: ensure we ALWAYS display unmatched comments.
r3080 line_key = '{}{}'.format(line_version, line_number) ## e.g o37, n12
Bartłomiej Wołyńczyk
caching: add option to cache diffs for commits and pull requests....
r2685 if comments and filename in comments:
file_comments = comments[filename]
if line_key in file_comments:
comments: ensure we ALWAYS display unmatched comments.
r3080 data = file_comments.pop(line_key)
return data