Show More
@@ -1,1006 +1,1006 b'' | |||||
1 | // Default styles |
|
1 | // Default styles | |
2 |
|
2 | |||
3 | .diff-collapse { |
|
3 | .diff-collapse { | |
4 | margin: @padding 0; |
|
4 | margin: @padding 0; | |
5 | text-align: right; |
|
5 | text-align: right; | |
6 | } |
|
6 | } | |
7 |
|
7 | |||
8 | .diff-container { |
|
8 | .diff-container { | |
9 | margin-bottom: @space; |
|
9 | margin-bottom: @space; | |
10 |
|
10 | |||
11 | .diffblock { |
|
11 | .diffblock { | |
12 | margin-bottom: @space; |
|
12 | margin-bottom: @space; | |
13 | } |
|
13 | } | |
14 |
|
14 | |||
15 | &.hidden { |
|
15 | &.hidden { | |
16 | display: none; |
|
16 | display: none; | |
17 | overflow: hidden; |
|
17 | overflow: hidden; | |
18 | } |
|
18 | } | |
19 | } |
|
19 | } | |
20 |
|
20 | |||
21 | .compare_view_files { |
|
21 | .compare_view_files { | |
22 |
|
22 | |||
23 | .diff-container { |
|
23 | .diff-container { | |
24 |
|
24 | |||
25 | .diffblock { |
|
25 | .diffblock { | |
26 | margin-bottom: 0; |
|
26 | margin-bottom: 0; | |
27 | } |
|
27 | } | |
28 | } |
|
28 | } | |
29 | } |
|
29 | } | |
30 |
|
30 | |||
31 | div.diffblock .sidebyside { |
|
31 | div.diffblock .sidebyside { | |
32 | background: #ffffff; |
|
32 | background: #ffffff; | |
33 | } |
|
33 | } | |
34 |
|
34 | |||
35 | div.diffblock { |
|
35 | div.diffblock { | |
36 | overflow-x: auto; |
|
36 | overflow-x: auto; | |
37 | overflow-y: hidden; |
|
37 | overflow-y: hidden; | |
38 | clear: both; |
|
38 | clear: both; | |
39 | padding: 0px; |
|
39 | padding: 0px; | |
40 | background: @grey6; |
|
40 | background: @grey6; | |
41 | border: @border-thickness solid @grey5; |
|
41 | border: @border-thickness solid @grey5; | |
42 | -webkit-border-radius: @border-radius @border-radius 0px 0px; |
|
42 | -webkit-border-radius: @border-radius @border-radius 0px 0px; | |
43 | border-radius: @border-radius @border-radius 0px 0px; |
|
43 | border-radius: @border-radius @border-radius 0px 0px; | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | .comments-number { |
|
46 | .comments-number { | |
47 | float: right; |
|
47 | float: right; | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | // BEGIN CODE-HEADER STYLES |
|
50 | // BEGIN CODE-HEADER STYLES | |
51 |
|
51 | |||
52 | .code-header { |
|
52 | .code-header { | |
53 | background: @grey6; |
|
53 | background: @grey6; | |
54 | padding: 10px 0 10px 0; |
|
54 | padding: 10px 0 10px 0; | |
55 | height: auto; |
|
55 | height: auto; | |
56 | width: 100%; |
|
56 | width: 100%; | |
57 |
|
57 | |||
58 | .hash { |
|
58 | .hash { | |
59 | float: left; |
|
59 | float: left; | |
60 | padding: 2px 0 0 2px; |
|
60 | padding: 2px 0 0 2px; | |
61 | } |
|
61 | } | |
62 |
|
62 | |||
63 | .date { |
|
63 | .date { | |
64 | float: left; |
|
64 | float: left; | |
65 | text-transform: uppercase; |
|
65 | text-transform: uppercase; | |
66 | padding: 4px 0px 0px 2px; |
|
66 | padding: 4px 0px 0px 2px; | |
67 | } |
|
67 | } | |
68 |
|
68 | |||
69 | div { |
|
69 | div { | |
70 | margin-left: 4px; |
|
70 | margin-left: 4px; | |
71 | } |
|
71 | } | |
72 |
|
72 | |||
73 | div.compare_header { |
|
73 | div.compare_header { | |
74 | min-height: 40px; |
|
74 | min-height: 40px; | |
75 | margin: 0; |
|
75 | margin: 0; | |
76 | padding: 0 @padding; |
|
76 | padding: 0 @padding; | |
77 |
|
77 | |||
78 | .drop-menu { |
|
78 | .drop-menu { | |
79 | float:left; |
|
79 | float:left; | |
80 | display: block; |
|
80 | display: block; | |
81 | margin:0 0 @padding 0; |
|
81 | margin:0 0 @padding 0; | |
82 | } |
|
82 | } | |
83 |
|
83 | |||
84 | .compare-label { |
|
84 | .compare-label { | |
85 | float: left; |
|
85 | float: left; | |
86 | clear: both; |
|
86 | clear: both; | |
87 | display: inline-block; |
|
87 | display: inline-block; | |
88 | min-width: 5em; |
|
88 | min-width: 5em; | |
89 | margin: 0; |
|
89 | margin: 0; | |
90 | padding: @button-padding @button-padding @button-padding 0; |
|
90 | padding: @button-padding @button-padding @button-padding 0; | |
91 | font-family: @text-semibold; |
|
91 | font-family: @text-semibold; | |
92 | } |
|
92 | } | |
93 |
|
93 | |||
94 | .compare-buttons { |
|
94 | .compare-buttons { | |
95 | float: left; |
|
95 | float: left; | |
96 | margin: 0; |
|
96 | margin: 0; | |
97 | padding: 0 0 @padding; |
|
97 | padding: 0 0 @padding; | |
98 |
|
98 | |||
99 | .btn { |
|
99 | .btn { | |
100 | margin: 0 @padding 0 0; |
|
100 | margin: 0 @padding 0 0; | |
101 | } |
|
101 | } | |
102 | } |
|
102 | } | |
103 | } |
|
103 | } | |
104 |
|
104 | |||
105 | } |
|
105 | } | |
106 |
|
106 | |||
107 | .parents { |
|
107 | .parents { | |
108 | float: left; |
|
108 | float: left; | |
109 | width: 100px; |
|
109 | width: 100px; | |
110 | font-weight: 400; |
|
110 | font-weight: 400; | |
111 | vertical-align: middle; |
|
111 | vertical-align: middle; | |
112 | padding: 0px 2px 0px 2px; |
|
112 | padding: 0px 2px 0px 2px; | |
113 | background-color: @grey6; |
|
113 | background-color: @grey6; | |
114 |
|
114 | |||
115 | #parent_link { |
|
115 | #parent_link { | |
116 | margin: 00px 2px; |
|
116 | margin: 00px 2px; | |
117 |
|
117 | |||
118 | &.double { |
|
118 | &.double { | |
119 | margin: 0px 2px; |
|
119 | margin: 0px 2px; | |
120 | } |
|
120 | } | |
121 |
|
121 | |||
122 | &.disabled{ |
|
122 | &.disabled{ | |
123 | margin-right: @padding; |
|
123 | margin-right: @padding; | |
124 | } |
|
124 | } | |
125 | } |
|
125 | } | |
126 | } |
|
126 | } | |
127 |
|
127 | |||
128 | .children { |
|
128 | .children { | |
129 | float: right; |
|
129 | float: right; | |
130 | width: 100px; |
|
130 | width: 100px; | |
131 | font-weight: 400; |
|
131 | font-weight: 400; | |
132 | vertical-align: middle; |
|
132 | vertical-align: middle; | |
133 | text-align: right; |
|
133 | text-align: right; | |
134 | padding: 0px 2px 0px 2px; |
|
134 | padding: 0px 2px 0px 2px; | |
135 | background-color: @grey6; |
|
135 | background-color: @grey6; | |
136 |
|
136 | |||
137 | #child_link { |
|
137 | #child_link { | |
138 | margin: 0px 2px; |
|
138 | margin: 0px 2px; | |
139 |
|
139 | |||
140 | &.double { |
|
140 | &.double { | |
141 | margin: 0px 2px; |
|
141 | margin: 0px 2px; | |
142 | } |
|
142 | } | |
143 |
|
143 | |||
144 | &.disabled{ |
|
144 | &.disabled{ | |
145 | margin-right: @padding; |
|
145 | margin-right: @padding; | |
146 | } |
|
146 | } | |
147 | } |
|
147 | } | |
148 | } |
|
148 | } | |
149 |
|
149 | |||
150 | .changeset_header { |
|
150 | .changeset_header { | |
151 | height: 16px; |
|
151 | height: 16px; | |
152 |
|
152 | |||
153 | & > div{ |
|
153 | & > div{ | |
154 | margin-right: @padding; |
|
154 | margin-right: @padding; | |
155 | } |
|
155 | } | |
156 | } |
|
156 | } | |
157 |
|
157 | |||
158 | .changeset_file { |
|
158 | .changeset_file { | |
159 | text-align: left; |
|
159 | text-align: left; | |
160 | float: left; |
|
160 | float: left; | |
161 | padding: 0; |
|
161 | padding: 0; | |
162 |
|
162 | |||
163 | a{ |
|
163 | a{ | |
164 | display: inline-block; |
|
164 | display: inline-block; | |
165 | margin-right: 0.5em; |
|
165 | margin-right: 0.5em; | |
166 | } |
|
166 | } | |
167 |
|
167 | |||
168 | #selected_mode{ |
|
168 | #selected_mode{ | |
169 | margin-left: 0; |
|
169 | margin-left: 0; | |
170 | } |
|
170 | } | |
171 | } |
|
171 | } | |
172 |
|
172 | |||
173 | .diff-menu-wrapper { |
|
173 | .diff-menu-wrapper { | |
174 | float: left; |
|
174 | float: left; | |
175 | } |
|
175 | } | |
176 |
|
176 | |||
177 | .diff-menu { |
|
177 | .diff-menu { | |
178 | position: absolute; |
|
178 | position: absolute; | |
179 | background: none repeat scroll 0 0 #FFFFFF; |
|
179 | background: none repeat scroll 0 0 #FFFFFF; | |
180 | border-color: #003367 @grey3 @grey3; |
|
180 | border-color: #003367 @grey3 @grey3; | |
181 | border-right: 1px solid @grey3; |
|
181 | border-right: 1px solid @grey3; | |
182 | border-style: solid solid solid; |
|
182 | border-style: solid solid solid; | |
183 | border-width: @border-thickness; |
|
183 | border-width: @border-thickness; | |
184 | box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2); |
|
184 | box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2); | |
185 | margin-top: 5px; |
|
185 | margin-top: 5px; | |
186 | margin-left: 1px; |
|
186 | margin-left: 1px; | |
187 | } |
|
187 | } | |
188 |
|
188 | |||
189 | .diff-actions, .editor-actions { |
|
189 | .diff-actions, .editor-actions { | |
190 | float: left; |
|
190 | float: left; | |
191 |
|
191 | |||
192 | input{ |
|
192 | input{ | |
193 | margin: 0 0.5em 0 0; |
|
193 | margin: 0 0.5em 0 0; | |
194 | } |
|
194 | } | |
195 | } |
|
195 | } | |
196 |
|
196 | |||
197 | // END CODE-HEADER STYLES |
|
197 | // END CODE-HEADER STYLES | |
198 |
|
198 | |||
199 | // BEGIN CODE-BODY STYLES |
|
199 | // BEGIN CODE-BODY STYLES | |
200 |
|
200 | |||
201 | .code-body { |
|
201 | .code-body { | |
202 | background: white; |
|
202 | background: white; | |
203 | padding: 0; |
|
203 | padding: 0; | |
204 | background-color: #ffffff; |
|
204 | background-color: #ffffff; | |
205 | position: relative; |
|
205 | position: relative; | |
206 | max-width: none; |
|
206 | max-width: none; | |
207 | box-sizing: border-box; |
|
207 | box-sizing: border-box; | |
208 | // TODO: johbo: Parent has overflow: auto, this forces the child here |
|
208 | // TODO: johbo: Parent has overflow: auto, this forces the child here | |
209 | // to have the intended size and to scroll. Should be simplified. |
|
209 | // to have the intended size and to scroll. Should be simplified. | |
210 | width: 100%; |
|
210 | width: 100%; | |
211 | overflow-x: auto; |
|
211 | overflow-x: auto; | |
212 | } |
|
212 | } | |
213 |
|
213 | |||
214 | pre.raw { |
|
214 | pre.raw { | |
215 | background: white; |
|
215 | background: white; | |
216 | color: @grey1; |
|
216 | color: @grey1; | |
217 | } |
|
217 | } | |
218 | // END CODE-BODY STYLES |
|
218 | // END CODE-BODY STYLES | |
219 |
|
219 | |||
220 | } |
|
220 | } | |
221 |
|
221 | |||
222 |
|
222 | |||
223 | table.code-difftable { |
|
223 | table.code-difftable { | |
224 | border-collapse: collapse; |
|
224 | border-collapse: collapse; | |
225 | width: 99%; |
|
225 | width: 99%; | |
226 | border-radius: 0px !important; |
|
226 | border-radius: 0px !important; | |
227 |
|
227 | |||
228 | td { |
|
228 | td { | |
229 | padding: 0 !important; |
|
229 | padding: 0 !important; | |
230 | background: none !important; |
|
230 | background: none !important; | |
231 | border: 0 !important; |
|
231 | border: 0 !important; | |
232 | } |
|
232 | } | |
233 |
|
233 | |||
234 | .context { |
|
234 | .context { | |
235 | background: none repeat scroll 0 0 #DDE7EF; |
|
235 | background: none repeat scroll 0 0 #DDE7EF; | |
236 | } |
|
236 | } | |
237 |
|
237 | |||
238 | .add { |
|
238 | .add { | |
239 | background: none repeat scroll 0 0 #DDFFDD; |
|
239 | background: none repeat scroll 0 0 #DDFFDD; | |
240 |
|
240 | |||
241 | ins { |
|
241 | ins { | |
242 | background: none repeat scroll 0 0 #AAFFAA; |
|
242 | background: none repeat scroll 0 0 #AAFFAA; | |
243 | text-decoration: none; |
|
243 | text-decoration: none; | |
244 | } |
|
244 | } | |
245 | } |
|
245 | } | |
246 |
|
246 | |||
247 | .del { |
|
247 | .del { | |
248 | background: none repeat scroll 0 0 #FFDDDD; |
|
248 | background: none repeat scroll 0 0 #FFDDDD; | |
249 |
|
249 | |||
250 | del { |
|
250 | del { | |
251 | background: none repeat scroll 0 0 #FFAAAA; |
|
251 | background: none repeat scroll 0 0 #FFAAAA; | |
252 | text-decoration: none; |
|
252 | text-decoration: none; | |
253 | } |
|
253 | } | |
254 | } |
|
254 | } | |
255 |
|
255 | |||
256 | /** LINE NUMBERS **/ |
|
256 | /** LINE NUMBERS **/ | |
257 | .lineno { |
|
257 | .lineno { | |
258 | padding-left: 2px !important; |
|
258 | padding-left: 2px !important; | |
259 | padding-right: 2px; |
|
259 | padding-right: 2px; | |
260 | text-align: right; |
|
260 | text-align: right; | |
261 | width: 32px; |
|
261 | width: 32px; | |
262 | -moz-user-select: none; |
|
262 | -moz-user-select: none; | |
263 | -webkit-user-select: none; |
|
263 | -webkit-user-select: none; | |
264 | border-right: @border-thickness solid @grey5 !important; |
|
264 | border-right: @border-thickness solid @grey5 !important; | |
265 | border-left: 0px solid #CCC !important; |
|
265 | border-left: 0px solid #CCC !important; | |
266 | border-top: 0px solid #CCC !important; |
|
266 | border-top: 0px solid #CCC !important; | |
267 | border-bottom: none !important; |
|
267 | border-bottom: none !important; | |
268 |
|
268 | |||
269 | a { |
|
269 | a { | |
270 | &:extend(pre); |
|
270 | &:extend(pre); | |
271 | text-align: right; |
|
271 | text-align: right; | |
272 | padding-right: 2px; |
|
272 | padding-right: 2px; | |
273 | cursor: pointer; |
|
273 | cursor: pointer; | |
274 | display: block; |
|
274 | display: block; | |
275 | width: 32px; |
|
275 | width: 32px; | |
276 | } |
|
276 | } | |
277 | } |
|
277 | } | |
278 |
|
278 | |||
279 | .context { |
|
279 | .context { | |
280 | cursor: auto; |
|
280 | cursor: auto; | |
281 | &:extend(pre); |
|
281 | &:extend(pre); | |
282 | } |
|
282 | } | |
283 |
|
283 | |||
284 | .lineno-inline { |
|
284 | .lineno-inline { | |
285 | background: none repeat scroll 0 0 #FFF !important; |
|
285 | background: none repeat scroll 0 0 #FFF !important; | |
286 | padding-left: 2px; |
|
286 | padding-left: 2px; | |
287 | padding-right: 2px; |
|
287 | padding-right: 2px; | |
288 | text-align: right; |
|
288 | text-align: right; | |
289 | width: 30px; |
|
289 | width: 30px; | |
290 | -moz-user-select: none; |
|
290 | -moz-user-select: none; | |
291 | -webkit-user-select: none; |
|
291 | -webkit-user-select: none; | |
292 | } |
|
292 | } | |
293 |
|
293 | |||
294 | /** CODE **/ |
|
294 | /** CODE **/ | |
295 | .code { |
|
295 | .code { | |
296 | display: block; |
|
296 | display: block; | |
297 | width: 100%; |
|
297 | width: 100%; | |
298 |
|
298 | |||
299 | td { |
|
299 | td { | |
300 | margin: 0; |
|
300 | margin: 0; | |
301 | padding: 0; |
|
301 | padding: 0; | |
302 | } |
|
302 | } | |
303 |
|
303 | |||
304 | pre { |
|
304 | pre { | |
305 | margin: 0; |
|
305 | margin: 0; | |
306 | padding: 0; |
|
306 | padding: 0; | |
307 | margin-left: .5em; |
|
307 | margin-left: .5em; | |
308 | } |
|
308 | } | |
309 | } |
|
309 | } | |
310 | } |
|
310 | } | |
311 |
|
311 | |||
312 |
|
312 | |||
313 | // Comments |
|
313 | // Comments | |
314 |
|
314 | |||
315 | div.comment:target { |
|
315 | div.comment:target { | |
316 | border-left: 6px solid @comment-highlight-color; |
|
316 | border-left: 6px solid @comment-highlight-color; | |
317 | padding-left: 3px; |
|
317 | padding-left: 3px; | |
318 | margin-left: -9px; |
|
318 | margin-left: -9px; | |
319 | } |
|
319 | } | |
320 |
|
320 | |||
321 | //TODO: anderson: can't get an absolute number out of anything, so had to put the |
|
321 | //TODO: anderson: can't get an absolute number out of anything, so had to put the | |
322 | //current values that might change. But to make it clear I put as a calculation |
|
322 | //current values that might change. But to make it clear I put as a calculation | |
323 | @comment-max-width: 1065px; |
|
323 | @comment-max-width: 1065px; | |
324 | @pr-extra-margin: 34px; |
|
324 | @pr-extra-margin: 34px; | |
325 | @pr-border-spacing: 4px; |
|
325 | @pr-border-spacing: 4px; | |
326 | @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing; |
|
326 | @pr-comment-width: @comment-max-width - @pr-extra-margin - @pr-border-spacing; | |
327 |
|
327 | |||
328 | // Pull Request |
|
328 | // Pull Request | |
329 | .cs_files .code-difftable { |
|
329 | .cs_files .code-difftable { | |
330 | border: @border-thickness solid @grey5; //borders only on PRs |
|
330 | border: @border-thickness solid @grey5; //borders only on PRs | |
331 |
|
331 | |||
332 | .comment-inline-form, |
|
332 | .comment-inline-form, | |
333 | div.comment { |
|
333 | div.comment { | |
334 | width: @pr-comment-width; |
|
334 | width: @pr-comment-width; | |
335 | } |
|
335 | } | |
336 | } |
|
336 | } | |
337 |
|
337 | |||
338 | // Changeset |
|
338 | // Changeset | |
339 | .code-difftable { |
|
339 | .code-difftable { | |
340 | .comment-inline-form, |
|
340 | .comment-inline-form, | |
341 | div.comment { |
|
341 | div.comment { | |
342 | width: @comment-max-width; |
|
342 | width: @comment-max-width; | |
343 | } |
|
343 | } | |
344 | } |
|
344 | } | |
345 |
|
345 | |||
346 | //Style page |
|
346 | //Style page | |
347 | @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding; |
|
347 | @style-extra-margin: @sidebar-width + (@sidebarpadding * 3) + @padding; | |
348 | #style-page .code-difftable{ |
|
348 | #style-page .code-difftable{ | |
349 | .comment-inline-form, |
|
349 | .comment-inline-form, | |
350 | div.comment { |
|
350 | div.comment { | |
351 | width: @comment-max-width - @style-extra-margin; |
|
351 | width: @comment-max-width - @style-extra-margin; | |
352 | } |
|
352 | } | |
353 | } |
|
353 | } | |
354 |
|
354 | |||
355 | #context-bar > h2 { |
|
355 | #context-bar > h2 { | |
356 | font-size: 20px; |
|
356 | font-size: 20px; | |
357 | } |
|
357 | } | |
358 |
|
358 | |||
359 | #context-bar > h2> a { |
|
359 | #context-bar > h2> a { | |
360 | font-size: 20px; |
|
360 | font-size: 20px; | |
361 | } |
|
361 | } | |
362 | // end of defaults |
|
362 | // end of defaults | |
363 |
|
363 | |||
364 | .file_diff_buttons { |
|
364 | .file_diff_buttons { | |
365 | padding: 0 0 @padding; |
|
365 | padding: 0 0 @padding; | |
366 |
|
366 | |||
367 | .drop-menu { |
|
367 | .drop-menu { | |
368 | float: left; |
|
368 | float: left; | |
369 | margin: 0 @padding 0 0; |
|
369 | margin: 0 @padding 0 0; | |
370 | } |
|
370 | } | |
371 | .btn { |
|
371 | .btn { | |
372 | margin: 0 @padding 0 0; |
|
372 | margin: 0 @padding 0 0; | |
373 | } |
|
373 | } | |
374 | } |
|
374 | } | |
375 |
|
375 | |||
376 | .code-body.textarea.editor { |
|
376 | .code-body.textarea.editor { | |
377 | max-width: none; |
|
377 | max-width: none; | |
378 | padding: 15px; |
|
378 | padding: 15px; | |
379 | } |
|
379 | } | |
380 |
|
380 | |||
381 | td.injected_diff{ |
|
381 | td.injected_diff{ | |
382 | max-width: 1178px; |
|
382 | max-width: 1178px; | |
383 | overflow-x: auto; |
|
383 | overflow-x: auto; | |
384 | overflow-y: hidden; |
|
384 | overflow-y: hidden; | |
385 |
|
385 | |||
386 | div.diff-container, |
|
386 | div.diff-container, | |
387 | div.diffblock{ |
|
387 | div.diffblock{ | |
388 | max-width: 100%; |
|
388 | max-width: 100%; | |
389 | } |
|
389 | } | |
390 |
|
390 | |||
391 | div.code-body { |
|
391 | div.code-body { | |
392 | max-width: 1124px; |
|
392 | max-width: 1124px; | |
393 | overflow-x: auto; |
|
393 | overflow-x: auto; | |
394 | overflow-y: hidden; |
|
394 | overflow-y: hidden; | |
395 | padding: 0; |
|
395 | padding: 0; | |
396 | } |
|
396 | } | |
397 | div.diffblock { |
|
397 | div.diffblock { | |
398 | border: none; |
|
398 | border: none; | |
399 | } |
|
399 | } | |
400 |
|
400 | |||
401 | &.inline-form { |
|
401 | &.inline-form { | |
402 | width: 99% |
|
402 | width: 99% | |
403 | } |
|
403 | } | |
404 | } |
|
404 | } | |
405 |
|
405 | |||
406 |
|
406 | |||
407 | table.code-difftable { |
|
407 | table.code-difftable { | |
408 | width: 100%; |
|
408 | width: 100%; | |
409 | } |
|
409 | } | |
410 |
|
410 | |||
411 | /** PYGMENTS COLORING **/ |
|
411 | /** PYGMENTS COLORING **/ | |
412 | div.codeblock { |
|
412 | div.codeblock { | |
413 |
|
413 | |||
414 | // TODO: johbo: Added interim to get rid of the margin around |
|
414 | // TODO: johbo: Added interim to get rid of the margin around | |
415 | // Select2 widgets. This needs further cleanup. |
|
415 | // Select2 widgets. This needs further cleanup. | |
416 | margin-top: @padding; |
|
416 | margin-top: @padding; | |
417 |
|
417 | |||
418 | overflow: auto; |
|
418 | overflow: auto; | |
419 | padding: 0px; |
|
419 | padding: 0px; | |
420 | border: @border-thickness solid @grey5; |
|
420 | border: @border-thickness solid @grey5; | |
421 | background: @grey6; |
|
421 | background: @grey6; | |
422 | .border-radius(@border-radius); |
|
422 | .border-radius(@border-radius); | |
423 |
|
423 | |||
424 | #remove_gist { |
|
424 | #remove_gist { | |
425 | float: right; |
|
425 | float: right; | |
426 | } |
|
426 | } | |
427 |
|
427 | |||
428 | .author { |
|
428 | .author { | |
429 | clear: both; |
|
429 | clear: both; | |
430 | vertical-align: middle; |
|
430 | vertical-align: middle; | |
431 | font-family: @text-bold; |
|
431 | font-family: @text-bold; | |
432 | } |
|
432 | } | |
433 |
|
433 | |||
434 | .btn-mini { |
|
434 | .btn-mini { | |
435 | float: left; |
|
435 | float: left; | |
436 | margin: 0 5px 0 0; |
|
436 | margin: 0 5px 0 0; | |
437 | } |
|
437 | } | |
438 |
|
438 | |||
439 | .code-header { |
|
439 | .code-header { | |
440 | padding: @padding; |
|
440 | padding: @padding; | |
441 | border-bottom: @border-thickness solid @grey5; |
|
441 | border-bottom: @border-thickness solid @grey5; | |
442 |
|
442 | |||
443 | .rc-user { |
|
443 | .rc-user { | |
444 | min-width: 0; |
|
444 | min-width: 0; | |
445 | margin-right: .5em; |
|
445 | margin-right: .5em; | |
446 | } |
|
446 | } | |
447 |
|
447 | |||
448 | .stats { |
|
448 | .stats { | |
449 | clear: both; |
|
449 | clear: both; | |
450 | margin: 0 0 @padding 0; |
|
450 | margin: 0 0 @padding 0; | |
451 | padding: 0; |
|
451 | padding: 0; | |
452 | .left { |
|
452 | .left { | |
453 | float: left; |
|
453 | float: left; | |
454 | clear: left; |
|
454 | clear: left; | |
455 | max-width: 75%; |
|
455 | max-width: 75%; | |
456 | margin: 0 0 @padding 0; |
|
456 | margin: 0 0 @padding 0; | |
457 |
|
457 | |||
458 | &.item { |
|
458 | &.item { | |
459 | margin-right: @padding; |
|
459 | margin-right: @padding; | |
460 | &.last { border-right: none; } |
|
460 | &.last { border-right: none; } | |
461 | } |
|
461 | } | |
462 | } |
|
462 | } | |
463 | .buttons { float: right; } |
|
463 | .buttons { float: right; } | |
464 | .author { |
|
464 | .author { | |
465 | height: 25px; margin-left: 15px; font-weight: bold; |
|
465 | height: 25px; margin-left: 15px; font-weight: bold; | |
466 | } |
|
466 | } | |
467 | } |
|
467 | } | |
468 |
|
468 | |||
469 | .commit { |
|
469 | .commit { | |
470 | margin: 5px 0 0 26px; |
|
470 | margin: 5px 0 0 26px; | |
471 | font-weight: normal; |
|
471 | font-weight: normal; | |
472 | white-space: pre-wrap; |
|
472 | white-space: pre-wrap; | |
473 | } |
|
473 | } | |
474 | } |
|
474 | } | |
475 |
|
475 | |||
476 | .message { |
|
476 | .message { | |
477 | position: relative; |
|
477 | position: relative; | |
478 | margin: @padding; |
|
478 | margin: @padding; | |
479 |
|
479 | |||
480 | .codeblock-label { |
|
480 | .codeblock-label { | |
481 | margin: 0 0 1em 0; |
|
481 | margin: 0 0 1em 0; | |
482 | } |
|
482 | } | |
483 | } |
|
483 | } | |
484 |
|
484 | |||
485 | .code-body { |
|
485 | .code-body { | |
486 | padding: @padding; |
|
486 | padding: @padding; | |
487 | background-color: #ffffff; |
|
487 | background-color: #ffffff; | |
488 | min-width: 100%; |
|
488 | min-width: 100%; | |
489 | box-sizing: border-box; |
|
489 | box-sizing: border-box; | |
490 | // TODO: johbo: Parent has overflow: auto, this forces the child here |
|
490 | // TODO: johbo: Parent has overflow: auto, this forces the child here | |
491 | // to have the intended size and to scroll. Should be simplified. |
|
491 | // to have the intended size and to scroll. Should be simplified. | |
492 | width: 100%; |
|
492 | width: 100%; | |
493 | overflow-x: auto; |
|
493 | overflow-x: auto; | |
494 | } |
|
494 | } | |
495 | } |
|
495 | } | |
496 |
|
496 | |||
497 | .code-highlighttable, |
|
497 | .code-highlighttable, | |
498 | div.codeblock { |
|
498 | div.codeblock { | |
499 |
|
499 | |||
500 | &.readme { |
|
500 | &.readme { | |
501 | background-color: white; |
|
501 | background-color: white; | |
502 | } |
|
502 | } | |
503 |
|
503 | |||
504 | .markdown-block table { |
|
504 | .markdown-block table { | |
505 | border-collapse: collapse; |
|
505 | border-collapse: collapse; | |
506 |
|
506 | |||
507 | th, |
|
507 | th, | |
508 | td { |
|
508 | td { | |
509 | padding: .5em; |
|
509 | padding: .5em; | |
510 | border: @border-thickness solid @border-default-color; |
|
510 | border: @border-thickness solid @border-default-color; | |
511 | } |
|
511 | } | |
512 | } |
|
512 | } | |
513 |
|
513 | |||
514 | table { |
|
514 | table { | |
515 | border: 0px; |
|
515 | border: 0px; | |
516 | margin: 0; |
|
516 | margin: 0; | |
517 | letter-spacing: normal; |
|
517 | letter-spacing: normal; | |
518 |
|
518 | |||
519 |
|
519 | |||
520 | td { |
|
520 | td { | |
521 | border: 0px; |
|
521 | border: 0px; | |
522 | vertical-align: top; |
|
522 | vertical-align: top; | |
523 | } |
|
523 | } | |
524 | } |
|
524 | } | |
525 | } |
|
525 | } | |
526 |
|
526 | |||
527 | div.codeblock .code-header .search-path { padding: 0 0 0 10px; } |
|
527 | div.codeblock .code-header .search-path { padding: 0 0 0 10px; } | |
528 | div.search-code-body { |
|
528 | div.search-code-body { | |
529 | background-color: #ffffff; padding: 5px 0 5px 10px; |
|
529 | background-color: #ffffff; padding: 5px 0 5px 10px; | |
530 | pre { |
|
530 | pre { | |
531 | .match { background-color: #faffa6;} |
|
531 | .match { background-color: #faffa6;} | |
532 | .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; } |
|
532 | .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; } | |
533 | } |
|
533 | } | |
534 | .code-highlighttable { |
|
534 | .code-highlighttable { | |
535 | border-collapse: collapse; |
|
535 | border-collapse: collapse; | |
536 |
|
536 | |||
537 | tr:hover { |
|
537 | tr:hover { | |
538 | background: #fafafa; |
|
538 | background: #fafafa; | |
539 | } |
|
539 | } | |
540 | td.code { |
|
540 | td.code { | |
541 | padding-left: 10px; |
|
541 | padding-left: 10px; | |
542 | } |
|
542 | } | |
543 | td.line { |
|
543 | td.line { | |
544 | border-right: 1px solid #ccc !important; |
|
544 | border-right: 1px solid #ccc !important; | |
545 | padding-right: 10px; |
|
545 | padding-right: 10px; | |
546 | text-align: right; |
|
546 | text-align: right; | |
547 | font-family: "Lucida Console",Monaco,monospace; |
|
547 | font-family: "Lucida Console",Monaco,monospace; | |
548 | span { |
|
548 | span { | |
549 | white-space: pre-wrap; |
|
549 | white-space: pre-wrap; | |
550 | color: #666666; |
|
550 | color: #666666; | |
551 | } |
|
551 | } | |
552 | } |
|
552 | } | |
553 | } |
|
553 | } | |
554 | } |
|
554 | } | |
555 |
|
555 | |||
556 | div.annotatediv { margin-left: 2px; margin-right: 4px; } |
|
556 | div.annotatediv { margin-left: 2px; margin-right: 4px; } | |
557 | .code-highlight { |
|
557 | .code-highlight { | |
558 | margin: 0; padding: 0; border-left: @border-thickness solid @grey5; |
|
558 | margin: 0; padding: 0; border-left: @border-thickness solid @grey5; | |
559 | pre, .linenodiv pre { padding: 0 5px; margin: 0; } |
|
559 | pre, .linenodiv pre { padding: 0 5px; margin: 0; } | |
560 | pre div:target {background-color: @comment-highlight-color !important;} |
|
560 | pre div:target {background-color: @comment-highlight-color !important;} | |
561 | } |
|
561 | } | |
562 |
|
562 | |||
563 | .linenos a { text-decoration: none; } |
|
563 | .linenos a { text-decoration: none; } | |
564 |
|
564 | |||
565 | .CodeMirror-selected { background: @rchighlightblue; } |
|
565 | .CodeMirror-selected { background: @rchighlightblue; } | |
566 | .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; } |
|
566 | .CodeMirror-focused .CodeMirror-selected { background: @rchighlightblue; } | |
567 | .CodeMirror ::selection { background: @rchighlightblue; } |
|
567 | .CodeMirror ::selection { background: @rchighlightblue; } | |
568 | .CodeMirror ::-moz-selection { background: @rchighlightblue; } |
|
568 | .CodeMirror ::-moz-selection { background: @rchighlightblue; } | |
569 |
|
569 | |||
570 | .code { display: block; border:0px !important; } |
|
570 | .code { display: block; border:0px !important; } | |
571 | .code-highlight, /* TODO: dan: merge codehilite into code-highlight */ |
|
571 | .code-highlight, /* TODO: dan: merge codehilite into code-highlight */ | |
572 | .codehilite { |
|
572 | .codehilite { | |
573 | .hll { background-color: #ffffcc } |
|
573 | .hll { background-color: #ffffcc } | |
574 | .c { color: #408080; font-style: italic } /* Comment */ |
|
574 | .c { color: #408080; font-style: italic } /* Comment */ | |
575 | .err, .codehilite .err { border: @border-thickness solid #FF0000 } /* Error */ |
|
575 | .err, .codehilite .err { border: @border-thickness solid #FF0000 } /* Error */ | |
576 | .k { color: #008000; font-weight: bold } /* Keyword */ |
|
576 | .k { color: #008000; font-weight: bold } /* Keyword */ | |
577 | .o { color: #666666 } /* Operator */ |
|
577 | .o { color: #666666 } /* Operator */ | |
578 | .cm { color: #408080; font-style: italic } /* Comment.Multiline */ |
|
578 | .cm { color: #408080; font-style: italic } /* Comment.Multiline */ | |
579 | .cp { color: #BC7A00 } /* Comment.Preproc */ |
|
579 | .cp { color: #BC7A00 } /* Comment.Preproc */ | |
580 | .c1 { color: #408080; font-style: italic } /* Comment.Single */ |
|
580 | .c1 { color: #408080; font-style: italic } /* Comment.Single */ | |
581 | .cs { color: #408080; font-style: italic } /* Comment.Special */ |
|
581 | .cs { color: #408080; font-style: italic } /* Comment.Special */ | |
582 | .gd { color: #A00000 } /* Generic.Deleted */ |
|
582 | .gd { color: #A00000 } /* Generic.Deleted */ | |
583 | .ge { font-style: italic } /* Generic.Emph */ |
|
583 | .ge { font-style: italic } /* Generic.Emph */ | |
584 | .gr { color: #FF0000 } /* Generic.Error */ |
|
584 | .gr { color: #FF0000 } /* Generic.Error */ | |
585 | .gh { color: #000080; font-weight: bold } /* Generic.Heading */ |
|
585 | .gh { color: #000080; font-weight: bold } /* Generic.Heading */ | |
586 | .gi { color: #00A000 } /* Generic.Inserted */ |
|
586 | .gi { color: #00A000 } /* Generic.Inserted */ | |
587 | .go { color: #808080 } /* Generic.Output */ |
|
587 | .go { color: #808080 } /* Generic.Output */ | |
588 | .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ |
|
588 | .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ | |
589 | .gs { font-weight: bold } /* Generic.Strong */ |
|
589 | .gs { font-weight: bold } /* Generic.Strong */ | |
590 | .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ |
|
590 | .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ | |
591 | .gt { color: #0040D0 } /* Generic.Traceback */ |
|
591 | .gt { color: #0040D0 } /* Generic.Traceback */ | |
592 | .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ |
|
592 | .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ | |
593 | .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ |
|
593 | .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ | |
594 | .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ |
|
594 | .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ | |
595 | .kp { color: #008000 } /* Keyword.Pseudo */ |
|
595 | .kp { color: #008000 } /* Keyword.Pseudo */ | |
596 | .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ |
|
596 | .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ | |
597 | .kt { color: #B00040 } /* Keyword.Type */ |
|
597 | .kt { color: #B00040 } /* Keyword.Type */ | |
598 | .m { color: #666666 } /* Literal.Number */ |
|
598 | .m { color: #666666 } /* Literal.Number */ | |
599 | .s { color: #BA2121 } /* Literal.String */ |
|
599 | .s { color: #BA2121 } /* Literal.String */ | |
600 | .na { color: #7D9029 } /* Name.Attribute */ |
|
600 | .na { color: #7D9029 } /* Name.Attribute */ | |
601 | .nb { color: #008000 } /* Name.Builtin */ |
|
601 | .nb { color: #008000 } /* Name.Builtin */ | |
602 | .nc { color: #0000FF; font-weight: bold } /* Name.Class */ |
|
602 | .nc { color: #0000FF; font-weight: bold } /* Name.Class */ | |
603 | .no { color: #880000 } /* Name.Constant */ |
|
603 | .no { color: #880000 } /* Name.Constant */ | |
604 | .nd { color: #AA22FF } /* Name.Decorator */ |
|
604 | .nd { color: #AA22FF } /* Name.Decorator */ | |
605 | .ni { color: #999999; font-weight: bold } /* Name.Entity */ |
|
605 | .ni { color: #999999; font-weight: bold } /* Name.Entity */ | |
606 | .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ |
|
606 | .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ | |
607 | .nf { color: #0000FF } /* Name.Function */ |
|
607 | .nf { color: #0000FF } /* Name.Function */ | |
608 | .nl { color: #A0A000 } /* Name.Label */ |
|
608 | .nl { color: #A0A000 } /* Name.Label */ | |
609 | .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ |
|
609 | .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ | |
610 | .nt { color: #008000; font-weight: bold } /* Name.Tag */ |
|
610 | .nt { color: #008000; font-weight: bold } /* Name.Tag */ | |
611 | .nv { color: #19177C } /* Name.Variable */ |
|
611 | .nv { color: #19177C } /* Name.Variable */ | |
612 | .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ |
|
612 | .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ | |
613 | .w { color: #bbbbbb } /* Text.Whitespace */ |
|
613 | .w { color: #bbbbbb } /* Text.Whitespace */ | |
614 | .mf { color: #666666 } /* Literal.Number.Float */ |
|
614 | .mf { color: #666666 } /* Literal.Number.Float */ | |
615 | .mh { color: #666666 } /* Literal.Number.Hex */ |
|
615 | .mh { color: #666666 } /* Literal.Number.Hex */ | |
616 | .mi { color: #666666 } /* Literal.Number.Integer */ |
|
616 | .mi { color: #666666 } /* Literal.Number.Integer */ | |
617 | .mo { color: #666666 } /* Literal.Number.Oct */ |
|
617 | .mo { color: #666666 } /* Literal.Number.Oct */ | |
618 | .sb { color: #BA2121 } /* Literal.String.Backtick */ |
|
618 | .sb { color: #BA2121 } /* Literal.String.Backtick */ | |
619 | .sc { color: #BA2121 } /* Literal.String.Char */ |
|
619 | .sc { color: #BA2121 } /* Literal.String.Char */ | |
620 | .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ |
|
620 | .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ | |
621 | .s2 { color: #BA2121 } /* Literal.String.Double */ |
|
621 | .s2 { color: #BA2121 } /* Literal.String.Double */ | |
622 | .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ |
|
622 | .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ | |
623 | .sh { color: #BA2121 } /* Literal.String.Heredoc */ |
|
623 | .sh { color: #BA2121 } /* Literal.String.Heredoc */ | |
624 | .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ |
|
624 | .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ | |
625 | .sx { color: #008000 } /* Literal.String.Other */ |
|
625 | .sx { color: #008000 } /* Literal.String.Other */ | |
626 | .sr { color: #BB6688 } /* Literal.String.Regex */ |
|
626 | .sr { color: #BB6688 } /* Literal.String.Regex */ | |
627 | .s1 { color: #BA2121 } /* Literal.String.Single */ |
|
627 | .s1 { color: #BA2121 } /* Literal.String.Single */ | |
628 | .ss { color: #19177C } /* Literal.String.Symbol */ |
|
628 | .ss { color: #19177C } /* Literal.String.Symbol */ | |
629 | .bp { color: #008000 } /* Name.Builtin.Pseudo */ |
|
629 | .bp { color: #008000 } /* Name.Builtin.Pseudo */ | |
630 | .vc { color: #19177C } /* Name.Variable.Class */ |
|
630 | .vc { color: #19177C } /* Name.Variable.Class */ | |
631 | .vg { color: #19177C } /* Name.Variable.Global */ |
|
631 | .vg { color: #19177C } /* Name.Variable.Global */ | |
632 | .vi { color: #19177C } /* Name.Variable.Instance */ |
|
632 | .vi { color: #19177C } /* Name.Variable.Instance */ | |
633 | .il { color: #666666 } /* Literal.Number.Integer.Long */ |
|
633 | .il { color: #666666 } /* Literal.Number.Integer.Long */ | |
634 | } |
|
634 | } | |
635 |
|
635 | |||
636 | /* customized pre blocks for markdown/rst */ |
|
636 | /* customized pre blocks for markdown/rst */ | |
637 | pre.literal-block, .codehilite pre{ |
|
637 | pre.literal-block, .codehilite pre{ | |
638 | padding: @padding; |
|
638 | padding: @padding; | |
639 | border: 1px solid @grey6; |
|
639 | border: 1px solid @grey6; | |
640 | .border-radius(@border-radius); |
|
640 | .border-radius(@border-radius); | |
641 | background-color: @grey7; |
|
641 | background-color: @grey7; | |
642 | } |
|
642 | } | |
643 |
|
643 | |||
644 |
|
644 | |||
645 | /* START NEW CODE BLOCK CSS */ |
|
645 | /* START NEW CODE BLOCK CSS */ | |
646 |
|
646 | |||
647 | @cb-line-height: 18px; |
|
647 | @cb-line-height: 18px; | |
648 | @cb-line-code-padding: 10px; |
|
648 | @cb-line-code-padding: 10px; | |
649 | @cb-text-padding: 5px; |
|
649 | @cb-text-padding: 5px; | |
650 |
|
650 | |||
651 |
@ |
|
651 | @pill-padding: 2px 7px; | |
652 |
|
652 | |||
653 | input.diff-collapse-state { |
|
653 | input.filediff-collapse-state { | |
654 | display: none; |
|
654 | display: none; | |
655 |
|
655 | |||
656 | &:checked + .diff { /* file diff is collapsed */ |
|
656 | &:checked + .filediff { /* file diff is collapsed */ | |
657 | .cb { |
|
657 | .cb { | |
658 | display: none |
|
658 | display: none | |
659 | } |
|
659 | } | |
660 | .diff-collapse-indicator { |
|
660 | .filediff-collapse-indicator { | |
661 | border-width: 9px 0 9px 15.6px; |
|
661 | border-width: 9px 0 9px 15.6px; | |
662 | border-color: transparent transparent transparent #ccc; |
|
662 | border-color: transparent transparent transparent #ccc; | |
663 | } |
|
663 | } | |
664 | .diff-menu { |
|
664 | .filediff-menu { | |
665 | display: none; |
|
665 | display: none; | |
666 | } |
|
666 | } | |
667 | margin: -1px 0 0 0; |
|
667 | margin: -1px 0 0 0; | |
668 | } |
|
668 | } | |
669 |
|
669 | |||
670 | &+ .diff { /* file diff is expanded */ |
|
670 | &+ .filediff { /* file diff is expanded */ | |
671 | .diff-collapse-indicator { |
|
671 | .filediff-collapse-indicator { | |
672 | border-width: 15.6px 9px 0 9px; |
|
672 | border-width: 15.6px 9px 0 9px; | |
673 | border-color: #ccc transparent transparent transparent; |
|
673 | border-color: #ccc transparent transparent transparent; | |
674 | } |
|
674 | } | |
675 | .diff-menu { |
|
675 | .filediff-menu { | |
676 | display: block; |
|
676 | display: block; | |
677 | } |
|
677 | } | |
678 | margin: 20px 0; |
|
678 | margin: 20px 0; | |
679 | } |
|
679 | } | |
680 | } |
|
680 | } | |
681 | .diff { |
|
681 | .filediff { | |
682 | border: 1px solid @grey5; |
|
682 | border: 1px solid @grey5; | |
683 |
|
683 | |||
684 | /* START OVERRIDES */ |
|
684 | /* START OVERRIDES */ | |
685 | .code-highlight { |
|
685 | .code-highlight { | |
686 | border: none; // TODO: remove this border from the global |
|
686 | border: none; // TODO: remove this border from the global | |
687 | // .code-highlight, it doesn't belong there |
|
687 | // .code-highlight, it doesn't belong there | |
688 | } |
|
688 | } | |
689 | label { |
|
689 | label { | |
690 | margin: 0; // TODO: remove this margin definition from global label |
|
690 | margin: 0; // TODO: remove this margin definition from global label | |
691 | // it doesn't belong there - if margin on labels |
|
691 | // it doesn't belong there - if margin on labels | |
692 | // are needed for a form they should be defined |
|
692 | // are needed for a form they should be defined | |
693 | // in the form's class |
|
693 | // in the form's class | |
694 | } |
|
694 | } | |
695 | /* END OVERRIDES */ |
|
695 | /* END OVERRIDES */ | |
696 |
|
696 | |||
697 | * { |
|
697 | * { | |
698 | box-sizing: border-box; |
|
698 | box-sizing: border-box; | |
699 | } |
|
699 | } | |
700 | .diff-anchor { |
|
700 | .filediff-anchor { | |
701 | visibility: hidden; |
|
701 | visibility: hidden; | |
702 | } |
|
702 | } | |
703 | &:hover { |
|
703 | &:hover { | |
704 | .diff-anchor { |
|
704 | .filediff-anchor { | |
705 | visibility: visible; |
|
705 | visibility: visible; | |
706 | } |
|
706 | } | |
707 | } |
|
707 | } | |
708 |
|
708 | |||
709 | .diff-collapse-indicator { |
|
709 | .filediff-collapse-indicator { | |
710 | width: 0; |
|
710 | width: 0; | |
711 | height: 0; |
|
711 | height: 0; | |
712 | border-style: solid; |
|
712 | border-style: solid; | |
713 | float: left; |
|
713 | float: left; | |
714 | margin: 2px 2px 0 0; |
|
714 | margin: 2px 2px 0 0; | |
715 | cursor: pointer; |
|
715 | cursor: pointer; | |
716 | } |
|
716 | } | |
717 |
|
717 | |||
718 | .diff-heading { |
|
718 | .filediff-heading { | |
719 | background: @grey7; |
|
719 | background: @grey7; | |
720 | cursor: pointer; |
|
720 | cursor: pointer; | |
721 | display: block; |
|
721 | display: block; | |
722 | padding: 5px 10px; |
|
722 | padding: 5px 10px; | |
723 | } |
|
723 | } | |
724 | .diff-heading:after { |
|
724 | .filediff-heading:after { | |
725 | content: ""; |
|
725 | content: ""; | |
726 | display: table; |
|
726 | display: table; | |
727 | clear: both; |
|
727 | clear: both; | |
728 | } |
|
728 | } | |
729 | .diff-heading:hover { |
|
729 | .filediff-heading:hover { | |
730 | background: #e1e9f4 !important; |
|
730 | background: #e1e9f4 !important; | |
731 | } |
|
731 | } | |
732 |
|
732 | |||
733 | .diff-menu { |
|
733 | .filediff-menu { | |
734 | float: right; |
|
734 | float: right; | |
735 |
|
735 | |||
736 | a, span { |
|
736 | a, span { | |
737 | padding: 5px; |
|
737 | padding: 5px; | |
738 | display: block; |
|
738 | display: block; | |
739 | float: left |
|
739 | float: left | |
740 | } |
|
740 | } | |
741 | } |
|
741 | } | |
742 |
. |
|
742 | .pill { | |
743 | display: block; |
|
743 | display: block; | |
744 | float: left; |
|
744 | float: left; | |
745 |
padding: @ |
|
745 | padding: @pill-padding; | |
746 | } |
|
746 | } | |
747 |
. |
|
747 | .pill-group { | |
748 |
. |
|
748 | .pill { | |
749 | opacity: .8; |
|
749 | opacity: .8; | |
750 | &:first-child { |
|
750 | &:first-child { | |
751 | border-radius: @border-radius 0 0 @border-radius; |
|
751 | border-radius: @border-radius 0 0 @border-radius; | |
752 | } |
|
752 | } | |
753 | &:last-child { |
|
753 | &:last-child { | |
754 | border-radius: 0 @border-radius @border-radius 0; |
|
754 | border-radius: 0 @border-radius @border-radius 0; | |
755 | } |
|
755 | } | |
756 | &:only-child { |
|
756 | &:only-child { | |
757 | border-radius: @border-radius; |
|
757 | border-radius: @border-radius; | |
758 | } |
|
758 | } | |
759 | } |
|
759 | } | |
760 | } |
|
760 | } | |
761 |
. |
|
761 | .pill { | |
762 | &[op="name"] { |
|
762 | &[op="name"] { | |
763 | background: none; |
|
763 | background: none; | |
764 | color: @grey2; |
|
764 | color: @grey2; | |
765 | opacity: 1; |
|
765 | opacity: 1; | |
766 | color: white; |
|
766 | color: white; | |
767 | } |
|
767 | } | |
768 | &[op="limited"] { |
|
768 | &[op="limited"] { | |
769 | background: @grey2; |
|
769 | background: @grey2; | |
770 | color: white; |
|
770 | color: white; | |
771 | } |
|
771 | } | |
772 | &[op="binary"] { |
|
772 | &[op="binary"] { | |
773 | background: @color7; |
|
773 | background: @color7; | |
774 | color: white; |
|
774 | color: white; | |
775 | } |
|
775 | } | |
776 | &[op="modified"] { |
|
776 | &[op="modified"] { | |
777 | background: @alert1; |
|
777 | background: @alert1; | |
778 | color: white; |
|
778 | color: white; | |
779 | } |
|
779 | } | |
780 | &[op="renamed"] { |
|
780 | &[op="renamed"] { | |
781 | background: @color4; |
|
781 | background: @color4; | |
782 | color: white; |
|
782 | color: white; | |
783 | } |
|
783 | } | |
784 | &[op="mode"] { |
|
784 | &[op="mode"] { | |
785 | background: @grey3; |
|
785 | background: @grey3; | |
786 | color: white; |
|
786 | color: white; | |
787 | } |
|
787 | } | |
788 | &[op="symlink"] { |
|
788 | &[op="symlink"] { | |
789 | background: @color8; |
|
789 | background: @color8; | |
790 | color: white; |
|
790 | color: white; | |
791 | } |
|
791 | } | |
792 |
|
792 | |||
793 | &[op="added"] { /* added lines */ |
|
793 | &[op="added"] { /* added lines */ | |
794 | background: @alert1; |
|
794 | background: @alert1; | |
795 | color: white; |
|
795 | color: white; | |
796 | } |
|
796 | } | |
797 | &[op="deleted"] { /* deleted lines */ |
|
797 | &[op="deleted"] { /* deleted lines */ | |
798 | background: @alert2; |
|
798 | background: @alert2; | |
799 | color: white; |
|
799 | color: white; | |
800 | } |
|
800 | } | |
801 |
|
801 | |||
802 | &[op="created"] { /* created file */ |
|
802 | &[op="created"] { /* created file */ | |
803 | background: @alert1; |
|
803 | background: @alert1; | |
804 | color: white; |
|
804 | color: white; | |
805 | } |
|
805 | } | |
806 | &[op="removed"] { /* deleted file */ |
|
806 | &[op="removed"] { /* deleted file */ | |
807 | background: @color5; |
|
807 | background: @color5; | |
808 | color: white; |
|
808 | color: white; | |
809 | } |
|
809 | } | |
810 | } |
|
810 | } | |
811 |
|
811 | |||
812 | .diff-collapse-button, .diff-expand-button { |
|
812 | .filediff-collapse-button, .filediff-expand-button { | |
813 | cursor: pointer; |
|
813 | cursor: pointer; | |
814 | } |
|
814 | } | |
815 | .diff-collapse-button { |
|
815 | .filediff-collapse-button { | |
816 | display: inline; |
|
816 | display: inline; | |
817 | } |
|
817 | } | |
818 | .diff-expand-button { |
|
818 | .filediff-expand-button { | |
819 | display: none; |
|
819 | display: none; | |
820 | } |
|
820 | } | |
821 | .diff-collapsed .diff-collapse-button { |
|
821 | .filediff-collapsed .filediff-collapse-button { | |
822 | display: none; |
|
822 | display: none; | |
823 | } |
|
823 | } | |
824 | .diff-collapsed .diff-expand-button { |
|
824 | .filediff-collapsed .filediff-expand-button { | |
825 | display: inline; |
|
825 | display: inline; | |
826 | } |
|
826 | } | |
827 | } |
|
827 | } | |
828 | table.cb { |
|
828 | table.cb { | |
829 | width: 100%; |
|
829 | width: 100%; | |
830 | border-collapse: collapse; |
|
830 | border-collapse: collapse; | |
831 |
|
831 | |||
832 | .cb-text { |
|
832 | .cb-text { | |
833 | padding: @cb-text-padding; |
|
833 | padding: @cb-text-padding; | |
834 | } |
|
834 | } | |
835 | .cb-hunk { |
|
835 | .cb-hunk { | |
836 | padding: @cb-text-padding; |
|
836 | padding: @cb-text-padding; | |
837 | } |
|
837 | } | |
838 | .cb-expand { |
|
838 | .cb-expand { | |
839 | display: none; |
|
839 | display: none; | |
840 | } |
|
840 | } | |
841 | .cb-collapse { |
|
841 | .cb-collapse { | |
842 | display: inline; |
|
842 | display: inline; | |
843 | } |
|
843 | } | |
844 | &.cb-collapsed { |
|
844 | &.cb-collapsed { | |
845 | .cb-line { |
|
845 | .cb-line { | |
846 | display: none; |
|
846 | display: none; | |
847 | } |
|
847 | } | |
848 | .cb-expand { |
|
848 | .cb-expand { | |
849 | display: inline; |
|
849 | display: inline; | |
850 | } |
|
850 | } | |
851 | .cb-collapse { |
|
851 | .cb-collapse { | |
852 | display: none; |
|
852 | display: none; | |
853 | } |
|
853 | } | |
854 | } |
|
854 | } | |
855 |
|
855 | |||
856 | /* intentionally general selector since .cb-line-selected must override it |
|
856 | /* intentionally general selector since .cb-line-selected must override it | |
857 | and they both use !important since the td itself may have a random color |
|
857 | and they both use !important since the td itself may have a random color | |
858 | generated by annotation blocks. TLDR: if you change it, make sure |
|
858 | generated by annotation blocks. TLDR: if you change it, make sure | |
859 | annotated block selection and line selection in file view still work */ |
|
859 | annotated block selection and line selection in file view still work */ | |
860 | .cb-line-fresh .cb-content { |
|
860 | .cb-line-fresh .cb-content { | |
861 | background: white !important; |
|
861 | background: white !important; | |
862 | } |
|
862 | } | |
863 | .cb-warning { |
|
863 | .cb-warning { | |
864 | background: #fff4dd; |
|
864 | background: #fff4dd; | |
865 | } |
|
865 | } | |
866 |
|
866 | |||
867 | &.cb-diff-sideside { |
|
867 | &.cb-diff-sideside { | |
868 | td { |
|
868 | td { | |
869 | &.cb-content { |
|
869 | &.cb-content { | |
870 | width: 50%; |
|
870 | width: 50%; | |
871 | } |
|
871 | } | |
872 | } |
|
872 | } | |
873 | } |
|
873 | } | |
874 |
|
874 | |||
875 | tr { |
|
875 | tr { | |
876 | &.cb-annotate { |
|
876 | &.cb-annotate { | |
877 | border-top: 1px solid #eee; |
|
877 | border-top: 1px solid #eee; | |
878 |
|
878 | |||
879 | &+ .cb-line { |
|
879 | &+ .cb-line { | |
880 | border-top: 1px solid #eee; |
|
880 | border-top: 1px solid #eee; | |
881 | } |
|
881 | } | |
882 |
|
882 | |||
883 | &:first-child { |
|
883 | &:first-child { | |
884 | border-top: none; |
|
884 | border-top: none; | |
885 | &+ .cb-line { |
|
885 | &+ .cb-line { | |
886 | border-top: none; |
|
886 | border-top: none; | |
887 | } |
|
887 | } | |
888 | } |
|
888 | } | |
889 | } |
|
889 | } | |
890 |
|
890 | |||
891 | &.cb-hunk { |
|
891 | &.cb-hunk { | |
892 | font-family: @font-family-monospace; |
|
892 | font-family: @font-family-monospace; | |
893 | color: rgba(0, 0, 0, 0.3); |
|
893 | color: rgba(0, 0, 0, 0.3); | |
894 |
|
894 | |||
895 | td { |
|
895 | td { | |
896 | &:first-child { |
|
896 | &:first-child { | |
897 | background: #edf2f9; |
|
897 | background: #edf2f9; | |
898 | } |
|
898 | } | |
899 | &:last-child { |
|
899 | &:last-child { | |
900 | background: #f4f7fb; |
|
900 | background: #f4f7fb; | |
901 | } |
|
901 | } | |
902 | } |
|
902 | } | |
903 | } |
|
903 | } | |
904 | } |
|
904 | } | |
905 |
|
905 | |||
906 | td { |
|
906 | td { | |
907 | vertical-align: top; |
|
907 | vertical-align: top; | |
908 | padding: 0; |
|
908 | padding: 0; | |
909 |
|
909 | |||
910 | &.cb-content { |
|
910 | &.cb-content { | |
911 | font-size: 12.35px; |
|
911 | font-size: 12.35px; | |
912 |
|
912 | |||
913 | &.cb-line-selected .cb-code { |
|
913 | &.cb-line-selected .cb-code { | |
914 | background: @comment-highlight-color !important; |
|
914 | background: @comment-highlight-color !important; | |
915 | } |
|
915 | } | |
916 |
|
916 | |||
917 | span.cb-code { |
|
917 | span.cb-code { | |
918 | line-height: @cb-line-height; |
|
918 | line-height: @cb-line-height; | |
919 | padding-left: @cb-line-code-padding; |
|
919 | padding-left: @cb-line-code-padding; | |
920 | padding-right: @cb-line-code-padding; |
|
920 | padding-right: @cb-line-code-padding; | |
921 | display: block; |
|
921 | display: block; | |
922 | white-space: pre-wrap; |
|
922 | white-space: pre-wrap; | |
923 | font-family: @font-family-monospace; |
|
923 | font-family: @font-family-monospace; | |
924 | word-break: break-word; |
|
924 | word-break: break-word; | |
925 | } |
|
925 | } | |
926 | } |
|
926 | } | |
927 |
|
927 | |||
928 | &.cb-lineno { |
|
928 | &.cb-lineno { | |
929 | padding: 0; |
|
929 | padding: 0; | |
930 | width: 50px; |
|
930 | width: 50px; | |
931 | color: rgba(0, 0, 0, 0.3); |
|
931 | color: rgba(0, 0, 0, 0.3); | |
932 | text-align: right; |
|
932 | text-align: right; | |
933 | border-right: 1px solid #eee; |
|
933 | border-right: 1px solid #eee; | |
934 | font-family: @font-family-monospace; |
|
934 | font-family: @font-family-monospace; | |
935 |
|
935 | |||
936 | a::before { |
|
936 | a::before { | |
937 | content: attr(data-line-no); |
|
937 | content: attr(data-line-no); | |
938 | } |
|
938 | } | |
939 | &.cb-line-selected a { |
|
939 | &.cb-line-selected a { | |
940 | background: @comment-highlight-color !important; |
|
940 | background: @comment-highlight-color !important; | |
941 | } |
|
941 | } | |
942 |
|
942 | |||
943 | a { |
|
943 | a { | |
944 | display: block; |
|
944 | display: block; | |
945 | padding-right: @cb-line-code-padding; |
|
945 | padding-right: @cb-line-code-padding; | |
946 | padding-left: @cb-line-code-padding; |
|
946 | padding-left: @cb-line-code-padding; | |
947 | line-height: @cb-line-height; |
|
947 | line-height: @cb-line-height; | |
948 | color: rgba(0, 0, 0, 0.3); |
|
948 | color: rgba(0, 0, 0, 0.3); | |
949 | } |
|
949 | } | |
950 | } |
|
950 | } | |
951 |
|
951 | |||
952 | &.cb-empty { |
|
952 | &.cb-empty { | |
953 | background: @grey7; |
|
953 | background: @grey7; | |
954 | } |
|
954 | } | |
955 |
|
955 | |||
956 | ins { |
|
956 | ins { | |
957 | color: black; |
|
957 | color: black; | |
958 | background: #a6f3a6; |
|
958 | background: #a6f3a6; | |
959 | text-decoration: none; |
|
959 | text-decoration: none; | |
960 | } |
|
960 | } | |
961 | del { |
|
961 | del { | |
962 | color: black; |
|
962 | color: black; | |
963 | background: #f8cbcb; |
|
963 | background: #f8cbcb; | |
964 | text-decoration: none; |
|
964 | text-decoration: none; | |
965 | } |
|
965 | } | |
966 | &.cb-addition { |
|
966 | &.cb-addition { | |
967 | background: #ecffec; |
|
967 | background: #ecffec; | |
968 |
|
968 | |||
969 | &.blob-lineno { |
|
969 | &.blob-lineno { | |
970 | background: #ddffdd; |
|
970 | background: #ddffdd; | |
971 | } |
|
971 | } | |
972 | } |
|
972 | } | |
973 | &.cb-deletion { |
|
973 | &.cb-deletion { | |
974 | background: #ffecec; |
|
974 | background: #ffecec; | |
975 |
|
975 | |||
976 | &.blob-lineno { |
|
976 | &.blob-lineno { | |
977 | background: #ffdddd; |
|
977 | background: #ffdddd; | |
978 | } |
|
978 | } | |
979 | } |
|
979 | } | |
980 |
|
980 | |||
981 | &.cb-annotate-info { |
|
981 | &.cb-annotate-info { | |
982 | width: 320px; |
|
982 | width: 320px; | |
983 | min-width: 320px; |
|
983 | min-width: 320px; | |
984 | max-width: 320px; |
|
984 | max-width: 320px; | |
985 | padding: 5px 2px; |
|
985 | padding: 5px 2px; | |
986 | font-size: 13px; |
|
986 | font-size: 13px; | |
987 |
|
987 | |||
988 | strong.cb-annotate-message { |
|
988 | strong.cb-annotate-message { | |
989 | padding: 5px 0; |
|
989 | padding: 5px 0; | |
990 | white-space: pre-line; |
|
990 | white-space: pre-line; | |
991 | display: inline-block; |
|
991 | display: inline-block; | |
992 | } |
|
992 | } | |
993 | .rc-user { |
|
993 | .rc-user { | |
994 | float: none; |
|
994 | float: none; | |
995 | padding: 0 6px 0 17px; |
|
995 | padding: 0 6px 0 17px; | |
996 | min-width: auto; |
|
996 | min-width: auto; | |
997 | min-height: auto; |
|
997 | min-height: auto; | |
998 | } |
|
998 | } | |
999 | } |
|
999 | } | |
1000 |
|
1000 | |||
1001 | &.cb-annotate-revision { |
|
1001 | &.cb-annotate-revision { | |
1002 | cursor: pointer; |
|
1002 | cursor: pointer; | |
1003 | text-align: right; |
|
1003 | text-align: right; | |
1004 | } |
|
1004 | } | |
1005 | } |
|
1005 | } | |
1006 | } |
|
1006 | } |
@@ -1,412 +1,412 b'' | |||||
1 | <%def name="diff_line_anchor(filename, line, type)"><% |
|
1 | <%def name="diff_line_anchor(filename, line, type)"><% | |
2 | return '%s_%s_%i' % (h.safeid(filename), type, line) |
|
2 | return '%s_%s_%i' % (h.safeid(filename), type, line) | |
3 | %></%def> |
|
3 | %></%def> | |
4 |
|
4 | |||
5 | <%def name="action_class(action)"><% |
|
5 | <%def name="action_class(action)"><% | |
6 | return { |
|
6 | return { | |
7 | '-': 'cb-deletion', |
|
7 | '-': 'cb-deletion', | |
8 | '+': 'cb-addition', |
|
8 | '+': 'cb-addition', | |
9 | ' ': 'cb-context', |
|
9 | ' ': 'cb-context', | |
10 | }.get(action, 'cb-empty') |
|
10 | }.get(action, 'cb-empty') | |
11 | %></%def> |
|
11 | %></%def> | |
12 |
|
12 | |||
13 | <%def name="op_class(op_id)"><% |
|
13 | <%def name="op_class(op_id)"><% | |
14 | return { |
|
14 | return { | |
15 | DEL_FILENODE: 'deletion', # file deleted |
|
15 | DEL_FILENODE: 'deletion', # file deleted | |
16 | BIN_FILENODE: 'warning' # binary diff hidden |
|
16 | BIN_FILENODE: 'warning' # binary diff hidden | |
17 | }.get(op_id, 'addition') |
|
17 | }.get(op_id, 'addition') | |
18 | %></%def> |
|
18 | %></%def> | |
19 |
|
19 | |||
20 | <%def name="link_for(**kw)"><% |
|
20 | <%def name="link_for(**kw)"><% | |
21 | new_args = request.GET.mixed() |
|
21 | new_args = request.GET.mixed() | |
22 | new_args.update(kw) |
|
22 | new_args.update(kw) | |
23 | return h.url('', **new_args) |
|
23 | return h.url('', **new_args) | |
24 | %></%def> |
|
24 | %></%def> | |
25 |
|
25 | |||
26 | <%def name="render_diffset(diffset, commit_id=None, |
|
26 | <%def name="render_diffset(diffset, commit_id=None, | |
27 |
|
27 | |||
28 | # collapse all file diff entries when there are more than this amount of files in the diff |
|
28 | # collapse all file diff entries when there are more than this amount of files in the diff | |
29 | collapse_when_files_over=20, |
|
29 | collapse_when_files_over=20, | |
30 |
|
30 | |||
31 | # collapse lines in the diff when more than this amount of lines changed in the file diff |
|
31 | # collapse lines in the diff when more than this amount of lines changed in the file diff | |
32 | lines_changed_limit=500, |
|
32 | lines_changed_limit=500, | |
33 |
|
33 | |||
34 | # add a ruler at to the output |
|
34 | # add a ruler at to the output | |
35 | ruler_at_chars=0, |
|
35 | ruler_at_chars=0, | |
36 | )"> |
|
36 | )"> | |
37 | <% |
|
37 | <% | |
38 | # TODO: dan: move this to an argument - and set a cookie so that it is saved |
|
38 | # TODO: dan: move this to an argument - and set a cookie so that it is saved | |
39 | # default option for future requests |
|
39 | # default option for future requests | |
40 | diff_mode = request.GET.get('diffmode', 'sideside') |
|
40 | diff_mode = request.GET.get('diffmode', 'sideside') | |
41 | if diff_mode not in ('sideside', 'unified'): |
|
41 | if diff_mode not in ('sideside', 'unified'): | |
42 | diff_mode = 'sideside' |
|
42 | diff_mode = 'sideside' | |
43 |
|
43 | |||
44 | collapse_all = len(diffset.files) > collapse_when_files_over |
|
44 | collapse_all = len(diffset.files) > collapse_when_files_over | |
45 | %> |
|
45 | %> | |
46 |
|
46 | |||
47 | %if diff_mode == 'sideside': |
|
47 | %if diff_mode == 'sideside': | |
48 | <style> |
|
48 | <style> | |
49 | .wrapper { |
|
49 | .wrapper { | |
50 | max-width: 1600px !important; |
|
50 | max-width: 1600px !important; | |
51 | } |
|
51 | } | |
52 | </style> |
|
52 | </style> | |
53 | %endif |
|
53 | %endif | |
54 | %if ruler_at_chars: |
|
54 | %if ruler_at_chars: | |
55 | <style> |
|
55 | <style> | |
56 | .diff table.cb .cb-content:after { |
|
56 | .diff table.cb .cb-content:after { | |
57 | content: ""; |
|
57 | content: ""; | |
58 | border-left: 1px solid blue; |
|
58 | border-left: 1px solid blue; | |
59 | position: absolute; |
|
59 | position: absolute; | |
60 | top: 0; |
|
60 | top: 0; | |
61 | height: 18px; |
|
61 | height: 18px; | |
62 | opacity: .2; |
|
62 | opacity: .2; | |
63 | z-index: 10; |
|
63 | z-index: 10; | |
64 | ## +5 to account for diff action (+/-) |
|
64 | ## +5 to account for diff action (+/-) | |
65 | left: ${ruler_at_chars + 5}ch; |
|
65 | left: ${ruler_at_chars + 5}ch; | |
66 | </style> |
|
66 | </style> | |
67 | %endif |
|
67 | %endif | |
68 | % if diffset.limited_diff: |
|
68 | % if diffset.limited_diff: | |
69 | <div class="alert alert-warning"> |
|
69 | <div class="alert alert-warning"> | |
70 | ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
70 | ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> | |
71 | </div> |
|
71 | </div> | |
72 | % endif |
|
72 | % endif | |
73 |
|
73 | |||
74 |
<div class=" |
|
74 | <div class="diffset"> | |
75 |
<div class=" |
|
75 | <div class="diffset-heading"> | |
76 | %if diffset.files: |
|
76 | %if diffset.files: | |
77 | <div class="pull-right"> |
|
77 | <div class="pull-right"> | |
78 | <div class="btn-group"> |
|
78 | <div class="btn-group"> | |
79 | <a |
|
79 | <a | |
80 | class="btn ${diff_mode == 'sideside' and 'btn-primary'} tooltip" |
|
80 | class="btn ${diff_mode == 'sideside' and 'btn-primary'} tooltip" | |
81 | title="${_('View side by side')}" |
|
81 | title="${_('View side by side')}" | |
82 | href="${link_for(diffmode='sideside')}"> |
|
82 | href="${link_for(diffmode='sideside')}"> | |
83 | <span>${_('Side by Side')}</span> |
|
83 | <span>${_('Side by Side')}</span> | |
84 | </a> |
|
84 | </a> | |
85 | <a |
|
85 | <a | |
86 | class="btn ${diff_mode == 'unified' and 'btn-primary'} tooltip" |
|
86 | class="btn ${diff_mode == 'unified' and 'btn-primary'} tooltip" | |
87 | title="${_('View unified')}" href="${link_for(diffmode='unified')}"> |
|
87 | title="${_('View unified')}" href="${link_for(diffmode='unified')}"> | |
88 | <span>${_('Unified')}</span> |
|
88 | <span>${_('Unified')}</span> | |
89 | </a> |
|
89 | </a> | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 | <div class="pull-left"> |
|
92 | <div class="pull-left"> | |
93 | <div class="btn-group"> |
|
93 | <div class="btn-group"> | |
94 | <a |
|
94 | <a | |
95 | class="btn" |
|
95 | class="btn" | |
96 | href="#" |
|
96 | href="#" | |
97 | onclick="$('input[class=diff-collapse-state]').prop('checked', false); return false">${_('Expand All')}</a> |
|
97 | onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All')}</a> | |
98 | <a |
|
98 | <a | |
99 | class="btn" |
|
99 | class="btn" | |
100 | href="#" |
|
100 | href="#" | |
101 | onclick="$('input[class=diff-collapse-state]').prop('checked', true); return false">${_('Collapse All')}</a> |
|
101 | onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All')}</a> | |
102 | </div> |
|
102 | </div> | |
103 | </div> |
|
103 | </div> | |
104 | %endif |
|
104 | %endif | |
105 | <h2 style="padding: 5px; text-align: center;"> |
|
105 | <h2 style="padding: 5px; text-align: center;"> | |
106 | %if diffset.limited_diff: |
|
106 | %if diffset.limited_diff: | |
107 | ${ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files}} |
|
107 | ${ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files}} | |
108 | %else: |
|
108 | %else: | |
109 | ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', |
|
109 | ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', | |
110 | '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}} |
|
110 | '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}} | |
111 | %endif |
|
111 | %endif | |
112 | </h2> |
|
112 | </h2> | |
113 | </div> |
|
113 | </div> | |
114 |
|
114 | |||
115 | %if not diffset.files: |
|
115 | %if not diffset.files: | |
116 | <p class="empty_data">${_('No files')}</p> |
|
116 | <p class="empty_data">${_('No files')}</p> | |
117 | %endif |
|
117 | %endif | |
118 |
|
118 | |||
119 | <div class="filediffs"> |
|
119 | <div class="filediffs"> | |
120 | %for i, filediff in enumerate(diffset.files): |
|
120 | %for i, filediff in enumerate(diffset.files): | |
121 | <% |
|
121 | <% | |
122 | lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted'] |
|
122 | lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted'] | |
123 | over_lines_changed_limit = lines_changed > lines_changed_limit |
|
123 | over_lines_changed_limit = lines_changed > lines_changed_limit | |
124 | %> |
|
124 | %> | |
125 | <input ${collapse_all and 'checked' or ''} class="diff-collapse-state" id="diff-collapse-${id(filediff)}" type="checkbox"> |
|
125 | <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox"> | |
126 | <div |
|
126 | <div | |
127 | class="diff" |
|
127 | class="filediff" | |
128 | data-f-path="${filediff['patch']['filename']}" |
|
128 | data-f-path="${filediff['patch']['filename']}" | |
129 | id="a_${h.FID(commit_id or '', filediff['patch']['filename'])}"> |
|
129 | id="a_${h.FID(commit_id or '', filediff['patch']['filename'])}"> | |
130 | <label for="diff-collapse-${id(filediff)}" class="diff-heading"> |
|
130 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> | |
131 | <div class="diff-collapse-indicator"></div> |
|
131 | <div class="filediff-collapse-indicator"></div> | |
132 | ${diff_ops(filediff)} |
|
132 | ${diff_ops(filediff)} | |
133 | </label> |
|
133 | </label> | |
134 | ${diff_menu(filediff)} |
|
134 | ${diff_menu(filediff)} | |
135 | <table class="cb cb-diff-${diff_mode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> |
|
135 | <table class="cb cb-diff-${diff_mode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}"> | |
136 | %if not filediff.hunks: |
|
136 | %if not filediff.hunks: | |
137 | %for op_id, op_text in filediff['patch']['stats']['ops'].items(): |
|
137 | %for op_id, op_text in filediff['patch']['stats']['ops'].items(): | |
138 | <tr> |
|
138 | <tr> | |
139 | <td class="cb-text cb-${op_class(op_id)}" ${diff_mode == 'unified' and 'colspan=3' or 'colspan=4'}> |
|
139 | <td class="cb-text cb-${op_class(op_id)}" ${diff_mode == 'unified' and 'colspan=3' or 'colspan=4'}> | |
140 | %if op_id == DEL_FILENODE: |
|
140 | %if op_id == DEL_FILENODE: | |
141 | ${_('File was deleted')} |
|
141 | ${_('File was deleted')} | |
142 | %elif op_id == BIN_FILENODE: |
|
142 | %elif op_id == BIN_FILENODE: | |
143 | ${_('Binary file hidden')} |
|
143 | ${_('Binary file hidden')} | |
144 | %else: |
|
144 | %else: | |
145 | ${op_text} |
|
145 | ${op_text} | |
146 | %endif |
|
146 | %endif | |
147 | </td> |
|
147 | </td> | |
148 | </tr> |
|
148 | </tr> | |
149 | %endfor |
|
149 | %endfor | |
150 | %endif |
|
150 | %endif | |
151 | %if over_lines_changed_limit: |
|
151 | %if over_lines_changed_limit: | |
152 | <tr class="cb-warning cb-collapser"> |
|
152 | <tr class="cb-warning cb-collapser"> | |
153 | <td class="cb-text" ${diff_mode == 'unified' and 'colspan=3' or 'colspan=4'}> |
|
153 | <td class="cb-text" ${diff_mode == 'unified' and 'colspan=3' or 'colspan=4'}> | |
154 | ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)} |
|
154 | ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)} | |
155 | <a href="#" class="cb-expand" |
|
155 | <a href="#" class="cb-expand" | |
156 | onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')} |
|
156 | onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')} | |
157 | </a> |
|
157 | </a> | |
158 | <a href="#" class="cb-collapse" |
|
158 | <a href="#" class="cb-collapse" | |
159 | onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')} |
|
159 | onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')} | |
160 | </a> |
|
160 | </a> | |
161 | </td> |
|
161 | </td> | |
162 | </tr> |
|
162 | </tr> | |
163 | %endif |
|
163 | %endif | |
164 | %if filediff.patch['is_limited_diff']: |
|
164 | %if filediff.patch['is_limited_diff']: | |
165 | <tr class="cb-warning cb-collapser"> |
|
165 | <tr class="cb-warning cb-collapser"> | |
166 | <td class="cb-text" ${diff_mode == 'unified' and 'colspan=3' or 'colspan=4'}> |
|
166 | <td class="cb-text" ${diff_mode == 'unified' and 'colspan=3' or 'colspan=4'}> | |
167 | ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> |
|
167 | ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a> | |
168 | </td> |
|
168 | </td> | |
169 | </tr> |
|
169 | </tr> | |
170 | %endif |
|
170 | %endif | |
171 | %for hunk in filediff.hunks: |
|
171 | %for hunk in filediff.hunks: | |
172 | <tr class="cb-hunk"> |
|
172 | <tr class="cb-hunk"> | |
173 | <td ${diff_mode == 'unified' and 'colspan=2' or ''}> |
|
173 | <td ${diff_mode == 'unified' and 'colspan=2' or ''}> | |
174 | ## TODO: dan: add ajax loading of more context here |
|
174 | ## TODO: dan: add ajax loading of more context here | |
175 | ## <a href="#"> |
|
175 | ## <a href="#"> | |
176 | <i class="icon-more"></i> |
|
176 | <i class="icon-more"></i> | |
177 | ## </a> |
|
177 | ## </a> | |
178 | </td> |
|
178 | </td> | |
179 | <td ${diff_mode == 'sideside' and 'colspan=3' or ''}> |
|
179 | <td ${diff_mode == 'sideside' and 'colspan=3' or ''}> | |
180 | @@ |
|
180 | @@ | |
181 | -${hunk.source_start},${hunk.source_length} |
|
181 | -${hunk.source_start},${hunk.source_length} | |
182 | +${hunk.target_start},${hunk.target_length} |
|
182 | +${hunk.target_start},${hunk.target_length} | |
183 | ${hunk.section_header} |
|
183 | ${hunk.section_header} | |
184 | </td> |
|
184 | </td> | |
185 | </tr> |
|
185 | </tr> | |
186 | %if diff_mode == 'unified': |
|
186 | %if diff_mode == 'unified': | |
187 | ${render_hunk_lines_unified(hunk)} |
|
187 | ${render_hunk_lines_unified(hunk)} | |
188 | %elif diff_mode == 'sideside': |
|
188 | %elif diff_mode == 'sideside': | |
189 | ${render_hunk_lines_sideside(hunk)} |
|
189 | ${render_hunk_lines_sideside(hunk)} | |
190 | %else: |
|
190 | %else: | |
191 | <tr class="cb-line"> |
|
191 | <tr class="cb-line"> | |
192 | <td>unknown diff mode</td> |
|
192 | <td>unknown diff mode</td> | |
193 | </tr> |
|
193 | </tr> | |
194 | %endif |
|
194 | %endif | |
195 | %endfor |
|
195 | %endfor | |
196 | </table> |
|
196 | </table> | |
197 | </div> |
|
197 | </div> | |
198 | %endfor |
|
198 | %endfor | |
199 | </div> |
|
199 | </div> | |
200 | </div> |
|
200 | </div> | |
201 | </%def> |
|
201 | </%def> | |
202 |
|
202 | |||
203 | <%def name="diff_ops(filediff)"> |
|
203 | <%def name="diff_ops(filediff)"> | |
204 | <% |
|
204 | <% | |
205 | stats = filediff['patch']['stats'] |
|
205 | stats = filediff['patch']['stats'] | |
206 | from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ |
|
206 | from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ | |
207 | MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE |
|
207 | MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE | |
208 | %> |
|
208 | %> | |
209 |
<span class=" |
|
209 | <span class="pill"> | |
210 | %if filediff.source_file_path and filediff.target_file_path: |
|
210 | %if filediff.source_file_path and filediff.target_file_path: | |
211 | %if filediff.source_file_path != filediff.target_file_path: # file was renamed |
|
211 | %if filediff.source_file_path != filediff.target_file_path: # file was renamed | |
212 | <strong>${filediff.target_file_path}</strong> β¬ <del>${filediff.source_file_path}</del> |
|
212 | <strong>${filediff.target_file_path}</strong> β¬ <del>${filediff.source_file_path}</del> | |
213 | %else: |
|
213 | %else: | |
214 | ## file was modified |
|
214 | ## file was modified | |
215 | <strong>${filediff.source_file_path}</strong> |
|
215 | <strong>${filediff.source_file_path}</strong> | |
216 | %endif |
|
216 | %endif | |
217 | %else: |
|
217 | %else: | |
218 | %if filediff.source_file_path: |
|
218 | %if filediff.source_file_path: | |
219 | ## file was deleted |
|
219 | ## file was deleted | |
220 | <strong>${filediff.source_file_path}</strong> |
|
220 | <strong>${filediff.source_file_path}</strong> | |
221 | %else: |
|
221 | %else: | |
222 | ## file was added |
|
222 | ## file was added | |
223 | <strong>${filediff.target_file_path}</strong> |
|
223 | <strong>${filediff.target_file_path}</strong> | |
224 | %endif |
|
224 | %endif | |
225 | %endif |
|
225 | %endif | |
226 | </span> |
|
226 | </span> | |
227 |
<span class=" |
|
227 | <span class="pill-group" style="float: left"> | |
228 | %if filediff.patch['is_limited_diff']: |
|
228 | %if filediff.patch['is_limited_diff']: | |
229 |
<span class=" |
|
229 | <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span> | |
230 | %endif |
|
230 | %endif | |
231 | %if RENAMED_FILENODE in stats['ops']: |
|
231 | %if RENAMED_FILENODE in stats['ops']: | |
232 |
<span class=" |
|
232 | <span class="pill" op="renamed">renamed</span> | |
233 | %endif |
|
233 | %endif | |
234 |
|
234 | |||
235 | %if NEW_FILENODE in stats['ops']: |
|
235 | %if NEW_FILENODE in stats['ops']: | |
236 |
<span class=" |
|
236 | <span class="pill" op="created">created</span> | |
237 | %if filediff['target_mode'].startswith('120'): |
|
237 | %if filediff['target_mode'].startswith('120'): | |
238 |
<span class=" |
|
238 | <span class="pill" op="symlink">symlink</span> | |
239 | %else: |
|
239 | %else: | |
240 |
<span class=" |
|
240 | <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span> | |
241 | %endif |
|
241 | %endif | |
242 | %endif |
|
242 | %endif | |
243 |
|
243 | |||
244 | %if DEL_FILENODE in stats['ops']: |
|
244 | %if DEL_FILENODE in stats['ops']: | |
245 |
<span class=" |
|
245 | <span class="pill" op="removed">removed</span> | |
246 | %endif |
|
246 | %endif | |
247 |
|
247 | |||
248 | %if CHMOD_FILENODE in stats['ops']: |
|
248 | %if CHMOD_FILENODE in stats['ops']: | |
249 |
<span class=" |
|
249 | <span class="pill" op="mode"> | |
250 | ${nice_mode(filediff['source_mode'])} β‘ ${nice_mode(filediff['target_mode'])} |
|
250 | ${nice_mode(filediff['source_mode'])} β‘ ${nice_mode(filediff['target_mode'])} | |
251 | </span> |
|
251 | </span> | |
252 | %endif |
|
252 | %endif | |
253 | </span> |
|
253 | </span> | |
254 |
|
254 | |||
255 |
<a class=" |
|
255 | <a class="pill filediff-anchor" href="#a_${h.FID(commit_id or '', filediff.patch['filename'])}">ΒΆ</a> | |
256 |
|
256 | |||
257 |
<span class=" |
|
257 | <span class="pill-group" style="float: right"> | |
258 | %if BIN_FILENODE in stats['ops']: |
|
258 | %if BIN_FILENODE in stats['ops']: | |
259 |
<span class=" |
|
259 | <span class="pill" op="binary">binary</span> | |
260 | %if MOD_FILENODE in stats['ops']: |
|
260 | %if MOD_FILENODE in stats['ops']: | |
261 |
<span class=" |
|
261 | <span class="pill" op="modified">modified</span> | |
262 | %endif |
|
262 | %endif | |
263 | %endif |
|
263 | %endif | |
264 | %if stats['added']: |
|
264 | %if stats['added']: | |
265 |
<span class=" |
|
265 | <span class="pill" op="added">+${stats['added']}</span> | |
266 | %endif |
|
266 | %endif | |
267 | %if stats['deleted']: |
|
267 | %if stats['deleted']: | |
268 |
<span class=" |
|
268 | <span class="pill" op="deleted">-${stats['deleted']}</span> | |
269 | %endif |
|
269 | %endif | |
270 | </span> |
|
270 | </span> | |
271 |
|
271 | |||
272 | </%def> |
|
272 | </%def> | |
273 |
|
273 | |||
274 | <%def name="nice_mode(filemode)"> |
|
274 | <%def name="nice_mode(filemode)"> | |
275 | ${filemode.startswith('100') and filemode[3:] or filemode} |
|
275 | ${filemode.startswith('100') and filemode[3:] or filemode} | |
276 | </%def> |
|
276 | </%def> | |
277 |
|
277 | |||
278 | <%def name="diff_menu(filediff)"> |
|
278 | <%def name="diff_menu(filediff)"> | |
279 | <div class="diff-menu"> |
|
279 | <div class="filediff-menu"> | |
280 | %if filediff.diffset.source_ref: |
|
280 | %if filediff.diffset.source_ref: | |
281 | %if filediff.patch['operation'] in ['D', 'M']: |
|
281 | %if filediff.patch['operation'] in ['D', 'M']: | |
282 | <a |
|
282 | <a | |
283 | class="tooltip" |
|
283 | class="tooltip" | |
284 | href="${h.url('files_home',repo_name=c.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}" |
|
284 | href="${h.url('files_home',repo_name=c.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}" | |
285 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
285 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" | |
286 | > |
|
286 | > | |
287 | ${_('Show file before')} |
|
287 | ${_('Show file before')} | |
288 | </a> |
|
288 | </a> | |
289 | %else: |
|
289 | %else: | |
290 | <span |
|
290 | <span | |
291 | class="tooltip" |
|
291 | class="tooltip" | |
292 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" |
|
292 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}" | |
293 | > |
|
293 | > | |
294 | ${_('Show file before')} |
|
294 | ${_('Show file before')} | |
295 | </span> |
|
295 | </span> | |
296 | %endif |
|
296 | %endif | |
297 | %if filediff.patch['operation'] in ['A', 'M']: |
|
297 | %if filediff.patch['operation'] in ['A', 'M']: | |
298 | <a |
|
298 | <a | |
299 | class="tooltip" |
|
299 | class="tooltip" | |
300 | href="${h.url('files_home',repo_name=c.repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}" |
|
300 | href="${h.url('files_home',repo_name=c.repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}" | |
301 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
301 | title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" | |
302 | > |
|
302 | > | |
303 | ${_('Show file after')} |
|
303 | ${_('Show file after')} | |
304 | </a> |
|
304 | </a> | |
305 | %else: |
|
305 | %else: | |
306 | <span |
|
306 | <span | |
307 | class="tooltip" |
|
307 | class="tooltip" | |
308 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" |
|
308 | title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}" | |
309 | > |
|
309 | > | |
310 | ${_('Show file after')} |
|
310 | ${_('Show file after')} | |
311 | </span> |
|
311 | </span> | |
312 | %endif |
|
312 | %endif | |
313 | <a |
|
313 | <a | |
314 | class="tooltip" |
|
314 | class="tooltip" | |
315 | title="${h.tooltip(_('Raw diff'))}" |
|
315 | title="${h.tooltip(_('Raw diff'))}" | |
316 | href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}" |
|
316 | href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}" | |
317 | > |
|
317 | > | |
318 | ${_('Raw diff')} |
|
318 | ${_('Raw diff')} | |
319 | </a> |
|
319 | </a> | |
320 | <a |
|
320 | <a | |
321 | class="tooltip" |
|
321 | class="tooltip" | |
322 | title="${h.tooltip(_('Download diff'))}" |
|
322 | title="${h.tooltip(_('Download diff'))}" | |
323 | href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}" |
|
323 | href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}" | |
324 | > |
|
324 | > | |
325 | ${_('Download diff')} |
|
325 | ${_('Download diff')} | |
326 | </a> |
|
326 | </a> | |
327 | %endif |
|
327 | %endif | |
328 | </div> |
|
328 | </div> | |
329 | </%def> |
|
329 | </%def> | |
330 |
|
330 | |||
331 |
|
331 | |||
332 | <%def name="render_hunk_lines_sideside(hunk)"> |
|
332 | <%def name="render_hunk_lines_sideside(hunk)"> | |
333 | %for i, line in enumerate(hunk.sideside): |
|
333 | %for i, line in enumerate(hunk.sideside): | |
334 | <% |
|
334 | <% | |
335 | old_line_anchor, new_line_anchor = None, None |
|
335 | old_line_anchor, new_line_anchor = None, None | |
336 | if line.original.lineno: |
|
336 | if line.original.lineno: | |
337 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o') |
|
337 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o') | |
338 | if line.modified.lineno: |
|
338 | if line.modified.lineno: | |
339 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n') |
|
339 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n') | |
340 | %> |
|
340 | %> | |
341 | <tr class="cb-line"> |
|
341 | <tr class="cb-line"> | |
342 | <td class="cb-lineno ${action_class(line.original.action)}" |
|
342 | <td class="cb-lineno ${action_class(line.original.action)}" | |
343 | data-line-number="${line.original.lineno}" |
|
343 | data-line-number="${line.original.lineno}" | |
344 | %if old_line_anchor: |
|
344 | %if old_line_anchor: | |
345 | id="${old_line_anchor}" |
|
345 | id="${old_line_anchor}" | |
346 | %endif |
|
346 | %endif | |
347 | > |
|
347 | > | |
348 | %if line.original.lineno: |
|
348 | %if line.original.lineno: | |
349 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a> |
|
349 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a> | |
350 | %endif |
|
350 | %endif | |
351 | </td> |
|
351 | </td> | |
352 | <td class="cb-content ${action_class(line.original.action)}" |
|
352 | <td class="cb-content ${action_class(line.original.action)}" | |
353 | data-line-number="o${line.original.lineno}" |
|
353 | data-line-number="o${line.original.lineno}" | |
354 | ><span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span> |
|
354 | ><span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span> | |
355 | </td> |
|
355 | </td> | |
356 | <td class="cb-lineno ${action_class(line.modified.action)}" |
|
356 | <td class="cb-lineno ${action_class(line.modified.action)}" | |
357 | data-line-number="${line.modified.lineno}" |
|
357 | data-line-number="${line.modified.lineno}" | |
358 | %if new_line_anchor: |
|
358 | %if new_line_anchor: | |
359 | id="${new_line_anchor}" |
|
359 | id="${new_line_anchor}" | |
360 | %endif |
|
360 | %endif | |
361 | > |
|
361 | > | |
362 | %if line.modified.lineno: |
|
362 | %if line.modified.lineno: | |
363 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a> |
|
363 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a> | |
364 | %endif |
|
364 | %endif | |
365 | </td> |
|
365 | </td> | |
366 | <td class="cb-content ${action_class(line.modified.action)}" |
|
366 | <td class="cb-content ${action_class(line.modified.action)}" | |
367 | data-line-number="n${line.modified.lineno}" |
|
367 | data-line-number="n${line.modified.lineno}" | |
368 | > |
|
368 | > | |
369 | <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span> |
|
369 | <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span> | |
370 | </td> |
|
370 | </td> | |
371 | </tr> |
|
371 | </tr> | |
372 | %endfor |
|
372 | %endfor | |
373 | </%def> |
|
373 | </%def> | |
374 |
|
374 | |||
375 |
|
375 | |||
376 | <%def name="render_hunk_lines_unified(hunk)"> |
|
376 | <%def name="render_hunk_lines_unified(hunk)"> | |
377 | %for old_line_no, new_line_no, action, content in hunk.unified: |
|
377 | %for old_line_no, new_line_no, action, content in hunk.unified: | |
378 | <% |
|
378 | <% | |
379 | old_line_anchor, new_line_anchor = None, None |
|
379 | old_line_anchor, new_line_anchor = None, None | |
380 | if old_line_no: |
|
380 | if old_line_no: | |
381 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o') |
|
381 | old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o') | |
382 | if new_line_no: |
|
382 | if new_line_no: | |
383 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n') |
|
383 | new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n') | |
384 | %> |
|
384 | %> | |
385 | <tr class="cb-line"> |
|
385 | <tr class="cb-line"> | |
386 | <td class="cb-lineno ${action_class(action)}" |
|
386 | <td class="cb-lineno ${action_class(action)}" | |
387 | data-line-number="${old_line_no}" |
|
387 | data-line-number="${old_line_no}" | |
388 | %if old_line_anchor: |
|
388 | %if old_line_anchor: | |
389 | id="${old_line_anchor}" |
|
389 | id="${old_line_anchor}" | |
390 | %endif |
|
390 | %endif | |
391 | > |
|
391 | > | |
392 | %if old_line_anchor: |
|
392 | %if old_line_anchor: | |
393 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a> |
|
393 | <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a> | |
394 | %endif |
|
394 | %endif | |
395 | </td> |
|
395 | </td> | |
396 | <td class="cb-lineno ${action_class(action)}" |
|
396 | <td class="cb-lineno ${action_class(action)}" | |
397 | data-line-number="${new_line_no}" |
|
397 | data-line-number="${new_line_no}" | |
398 | %if new_line_anchor: |
|
398 | %if new_line_anchor: | |
399 | id="${new_line_anchor}" |
|
399 | id="${new_line_anchor}" | |
400 | %endif |
|
400 | %endif | |
401 | > |
|
401 | > | |
402 | %if new_line_anchor: |
|
402 | %if new_line_anchor: | |
403 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a> |
|
403 | <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a> | |
404 | %endif |
|
404 | %endif | |
405 | </td> |
|
405 | </td> | |
406 | <td class="cb-content ${action_class(action)}" |
|
406 | <td class="cb-content ${action_class(action)}" | |
407 | data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}" |
|
407 | data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}" | |
408 | ><span class="cb-code">${action} ${content or '' | n}</span> |
|
408 | ><span class="cb-code">${action} ${content or '' | n}</span> | |
409 | </td> |
|
409 | </td> | |
410 | </tr> |
|
410 | </tr> | |
411 | %endfor |
|
411 | %endfor | |
412 | </%def> |
|
412 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now