##// END OF EJS Templates
comment-history: UI fixes
marcink -
r4404:56b5a39d default
parent child Browse files
Show More
@@ -447,6 +447,13 b' form.comment-form {'
447 447 }
448 448 }
449 449
450 .comment-version-select {
451 margin: 0px;
452 border-radius: inherit;
453 border-color: @grey6;
454 height: 20px;
455 }
456
450 457 .comment-type {
451 458 margin: 0px;
452 459 border-radius: inherit;
@@ -137,9 +137,7 b' var _submitAjaxPOST = function(url, post'
137 137 $(this.commentType).prop('disabled', true);
138 138 $(this.commentType).addClass('disabled');
139 139 var editInfo =
140 '<div class="comment-label note" id="comment-label-6" title="line: ">' +
141 'editing' +
142 '</div>';
140 '';
143 141 $(editInfo).insertBefore($(this.editButton).parent());
144 142 }
145 143
@@ -554,7 +552,7 b' var CommentsController = function() {'
554 552 };
555 553 failRenderCommit = function () {
556 554 SwalNoAnimation.fire({
557 html: 'Error while loading comment',
555 html: 'Error while loading comment history',
558 556 title: '',
559 557 });
560 558 };
@@ -68,23 +68,25 b''
68 68 </div>
69 69 % if comment.history:
70 70 <div class="date">
71 <span class="comment-area-text">${_('Comment version')}:</span>
72 <select class="comment-type" id="comment_history_for_comment_${comment.comment_id}"
71 <span class="comment-area-text">${_('Edited')}:</span>
72 <select class="comment-version-select" id="comment_history_for_comment_${comment.comment_id}"
73 73 onchange="return Rhodecode.comments.showVersion(this)"
74 74 name="comment_type">
75
75 76 <option style="display: none" value="0">---</option>
76 %for comment_history in comment.history:
77 <option
78 data-comment-history-id="${comment_history.comment_history_id}",
79 data-comment-id="${comment.comment_id}",
80 value="${comment_history.version}">${comment_history.version}</option>
81 %endfor
77 % for comment_history in comment.history:
78 <option data-comment-history-id="${comment_history.comment_history_id}"
79 data-comment-id="${comment.comment_id}"
80 value="${comment_history.version}">
81 ${comment_history.version}
82 </option>
83 % endfor
82 84 </select>
83 85 </div>
84 86 % else:
85 87 <div class="date" style="display: none">
86 <span class="comment-area-text">${_('Comment version')}</span>
87 <select class="comment-type" id="comment_history_for_comment_${comment.comment_id}"
88 <span class="comment-area-text">${_('Edited')}</span>
89 <select class="comment-version-select" id="comment_history_for_comment_${comment.comment_id}"
88 90 onchange="return Rhodecode.comments.showVersion(this)"
89 91 name="comment_type">
90 92 <option style="display: none" value="0">---</option>
@@ -169,19 +171,19 b''
169 171 %if comment.immutable is False and (c.is_super_admin or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id):
170 172 %if comment.comment_type == 'note':
171 173 <a onclick="return Rhodecode.comments.editComment(this);"
172 class="edit-comment"> ${_('Edit')}</a>
174 class="edit-comment">${_('Edit')}</a>
173 175 %else:
174 <button class="btn-link" disabled="disabled"> ${_('Edit')}</button>
176 <button class="btn-link" disabled="disabled">${_('Edit')}</button>
175 177 %endif
176 178 | <a onclick="return Rhodecode.comments.deleteComment(this);"
177 class="delete-comment"> ${_('Delete')}</a>
179 class="delete-comment">${_('Delete')}</a>
178 180 %else:
179 <button class="btn-link" disabled="disabled"> ${_('Edit')}</button>
180 | <button class="btn-link" disabled="disabled"> ${_('Delete')}</button>
181 <button class="btn-link" disabled="disabled">${_('Edit')}</button>
182 | <button class="btn-link" disabled="disabled">${_('Delete')}</button>
181 183 %endif
182 184 %else:
183 <button class="btn-link" disabled="disabled"> ${_('Edit')}</button>
184 | <button class="btn-link" disabled="disabled"> ${_('Delete')}</button>
185 <button class="btn-link" disabled="disabled">${_('Edit')}</button>
186 | <button class="btn-link" disabled="disabled">${_('Delete')}</button>
185 187 %endif
186 188
187 189 % if outdated_at_ver:
@@ -1,7 +1,31 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 ${c.comment_history.author.email}
4 ${base.gravatar_with_user(c.comment_history.author.email, 16, tooltip=True)}
5 ${h.age_component(c.comment_history.created_on)}
6 ${c.comment_history.text}
7 ${c.comment_history.version} No newline at end of file
3 <%
4 active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
5 %>
6
7 ## NOTE, inline styles are here to override the default rendering of
8 ## the swal JS dialog which this template is displayed
9
10 <div style="text-align: left;">
11
12 <div style="border-bottom: 1px solid #dbd9da; padding-bottom: 5px; height: 20px">
13
14 <div class="pull-left">
15 ${base.gravatar_with_user(c.comment_history.author.email, 16, tooltip=True)}
16 </div>
17
18 <div class="pull-right">
19 <code>edited: ${h.age_component(c.comment_history.created_on)}</code>
20 </div>
21
22 </div>
23
24 <div style="margin: 5px 0px">
25 <code>comment body at v${c.comment_history.version}:</code>
26 </div>
27 <div class="text" style="padding-top: 20px; border: 1px solid #dbd9da">
28 ${h.render(c.comment_history.text, renderer=c.comment_history.comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
29 </div>
30
31 </div> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now