##// END OF EJS Templates
comments: made few UI changes/improvements for how we show comments status, ribbons and general comment data.
marcink -
r4411:569617be default
parent child Browse files
Show More
@@ -3806,6 +3806,11 b' class ChangesetComment(Base, BaseModel):'
3806 3806 return self.pull_request_version_id < version
3807 3807
3808 3808 @property
3809 def commit_id(self):
3810 """New style naming to stop using .revision"""
3811 return self.revision
3812
3813 @property
3809 3814 def resolved(self):
3810 3815 return self.resolved_by[0] if self.resolved_by else None
3811 3816
@@ -1063,6 +1063,10 b' input.filediff-collapse-state {'
1063 1063 background: @color5;
1064 1064 color: white;
1065 1065 }
1066 &[op="comments"] { /* comments on file */
1067 background: @grey4;
1068 color: white;
1069 }
1066 1070 }
1067 1071 }
1068 1072
@@ -65,7 +65,7 b' tr.inline-comments div {'
65 65 float: left;
66 66
67 67 padding: 0.4em 0.4em;
68 margin: 3px 5px 0px -10px;
68 margin: 2px 4px 0px 0px;
69 69 display: inline-block;
70 70 min-height: 0;
71 71
@@ -76,12 +76,13 b' tr.inline-comments div {'
76 76 font-family: @text-italic;
77 77 font-style: italic;
78 78 background: #fff none;
79 color: @grey4;
79 color: @grey3;
80 80 border: 1px solid @grey4;
81 81 white-space: nowrap;
82 82
83 83 text-transform: uppercase;
84 min-width: 40px;
84 min-width: 50px;
85 border-radius: 4px;
85 86
86 87 &.todo {
87 88 color: @color5;
@@ -33,46 +33,82 b''
33 33
34 34 <div class="meta">
35 35 <div class="comment-type-label">
36 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}" title="line: ${comment.line_no}">
36 <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}">
37
38 ## TODO COMMENT
37 39 % if comment.comment_type == 'todo':
38 40 % if comment.resolved:
39 41 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
42 <i class="icon-flag-filled"></i>
40 43 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
41 44 </div>
42 45 % else:
43 46 <div class="resolved tooltip" style="display: none">
44 47 <span>${comment.comment_type}</span>
45 48 </div>
46 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to resolve this comment')}">
49 <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to create resolution comment.')}">
50 <i class="icon-flag-filled"></i>
47 51 ${comment.comment_type}
48 52 </div>
49 53 % endif
54 ## NOTE COMMENT
50 55 % else:
56 ## RESOLVED NOTE
51 57 % if comment.resolved_comment:
52 fix
53 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.json.dumps(comment.resolved_comment.outdated)})">
54 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
55 </a>
58 <div class="tooltip" title="${_('This comment resolves TODO #{}').format(comment.resolved_comment.comment_id)}">
59 fix
60 <a href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'), 0, ${h.json.dumps(comment.resolved_comment.outdated)})">
61 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
62 </a>
63 </div>
64 ## STATUS CHANGE NOTE
65 % elif not comment.is_inline and comment.status_change:
66 <%
67 if comment.pull_request:
68 status_change_title = 'Status of review for pull request !{}'.format(comment.pull_request.pull_request_id)
69 else:
70 status_change_title = 'Status of review for commit {}'.format(h.short_id(comment.commit_id))
71 %>
72
73 <i class="icon-circle review-status-${comment.status_change[0].status}"></i>
74 <div class="changeset-status-lbl tooltip" title="${status_change_title}">
75 ${comment.status_change[0].status_lbl}
76 </div>
56 77 % else:
57 ${comment.comment_type or 'note'}
78 <div>
79 <i class="icon-comment"></i>
80 ${(comment.comment_type or 'note')}
81 </div>
58 82 % endif
59 83 % endif
84
60 85 </div>
61 86 </div>
62 87
88 % if 0 and comment.status_change:
89 <div class="pull-left">
90 <span class="tag authortag tooltip" title="${_('Status from pull request.')}">
91 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
92 ${'!{}'.format(comment.pull_request.pull_request_id)}
93 </a>
94 </span>
95 </div>
96 % endif
97
63 98 <div class="author ${'author-inline' if inline else 'author-general'}">
64 99 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
100 </div>
65 101
66 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
67 <span class="tag authortag tooltip" title="${_('Pull request author')}">
68 ${_('author')}
69 </span>
70 % endif
71
72 </div>
73 102 <div class="date">
74 103 ${h.age_component(comment.modified_at, time_is_local=True)}
75 104 </div>
105
106 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
107 <span class="tag authortag tooltip" title="${_('Pull request author')}">
108 ${_('author')}
109 </span>
110 % endif
111
76 112 <%
77 113 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
78 114 %>
@@ -116,32 +152,6 b''
116 152 data-last-version="0">
117 153 </div>
118 154 %endif
119 % if inline:
120 <span></span>
121 % else:
122 <div class="status-change">
123 % if comment.pull_request:
124 <a href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}">
125 % if comment.status_change:
126 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}:
127 % else:
128 ${_('pull request !{}').format(comment.pull_request.pull_request_id)}
129 % endif
130 </a>
131 % else:
132 % if comment.status_change:
133 ${_('Status change on commit')}:
134 % endif
135 % endif
136 </div>
137 % endif
138
139 % if comment.status_change:
140 <i class="icon-circle review-status-${comment.status_change[0].status}"></i>
141 <div title="${_('Commit status')}" class="changeset-status-lbl">
142 ${comment.status_change[0].status_lbl}
143 </div>
144 % endif
145 155
146 156 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
147 157
@@ -150,17 +160,17 b''
150 160 % if inline:
151 161 <a class="pr-version-inline" href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
152 162 % if outdated_at_ver:
153 <code class="pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
163 <code class="tooltip pr-version-num" title="${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
154 164 outdated ${'v{}'.format(pr_index_ver)} |
155 165 </code>
156 166 % elif pr_index_ver:
157 <code class="pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
167 <code class="tooltip pr-version-num" title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}">
158 168 ${'v{}'.format(pr_index_ver)} |
159 169 </code>
160 170 % endif
161 171 </a>
162 172 % else:
163 % if comment.pull_request_version_id and pr_index_ver:
173 % if pr_index_ver:
164 174
165 175 % if comment.outdated:
166 176 <a class="pr-version"
@@ -169,7 +179,7 b''
169 179 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}
170 180 </a> |
171 181 % else:
172 <a class="pr-version"
182 <a class="tooltip pr-version"
173 183 title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}"
174 184 href="${h.route_path('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id, version=comment.pull_request_version_id)}"
175 185 >
@@ -259,7 +259,10 b" return '%s_%s_%i' % (h.md5_safe(commit+f"
259 259 %>
260 260 <div class="filediff-collapse-indicator icon-"></div>
261 261 <span class="pill-group pull-right" >
262 <span class="pill"><i class="icon-comment"></i> ${len(total_file_comments)}</span>
262 <span class="pill" op="comments">
263
264 <i class="icon-comment"></i> ${len(total_file_comments)}
265 </span>
263 266 </span>
264 267 ${diff_ops(filediff)}
265 268
General Comments 0
You need to be logged in to leave comments. Login now