##// 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 return self.pull_request_version_id < version
3806 return self.pull_request_version_id < version
3807
3807
3808 @property
3808 @property
3809 def commit_id(self):
3810 """New style naming to stop using .revision"""
3811 return self.revision
3812
3813 @property
3809 def resolved(self):
3814 def resolved(self):
3810 return self.resolved_by[0] if self.resolved_by else None
3815 return self.resolved_by[0] if self.resolved_by else None
3811
3816
@@ -1063,6 +1063,10 b' input.filediff-collapse-state {'
1063 background: @color5;
1063 background: @color5;
1064 color: white;
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 float: left;
65 float: left;
66
66
67 padding: 0.4em 0.4em;
67 padding: 0.4em 0.4em;
68 margin: 3px 5px 0px -10px;
68 margin: 2px 4px 0px 0px;
69 display: inline-block;
69 display: inline-block;
70 min-height: 0;
70 min-height: 0;
71
71
@@ -76,12 +76,13 b' tr.inline-comments div {'
76 font-family: @text-italic;
76 font-family: @text-italic;
77 font-style: italic;
77 font-style: italic;
78 background: #fff none;
78 background: #fff none;
79 color: @grey4;
79 color: @grey3;
80 border: 1px solid @grey4;
80 border: 1px solid @grey4;
81 white-space: nowrap;
81 white-space: nowrap;
82
82
83 text-transform: uppercase;
83 text-transform: uppercase;
84 min-width: 40px;
84 min-width: 50px;
85 border-radius: 4px;
85
86
86 &.todo {
87 &.todo {
87 color: @color5;
88 color: @color5;
@@ -33,35 +33,75 b''
33
33
34 <div class="meta">
34 <div class="meta">
35 <div class="comment-type-label">
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 % if comment.comment_type == 'todo':
39 % if comment.comment_type == 'todo':
38 % if comment.resolved:
40 % if comment.resolved:
39 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
41 <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}">
42 <i class="icon-flag-filled"></i>
40 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
43 <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a>
41 </div>
44 </div>
42 % else:
45 % else:
43 <div class="resolved tooltip" style="display: none">
46 <div class="resolved tooltip" style="display: none">
44 <span>${comment.comment_type}</span>
47 <span>${comment.comment_type}</span>
45 </div>
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 ${comment.comment_type}
51 ${comment.comment_type}
48 </div>
52 </div>
49 % endif
53 % endif
54 ## NOTE COMMENT
50 % else:
55 % else:
56 ## RESOLVED NOTE
51 % if comment.resolved_comment:
57 % if comment.resolved_comment:
58 <div class="tooltip" title="${_('This comment resolves TODO #{}').format(comment.resolved_comment.comment_id)}">
52 fix
59 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)})">
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)})">
54 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
61 <span style="text-decoration: line-through">#${comment.resolved_comment.comment_id}</span>
55 </a>
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 % else:
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 % endif
82 % endif
59 % endif
83 % endif
84
60 </div>
85 </div>
61 </div>
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 <div class="author ${'author-inline' if inline else 'author-general'}">
98 <div class="author ${'author-inline' if inline else 'author-general'}">
64 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
99 ${base.gravatar_with_user(comment.author.email, 16, tooltip=True)}
100 </div>
101
102 <div class="date">
103 ${h.age_component(comment.modified_at, time_is_local=True)}
104 </div>
65
105
66 % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id:
106 % 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')}">
107 <span class="tag authortag tooltip" title="${_('Pull request author')}">
@@ -69,10 +109,6 b''
69 </span>
109 </span>
70 % endif
110 % endif
71
111
72 </div>
73 <div class="date">
74 ${h.age_component(comment.modified_at, time_is_local=True)}
75 </div>
76 <%
112 <%
77 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
113 comment_version_selector = 'comment_versions_{}'.format(comment.comment_id)
78 %>
114 %>
@@ -116,32 +152,6 b''
116 data-last-version="0">
152 data-last-version="0">
117 </div>
153 </div>
118 %endif
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 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
156 <a class="permalink" href="#comment-${comment.comment_id}"> &para;</a>
147
157
@@ -150,17 +160,17 b''
150 % if inline:
160 % if inline:
151 <a class="pr-version-inline" href="${request.current_route_path(_query=dict(version=comment.pull_request_version_id), _anchor='comment-{}'.format(comment.comment_id))}">
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 % if outdated_at_ver:
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 outdated ${'v{}'.format(pr_index_ver)} |
164 outdated ${'v{}'.format(pr_index_ver)} |
155 </code>
165 </code>
156 % elif pr_index_ver:
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 ${'v{}'.format(pr_index_ver)} |
168 ${'v{}'.format(pr_index_ver)} |
159 </code>
169 </code>
160 % endif
170 % endif
161 </a>
171 </a>
162 % else:
172 % else:
163 % if comment.pull_request_version_id and pr_index_ver:
173 % if pr_index_ver:
164
174
165 % if comment.outdated:
175 % if comment.outdated:
166 <a class="pr-version"
176 <a class="pr-version"
@@ -169,7 +179,7 b''
169 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}
179 ${_('Outdated comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}
170 </a> |
180 </a> |
171 % else:
181 % else:
172 <a class="pr-version"
182 <a class="tooltip pr-version"
173 title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}"
183 title="${_('Comment from pull request version v{0}, latest v{1}').format(pr_index_ver, latest_ver)}"
174 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)}"
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 <div class="filediff-collapse-indicator icon-"></div>
260 <div class="filediff-collapse-indicator icon-"></div>
261 <span class="pill-group pull-right" >
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 </span>
266 </span>
264 ${diff_ops(filediff)}
267 ${diff_ops(filediff)}
265
268
General Comments 0
You need to be logged in to leave comments. Login now