Show More
@@ -1,558 +1,571 b'' | |||||
1 | // comments.less |
|
1 | // comments.less | |
2 | // For use in RhodeCode applications; |
|
2 | // For use in RhodeCode applications; | |
3 | // see style guide documentation for guidelines. |
|
3 | // see style guide documentation for guidelines. | |
4 |
|
4 | |||
5 |
|
5 | |||
6 | // Comments |
|
6 | // Comments | |
7 | @comment-outdated-opacity: 0.6; |
|
7 | @comment-outdated-opacity: 0.6; | |
8 |
|
8 | |||
9 | .comments { |
|
9 | .comments { | |
10 | width: 100%; |
|
10 | width: 100%; | |
11 | } |
|
11 | } | |
12 |
|
12 | |||
13 | tr.inline-comments div { |
|
13 | tr.inline-comments div { | |
14 | max-width: 100%; |
|
14 | max-width: 100%; | |
15 |
|
15 | |||
16 | p { |
|
16 | p { | |
17 | white-space: normal; |
|
17 | white-space: normal; | |
18 | } |
|
18 | } | |
19 |
|
19 | |||
20 | code, pre, .code, dd { |
|
20 | code, pre, .code, dd { | |
21 | overflow-x: auto; |
|
21 | overflow-x: auto; | |
22 | width: 1062px; |
|
22 | width: 1062px; | |
23 | } |
|
23 | } | |
24 |
|
24 | |||
25 | dd { |
|
25 | dd { | |
26 | width: auto; |
|
26 | width: auto; | |
27 | } |
|
27 | } | |
28 | } |
|
28 | } | |
29 |
|
29 | |||
30 | #injected_page_comments { |
|
30 | #injected_page_comments { | |
31 | .comment-previous-link, |
|
31 | .comment-previous-link, | |
32 | .comment-next-link, |
|
32 | .comment-next-link, | |
33 | .comment-links-divider { |
|
33 | .comment-links-divider { | |
34 | display: none; |
|
34 | display: none; | |
35 | } |
|
35 | } | |
36 | } |
|
36 | } | |
37 |
|
37 | |||
38 | .add-comment { |
|
38 | .add-comment { | |
39 | margin-bottom: 10px; |
|
39 | margin-bottom: 10px; | |
40 | } |
|
40 | } | |
41 | .hide-comment-button .add-comment { |
|
41 | .hide-comment-button .add-comment { | |
42 | display: none; |
|
42 | display: none; | |
43 | } |
|
43 | } | |
44 |
|
44 | |||
45 | .comment-bubble { |
|
45 | .comment-bubble { | |
46 | color: @grey4; |
|
46 | color: @grey4; | |
47 | margin-top: 4px; |
|
47 | margin-top: 4px; | |
48 | margin-right: 30px; |
|
48 | margin-right: 30px; | |
49 | visibility: hidden; |
|
49 | visibility: hidden; | |
50 | } |
|
50 | } | |
51 |
|
51 | |||
52 | .comment-label { |
|
52 | .comment-label { | |
53 | float: left; |
|
53 | float: left; | |
54 |
|
54 | |||
55 | padding: 0.4em 0.4em; |
|
55 | padding: 0.4em 0.4em; | |
56 | margin: 3px 5px 0px -10px; |
|
56 | margin: 3px 5px 0px -10px; | |
57 | display: inline-block; |
|
57 | display: inline-block; | |
58 | min-height: 0; |
|
58 | min-height: 0; | |
59 |
|
59 | |||
60 | text-align: center; |
|
60 | text-align: center; | |
61 | font-size: 10px; |
|
61 | font-size: 10px; | |
62 | line-height: .8em; |
|
62 | line-height: .8em; | |
63 |
|
63 | |||
64 | font-family: @text-italic; |
|
64 | font-family: @text-italic; | |
65 | background: #fff none; |
|
65 | background: #fff none; | |
66 | color: @grey4; |
|
66 | color: @grey4; | |
67 | border: 1px solid @grey4; |
|
67 | border: 1px solid @grey4; | |
68 | white-space: nowrap; |
|
68 | white-space: nowrap; | |
69 |
|
69 | |||
70 | text-transform: uppercase; |
|
70 | text-transform: uppercase; | |
71 | min-width: 40px; |
|
71 | min-width: 40px; | |
72 |
|
72 | |||
73 | &.todo { |
|
73 | &.todo { | |
74 | color: @color5; |
|
74 | color: @color5; | |
75 | font-family: @text-bold-italic; |
|
75 | font-family: @text-bold-italic; | |
76 | } |
|
76 | } | |
77 |
|
77 | |||
78 | .resolve { |
|
78 | .resolve { | |
79 | cursor: pointer; |
|
79 | cursor: pointer; | |
80 | text-decoration: underline; |
|
80 | text-decoration: underline; | |
81 | } |
|
81 | } | |
82 |
|
82 | |||
83 | .resolved { |
|
83 | .resolved { | |
84 | text-decoration: line-through; |
|
84 | text-decoration: line-through; | |
85 | color: @color1; |
|
85 | color: @color1; | |
86 | } |
|
86 | } | |
87 | .resolved a { |
|
87 | .resolved a { | |
88 | text-decoration: line-through; |
|
88 | text-decoration: line-through; | |
89 | color: @color1; |
|
89 | color: @color1; | |
90 | } |
|
90 | } | |
91 | .resolve-text { |
|
91 | .resolve-text { | |
92 | color: @color1; |
|
92 | color: @color1; | |
93 | margin: 2px 8px; |
|
93 | margin: 2px 8px; | |
94 | font-family: @text-italic; |
|
94 | font-family: @text-italic; | |
95 | } |
|
95 | } | |
96 | } |
|
96 | } | |
97 |
|
97 | |||
|
98 | .has-spacer-after { | |||
|
99 | &:after { | |||
|
100 | content: ' | '; | |||
|
101 | color: @grey5; | |||
|
102 | } | |||
|
103 | } | |||
|
104 | ||||
|
105 | .has-spacer-before { | |||
|
106 | &:before { | |||
|
107 | content: ' | '; | |||
|
108 | color: @grey5; | |||
|
109 | } | |||
|
110 | } | |||
98 |
|
111 | |||
99 | .comment { |
|
112 | .comment { | |
100 |
|
113 | |||
101 | &.comment-general { |
|
114 | &.comment-general { | |
102 | border: 1px solid @grey5; |
|
115 | border: 1px solid @grey5; | |
103 | padding: 5px 5px 5px 5px; |
|
116 | padding: 5px 5px 5px 5px; | |
104 | } |
|
117 | } | |
105 |
|
118 | |||
106 | margin: @padding 0; |
|
119 | margin: @padding 0; | |
107 | padding: 4px 0 0 0; |
|
120 | padding: 4px 0 0 0; | |
108 | line-height: 1em; |
|
121 | line-height: 1em; | |
109 |
|
122 | |||
110 | .rc-user { |
|
123 | .rc-user { | |
111 | min-width: 0; |
|
124 | min-width: 0; | |
112 | margin: 0px .5em 0 0; |
|
125 | margin: 0px .5em 0 0; | |
113 |
|
126 | |||
114 | .user { |
|
127 | .user { | |
115 | display: inline; |
|
128 | display: inline; | |
116 | } |
|
129 | } | |
117 | } |
|
130 | } | |
118 |
|
131 | |||
119 | .meta { |
|
132 | .meta { | |
120 | position: relative; |
|
133 | position: relative; | |
121 | width: 100%; |
|
134 | width: 100%; | |
122 | border-bottom: 1px solid @grey5; |
|
135 | border-bottom: 1px solid @grey5; | |
123 | margin: -5px 0px; |
|
136 | margin: -5px 0px; | |
124 | line-height: 24px; |
|
137 | line-height: 24px; | |
125 |
|
138 | |||
126 | &:hover .permalink { |
|
139 | &:hover .permalink { | |
127 | visibility: visible; |
|
140 | visibility: visible; | |
128 | color: @rcblue; |
|
141 | color: @rcblue; | |
129 | } |
|
142 | } | |
130 | } |
|
143 | } | |
131 |
|
144 | |||
132 | .author, |
|
145 | .author, | |
133 | .date { |
|
146 | .date { | |
134 | display: inline; |
|
147 | display: inline; | |
135 |
|
148 | |||
136 | &:after { |
|
149 | &:after { | |
137 | content: ' | '; |
|
150 | content: ' | '; | |
138 | color: @grey5; |
|
151 | color: @grey5; | |
139 | } |
|
152 | } | |
140 | } |
|
153 | } | |
141 |
|
154 | |||
142 | .author-general img { |
|
155 | .author-general img { | |
143 | top: 3px; |
|
156 | top: 3px; | |
144 | } |
|
157 | } | |
145 | .author-inline img { |
|
158 | .author-inline img { | |
146 | top: 3px; |
|
159 | top: 3px; | |
147 | } |
|
160 | } | |
148 |
|
161 | |||
149 | .status-change, |
|
162 | .status-change, | |
150 | .permalink, |
|
163 | .permalink, | |
151 | .changeset-status-lbl { |
|
164 | .changeset-status-lbl { | |
152 | display: inline; |
|
165 | display: inline; | |
153 | } |
|
166 | } | |
154 |
|
167 | |||
155 | .permalink { |
|
168 | .permalink { | |
156 | visibility: hidden; |
|
169 | visibility: hidden; | |
157 | } |
|
170 | } | |
158 |
|
171 | |||
159 | .comment-links-divider { |
|
172 | .comment-links-divider { | |
160 | display: inline; |
|
173 | display: inline; | |
161 | } |
|
174 | } | |
162 |
|
175 | |||
163 | .comment-links-block { |
|
176 | .comment-links-block { | |
164 | float:right; |
|
177 | float:right; | |
165 | text-align: right; |
|
178 | text-align: right; | |
166 | min-width: 85px; |
|
179 | min-width: 85px; | |
167 |
|
180 | |||
168 | [class^="icon-"]:before, |
|
181 | [class^="icon-"]:before, | |
169 | [class*=" icon-"]:before { |
|
182 | [class*=" icon-"]:before { | |
170 | margin-left: 0; |
|
183 | margin-left: 0; | |
171 | margin-right: 0; |
|
184 | margin-right: 0; | |
172 | } |
|
185 | } | |
173 | } |
|
186 | } | |
174 |
|
187 | |||
175 | .comment-previous-link { |
|
188 | .comment-previous-link { | |
176 | display: inline-block; |
|
189 | display: inline-block; | |
177 |
|
190 | |||
178 | .arrow_comment_link{ |
|
191 | .arrow_comment_link{ | |
179 | cursor: pointer; |
|
192 | cursor: pointer; | |
180 | i { |
|
193 | i { | |
181 | font-size:10px; |
|
194 | font-size:10px; | |
182 | } |
|
195 | } | |
183 | } |
|
196 | } | |
184 | .arrow_comment_link.disabled { |
|
197 | .arrow_comment_link.disabled { | |
185 | cursor: default; |
|
198 | cursor: default; | |
186 | color: @grey5; |
|
199 | color: @grey5; | |
187 | } |
|
200 | } | |
188 | } |
|
201 | } | |
189 |
|
202 | |||
190 | .comment-next-link { |
|
203 | .comment-next-link { | |
191 | display: inline-block; |
|
204 | display: inline-block; | |
192 |
|
205 | |||
193 | .arrow_comment_link{ |
|
206 | .arrow_comment_link{ | |
194 | cursor: pointer; |
|
207 | cursor: pointer; | |
195 | i { |
|
208 | i { | |
196 | font-size:10px; |
|
209 | font-size:10px; | |
197 | } |
|
210 | } | |
198 | } |
|
211 | } | |
199 | .arrow_comment_link.disabled { |
|
212 | .arrow_comment_link.disabled { | |
200 | cursor: default; |
|
213 | cursor: default; | |
201 | color: @grey5; |
|
214 | color: @grey5; | |
202 | } |
|
215 | } | |
203 | } |
|
216 | } | |
204 |
|
217 | |||
205 | .flag_status { |
|
218 | .flag_status { | |
206 | display: inline-block; |
|
219 | display: inline-block; | |
207 | margin: -2px .5em 0 .25em |
|
220 | margin: -2px .5em 0 .25em | |
208 | } |
|
221 | } | |
209 |
|
222 | |||
210 | .delete-comment { |
|
223 | .delete-comment { | |
211 | display: inline-block; |
|
224 | display: inline-block; | |
212 | color: @rcblue; |
|
225 | color: @rcblue; | |
213 |
|
226 | |||
214 | &:hover { |
|
227 | &:hover { | |
215 | cursor: pointer; |
|
228 | cursor: pointer; | |
216 | } |
|
229 | } | |
217 | } |
|
230 | } | |
218 |
|
231 | |||
219 | .text { |
|
232 | .text { | |
220 | clear: both; |
|
233 | clear: both; | |
221 | .border-radius(@border-radius); |
|
234 | .border-radius(@border-radius); | |
222 | .box-sizing(border-box); |
|
235 | .box-sizing(border-box); | |
223 |
|
236 | |||
224 | .markdown-block p, |
|
237 | .markdown-block p, | |
225 | .rst-block p { |
|
238 | .rst-block p { | |
226 | margin: .5em 0 !important; |
|
239 | margin: .5em 0 !important; | |
227 | // TODO: lisa: This is needed because of other rst !important rules :[ |
|
240 | // TODO: lisa: This is needed because of other rst !important rules :[ | |
228 | } |
|
241 | } | |
229 | } |
|
242 | } | |
230 |
|
243 | |||
231 | .pr-version { |
|
244 | .pr-version { | |
232 | float: left; |
|
245 | float: left; | |
233 | margin: 0px 4px; |
|
246 | margin: 0px 4px; | |
234 | } |
|
247 | } | |
235 | .pr-version-inline { |
|
248 | .pr-version-inline { | |
236 | float: left; |
|
249 | float: left; | |
237 | margin: 0px 4px; |
|
250 | margin: 0px 4px; | |
238 | } |
|
251 | } | |
239 | .pr-version-num { |
|
252 | .pr-version-num { | |
240 | font-size: 10px; |
|
253 | font-size: 10px; | |
241 | } |
|
254 | } | |
242 | } |
|
255 | } | |
243 |
|
256 | |||
244 | @comment-padding: 5px; |
|
257 | @comment-padding: 5px; | |
245 |
|
258 | |||
246 | .general-comments { |
|
259 | .general-comments { | |
247 | .comment-outdated { |
|
260 | .comment-outdated { | |
248 | opacity: @comment-outdated-opacity; |
|
261 | opacity: @comment-outdated-opacity; | |
249 | } |
|
262 | } | |
250 | } |
|
263 | } | |
251 |
|
264 | |||
252 | .inline-comments { |
|
265 | .inline-comments { | |
253 | border-radius: @border-radius; |
|
266 | border-radius: @border-radius; | |
254 | .comment { |
|
267 | .comment { | |
255 | margin: 0; |
|
268 | margin: 0; | |
256 | border-radius: @border-radius; |
|
269 | border-radius: @border-radius; | |
257 | } |
|
270 | } | |
258 | .comment-outdated { |
|
271 | .comment-outdated { | |
259 | opacity: @comment-outdated-opacity; |
|
272 | opacity: @comment-outdated-opacity; | |
260 | } |
|
273 | } | |
261 |
|
274 | |||
262 | .comment-inline { |
|
275 | .comment-inline { | |
263 | background: white; |
|
276 | background: white; | |
264 | padding: @comment-padding @comment-padding; |
|
277 | padding: @comment-padding @comment-padding; | |
265 | border: @comment-padding solid @grey6; |
|
278 | border: @comment-padding solid @grey6; | |
266 |
|
279 | |||
267 | .text { |
|
280 | .text { | |
268 | border: none; |
|
281 | border: none; | |
269 | } |
|
282 | } | |
270 | .meta { |
|
283 | .meta { | |
271 | border-bottom: 1px solid @grey6; |
|
284 | border-bottom: 1px solid @grey6; | |
272 | margin: -5px 0px; |
|
285 | margin: -5px 0px; | |
273 | line-height: 24px; |
|
286 | line-height: 24px; | |
274 | } |
|
287 | } | |
275 | } |
|
288 | } | |
276 | .comment-selected { |
|
289 | .comment-selected { | |
277 | border-left: 6px solid @comment-highlight-color; |
|
290 | border-left: 6px solid @comment-highlight-color; | |
278 | } |
|
291 | } | |
279 | .comment-inline-form { |
|
292 | .comment-inline-form { | |
280 | padding: @comment-padding; |
|
293 | padding: @comment-padding; | |
281 | display: none; |
|
294 | display: none; | |
282 | } |
|
295 | } | |
283 | .cb-comment-add-button { |
|
296 | .cb-comment-add-button { | |
284 | margin: @comment-padding; |
|
297 | margin: @comment-padding; | |
285 | } |
|
298 | } | |
286 | /* hide add comment button when form is open */ |
|
299 | /* hide add comment button when form is open */ | |
287 | .comment-inline-form-open ~ .cb-comment-add-button { |
|
300 | .comment-inline-form-open ~ .cb-comment-add-button { | |
288 | display: none; |
|
301 | display: none; | |
289 | } |
|
302 | } | |
290 | .comment-inline-form-open { |
|
303 | .comment-inline-form-open { | |
291 | display: block; |
|
304 | display: block; | |
292 | } |
|
305 | } | |
293 | /* hide add comment button when form but no comments */ |
|
306 | /* hide add comment button when form but no comments */ | |
294 | .comment-inline-form:first-child + .cb-comment-add-button { |
|
307 | .comment-inline-form:first-child + .cb-comment-add-button { | |
295 | display: none; |
|
308 | display: none; | |
296 | } |
|
309 | } | |
297 | /* hide add comment button when no comments or form */ |
|
310 | /* hide add comment button when no comments or form */ | |
298 | .cb-comment-add-button:first-child { |
|
311 | .cb-comment-add-button:first-child { | |
299 | display: none; |
|
312 | display: none; | |
300 | } |
|
313 | } | |
301 | /* hide add comment button when only comment is being deleted */ |
|
314 | /* hide add comment button when only comment is being deleted */ | |
302 | .comment-deleting:first-child + .cb-comment-add-button { |
|
315 | .comment-deleting:first-child + .cb-comment-add-button { | |
303 | display: none; |
|
316 | display: none; | |
304 | } |
|
317 | } | |
305 | } |
|
318 | } | |
306 |
|
319 | |||
307 |
|
320 | |||
308 | .show-outdated-comments { |
|
321 | .show-outdated-comments { | |
309 | display: inline; |
|
322 | display: inline; | |
310 | color: @rcblue; |
|
323 | color: @rcblue; | |
311 | } |
|
324 | } | |
312 |
|
325 | |||
313 | // Comment Form |
|
326 | // Comment Form | |
314 | div.comment-form { |
|
327 | div.comment-form { | |
315 | margin-top: 20px; |
|
328 | margin-top: 20px; | |
316 | } |
|
329 | } | |
317 |
|
330 | |||
318 | .comment-form strong { |
|
331 | .comment-form strong { | |
319 | display: block; |
|
332 | display: block; | |
320 | margin-bottom: 15px; |
|
333 | margin-bottom: 15px; | |
321 | } |
|
334 | } | |
322 |
|
335 | |||
323 | .comment-form textarea { |
|
336 | .comment-form textarea { | |
324 | width: 100%; |
|
337 | width: 100%; | |
325 | height: 100px; |
|
338 | height: 100px; | |
326 | font-family: 'Monaco', 'Courier', 'Courier New', monospace; |
|
339 | font-family: 'Monaco', 'Courier', 'Courier New', monospace; | |
327 | } |
|
340 | } | |
328 |
|
341 | |||
329 | form.comment-form { |
|
342 | form.comment-form { | |
330 | margin-top: 10px; |
|
343 | margin-top: 10px; | |
331 | margin-left: 10px; |
|
344 | margin-left: 10px; | |
332 | } |
|
345 | } | |
333 |
|
346 | |||
334 | .comment-inline-form .comment-block-ta, |
|
347 | .comment-inline-form .comment-block-ta, | |
335 | .comment-form .comment-block-ta, |
|
348 | .comment-form .comment-block-ta, | |
336 | .comment-form .preview-box { |
|
349 | .comment-form .preview-box { | |
337 | .border-radius(@border-radius); |
|
350 | .border-radius(@border-radius); | |
338 | .box-sizing(border-box); |
|
351 | .box-sizing(border-box); | |
339 | background-color: white; |
|
352 | background-color: white; | |
340 | } |
|
353 | } | |
341 |
|
354 | |||
342 | .comment-form-submit { |
|
355 | .comment-form-submit { | |
343 | margin-top: 5px; |
|
356 | margin-top: 5px; | |
344 | margin-left: 525px; |
|
357 | margin-left: 525px; | |
345 | } |
|
358 | } | |
346 |
|
359 | |||
347 | .file-comments { |
|
360 | .file-comments { | |
348 | display: none; |
|
361 | display: none; | |
349 | } |
|
362 | } | |
350 |
|
363 | |||
351 | .comment-form .preview-box.unloaded, |
|
364 | .comment-form .preview-box.unloaded, | |
352 | .comment-inline-form .preview-box.unloaded { |
|
365 | .comment-inline-form .preview-box.unloaded { | |
353 | height: 50px; |
|
366 | height: 50px; | |
354 | text-align: center; |
|
367 | text-align: center; | |
355 | padding: 20px; |
|
368 | padding: 20px; | |
356 | background-color: white; |
|
369 | background-color: white; | |
357 | } |
|
370 | } | |
358 |
|
371 | |||
359 | .comment-footer { |
|
372 | .comment-footer { | |
360 | position: relative; |
|
373 | position: relative; | |
361 | width: 100%; |
|
374 | width: 100%; | |
362 | min-height: 42px; |
|
375 | min-height: 42px; | |
363 |
|
376 | |||
364 | .status_box, |
|
377 | .status_box, | |
365 | .cancel-button { |
|
378 | .cancel-button { | |
366 | float: left; |
|
379 | float: left; | |
367 | display: inline-block; |
|
380 | display: inline-block; | |
368 | } |
|
381 | } | |
369 |
|
382 | |||
370 | .action-buttons { |
|
383 | .action-buttons { | |
371 | float: right; |
|
384 | float: right; | |
372 | display: inline-block; |
|
385 | display: inline-block; | |
373 | } |
|
386 | } | |
374 | } |
|
387 | } | |
375 |
|
388 | |||
376 | .comment-form { |
|
389 | .comment-form { | |
377 |
|
390 | |||
378 | .comment { |
|
391 | .comment { | |
379 | margin-left: 10px; |
|
392 | margin-left: 10px; | |
380 | } |
|
393 | } | |
381 |
|
394 | |||
382 | .comment-help { |
|
395 | .comment-help { | |
383 | color: @grey4; |
|
396 | color: @grey4; | |
384 | padding: 5px 0 5px 0; |
|
397 | padding: 5px 0 5px 0; | |
385 | } |
|
398 | } | |
386 |
|
399 | |||
387 | .comment-title { |
|
400 | .comment-title { | |
388 | padding: 5px 0 5px 0; |
|
401 | padding: 5px 0 5px 0; | |
389 | } |
|
402 | } | |
390 |
|
403 | |||
391 | .comment-button { |
|
404 | .comment-button { | |
392 | display: inline-block; |
|
405 | display: inline-block; | |
393 | } |
|
406 | } | |
394 |
|
407 | |||
395 | .comment-button-input { |
|
408 | .comment-button-input { | |
396 | margin-right: 0; |
|
409 | margin-right: 0; | |
397 | } |
|
410 | } | |
398 |
|
411 | |||
399 | .comment-footer { |
|
412 | .comment-footer { | |
400 | margin-bottom: 110px; |
|
413 | margin-bottom: 110px; | |
401 | margin-top: 10px; |
|
414 | margin-top: 10px; | |
402 | } |
|
415 | } | |
403 | } |
|
416 | } | |
404 |
|
417 | |||
405 |
|
418 | |||
406 | .comment-form-login { |
|
419 | .comment-form-login { | |
407 | .comment-help { |
|
420 | .comment-help { | |
408 | padding: 0.9em; //same as the button |
|
421 | padding: 0.9em; //same as the button | |
409 | } |
|
422 | } | |
410 |
|
423 | |||
411 | div.clearfix { |
|
424 | div.clearfix { | |
412 | clear: both; |
|
425 | clear: both; | |
413 | width: 100%; |
|
426 | width: 100%; | |
414 | display: block; |
|
427 | display: block; | |
415 | } |
|
428 | } | |
416 | } |
|
429 | } | |
417 |
|
430 | |||
418 | .comment-type { |
|
431 | .comment-type { | |
419 | margin: 0px; |
|
432 | margin: 0px; | |
420 | border-radius: inherit; |
|
433 | border-radius: inherit; | |
421 | border-color: @grey6; |
|
434 | border-color: @grey6; | |
422 | } |
|
435 | } | |
423 |
|
436 | |||
424 | .preview-box { |
|
437 | .preview-box { | |
425 | min-height: 105px; |
|
438 | min-height: 105px; | |
426 | margin-bottom: 15px; |
|
439 | margin-bottom: 15px; | |
427 | background-color: white; |
|
440 | background-color: white; | |
428 | .border-radius(@border-radius); |
|
441 | .border-radius(@border-radius); | |
429 | .box-sizing(border-box); |
|
442 | .box-sizing(border-box); | |
430 | } |
|
443 | } | |
431 |
|
444 | |||
432 | .add-another-button { |
|
445 | .add-another-button { | |
433 | margin-left: 10px; |
|
446 | margin-left: 10px; | |
434 | margin-top: 10px; |
|
447 | margin-top: 10px; | |
435 | margin-bottom: 10px; |
|
448 | margin-bottom: 10px; | |
436 | } |
|
449 | } | |
437 |
|
450 | |||
438 | .comment .buttons { |
|
451 | .comment .buttons { | |
439 | float: right; |
|
452 | float: right; | |
440 | margin: -1px 0px 0px 0px; |
|
453 | margin: -1px 0px 0px 0px; | |
441 | } |
|
454 | } | |
442 |
|
455 | |||
443 | // Inline Comment Form |
|
456 | // Inline Comment Form | |
444 | .injected_diff .comment-inline-form, |
|
457 | .injected_diff .comment-inline-form, | |
445 | .comment-inline-form { |
|
458 | .comment-inline-form { | |
446 | background-color: white; |
|
459 | background-color: white; | |
447 | margin-top: 10px; |
|
460 | margin-top: 10px; | |
448 | margin-bottom: 20px; |
|
461 | margin-bottom: 20px; | |
449 | } |
|
462 | } | |
450 |
|
463 | |||
451 | .inline-form { |
|
464 | .inline-form { | |
452 | padding: 10px 7px; |
|
465 | padding: 10px 7px; | |
453 | } |
|
466 | } | |
454 |
|
467 | |||
455 | .inline-form div { |
|
468 | .inline-form div { | |
456 | max-width: 100%; |
|
469 | max-width: 100%; | |
457 | } |
|
470 | } | |
458 |
|
471 | |||
459 | .overlay { |
|
472 | .overlay { | |
460 | display: none; |
|
473 | display: none; | |
461 | position: absolute; |
|
474 | position: absolute; | |
462 | width: 100%; |
|
475 | width: 100%; | |
463 | text-align: center; |
|
476 | text-align: center; | |
464 | vertical-align: middle; |
|
477 | vertical-align: middle; | |
465 | font-size: 16px; |
|
478 | font-size: 16px; | |
466 | background: none repeat scroll 0 0 white; |
|
479 | background: none repeat scroll 0 0 white; | |
467 |
|
480 | |||
468 | &.submitting { |
|
481 | &.submitting { | |
469 | display: block; |
|
482 | display: block; | |
470 | opacity: 0.5; |
|
483 | opacity: 0.5; | |
471 | z-index: 100; |
|
484 | z-index: 100; | |
472 | } |
|
485 | } | |
473 | } |
|
486 | } | |
474 | .comment-inline-form .overlay.submitting .overlay-text { |
|
487 | .comment-inline-form .overlay.submitting .overlay-text { | |
475 | margin-top: 5%; |
|
488 | margin-top: 5%; | |
476 | } |
|
489 | } | |
477 |
|
490 | |||
478 | .comment-inline-form .clearfix, |
|
491 | .comment-inline-form .clearfix, | |
479 | .comment-form .clearfix { |
|
492 | .comment-form .clearfix { | |
480 | .border-radius(@border-radius); |
|
493 | .border-radius(@border-radius); | |
481 | margin: 0px; |
|
494 | margin: 0px; | |
482 | } |
|
495 | } | |
483 |
|
496 | |||
484 | .comment-inline-form .comment-footer { |
|
497 | .comment-inline-form .comment-footer { | |
485 | margin: 10px 0px 0px 0px; |
|
498 | margin: 10px 0px 0px 0px; | |
486 | } |
|
499 | } | |
487 |
|
500 | |||
488 | .hide-inline-form-button { |
|
501 | .hide-inline-form-button { | |
489 | margin-left: 5px; |
|
502 | margin-left: 5px; | |
490 | } |
|
503 | } | |
491 | .comment-button .hide-inline-form { |
|
504 | .comment-button .hide-inline-form { | |
492 | background: white; |
|
505 | background: white; | |
493 | } |
|
506 | } | |
494 |
|
507 | |||
495 | .comment-area { |
|
508 | .comment-area { | |
496 | padding: 8px 12px; |
|
509 | padding: 8px 12px; | |
497 | border: 1px solid @grey5; |
|
510 | border: 1px solid @grey5; | |
498 | .border-radius(@border-radius); |
|
511 | .border-radius(@border-radius); | |
499 |
|
512 | |||
500 | .resolve-action { |
|
513 | .resolve-action { | |
501 | padding: 1px 0px 0px 6px; |
|
514 | padding: 1px 0px 0px 6px; | |
502 | } |
|
515 | } | |
503 |
|
516 | |||
504 | } |
|
517 | } | |
505 |
|
518 | |||
506 | .comment-area-header .nav-links { |
|
519 | .comment-area-header .nav-links { | |
507 | display: flex; |
|
520 | display: flex; | |
508 | flex-flow: row wrap; |
|
521 | flex-flow: row wrap; | |
509 | -webkit-flex-flow: row wrap; |
|
522 | -webkit-flex-flow: row wrap; | |
510 | width: 100%; |
|
523 | width: 100%; | |
511 | } |
|
524 | } | |
512 |
|
525 | |||
513 | .comment-area-footer { |
|
526 | .comment-area-footer { | |
514 | display: flex; |
|
527 | display: flex; | |
515 | } |
|
528 | } | |
516 |
|
529 | |||
517 | .comment-footer .toolbar { |
|
530 | .comment-footer .toolbar { | |
518 |
|
531 | |||
519 | } |
|
532 | } | |
520 |
|
533 | |||
521 | .nav-links { |
|
534 | .nav-links { | |
522 | padding: 0; |
|
535 | padding: 0; | |
523 | margin: 0; |
|
536 | margin: 0; | |
524 | list-style: none; |
|
537 | list-style: none; | |
525 | height: auto; |
|
538 | height: auto; | |
526 | border-bottom: 1px solid @grey5; |
|
539 | border-bottom: 1px solid @grey5; | |
527 | } |
|
540 | } | |
528 | .nav-links li { |
|
541 | .nav-links li { | |
529 | display: inline-block; |
|
542 | display: inline-block; | |
530 | } |
|
543 | } | |
531 | .nav-links li:before { |
|
544 | .nav-links li:before { | |
532 | content: ""; |
|
545 | content: ""; | |
533 | } |
|
546 | } | |
534 | .nav-links li a.disabled { |
|
547 | .nav-links li a.disabled { | |
535 | cursor: not-allowed; |
|
548 | cursor: not-allowed; | |
536 | } |
|
549 | } | |
537 |
|
550 | |||
538 | .nav-links li.active a { |
|
551 | .nav-links li.active a { | |
539 | border-bottom: 2px solid @rcblue; |
|
552 | border-bottom: 2px solid @rcblue; | |
540 | color: #000; |
|
553 | color: #000; | |
541 | font-weight: 600; |
|
554 | font-weight: 600; | |
542 | } |
|
555 | } | |
543 | .nav-links li a { |
|
556 | .nav-links li a { | |
544 | display: inline-block; |
|
557 | display: inline-block; | |
545 | padding: 0px 10px 5px 10px; |
|
558 | padding: 0px 10px 5px 10px; | |
546 | margin-bottom: -1px; |
|
559 | margin-bottom: -1px; | |
547 | font-size: 14px; |
|
560 | font-size: 14px; | |
548 | line-height: 28px; |
|
561 | line-height: 28px; | |
549 | color: #8f8f8f; |
|
562 | color: #8f8f8f; | |
550 | border-bottom: 2px solid transparent; |
|
563 | border-bottom: 2px solid transparent; | |
551 | } |
|
564 | } | |
552 |
|
565 | |||
553 | .toolbar-text { |
|
566 | .toolbar-text { | |
554 | float: left; |
|
567 | float: left; | |
555 | margin: -5px 0px 0px 0px; |
|
568 | margin: -5px 0px 0px 0px; | |
556 | font-size: 12px; |
|
569 | font-size: 12px; | |
557 | } |
|
570 | } | |
558 |
|
571 |
@@ -1,388 +1,394 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | |
4 | ## ${comment.comment_block(comment)} |
|
4 | ## ${comment.comment_block(comment)} | |
5 | ## |
|
5 | ## | |
6 | <%namespace name="base" file="/base/base.mako"/> |
|
6 | <%namespace name="base" file="/base/base.mako"/> | |
7 |
|
7 | |||
8 | <%def name="comment_block(comment, inline=False)"> |
|
8 | <%def name="comment_block(comment, inline=False)"> | |
9 | <% pr_index_ver = comment.get_index_version(getattr(c, 'versions', [])) %> |
|
9 | <% pr_index_ver = comment.get_index_version(getattr(c, 'versions', [])) %> | |
10 | % if inline: |
|
10 | % if inline: | |
11 | <% outdated_at_ver = comment.outdated_at_version(getattr(c, 'at_version_num', None)) %> |
|
11 | <% outdated_at_ver = comment.outdated_at_version(getattr(c, 'at_version_num', None)) %> | |
12 | % else: |
|
12 | % else: | |
13 | <% outdated_at_ver = comment.older_than_version(getattr(c, 'at_version_num', None)) %> |
|
13 | <% outdated_at_ver = comment.older_than_version(getattr(c, 'at_version_num', None)) %> | |
14 | % endif |
|
14 | % endif | |
15 |
|
15 | |||
16 |
|
16 | |||
17 | <div class="comment |
|
17 | <div class="comment | |
18 | ${'comment-inline' if inline else 'comment-general'} |
|
18 | ${'comment-inline' if inline else 'comment-general'} | |
19 | ${'comment-outdated' if outdated_at_ver else 'comment-current'}" |
|
19 | ${'comment-outdated' if outdated_at_ver else 'comment-current'}" | |
20 | id="comment-${comment.comment_id}" |
|
20 | id="comment-${comment.comment_id}" | |
21 | line="${comment.line_no}" |
|
21 | line="${comment.line_no}" | |
22 | data-comment-id="${comment.comment_id}" |
|
22 | data-comment-id="${comment.comment_id}" | |
23 | data-comment-type="${comment.comment_type}" |
|
23 | data-comment-type="${comment.comment_type}" | |
24 | data-comment-inline=${h.json.dumps(inline)} |
|
24 | data-comment-inline=${h.json.dumps(inline)} | |
25 | style="${'display: none;' if outdated_at_ver else ''}"> |
|
25 | style="${'display: none;' if outdated_at_ver else ''}"> | |
26 |
|
26 | |||
27 | <div class="meta"> |
|
27 | <div class="meta"> | |
28 | <div class="comment-type-label"> |
|
28 | <div class="comment-type-label"> | |
29 | <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}"> |
|
29 | <div class="comment-label ${comment.comment_type or 'note'}" id="comment-label-${comment.comment_id}"> | |
30 | % if comment.comment_type == 'todo': |
|
30 | % if comment.comment_type == 'todo': | |
31 | % if comment.resolved: |
|
31 | % if comment.resolved: | |
32 | <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}"> |
|
32 | <div class="resolved tooltip" title="${_('Resolved by comment #{}').format(comment.resolved.comment_id)}"> | |
33 | <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a> |
|
33 | <a href="#comment-${comment.resolved.comment_id}">${comment.comment_type}</a> | |
34 | </div> |
|
34 | </div> | |
35 | % else: |
|
35 | % else: | |
36 | <div class="resolved tooltip" style="display: none"> |
|
36 | <div class="resolved tooltip" style="display: none"> | |
37 | <span>${comment.comment_type}</span> |
|
37 | <span>${comment.comment_type}</span> | |
38 | </div> |
|
38 | </div> | |
39 | <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to resolve this comment')}"> |
|
39 | <div class="resolve tooltip" onclick="return Rhodecode.comments.createResolutionComment(${comment.comment_id});" title="${_('Click to resolve this comment')}"> | |
40 | ${comment.comment_type} |
|
40 | ${comment.comment_type} | |
41 | </div> |
|
41 | </div> | |
42 | % endif |
|
42 | % endif | |
43 | % else: |
|
43 | % else: | |
44 | % if comment.resolved_comment: |
|
44 | % if comment.resolved_comment: | |
45 | fix |
|
45 | fix | |
46 | % else: |
|
46 | % else: | |
47 | ${comment.comment_type or 'note'} |
|
47 | ${comment.comment_type or 'note'} | |
48 | % endif |
|
48 | % endif | |
49 | % endif |
|
49 | % endif | |
50 | </div> |
|
50 | </div> | |
51 | </div> |
|
51 | </div> | |
52 |
|
52 | |||
53 | <div class="author ${'author-inline' if inline else 'author-general'}"> |
|
53 | <div class="author ${'author-inline' if inline else 'author-general'}"> | |
54 | ${base.gravatar_with_user(comment.author.email, 16)} |
|
54 | ${base.gravatar_with_user(comment.author.email, 16)} | |
55 | </div> |
|
55 | </div> | |
56 | <div class="date"> |
|
56 | <div class="date"> | |
57 | ${h.age_component(comment.modified_at, time_is_local=True)} |
|
57 | ${h.age_component(comment.modified_at, time_is_local=True)} | |
58 | </div> |
|
58 | </div> | |
59 | % if inline: |
|
59 | % if inline: | |
60 | <span></span> |
|
60 | <span></span> | |
61 | % else: |
|
61 | % else: | |
62 | <div class="status-change"> |
|
62 | <div class="status-change"> | |
63 | % if comment.pull_request: |
|
63 | % if comment.pull_request: | |
64 | <a href="${h.url('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}"> |
|
64 | <a href="${h.url('pullrequest_show',repo_name=comment.pull_request.target_repo.repo_name,pull_request_id=comment.pull_request.pull_request_id)}"> | |
|
65 | % if comment.status_change: | |||
|
66 | ${_('pull request #%s') % comment.pull_request.pull_request_id}: | |||
|
67 | % else: | |||
|
68 | ${_('pull request #%s') % comment.pull_request.pull_request_id} | |||
|
69 | % endif | |||
|
70 | </a> | |||
|
71 | % else: | |||
65 | % if comment.status_change: |
|
72 | % if comment.status_change: | |
66 | ${_('pull request #%s') % comment.pull_request.pull_request_id}: |
|
73 | ${_('Status change on commit')}: | |
67 | % else: |
|
|||
68 | ${_('pull request #%s') % comment.pull_request.pull_request_id} |
|
|||
69 | % endif |
|
74 | % endif | |
70 | </a> |
|
|||
71 | % else: |
|
|||
72 | % if comment.status_change: |
|
|||
73 | ${_('Status change on commit')}: |
|
|||
74 | % endif |
|
75 | % endif | |
75 |
|
|
76 | </div> | |
76 | </div> |
|
|||
77 | % endif |
|
77 | % endif | |
78 |
|
78 | |||
79 | % if comment.status_change: |
|
79 | % if comment.status_change: | |
80 | <div class="${'flag_status %s' % comment.status_change[0].status}"></div> |
|
80 | <div class="${'flag_status %s' % comment.status_change[0].status}"></div> | |
81 | <div title="${_('Commit status')}" class="changeset-status-lbl"> |
|
81 | <div title="${_('Commit status')}" class="changeset-status-lbl"> | |
82 | ${comment.status_change[0].status_lbl} |
|
82 | ${comment.status_change[0].status_lbl} | |
83 | </div> |
|
83 | </div> | |
84 | % endif |
|
84 | % endif | |
85 |
|
85 | |||
|
86 | % if comment.resolved_comment: | |||
|
87 | <a class="has-spacer-before" href="#comment-${comment.resolved_comment.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${comment.resolved_comment.comment_id}'))"> | |||
|
88 | ${_('resolves comment #{}').format(comment.resolved_comment.comment_id)} | |||
|
89 | </a> | |||
|
90 | % endif | |||
|
91 | ||||
86 | <a class="permalink" href="#comment-${comment.comment_id}"> ¶</a> |
|
92 | <a class="permalink" href="#comment-${comment.comment_id}"> ¶</a> | |
87 |
|
93 | |||
88 | <div class="comment-links-block"> |
|
94 | <div class="comment-links-block"> | |
89 |
|
95 | |||
90 | % if inline: |
|
96 | % if inline: | |
91 | <div class="pr-version-inline"> |
|
97 | <div class="pr-version-inline"> | |
92 | <a href="${h.url.current(version=comment.pull_request_version_id, anchor='comment-{}'.format(comment.comment_id))}"> |
|
98 | <a href="${h.url.current(version=comment.pull_request_version_id, anchor='comment-{}'.format(comment.comment_id))}"> | |
93 | % if outdated_at_ver: |
|
99 | % if outdated_at_ver: | |
94 | <code class="pr-version-num" title="${_('Outdated comment from pull request version {0}').format(pr_index_ver)}"> |
|
100 | <code class="pr-version-num" title="${_('Outdated comment from pull request version {0}').format(pr_index_ver)}"> | |
95 | outdated ${'v{}'.format(pr_index_ver)} | |
|
101 | outdated ${'v{}'.format(pr_index_ver)} | | |
96 | </code> |
|
102 | </code> | |
97 | % elif pr_index_ver: |
|
103 | % elif pr_index_ver: | |
98 | <code class="pr-version-num" title="${_('Comment from pull request version {0}').format(pr_index_ver)}"> |
|
104 | <code class="pr-version-num" title="${_('Comment from pull request version {0}').format(pr_index_ver)}"> | |
99 | ${'v{}'.format(pr_index_ver)} | |
|
105 | ${'v{}'.format(pr_index_ver)} | | |
100 | </code> |
|
106 | </code> | |
101 | % endif |
|
107 | % endif | |
102 | </a> |
|
108 | </a> | |
103 | </div> |
|
109 | </div> | |
104 | % else: |
|
110 | % else: | |
105 | % if comment.pull_request_version_id and pr_index_ver: |
|
111 | % if comment.pull_request_version_id and pr_index_ver: | |
106 | | |
|
112 | | | |
107 | <div class="pr-version"> |
|
113 | <div class="pr-version"> | |
108 | % if comment.outdated: |
|
114 | % if comment.outdated: | |
109 | <a href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}"> |
|
115 | <a href="?version=${comment.pull_request_version_id}#comment-${comment.comment_id}"> | |
110 | ${_('Outdated comment from pull request version {}').format(pr_index_ver)} |
|
116 | ${_('Outdated comment from pull request version {}').format(pr_index_ver)} | |
111 | </a> |
|
117 | </a> | |
112 | % else: |
|
118 | % else: | |
113 | <div title="${_('Comment from pull request version {0}').format(pr_index_ver)}"> |
|
119 | <div title="${_('Comment from pull request version {0}').format(pr_index_ver)}"> | |
114 | <a href="${h.url('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)}"> |
|
120 | <a href="${h.url('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)}"> | |
115 | <code class="pr-version-num"> |
|
121 | <code class="pr-version-num"> | |
116 | ${'v{}'.format(pr_index_ver)} |
|
122 | ${'v{}'.format(pr_index_ver)} | |
117 | </code> |
|
123 | </code> | |
118 | </a> |
|
124 | </a> | |
119 | </div> |
|
125 | </div> | |
120 | % endif |
|
126 | % endif | |
121 | </div> |
|
127 | </div> | |
122 | % endif |
|
128 | % endif | |
123 | % endif |
|
129 | % endif | |
124 |
|
130 | |||
125 | ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed |
|
131 | ## show delete comment if it's not a PR (regular comments) or it's PR that is not closed | |
126 | ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated |
|
132 | ## only super-admin, repo admin OR comment owner can delete, also hide delete if currently viewed comment is outdated | |
127 | %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())): |
|
133 | %if not outdated_at_ver and (not comment.pull_request or (comment.pull_request and not comment.pull_request.is_closed())): | |
128 | ## permissions to delete |
|
134 | ## permissions to delete | |
129 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id: |
|
135 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or comment.author.user_id == c.rhodecode_user.user_id: | |
130 | ## TODO: dan: add edit comment here |
|
136 | ## TODO: dan: add edit comment here | |
131 | <a onclick="return Rhodecode.comments.deleteComment(this);" class="delete-comment"> ${_('Delete')}</a> |
|
137 | <a onclick="return Rhodecode.comments.deleteComment(this);" class="delete-comment"> ${_('Delete')}</a> | |
132 | %else: |
|
138 | %else: | |
133 | <button class="btn-link" disabled="disabled"> ${_('Delete')}</button> |
|
139 | <button class="btn-link" disabled="disabled"> ${_('Delete')}</button> | |
134 | %endif |
|
140 | %endif | |
135 | %else: |
|
141 | %else: | |
136 | <button class="btn-link" disabled="disabled"> ${_('Delete')}</button> |
|
142 | <button class="btn-link" disabled="disabled"> ${_('Delete')}</button> | |
137 | %endif |
|
143 | %endif | |
138 |
|
144 | |||
139 | % if outdated_at_ver: |
|
145 | % if outdated_at_ver: | |
140 | | <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="prev-comment"> ${_('Prev')}</a> |
|
146 | | <a onclick="return Rhodecode.comments.prevOutdatedComment(this);" class="prev-comment"> ${_('Prev')}</a> | |
141 | | <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="next-comment"> ${_('Next')}</a> |
|
147 | | <a onclick="return Rhodecode.comments.nextOutdatedComment(this);" class="next-comment"> ${_('Next')}</a> | |
142 | % else: |
|
148 | % else: | |
143 | | <a onclick="return Rhodecode.comments.prevComment(this);" class="prev-comment"> ${_('Prev')}</a> |
|
149 | | <a onclick="return Rhodecode.comments.prevComment(this);" class="prev-comment"> ${_('Prev')}</a> | |
144 | | <a onclick="return Rhodecode.comments.nextComment(this);" class="next-comment"> ${_('Next')}</a> |
|
150 | | <a onclick="return Rhodecode.comments.nextComment(this);" class="next-comment"> ${_('Next')}</a> | |
145 | % endif |
|
151 | % endif | |
146 |
|
152 | |||
147 | </div> |
|
153 | </div> | |
148 | </div> |
|
154 | </div> | |
149 | <div class="text"> |
|
155 | <div class="text"> | |
150 | ${comment.render(mentions=True)|n} |
|
156 | ${comment.render(mentions=True)|n} | |
151 | </div> |
|
157 | </div> | |
152 |
|
158 | |||
153 | </div> |
|
159 | </div> | |
154 | </%def> |
|
160 | </%def> | |
155 |
|
161 | |||
156 | ## generate main comments |
|
162 | ## generate main comments | |
157 | <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)"> |
|
163 | <%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)"> | |
158 | <div class="general-comments" id="comments"> |
|
164 | <div class="general-comments" id="comments"> | |
159 | %for comment in comments: |
|
165 | %for comment in comments: | |
160 | <div id="comment-tr-${comment.comment_id}"> |
|
166 | <div id="comment-tr-${comment.comment_id}"> | |
161 | ## only render comments that are not from pull request, or from |
|
167 | ## only render comments that are not from pull request, or from | |
162 | ## pull request and a status change |
|
168 | ## pull request and a status change | |
163 | %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request: |
|
169 | %if not comment.pull_request or (comment.pull_request and comment.status_change) or include_pull_request: | |
164 | ${comment_block(comment)} |
|
170 | ${comment_block(comment)} | |
165 | %endif |
|
171 | %endif | |
166 | </div> |
|
172 | </div> | |
167 | %endfor |
|
173 | %endfor | |
168 | ## to anchor ajax comments |
|
174 | ## to anchor ajax comments | |
169 | <div id="injected_page_comments"></div> |
|
175 | <div id="injected_page_comments"></div> | |
170 | </div> |
|
176 | </div> | |
171 | </%def> |
|
177 | </%def> | |
172 |
|
178 | |||
173 |
|
179 | |||
174 | <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)"> |
|
180 | <%def name="comments(post_url, cur_status, is_pull_request=False, is_compare=False, change_status=True, form_extras=None)"> | |
175 |
|
181 | |||
176 | <div class="comments"> |
|
182 | <div class="comments"> | |
177 | <% |
|
183 | <% | |
178 | if is_pull_request: |
|
184 | if is_pull_request: | |
179 | placeholder = _('Leave a comment on this Pull Request.') |
|
185 | placeholder = _('Leave a comment on this Pull Request.') | |
180 | elif is_compare: |
|
186 | elif is_compare: | |
181 | placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras)) |
|
187 | placeholder = _('Leave a comment on {} commits in this range.').format(len(form_extras)) | |
182 | else: |
|
188 | else: | |
183 | placeholder = _('Leave a comment on this Commit.') |
|
189 | placeholder = _('Leave a comment on this Commit.') | |
184 | %> |
|
190 | %> | |
185 |
|
191 | |||
186 | % if c.rhodecode_user.username != h.DEFAULT_USER: |
|
192 | % if c.rhodecode_user.username != h.DEFAULT_USER: | |
187 | <div class="js-template" id="cb-comment-general-form-template"> |
|
193 | <div class="js-template" id="cb-comment-general-form-template"> | |
188 | ## template generated for injection |
|
194 | ## template generated for injection | |
189 | ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)} |
|
195 | ${comment_form(form_type='general', review_statuses=c.commit_statuses, form_extras=form_extras)} | |
190 | </div> |
|
196 | </div> | |
191 |
|
197 | |||
192 | <div id="cb-comment-general-form-placeholder" class="comment-form ac"> |
|
198 | <div id="cb-comment-general-form-placeholder" class="comment-form ac"> | |
193 | ## inject form here |
|
199 | ## inject form here | |
194 | </div> |
|
200 | </div> | |
195 | <script type="text/javascript"> |
|
201 | <script type="text/javascript"> | |
196 | var lineNo = 'general'; |
|
202 | var lineNo = 'general'; | |
197 | var resolvesCommentId = null; |
|
203 | var resolvesCommentId = null; | |
198 | var generalCommentForm = Rhodecode.comments.createGeneralComment( |
|
204 | var generalCommentForm = Rhodecode.comments.createGeneralComment( | |
199 | lineNo, "${placeholder}", resolvesCommentId); |
|
205 | lineNo, "${placeholder}", resolvesCommentId); | |
200 |
|
206 | |||
201 | // set custom success callback on rangeCommit |
|
207 | // set custom success callback on rangeCommit | |
202 | % if is_compare: |
|
208 | % if is_compare: | |
203 | generalCommentForm.setHandleFormSubmit(function(o) { |
|
209 | generalCommentForm.setHandleFormSubmit(function(o) { | |
204 | var self = generalCommentForm; |
|
210 | var self = generalCommentForm; | |
205 |
|
211 | |||
206 | var text = self.cm.getValue(); |
|
212 | var text = self.cm.getValue(); | |
207 | var status = self.getCommentStatus(); |
|
213 | var status = self.getCommentStatus(); | |
208 | var commentType = self.getCommentType(); |
|
214 | var commentType = self.getCommentType(); | |
209 |
|
215 | |||
210 | if (text === "" && !status) { |
|
216 | if (text === "" && !status) { | |
211 | return; |
|
217 | return; | |
212 | } |
|
218 | } | |
213 |
|
219 | |||
214 | // we can pick which commits we want to make the comment by |
|
220 | // we can pick which commits we want to make the comment by | |
215 | // selecting them via click on preview pane, this will alter the hidden inputs |
|
221 | // selecting them via click on preview pane, this will alter the hidden inputs | |
216 | var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0; |
|
222 | var cherryPicked = $('#changeset_compare_view_content .compare_select.hl').length > 0; | |
217 |
|
223 | |||
218 | var commitIds = []; |
|
224 | var commitIds = []; | |
219 | $('#changeset_compare_view_content .compare_select').each(function(el) { |
|
225 | $('#changeset_compare_view_content .compare_select').each(function(el) { | |
220 | var commitId = this.id.replace('row-', ''); |
|
226 | var commitId = this.id.replace('row-', ''); | |
221 | if ($(this).hasClass('hl') || !cherryPicked) { |
|
227 | if ($(this).hasClass('hl') || !cherryPicked) { | |
222 | $("input[data-commit-id='{0}']".format(commitId)).val(commitId); |
|
228 | $("input[data-commit-id='{0}']".format(commitId)).val(commitId); | |
223 | commitIds.push(commitId); |
|
229 | commitIds.push(commitId); | |
224 | } else { |
|
230 | } else { | |
225 | $("input[data-commit-id='{0}']".format(commitId)).val('') |
|
231 | $("input[data-commit-id='{0}']".format(commitId)).val('') | |
226 | } |
|
232 | } | |
227 | }); |
|
233 | }); | |
228 |
|
234 | |||
229 | self.setActionButtonsDisabled(true); |
|
235 | self.setActionButtonsDisabled(true); | |
230 | self.cm.setOption("readOnly", true); |
|
236 | self.cm.setOption("readOnly", true); | |
231 | var postData = { |
|
237 | var postData = { | |
232 | 'text': text, |
|
238 | 'text': text, | |
233 | 'changeset_status': status, |
|
239 | 'changeset_status': status, | |
234 | 'comment_type': commentType, |
|
240 | 'comment_type': commentType, | |
235 | 'commit_ids': commitIds, |
|
241 | 'commit_ids': commitIds, | |
236 | 'csrf_token': CSRF_TOKEN |
|
242 | 'csrf_token': CSRF_TOKEN | |
237 | }; |
|
243 | }; | |
238 |
|
244 | |||
239 | var submitSuccessCallback = function(o) { |
|
245 | var submitSuccessCallback = function(o) { | |
240 | location.reload(true); |
|
246 | location.reload(true); | |
241 | }; |
|
247 | }; | |
242 | var submitFailCallback = function(){ |
|
248 | var submitFailCallback = function(){ | |
243 | self.resetCommentFormState(text) |
|
249 | self.resetCommentFormState(text) | |
244 | }; |
|
250 | }; | |
245 | self.submitAjaxPOST( |
|
251 | self.submitAjaxPOST( | |
246 | self.submitUrl, postData, submitSuccessCallback, submitFailCallback); |
|
252 | self.submitUrl, postData, submitSuccessCallback, submitFailCallback); | |
247 | }); |
|
253 | }); | |
248 | % endif |
|
254 | % endif | |
249 |
|
255 | |||
250 |
|
256 | |||
251 | </script> |
|
257 | </script> | |
252 | % else: |
|
258 | % else: | |
253 | ## form state when not logged in |
|
259 | ## form state when not logged in | |
254 | <div class="comment-form ac"> |
|
260 | <div class="comment-form ac"> | |
255 |
|
261 | |||
256 | <div class="comment-area"> |
|
262 | <div class="comment-area"> | |
257 | <div class="comment-area-header"> |
|
263 | <div class="comment-area-header"> | |
258 | <ul class="nav-links clearfix"> |
|
264 | <ul class="nav-links clearfix"> | |
259 | <li class="active"> |
|
265 | <li class="active"> | |
260 | <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a> |
|
266 | <a class="disabled" href="#edit-btn" disabled="disabled" onclick="return false">${_('Write')}</a> | |
261 | </li> |
|
267 | </li> | |
262 | <li class=""> |
|
268 | <li class=""> | |
263 | <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a> |
|
269 | <a class="disabled" href="#preview-btn" disabled="disabled" onclick="return false">${_('Preview')}</a> | |
264 | </li> |
|
270 | </li> | |
265 | </ul> |
|
271 | </ul> | |
266 | </div> |
|
272 | </div> | |
267 |
|
273 | |||
268 | <div class="comment-area-write" style="display: block;"> |
|
274 | <div class="comment-area-write" style="display: block;"> | |
269 | <div id="edit-container"> |
|
275 | <div id="edit-container"> | |
270 | <div style="padding: 40px 0"> |
|
276 | <div style="padding: 40px 0"> | |
271 | ${_('You need to be logged in to leave comments.')} |
|
277 | ${_('You need to be logged in to leave comments.')} | |
272 | <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a> |
|
278 | <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a> | |
273 | </div> |
|
279 | </div> | |
274 | </div> |
|
280 | </div> | |
275 | <div id="preview-container" class="clearfix" style="display: none;"> |
|
281 | <div id="preview-container" class="clearfix" style="display: none;"> | |
276 | <div id="preview-box" class="preview-box"></div> |
|
282 | <div id="preview-box" class="preview-box"></div> | |
277 | </div> |
|
283 | </div> | |
278 | </div> |
|
284 | </div> | |
279 |
|
285 | |||
280 | <div class="comment-area-footer"> |
|
286 | <div class="comment-area-footer"> | |
281 | <div class="toolbar"> |
|
287 | <div class="toolbar"> | |
282 | <div class="toolbar-text"> |
|
288 | <div class="toolbar-text"> | |
283 | </div> |
|
289 | </div> | |
284 | </div> |
|
290 | </div> | |
285 | </div> |
|
291 | </div> | |
286 | </div> |
|
292 | </div> | |
287 |
|
293 | |||
288 | <div class="comment-footer"> |
|
294 | <div class="comment-footer"> | |
289 | </div> |
|
295 | </div> | |
290 |
|
296 | |||
291 | </div> |
|
297 | </div> | |
292 | % endif |
|
298 | % endif | |
293 |
|
299 | |||
294 | <script type="text/javascript"> |
|
300 | <script type="text/javascript"> | |
295 | bindToggleButtons(); |
|
301 | bindToggleButtons(); | |
296 | </script> |
|
302 | </script> | |
297 | </div> |
|
303 | </div> | |
298 | </%def> |
|
304 | </%def> | |
299 |
|
305 | |||
300 |
|
306 | |||
301 | <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)"> |
|
307 | <%def name="comment_form(form_type, form_id='', lineno_id='{1}', review_statuses=None, form_extras=None)"> | |
302 | ## comment injected based on assumption that user is logged in |
|
308 | ## comment injected based on assumption that user is logged in | |
303 |
|
309 | |||
304 | <form ${'id="{}"'.format(form_id) if form_id else '' |n} action="#" method="GET"> |
|
310 | <form ${'id="{}"'.format(form_id) if form_id else '' |n} action="#" method="GET"> | |
305 |
|
311 | |||
306 | <div class="comment-area"> |
|
312 | <div class="comment-area"> | |
307 | <div class="comment-area-header"> |
|
313 | <div class="comment-area-header"> | |
308 | <ul class="nav-links clearfix"> |
|
314 | <ul class="nav-links clearfix"> | |
309 | <li class="active"> |
|
315 | <li class="active"> | |
310 | <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a> |
|
316 | <a href="#edit-btn" tabindex="-1" id="edit-btn_${lineno_id}">${_('Write')}</a> | |
311 | </li> |
|
317 | </li> | |
312 | <li class=""> |
|
318 | <li class=""> | |
313 | <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a> |
|
319 | <a href="#preview-btn" tabindex="-1" id="preview-btn_${lineno_id}">${_('Preview')}</a> | |
314 | </li> |
|
320 | </li> | |
315 | <li class="pull-right"> |
|
321 | <li class="pull-right"> | |
316 | <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type"> |
|
322 | <select class="comment-type" id="comment_type_${lineno_id}" name="comment_type"> | |
317 | % for val in c.visual.comment_types: |
|
323 | % for val in c.visual.comment_types: | |
318 | <option value="${val}">${val.upper()}</option> |
|
324 | <option value="${val}">${val.upper()}</option> | |
319 | % endfor |
|
325 | % endfor | |
320 | </select> |
|
326 | </select> | |
321 | </li> |
|
327 | </li> | |
322 | </ul> |
|
328 | </ul> | |
323 | </div> |
|
329 | </div> | |
324 |
|
330 | |||
325 | <div class="comment-area-write" style="display: block;"> |
|
331 | <div class="comment-area-write" style="display: block;"> | |
326 | <div id="edit-container_${lineno_id}"> |
|
332 | <div id="edit-container_${lineno_id}"> | |
327 | <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea> |
|
333 | <textarea id="text_${lineno_id}" name="text" class="comment-block-ta ac-input"></textarea> | |
328 | </div> |
|
334 | </div> | |
329 | <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;"> |
|
335 | <div id="preview-container_${lineno_id}" class="clearfix" style="display: none;"> | |
330 | <div id="preview-box_${lineno_id}" class="preview-box"></div> |
|
336 | <div id="preview-box_${lineno_id}" class="preview-box"></div> | |
331 | </div> |
|
337 | </div> | |
332 | </div> |
|
338 | </div> | |
333 |
|
339 | |||
334 | <div class="comment-area-footer"> |
|
340 | <div class="comment-area-footer"> | |
335 | <div class="toolbar"> |
|
341 | <div class="toolbar"> | |
336 | <div class="toolbar-text"> |
|
342 | <div class="toolbar-text"> | |
337 | ${(_('Comments parsed using %s syntax with %s support.') % ( |
|
343 | ${(_('Comments parsed using %s syntax with %s support.') % ( | |
338 | ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), |
|
344 | ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), | |
339 | ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) |
|
345 | ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) | |
340 | ) |
|
346 | ) | |
341 | )|n} |
|
347 | )|n} | |
342 | </div> |
|
348 | </div> | |
343 | </div> |
|
349 | </div> | |
344 | </div> |
|
350 | </div> | |
345 | </div> |
|
351 | </div> | |
346 |
|
352 | |||
347 | <div class="comment-footer"> |
|
353 | <div class="comment-footer"> | |
348 |
|
354 | |||
349 | % if review_statuses: |
|
355 | % if review_statuses: | |
350 | <div class="status_box"> |
|
356 | <div class="status_box"> | |
351 | <select id="change_status_${lineno_id}" name="changeset_status"> |
|
357 | <select id="change_status_${lineno_id}" name="changeset_status"> | |
352 | <option></option> ## Placeholder |
|
358 | <option></option> ## Placeholder | |
353 | % for status, lbl in review_statuses: |
|
359 | % for status, lbl in review_statuses: | |
354 | <option value="${status}" data-status="${status}">${lbl}</option> |
|
360 | <option value="${status}" data-status="${status}">${lbl}</option> | |
355 | %if is_pull_request and change_status and status in ('approved', 'rejected'): |
|
361 | %if is_pull_request and change_status and status in ('approved', 'rejected'): | |
356 | <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option> |
|
362 | <option value="${status}_closed" data-status="${status}">${lbl} & ${_('Closed')}</option> | |
357 | %endif |
|
363 | %endif | |
358 | % endfor |
|
364 | % endfor | |
359 | </select> |
|
365 | </select> | |
360 | </div> |
|
366 | </div> | |
361 | % endif |
|
367 | % endif | |
362 |
|
368 | |||
363 | ## inject extra inputs into the form |
|
369 | ## inject extra inputs into the form | |
364 | % if form_extras and isinstance(form_extras, (list, tuple)): |
|
370 | % if form_extras and isinstance(form_extras, (list, tuple)): | |
365 | <div id="comment_form_extras"> |
|
371 | <div id="comment_form_extras"> | |
366 | % for form_ex_el in form_extras: |
|
372 | % for form_ex_el in form_extras: | |
367 | ${form_ex_el|n} |
|
373 | ${form_ex_el|n} | |
368 | % endfor |
|
374 | % endfor | |
369 | </div> |
|
375 | </div> | |
370 | % endif |
|
376 | % endif | |
371 |
|
377 | |||
372 | <div class="action-buttons"> |
|
378 | <div class="action-buttons"> | |
373 | ## inline for has a file, and line-number together with cancel hide button. |
|
379 | ## inline for has a file, and line-number together with cancel hide button. | |
374 | % if form_type == 'inline': |
|
380 | % if form_type == 'inline': | |
375 | <input type="hidden" name="f_path" value="{0}"> |
|
381 | <input type="hidden" name="f_path" value="{0}"> | |
376 | <input type="hidden" name="line" value="${lineno_id}"> |
|
382 | <input type="hidden" name="line" value="${lineno_id}"> | |
377 | <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);"> |
|
383 | <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);"> | |
378 | ${_('Cancel')} |
|
384 | ${_('Cancel')} | |
379 | </button> |
|
385 | </button> | |
380 | % endif |
|
386 | % endif | |
381 | ${h.submit('save', _('Comment'), class_='btn btn-success comment-button-input')} |
|
387 | ${h.submit('save', _('Comment'), class_='btn btn-success comment-button-input')} | |
382 |
|
388 | |||
383 | </div> |
|
389 | </div> | |
384 | </div> |
|
390 | </div> | |
385 |
|
391 | |||
386 | </form> |
|
392 | </form> | |
387 |
|
393 | |||
388 | </%def> No newline at end of file |
|
394 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now