Show More
@@ -1,755 +1,763 b'' | |||||
1 | // navigation.less |
|
1 | // navigation.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 | // TOP MAIN DARK NAVIGATION |
|
5 | // TOP MAIN DARK NAVIGATION | |
6 |
|
6 | |||
7 | .header .main_nav.horizontal-list { |
|
7 | .header .main_nav.horizontal-list { | |
8 | float: right; |
|
8 | float: right; | |
9 | color: @grey4; |
|
9 | color: @grey4; | |
10 | > li { |
|
10 | > li { | |
11 | a { |
|
11 | a { | |
12 | color: @grey4; |
|
12 | color: @grey4; | |
13 | } |
|
13 | } | |
14 | } |
|
14 | } | |
15 | } |
|
15 | } | |
16 |
|
16 | |||
17 | // HEADER NAVIGATION |
|
17 | // HEADER NAVIGATION | |
18 |
|
18 | |||
19 | .horizontal-list { |
|
19 | .horizontal-list { | |
20 | display: block; |
|
20 | display: block; | |
21 | margin: 0; |
|
21 | margin: 0; | |
22 | padding: 0; |
|
22 | padding: 0; | |
23 | -webkit-padding-start: 0; |
|
23 | -webkit-padding-start: 0; | |
24 | text-align: left; |
|
24 | text-align: left; | |
25 | font-size: @navigation-fontsize; |
|
25 | font-size: @navigation-fontsize; | |
26 | color: @grey6; |
|
26 | color: @grey6; | |
27 | z-index:10; |
|
27 | z-index:10; | |
28 |
|
28 | |||
29 | li { |
|
29 | li { | |
30 | line-height: 1em; |
|
30 | line-height: 1em; | |
31 | list-style-type: none; |
|
31 | list-style-type: none; | |
32 | margin: 0 20px 0 0; |
|
32 | margin: 0 20px 0 0; | |
33 |
|
33 | |||
34 | a { |
|
34 | a { | |
35 | padding: 0 .5em; |
|
35 | padding: 0 .5em; | |
36 |
|
36 | |||
37 | &.menu_link_notifications { |
|
37 | &.menu_link_notifications { | |
38 | .pill(7px,@rcblue); |
|
38 | .pill(7px,@rcblue); | |
39 | display: inline; |
|
39 | display: inline; | |
40 | margin: 0 7px 0 .7em; |
|
40 | margin: 0 7px 0 .7em; | |
41 | font-size: @basefontsize; |
|
41 | font-size: @basefontsize; | |
42 | color: white; |
|
42 | color: white; | |
43 |
|
43 | |||
44 | &.empty { |
|
44 | &.empty { | |
45 | background-color: @grey4; |
|
45 | background-color: @grey4; | |
46 | } |
|
46 | } | |
47 |
|
47 | |||
48 | &:hover { |
|
48 | &:hover { | |
49 | background-color: @rcdarkblue; |
|
49 | background-color: @rcdarkblue; | |
50 | } |
|
50 | } | |
51 | } |
|
51 | } | |
52 | } |
|
52 | } | |
53 | .pill_container { |
|
53 | .pill_container { | |
54 | margin: 1.25em 0px 0px 0px; |
|
54 | margin: 1.25em 0px 0px 0px; | |
55 | float: right; |
|
55 | float: right; | |
56 | } |
|
56 | } | |
57 |
|
57 | |||
58 | &#quick_login_li { |
|
58 | &#quick_login_li { | |
59 | &:hover { |
|
59 | &:hover { | |
60 | color: @grey5; |
|
60 | color: @grey5; | |
61 | } |
|
61 | } | |
62 |
|
62 | |||
63 | a.menu_link_notifications { |
|
63 | a.menu_link_notifications { | |
64 | color: white; |
|
64 | color: white; | |
65 | } |
|
65 | } | |
66 |
|
66 | |||
67 | .user { |
|
67 | .user { | |
68 | padding-bottom: 10px; |
|
68 | padding-bottom: 10px; | |
69 | } |
|
69 | } | |
70 | } |
|
70 | } | |
71 |
|
71 | |||
72 | &:before { content: none; } |
|
72 | &:before { content: none; } | |
73 |
|
73 | |||
74 | &:last-child { |
|
74 | &:last-child { | |
75 | .menulabel { |
|
75 | .menulabel { | |
76 | padding-right: 0; |
|
76 | padding-right: 0; | |
77 | border-right: none; |
|
77 | border-right: none; | |
78 |
|
78 | |||
79 | .show_more { |
|
79 | .show_more { | |
80 | padding-right: 0; |
|
80 | padding-right: 0; | |
81 | } |
|
81 | } | |
82 | } |
|
82 | } | |
83 |
|
83 | |||
84 | &> a { |
|
84 | &> a { | |
85 | border-bottom: none; |
|
85 | border-bottom: none; | |
86 | } |
|
86 | } | |
87 | } |
|
87 | } | |
88 |
|
88 | |||
89 | &.open { |
|
89 | &.open { | |
90 |
|
90 | |||
91 | a { |
|
91 | a { | |
92 | color: white; |
|
92 | color: white; | |
93 | } |
|
93 | } | |
94 | } |
|
94 | } | |
95 |
|
95 | |||
96 | &:focus { |
|
96 | &:focus { | |
97 | outline: none; |
|
97 | outline: none; | |
98 | } |
|
98 | } | |
99 |
|
99 | |||
100 | ul li { |
|
100 | ul li { | |
101 | display: block; |
|
101 | display: block; | |
102 |
|
102 | |||
103 | &:last-child> a { |
|
103 | &:last-child> a { | |
104 | border-bottom: none; |
|
104 | border-bottom: none; | |
105 | } |
|
105 | } | |
106 |
|
106 | |||
107 | ul li:last-child a { |
|
107 | ul li:last-child a { | |
108 | /* we don't expect more then 3 levels of submenu and the third |
|
108 | /* we don't expect more then 3 levels of submenu and the third | |
109 | level can have different html structure */ |
|
109 | level can have different html structure */ | |
110 | border-bottom: none; |
|
110 | border-bottom: none; | |
111 | } |
|
111 | } | |
112 | } |
|
112 | } | |
113 | } |
|
113 | } | |
114 |
|
114 | |||
115 | > li { |
|
115 | > li { | |
116 | float: left; |
|
116 | float: left; | |
117 | display: block; |
|
117 | display: block; | |
118 | padding: 0; |
|
118 | padding: 0; | |
119 |
|
119 | |||
120 | > a, |
|
120 | > a, | |
121 | &.has_select2 a { |
|
121 | &.has_select2 a { | |
122 | display: block; |
|
122 | display: block; | |
123 | padding: 10px 0; |
|
123 | padding: 10px 0; | |
124 | } |
|
124 | } | |
125 |
|
125 | |||
126 | .menulabel { |
|
126 | .menulabel { | |
127 | line-height: 1em; |
|
127 | line-height: 1em; | |
128 | // for this specifically we do not use a variable |
|
128 | // for this specifically we do not use a variable | |
129 | } |
|
129 | } | |
130 |
|
130 | |||
131 | .pr_notifications { |
|
131 | .pr_notifications { | |
132 | padding-left: .5em; |
|
132 | padding-left: .5em; | |
133 | } |
|
133 | } | |
134 |
|
134 | |||
135 | .pr_notifications + .menulabel { |
|
135 | .pr_notifications + .menulabel { | |
136 | display:inline; |
|
136 | display:inline; | |
137 | padding-left: 0; |
|
137 | padding-left: 0; | |
138 | } |
|
138 | } | |
139 |
|
139 | |||
140 | &:hover, |
|
140 | &:hover, | |
141 | &.open, |
|
141 | &.open, | |
142 | &.active { |
|
142 | &.active { | |
143 | a { |
|
143 | a { | |
144 | color: @rcblue; |
|
144 | color: @rcblue; | |
145 | } |
|
145 | } | |
146 | } |
|
146 | } | |
147 | } |
|
147 | } | |
148 |
|
148 | |||
149 | pre { |
|
149 | pre { | |
150 | margin: 0; |
|
150 | margin: 0; | |
151 | padding: 0; |
|
151 | padding: 0; | |
152 | } |
|
152 | } | |
153 |
|
153 | |||
154 | .select2-container, |
|
154 | .select2-container, | |
155 | .menulink.childs { |
|
155 | .menulink.childs { | |
156 | position: relative; |
|
156 | position: relative; | |
157 | } |
|
157 | } | |
158 |
|
158 | |||
|
159 | .menulink { | |||
|
160 | &.disabled { | |||
|
161 | color: @grey3; | |||
|
162 | cursor: default; | |||
|
163 | opacity: 0.5; | |||
|
164 | } | |||
|
165 | } | |||
|
166 | ||||
159 | #quick_login { |
|
167 | #quick_login { | |
160 |
|
168 | |||
161 | li a { |
|
169 | li a { | |
162 | padding: .5em 0; |
|
170 | padding: .5em 0; | |
163 | border-bottom: none; |
|
171 | border-bottom: none; | |
164 | color: @grey2; |
|
172 | color: @grey2; | |
165 |
|
173 | |||
166 | &:hover { color: @grey1; } |
|
174 | &:hover { color: @grey1; } | |
167 | } |
|
175 | } | |
168 | } |
|
176 | } | |
169 |
|
177 | |||
170 | #quick_login_link { |
|
178 | #quick_login_link { | |
171 | display: inline-block; |
|
179 | display: inline-block; | |
172 |
|
180 | |||
173 | .gravatar { |
|
181 | .gravatar { | |
174 | border: 1px solid @grey5; |
|
182 | border: 1px solid @grey5; | |
175 | } |
|
183 | } | |
176 |
|
184 | |||
177 | .gravatar-login { |
|
185 | .gravatar-login { | |
178 | height: 20px; |
|
186 | height: 20px; | |
179 | width: 20px; |
|
187 | width: 20px; | |
180 | margin: -8px 0; |
|
188 | margin: -8px 0; | |
181 | padding: 0; |
|
189 | padding: 0; | |
182 | } |
|
190 | } | |
183 |
|
191 | |||
184 | &:hover .user { |
|
192 | &:hover .user { | |
185 | color: @grey6; |
|
193 | color: @grey6; | |
186 | } |
|
194 | } | |
187 | } |
|
195 | } | |
188 | } |
|
196 | } | |
189 | .header .horizontal-list { |
|
197 | .header .horizontal-list { | |
190 |
|
198 | |||
191 | li { |
|
199 | li { | |
192 |
|
200 | |||
193 | &#quick_login_li { |
|
201 | &#quick_login_li { | |
194 | padding-left: .5em; |
|
202 | padding-left: .5em; | |
195 |
|
203 | |||
196 | &:hover #quick_login_link { |
|
204 | &:hover #quick_login_link { | |
197 | color: inherit; |
|
205 | color: inherit; | |
198 | } |
|
206 | } | |
199 |
|
207 | |||
200 | .menu_link_user { |
|
208 | .menu_link_user { | |
201 | padding: 0 2px; |
|
209 | padding: 0 2px; | |
202 | } |
|
210 | } | |
203 | } |
|
211 | } | |
204 | list-style-type: none; |
|
212 | list-style-type: none; | |
205 | } |
|
213 | } | |
206 |
|
214 | |||
207 | > li { |
|
215 | > li { | |
208 |
|
216 | |||
209 | a { |
|
217 | a { | |
210 | padding: 18px 0 12px 0; |
|
218 | padding: 18px 0 12px 0; | |
211 | color: @nav-grey; |
|
219 | color: @nav-grey; | |
212 |
|
220 | |||
213 | &.menu_link_notifications { |
|
221 | &.menu_link_notifications { | |
214 | padding: 1px 8px; |
|
222 | padding: 1px 8px; | |
215 | } |
|
223 | } | |
216 | } |
|
224 | } | |
217 |
|
225 | |||
218 | &:hover, |
|
226 | &:hover, | |
219 | &.open, |
|
227 | &.open, | |
220 | &.active { |
|
228 | &.active { | |
221 | .pill_container a { |
|
229 | .pill_container a { | |
222 | // don't select text for the pill container, it has it' own |
|
230 | // don't select text for the pill container, it has it' own | |
223 | // hover behaviour |
|
231 | // hover behaviour | |
224 | color: @nav-grey; |
|
232 | color: @nav-grey; | |
225 | } |
|
233 | } | |
226 | } |
|
234 | } | |
227 |
|
235 | |||
228 | &:hover, |
|
236 | &:hover, | |
229 | &.open, |
|
237 | &.open, | |
230 | &.active { |
|
238 | &.active { | |
231 | a { |
|
239 | a { | |
232 | color: @grey6; |
|
240 | color: @grey6; | |
233 | } |
|
241 | } | |
234 | } |
|
242 | } | |
235 |
|
243 | |||
236 | .select2-dropdown-open a { |
|
244 | .select2-dropdown-open a { | |
237 | color: @grey6; |
|
245 | color: @grey6; | |
238 | } |
|
246 | } | |
239 |
|
247 | |||
240 | .repo-switcher { |
|
248 | .repo-switcher { | |
241 | padding-left: 0; |
|
249 | padding-left: 0; | |
242 |
|
250 | |||
243 | .menulabel { |
|
251 | .menulabel { | |
244 | padding-left: 0; |
|
252 | padding-left: 0; | |
245 | } |
|
253 | } | |
246 | } |
|
254 | } | |
247 | } |
|
255 | } | |
248 |
|
256 | |||
249 | li ul li { |
|
257 | li ul li { | |
250 | background-color:@grey2; |
|
258 | background-color:@grey2; | |
251 |
|
259 | |||
252 | a { |
|
260 | a { | |
253 | padding: .5em 0; |
|
261 | padding: .5em 0; | |
254 | border-bottom: @border-thickness solid @border-default-color; |
|
262 | border-bottom: @border-thickness solid @border-default-color; | |
255 | color: @grey6; |
|
263 | color: @grey6; | |
256 | } |
|
264 | } | |
257 |
|
265 | |||
258 | &:last-child a, &.last a{ |
|
266 | &:last-child a, &.last a{ | |
259 | border-bottom: none; |
|
267 | border-bottom: none; | |
260 | } |
|
268 | } | |
261 |
|
269 | |||
262 | &:hover { |
|
270 | &:hover { | |
263 | background-color: @grey3; |
|
271 | background-color: @grey3; | |
264 | } |
|
272 | } | |
265 | } |
|
273 | } | |
266 |
|
274 | |||
267 | .submenu { |
|
275 | .submenu { | |
268 | margin-top: 5px; |
|
276 | margin-top: 5px; | |
269 | } |
|
277 | } | |
270 | } |
|
278 | } | |
271 |
|
279 | |||
272 | // SUBMENUS |
|
280 | // SUBMENUS | |
273 | .navigation .submenu { |
|
281 | .navigation .submenu { | |
274 | display: none; |
|
282 | display: none; | |
275 | } |
|
283 | } | |
276 |
|
284 | |||
277 | .navigation li.open { |
|
285 | .navigation li.open { | |
278 | .submenu { |
|
286 | .submenu { | |
279 | display: block; |
|
287 | display: block; | |
280 | } |
|
288 | } | |
281 | } |
|
289 | } | |
282 |
|
290 | |||
283 | .navigation li:last-child .submenu { |
|
291 | .navigation li:last-child .submenu { | |
284 | right: auto; |
|
292 | right: auto; | |
285 | left: 0; |
|
293 | left: 0; | |
286 | border: 1px solid @grey5; |
|
294 | border: 1px solid @grey5; | |
287 | background: @white; |
|
295 | background: @white; | |
288 | box-shadow: @dropdown-shadow; |
|
296 | box-shadow: @dropdown-shadow; | |
289 | } |
|
297 | } | |
290 |
|
298 | |||
291 | .submenu { |
|
299 | .submenu { | |
292 | position: absolute; |
|
300 | position: absolute; | |
293 | top: 100%; |
|
301 | top: 100%; | |
294 | left: 0; |
|
302 | left: 0; | |
295 | min-width: 180px; |
|
303 | min-width: 180px; | |
296 | margin: 2px 0 0; |
|
304 | margin: 2px 0 0; | |
297 | padding: 0; |
|
305 | padding: 0; | |
298 | text-align: left; |
|
306 | text-align: left; | |
299 | font-family: @text-light; |
|
307 | font-family: @text-light; | |
300 | border-radius: @border-radius; |
|
308 | border-radius: @border-radius; | |
301 | z-index: 20; |
|
309 | z-index: 20; | |
302 |
|
310 | |||
303 | li { |
|
311 | li { | |
304 | display: block; |
|
312 | display: block; | |
305 | margin: 0; |
|
313 | margin: 0; | |
306 | padding: 0 .5em; |
|
314 | padding: 0 .5em; | |
307 | line-height: 1em; |
|
315 | line-height: 1em; | |
308 | color: @grey3; |
|
316 | color: @grey3; | |
309 | background-color: @white; |
|
317 | background-color: @white; | |
310 | list-style-type: none; |
|
318 | list-style-type: none; | |
311 |
|
319 | |||
312 | a { |
|
320 | a { | |
313 | display: block; |
|
321 | display: block; | |
314 | width: 100%; |
|
322 | width: 100%; | |
315 | padding: .5em 0; |
|
323 | padding: .5em 0; | |
316 | border-right: none; |
|
324 | border-right: none; | |
317 | border-bottom: @border-thickness solid white; |
|
325 | border-bottom: @border-thickness solid white; | |
318 | color: @grey3; |
|
326 | color: @grey3; | |
319 | } |
|
327 | } | |
320 |
|
328 | |||
321 | ul { |
|
329 | ul { | |
322 | display: none; |
|
330 | display: none; | |
323 | position: absolute; |
|
331 | position: absolute; | |
324 | top: 0; |
|
332 | top: 0; | |
325 | right: 100%; |
|
333 | right: 100%; | |
326 | padding: 0; |
|
334 | padding: 0; | |
327 | z-index: 30; |
|
335 | z-index: 30; | |
328 | } |
|
336 | } | |
329 | &:hover { |
|
337 | &:hover { | |
330 | background-color: @grey7; |
|
338 | background-color: @grey7; | |
331 | -webkit-transition: background .3s; |
|
339 | -webkit-transition: background .3s; | |
332 | -moz-transition: background .3s; |
|
340 | -moz-transition: background .3s; | |
333 | -o-transition: background .3s; |
|
341 | -o-transition: background .3s; | |
334 | transition: background .3s; |
|
342 | transition: background .3s; | |
335 |
|
343 | |||
336 | ul { |
|
344 | ul { | |
337 | display: block; |
|
345 | display: block; | |
338 | } |
|
346 | } | |
339 | } |
|
347 | } | |
340 | } |
|
348 | } | |
341 |
|
349 | |||
342 | } |
|
350 | } | |
343 |
|
351 | |||
344 |
|
352 | |||
345 |
|
353 | |||
346 |
|
354 | |||
347 | // repo dropdown |
|
355 | // repo dropdown | |
348 | .quick_repo_menu { |
|
356 | .quick_repo_menu { | |
349 | width: 15px; |
|
357 | width: 15px; | |
350 | text-align: center; |
|
358 | text-align: center; | |
351 | position: relative; |
|
359 | position: relative; | |
352 | cursor: pointer; |
|
360 | cursor: pointer; | |
353 |
|
361 | |||
354 | div { |
|
362 | div { | |
355 | overflow: visible !important; |
|
363 | overflow: visible !important; | |
356 | } |
|
364 | } | |
357 |
|
365 | |||
358 | &.sorting { |
|
366 | &.sorting { | |
359 | cursor: auto; |
|
367 | cursor: auto; | |
360 | } |
|
368 | } | |
361 |
|
369 | |||
362 | &:hover { |
|
370 | &:hover { | |
363 | .menu_items_container { |
|
371 | .menu_items_container { | |
364 | position: absolute; |
|
372 | position: absolute; | |
365 | display: block; |
|
373 | display: block; | |
366 | } |
|
374 | } | |
367 | .menu_items { |
|
375 | .menu_items { | |
368 | display: block; |
|
376 | display: block; | |
369 | } |
|
377 | } | |
370 | } |
|
378 | } | |
371 |
|
379 | |||
372 | i { |
|
380 | i { | |
373 | margin: 0; |
|
381 | margin: 0; | |
374 | color: @grey4; |
|
382 | color: @grey4; | |
375 | } |
|
383 | } | |
376 |
|
384 | |||
377 | .menu_items_container { |
|
385 | .menu_items_container { | |
378 | position: absolute; |
|
386 | position: absolute; | |
379 | top: 0; |
|
387 | top: 0; | |
380 | left: 100%; |
|
388 | left: 100%; | |
381 | margin: 0; |
|
389 | margin: 0; | |
382 | padding: 0; |
|
390 | padding: 0; | |
383 | list-style: none; |
|
391 | list-style: none; | |
384 | background-color: @grey6; |
|
392 | background-color: @grey6; | |
385 | z-index: 999; |
|
393 | z-index: 999; | |
386 | text-align: left; |
|
394 | text-align: left; | |
387 |
|
395 | |||
388 | a { |
|
396 | a { | |
389 | color: @grey2; |
|
397 | color: @grey2; | |
390 | } |
|
398 | } | |
391 |
|
399 | |||
392 | ul.menu_items { |
|
400 | ul.menu_items { | |
393 | margin: 0; |
|
401 | margin: 0; | |
394 | padding: 0; |
|
402 | padding: 0; | |
395 | } |
|
403 | } | |
396 |
|
404 | |||
397 | li { |
|
405 | li { | |
398 | margin: 0; |
|
406 | margin: 0; | |
399 | padding: 0; |
|
407 | padding: 0; | |
400 | line-height: 1em; |
|
408 | line-height: 1em; | |
401 | list-style-type: none; |
|
409 | list-style-type: none; | |
402 |
|
410 | |||
403 | a { |
|
411 | a { | |
404 | display: block; |
|
412 | display: block; | |
405 | height: 16px; |
|
413 | height: 16px; | |
406 | padding: 8px; //must add up to td height (28px) |
|
414 | padding: 8px; //must add up to td height (28px) | |
407 | width: 120px; // set width |
|
415 | width: 120px; // set width | |
408 |
|
416 | |||
409 | &:hover { |
|
417 | &:hover { | |
410 | background-color: @grey5; |
|
418 | background-color: @grey5; | |
411 | -webkit-transition: background .3s; |
|
419 | -webkit-transition: background .3s; | |
412 | -moz-transition: background .3s; |
|
420 | -moz-transition: background .3s; | |
413 | -o-transition: background .3s; |
|
421 | -o-transition: background .3s; | |
414 | transition: background .3s; |
|
422 | transition: background .3s; | |
415 | } |
|
423 | } | |
416 | } |
|
424 | } | |
417 | } |
|
425 | } | |
418 | } |
|
426 | } | |
419 | } |
|
427 | } | |
420 |
|
428 | |||
421 | // Header Repository Switcher |
|
429 | // Header Repository Switcher | |
422 | // Select2 Dropdown |
|
430 | // Select2 Dropdown | |
423 | #select2-drop.select2-drop.repo-switcher-dropdown { |
|
431 | #select2-drop.select2-drop.repo-switcher-dropdown { | |
424 | width: auto !important; |
|
432 | width: auto !important; | |
425 | margin-top: 5px; |
|
433 | margin-top: 5px; | |
426 | padding: 1em 0; |
|
434 | padding: 1em 0; | |
427 | text-align: left; |
|
435 | text-align: left; | |
428 | .border-radius-bottom(@border-radius); |
|
436 | .border-radius-bottom(@border-radius); | |
429 | border-color: transparent; |
|
437 | border-color: transparent; | |
430 | color: @grey6; |
|
438 | color: @grey6; | |
431 | background-color: @grey2; |
|
439 | background-color: @grey2; | |
432 |
|
440 | |||
433 | input { |
|
441 | input { | |
434 | min-width: 90%; |
|
442 | min-width: 90%; | |
435 | } |
|
443 | } | |
436 |
|
444 | |||
437 | ul.select2-result-sub { |
|
445 | ul.select2-result-sub { | |
438 |
|
446 | |||
439 | li { |
|
447 | li { | |
440 | line-height: 1em; |
|
448 | line-height: 1em; | |
441 |
|
449 | |||
442 | &:hover, |
|
450 | &:hover, | |
443 | &.select2-highlighted { |
|
451 | &.select2-highlighted { | |
444 | background-color: @grey3; |
|
452 | background-color: @grey3; | |
445 | } |
|
453 | } | |
446 | } |
|
454 | } | |
447 |
|
455 | |||
448 | &:before { content: none; } |
|
456 | &:before { content: none; } | |
449 | } |
|
457 | } | |
450 |
|
458 | |||
451 | ul.select2-results { |
|
459 | ul.select2-results { | |
452 | min-width: 200px; |
|
460 | min-width: 200px; | |
453 | margin: 0; |
|
461 | margin: 0; | |
454 | padding: 0; |
|
462 | padding: 0; | |
455 | list-style-type: none; |
|
463 | list-style-type: none; | |
456 | overflow-x: visible; |
|
464 | overflow-x: visible; | |
457 | overflow-y: scroll; |
|
465 | overflow-y: scroll; | |
458 |
|
466 | |||
459 | li { |
|
467 | li { | |
460 | padding: 0 8px; |
|
468 | padding: 0 8px; | |
461 | line-height: 1em; |
|
469 | line-height: 1em; | |
462 | color: @grey6; |
|
470 | color: @grey6; | |
463 |
|
471 | |||
464 | &>.select2-result-label { |
|
472 | &>.select2-result-label { | |
465 | padding: 8px 0; |
|
473 | padding: 8px 0; | |
466 | border-bottom: @border-thickness solid @grey3; |
|
474 | border-bottom: @border-thickness solid @grey3; | |
467 | white-space: nowrap; |
|
475 | white-space: nowrap; | |
468 | color: @grey5; |
|
476 | color: @grey5; | |
469 | cursor: pointer; |
|
477 | cursor: pointer; | |
470 | } |
|
478 | } | |
471 |
|
479 | |||
472 | &.select2-result-with-children { |
|
480 | &.select2-result-with-children { | |
473 | margin: 0; |
|
481 | margin: 0; | |
474 | padding: 0; |
|
482 | padding: 0; | |
475 | } |
|
483 | } | |
476 |
|
484 | |||
477 | &.select2-result-unselectable > .select2-result-label { |
|
485 | &.select2-result-unselectable > .select2-result-label { | |
478 | margin: 0 8px; |
|
486 | margin: 0 8px; | |
479 | } |
|
487 | } | |
480 |
|
488 | |||
481 | } |
|
489 | } | |
482 | } |
|
490 | } | |
483 |
|
491 | |||
484 | ul.select2-result-sub { |
|
492 | ul.select2-result-sub { | |
485 | margin: 0; |
|
493 | margin: 0; | |
486 | padding: 0; |
|
494 | padding: 0; | |
487 |
|
495 | |||
488 | li { |
|
496 | li { | |
489 | display: block; |
|
497 | display: block; | |
490 | margin: 0; |
|
498 | margin: 0; | |
491 | border-right: none; |
|
499 | border-right: none; | |
492 | line-height: 1em; |
|
500 | line-height: 1em; | |
493 | font-family: @text-light; |
|
501 | font-family: @text-light; | |
494 | color: @grey2; |
|
502 | color: @grey2; | |
495 | list-style-type: none; |
|
503 | list-style-type: none; | |
496 |
|
504 | |||
497 | &:hover { |
|
505 | &:hover { | |
498 | background-color: @grey3; |
|
506 | background-color: @grey3; | |
499 | } |
|
507 | } | |
500 | } |
|
508 | } | |
501 | } |
|
509 | } | |
502 | } |
|
510 | } | |
503 |
|
511 | |||
504 |
|
512 | |||
505 | #context-bar { |
|
513 | #context-bar { | |
506 | display: block; |
|
514 | display: block; | |
507 | margin: 0 auto 20px 0; |
|
515 | margin: 0 auto 20px 0; | |
508 | padding: 0 @header-padding; |
|
516 | padding: 0 @header-padding; | |
509 | background-color: @grey7; |
|
517 | background-color: @grey7; | |
510 | border-bottom: 1px solid @grey5; |
|
518 | border-bottom: 1px solid @grey5; | |
511 |
|
519 | |||
512 | .clear { |
|
520 | .clear { | |
513 | clear: both; |
|
521 | clear: both; | |
514 | } |
|
522 | } | |
515 | } |
|
523 | } | |
516 |
|
524 | |||
517 | ul#context-pages { |
|
525 | ul#context-pages { | |
518 | li { |
|
526 | li { | |
519 | list-style-type: none; |
|
527 | list-style-type: none; | |
520 |
|
528 | |||
521 | a { |
|
529 | a { | |
522 | color: @grey2; |
|
530 | color: @grey2; | |
523 |
|
531 | |||
524 | &:hover { |
|
532 | &:hover { | |
525 | color: @grey1; |
|
533 | color: @grey1; | |
526 | } |
|
534 | } | |
527 | } |
|
535 | } | |
528 |
|
536 | |||
529 | &.active { |
|
537 | &.active { | |
530 | // special case, non-variable color |
|
538 | // special case, non-variable color | |
531 | border-bottom: 2px solid @rcblue; |
|
539 | border-bottom: 2px solid @rcblue; | |
532 |
|
540 | |||
533 | a { |
|
541 | a { | |
534 | color: @rcblue; |
|
542 | color: @rcblue; | |
535 | } |
|
543 | } | |
536 | } |
|
544 | } | |
537 | } |
|
545 | } | |
538 | } |
|
546 | } | |
539 |
|
547 | |||
540 | // PAGINATION |
|
548 | // PAGINATION | |
541 |
|
549 | |||
542 | .pagination { |
|
550 | .pagination { | |
543 | border: @border-thickness solid @grey5; |
|
551 | border: @border-thickness solid @grey5; | |
544 | color: @grey2; |
|
552 | color: @grey2; | |
545 | box-shadow: @button-shadow; |
|
553 | box-shadow: @button-shadow; | |
546 |
|
554 | |||
547 | .current { |
|
555 | .current { | |
548 | color: @grey4; |
|
556 | color: @grey4; | |
549 | } |
|
557 | } | |
550 | } |
|
558 | } | |
551 |
|
559 | |||
552 | .dataTables_processing { |
|
560 | .dataTables_processing { | |
553 | text-align: center; |
|
561 | text-align: center; | |
554 | font-size: 1.1em; |
|
562 | font-size: 1.1em; | |
555 | position: relative; |
|
563 | position: relative; | |
556 | top: 95px; |
|
564 | top: 95px; | |
557 | } |
|
565 | } | |
558 |
|
566 | |||
559 | .dataTables_paginate, .pagination-wh { |
|
567 | .dataTables_paginate, .pagination-wh { | |
560 | text-align: left; |
|
568 | text-align: left; | |
561 | display: inline-block; |
|
569 | display: inline-block; | |
562 | border-left: 1px solid @grey5; |
|
570 | border-left: 1px solid @grey5; | |
563 | float: none; |
|
571 | float: none; | |
564 | overflow: hidden; |
|
572 | overflow: hidden; | |
565 | box-shadow: @button-shadow; |
|
573 | box-shadow: @button-shadow; | |
566 |
|
574 | |||
567 | .paginate_button, .pager_curpage, |
|
575 | .paginate_button, .pager_curpage, | |
568 | .pager_link, .pg-previous, .pg-next, .pager_dotdot { |
|
576 | .pager_link, .pg-previous, .pg-next, .pager_dotdot { | |
569 | display: inline-block; |
|
577 | display: inline-block; | |
570 | padding: @menupadding/4 @menupadding; |
|
578 | padding: @menupadding/4 @menupadding; | |
571 | border: 1px solid @grey5; |
|
579 | border: 1px solid @grey5; | |
572 | border-left: 0; |
|
580 | border-left: 0; | |
573 | color: @grey2; |
|
581 | color: @grey2; | |
574 | cursor: pointer; |
|
582 | cursor: pointer; | |
575 | float: left; |
|
583 | float: left; | |
576 |
|
584 | |||
577 | &:hover { |
|
585 | &:hover { | |
578 | color: @rcdarkblue; |
|
586 | color: @rcdarkblue; | |
579 | } |
|
587 | } | |
580 | } |
|
588 | } | |
581 |
|
589 | |||
582 | .paginate_button.disabled, |
|
590 | .paginate_button.disabled, | |
583 | .disabled { |
|
591 | .disabled { | |
584 | color: @grey3; |
|
592 | color: @grey3; | |
585 | cursor: default; |
|
593 | cursor: default; | |
586 | opacity: 0.5; |
|
594 | opacity: 0.5; | |
587 | } |
|
595 | } | |
588 |
|
596 | |||
589 | .paginate_button.current, .pager_curpage { |
|
597 | .paginate_button.current, .pager_curpage { | |
590 | background: @rcblue; |
|
598 | background: @rcblue; | |
591 | border-color: @rcblue; |
|
599 | border-color: @rcblue; | |
592 | color: @white; |
|
600 | color: @white; | |
593 | } |
|
601 | } | |
594 |
|
602 | |||
595 | .ellipsis { |
|
603 | .ellipsis { | |
596 | display: inline-block; |
|
604 | display: inline-block; | |
597 | text-align: left; |
|
605 | text-align: left; | |
598 | padding: @menupadding/4 @menupadding; |
|
606 | padding: @menupadding/4 @menupadding; | |
599 | border: 1px solid @grey5; |
|
607 | border: 1px solid @grey5; | |
600 | border-left: 0; |
|
608 | border-left: 0; | |
601 | float: left; |
|
609 | float: left; | |
602 | } |
|
610 | } | |
603 | } |
|
611 | } | |
604 |
|
612 | |||
605 | // SIDEBAR |
|
613 | // SIDEBAR | |
606 |
|
614 | |||
607 | .sidebar { |
|
615 | .sidebar { | |
608 | .block-left; |
|
616 | .block-left; | |
609 | clear: left; |
|
617 | clear: left; | |
610 | max-width: @sidebar-width; |
|
618 | max-width: @sidebar-width; | |
611 | margin-right: @sidebarpadding; |
|
619 | margin-right: @sidebarpadding; | |
612 | padding-right: @sidebarpadding; |
|
620 | padding-right: @sidebarpadding; | |
613 | font-family: @text-regular; |
|
621 | font-family: @text-regular; | |
614 | color: @grey1; |
|
622 | color: @grey1; | |
615 |
|
623 | |||
616 | &#graph_nodes { |
|
624 | &#graph_nodes { | |
617 | clear:both; |
|
625 | clear:both; | |
618 | width: auto; |
|
626 | width: auto; | |
619 | margin-left: -100px; |
|
627 | margin-left: -100px; | |
620 | padding: 0; |
|
628 | padding: 0; | |
621 | border: none; |
|
629 | border: none; | |
622 | } |
|
630 | } | |
623 |
|
631 | |||
624 | .nav-pills { |
|
632 | .nav-pills { | |
625 | margin: 0; |
|
633 | margin: 0; | |
626 | } |
|
634 | } | |
627 |
|
635 | |||
628 | .nav { |
|
636 | .nav { | |
629 | list-style: none; |
|
637 | list-style: none; | |
630 | padding: 0; |
|
638 | padding: 0; | |
631 |
|
639 | |||
632 | li { |
|
640 | li { | |
633 | padding-bottom: @menupadding; |
|
641 | padding-bottom: @menupadding; | |
634 | line-height: 1em; |
|
642 | line-height: 1em; | |
635 | color: @grey4; |
|
643 | color: @grey4; | |
636 | list-style-type: none; |
|
644 | list-style-type: none; | |
637 |
|
645 | |||
638 | &.active a { |
|
646 | &.active a { | |
639 | color: @grey2; |
|
647 | color: @grey2; | |
640 | } |
|
648 | } | |
641 |
|
649 | |||
642 | a { |
|
650 | a { | |
643 | color: @grey4; |
|
651 | color: @grey4; | |
644 | } |
|
652 | } | |
645 | } |
|
653 | } | |
646 |
|
654 | |||
647 | } |
|
655 | } | |
648 | } |
|
656 | } | |
649 |
|
657 | |||
650 | .main_filter_help_box { |
|
658 | .main_filter_help_box { | |
651 | padding: 7px 7px; |
|
659 | padding: 7px 7px; | |
652 | display: inline-block; |
|
660 | display: inline-block; | |
653 | vertical-align: top; |
|
661 | vertical-align: top; | |
654 | background: inherit; |
|
662 | background: inherit; | |
655 | position: absolute; |
|
663 | position: absolute; | |
656 | right: 0; |
|
664 | right: 0; | |
657 | top: 9px; |
|
665 | top: 9px; | |
658 | } |
|
666 | } | |
659 |
|
667 | |||
660 | .main_filter_input_box { |
|
668 | .main_filter_input_box { | |
661 | display: inline-block; |
|
669 | display: inline-block; | |
662 |
|
670 | |||
663 | .searchItems { |
|
671 | .searchItems { | |
664 | display:flex; |
|
672 | display:flex; | |
665 | background: @black; |
|
673 | background: @black; | |
666 | padding: 0px; |
|
674 | padding: 0px; | |
667 | border-radius: 3px; |
|
675 | border-radius: 3px; | |
668 | border: 1px solid @black; |
|
676 | border: 1px solid @black; | |
669 |
|
677 | |||
670 | a { |
|
678 | a { | |
671 | border: none !important; |
|
679 | border: none !important; | |
672 | } |
|
680 | } | |
673 | } |
|
681 | } | |
674 |
|
682 | |||
675 | .searchTag { |
|
683 | .searchTag { | |
676 | line-height: 28px; |
|
684 | line-height: 28px; | |
677 | padding: 0 5px; |
|
685 | padding: 0 5px; | |
678 |
|
686 | |||
679 | .tag { |
|
687 | .tag { | |
680 | color: @grey5; |
|
688 | color: @grey5; | |
681 | border-color: @grey2; |
|
689 | border-color: @grey2; | |
682 | background: @grey1; |
|
690 | background: @grey1; | |
683 | } |
|
691 | } | |
684 | } |
|
692 | } | |
685 |
|
693 | |||
686 | .searchTagFilter { |
|
694 | .searchTagFilter { | |
687 | background-color: @black !important; |
|
695 | background-color: @black !important; | |
688 | margin-right: 0; |
|
696 | margin-right: 0; | |
689 | } |
|
697 | } | |
690 |
|
698 | |||
691 | .searchTagHelp { |
|
699 | .searchTagHelp { | |
692 | background-color: @grey1 !important; |
|
700 | background-color: @grey1 !important; | |
693 | margin: 0; |
|
701 | margin: 0; | |
694 | } |
|
702 | } | |
695 | .searchTagHelp:hover { |
|
703 | .searchTagHelp:hover { | |
696 | background-color: @grey1 !important; |
|
704 | background-color: @grey1 !important; | |
697 | } |
|
705 | } | |
698 | .searchTagInput { |
|
706 | .searchTagInput { | |
699 | background-color: @grey1 !important; |
|
707 | background-color: @grey1 !important; | |
700 | margin-right: 0; |
|
708 | margin-right: 0; | |
701 | } |
|
709 | } | |
702 | } |
|
710 | } | |
703 |
|
711 | |||
704 | .main_filter_box { |
|
712 | .main_filter_box { | |
705 | margin: 9px 0 0 0; |
|
713 | margin: 9px 0 0 0; | |
706 | } |
|
714 | } | |
707 |
|
715 | |||
708 | #main_filter_help { |
|
716 | #main_filter_help { | |
709 | background: @grey1; |
|
717 | background: @grey1; | |
710 | border: 1px solid black; |
|
718 | border: 1px solid black; | |
711 | position: absolute; |
|
719 | position: absolute; | |
712 | white-space: pre; |
|
720 | white-space: pre; | |
713 | z-index: 9999; |
|
721 | z-index: 9999; | |
714 | color: @nav-grey; |
|
722 | color: @nav-grey; | |
715 | padding: 0 10px; |
|
723 | padding: 0 10px; | |
716 | } |
|
724 | } | |
717 |
|
725 | |||
718 | input { |
|
726 | input { | |
719 |
|
727 | |||
720 | &.main_filter_input { |
|
728 | &.main_filter_input { | |
721 | padding: 5px 10px; |
|
729 | padding: 5px 10px; | |
722 | min-width: 260px; |
|
730 | min-width: 260px; | |
723 | color: @grey7; |
|
731 | color: @grey7; | |
724 | background: @black; |
|
732 | background: @black; | |
725 | min-height: 18px; |
|
733 | min-height: 18px; | |
726 | border: 0; |
|
734 | border: 0; | |
727 |
|
735 | |||
728 | &:active { |
|
736 | &:active { | |
729 | color: @grey2 !important; |
|
737 | color: @grey2 !important; | |
730 | background: white !important; |
|
738 | background: white !important; | |
731 | } |
|
739 | } | |
732 | &:focus { |
|
740 | &:focus { | |
733 | color: @grey2 !important; |
|
741 | color: @grey2 !important; | |
734 | background: white !important; |
|
742 | background: white !important; | |
735 | } |
|
743 | } | |
736 | } |
|
744 | } | |
737 | } |
|
745 | } | |
738 |
|
746 | |||
739 |
|
747 | |||
740 |
|
748 | |||
741 | .main_filter_input::placeholder { |
|
749 | .main_filter_input::placeholder { | |
742 | color: @nav-grey; |
|
750 | color: @nav-grey; | |
743 | opacity: 1; |
|
751 | opacity: 1; | |
744 | } |
|
752 | } | |
745 |
|
753 | |||
746 | .notice-box { |
|
754 | .notice-box { | |
747 | display:block !important; |
|
755 | display:block !important; | |
748 | padding: 9px 0 !important; |
|
756 | padding: 9px 0 !important; | |
749 | } |
|
757 | } | |
750 |
|
758 | |||
751 | .menulabel-notice { |
|
759 | .menulabel-notice { | |
752 | border: 1px solid @color5; |
|
760 | border: 1px solid @color5; | |
753 | padding:7px 10px; |
|
761 | padding:7px 10px; | |
754 | color: @color5; |
|
762 | color: @color5; | |
755 | } |
|
763 | } |
@@ -1,963 +1,965 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="root.mako"/> |
|
2 | <%inherit file="root.mako"/> | |
3 |
|
3 | |||
4 | <%include file="/ejs_templates/templates.html"/> |
|
4 | <%include file="/ejs_templates/templates.html"/> | |
5 |
|
5 | |||
6 | <div class="outerwrapper"> |
|
6 | <div class="outerwrapper"> | |
7 | <!-- HEADER --> |
|
7 | <!-- HEADER --> | |
8 | <div class="header"> |
|
8 | <div class="header"> | |
9 | <div id="header-inner" class="wrapper"> |
|
9 | <div id="header-inner" class="wrapper"> | |
10 | <div id="logo"> |
|
10 | <div id="logo"> | |
11 | <div class="logo-wrapper"> |
|
11 | <div class="logo-wrapper"> | |
12 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a> |
|
12 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a> | |
13 | </div> |
|
13 | </div> | |
14 | % if c.rhodecode_name: |
|
14 | % if c.rhodecode_name: | |
15 | <div class="branding"> |
|
15 | <div class="branding"> | |
16 | <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a> |
|
16 | <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a> | |
17 | </div> |
|
17 | </div> | |
18 | % endif |
|
18 | % endif | |
19 | </div> |
|
19 | </div> | |
20 | <!-- MENU BAR NAV --> |
|
20 | <!-- MENU BAR NAV --> | |
21 | ${self.menu_bar_nav()} |
|
21 | ${self.menu_bar_nav()} | |
22 | <!-- END MENU BAR NAV --> |
|
22 | <!-- END MENU BAR NAV --> | |
23 | </div> |
|
23 | </div> | |
24 | </div> |
|
24 | </div> | |
25 | ${self.menu_bar_subnav()} |
|
25 | ${self.menu_bar_subnav()} | |
26 | <!-- END HEADER --> |
|
26 | <!-- END HEADER --> | |
27 |
|
27 | |||
28 | <!-- CONTENT --> |
|
28 | <!-- CONTENT --> | |
29 | <div id="content" class="wrapper"> |
|
29 | <div id="content" class="wrapper"> | |
30 |
|
30 | |||
31 | <rhodecode-toast id="notifications"></rhodecode-toast> |
|
31 | <rhodecode-toast id="notifications"></rhodecode-toast> | |
32 |
|
32 | |||
33 | <div class="main"> |
|
33 | <div class="main"> | |
34 | ${next.main()} |
|
34 | ${next.main()} | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 | <!-- END CONTENT --> |
|
37 | <!-- END CONTENT --> | |
38 |
|
38 | |||
39 | </div> |
|
39 | </div> | |
40 | <!-- FOOTER --> |
|
40 | <!-- FOOTER --> | |
41 | <div id="footer"> |
|
41 | <div id="footer"> | |
42 | <div id="footer-inner" class="title wrapper"> |
|
42 | <div id="footer-inner" class="title wrapper"> | |
43 | <div> |
|
43 | <div> | |
44 | <p class="footer-link-right"> |
|
44 | <p class="footer-link-right"> | |
45 | % if c.visual.show_version: |
|
45 | % if c.visual.show_version: | |
46 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} |
|
46 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} | |
47 | % endif |
|
47 | % endif | |
48 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. |
|
48 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. | |
49 | % if c.visual.rhodecode_support_url: |
|
49 | % if c.visual.rhodecode_support_url: | |
50 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
|
50 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> | |
51 | % endif |
|
51 | % endif | |
52 | </p> |
|
52 | </p> | |
53 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> |
|
53 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> | |
54 | <p class="server-instance" style="display:${sid}"> |
|
54 | <p class="server-instance" style="display:${sid}"> | |
55 | ## display hidden instance ID if specially defined |
|
55 | ## display hidden instance ID if specially defined | |
56 | % if c.rhodecode_instanceid: |
|
56 | % if c.rhodecode_instanceid: | |
57 | ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)} |
|
57 | ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)} | |
58 | % endif |
|
58 | % endif | |
59 | </p> |
|
59 | </p> | |
60 | </div> |
|
60 | </div> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 |
|
63 | |||
64 | <!-- END FOOTER --> |
|
64 | <!-- END FOOTER --> | |
65 |
|
65 | |||
66 | ### MAKO DEFS ### |
|
66 | ### MAKO DEFS ### | |
67 |
|
67 | |||
68 | <%def name="menu_bar_subnav()"> |
|
68 | <%def name="menu_bar_subnav()"> | |
69 | </%def> |
|
69 | </%def> | |
70 |
|
70 | |||
71 | <%def name="breadcrumbs(class_='breadcrumbs')"> |
|
71 | <%def name="breadcrumbs(class_='breadcrumbs')"> | |
72 | <div class="${class_}"> |
|
72 | <div class="${class_}"> | |
73 | ${self.breadcrumbs_links()} |
|
73 | ${self.breadcrumbs_links()} | |
74 | </div> |
|
74 | </div> | |
75 | </%def> |
|
75 | </%def> | |
76 |
|
76 | |||
77 | <%def name="admin_menu(active=None)"> |
|
77 | <%def name="admin_menu(active=None)"> | |
78 | <% |
|
78 | <% | |
79 | def is_active(selected): |
|
79 | def is_active(selected): | |
80 | if selected == active: |
|
80 | if selected == active: | |
81 | return "active" |
|
81 | return "active" | |
82 | %> |
|
82 | %> | |
83 |
|
83 | |||
84 | <div id="context-bar"> |
|
84 | <div id="context-bar"> | |
85 | <div class="wrapper"> |
|
85 | <div class="wrapper"> | |
86 | <div class="title"> |
|
86 | <div class="title"> | |
87 | <div class="title-content"> |
|
87 | <div class="title-content"> | |
88 | <div class="title-main"> |
|
88 | <div class="title-main"> | |
89 | % if c.is_super_admin: |
|
89 | % if c.is_super_admin: | |
90 | ${_('Super Admin Panel')} |
|
90 | ${_('Super Admin Panel')} | |
91 | % else: |
|
91 | % else: | |
92 | ${_('Delegated Admin Panel')} |
|
92 | ${_('Delegated Admin Panel')} | |
93 | % endif |
|
93 | % endif | |
94 | </div> |
|
94 | </div> | |
95 | </div> |
|
95 | </div> | |
96 | </div> |
|
96 | </div> | |
97 |
|
97 | |||
98 | <ul id="context-pages" class="navigation horizontal-list"> |
|
98 | <ul id="context-pages" class="navigation horizontal-list"> | |
99 |
|
99 | |||
100 | ## super admin case |
|
100 | ## super admin case | |
101 | % if c.is_super_admin: |
|
101 | % if c.is_super_admin: | |
102 | <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> |
|
102 | <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> | |
103 | <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
103 | <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> | |
104 | <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> |
|
104 | <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> | |
105 | <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li> |
|
105 | <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li> | |
106 | <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> |
|
106 | <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> | |
107 | <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li> |
|
107 | <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li> | |
108 | <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> |
|
108 | <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> | |
109 | <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> |
|
109 | <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> | |
110 | <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li> |
|
110 | <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li> | |
111 | <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li> |
|
111 | <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li> | |
112 |
|
112 | |||
113 | ## delegated admin |
|
113 | ## delegated admin | |
114 | % elif c.is_delegated_admin: |
|
114 | % elif c.is_delegated_admin: | |
115 | <% |
|
115 | <% | |
116 | repositories=c.auth_user.repositories_admin or c.can_create_repo |
|
116 | repositories=c.auth_user.repositories_admin or c.can_create_repo | |
117 | repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group |
|
117 | repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group | |
118 | user_groups=c.auth_user.user_groups_admin or c.can_create_user_group |
|
118 | user_groups=c.auth_user.user_groups_admin or c.can_create_user_group | |
119 | %> |
|
119 | %> | |
120 |
|
120 | |||
121 | %if repositories: |
|
121 | %if repositories: | |
122 | <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
122 | <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> | |
123 | %endif |
|
123 | %endif | |
124 | %if repository_groups: |
|
124 | %if repository_groups: | |
125 | <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> |
|
125 | <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> | |
126 | %endif |
|
126 | %endif | |
127 | %if user_groups: |
|
127 | %if user_groups: | |
128 | <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> |
|
128 | <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> | |
129 | %endif |
|
129 | %endif | |
130 | % endif |
|
130 | % endif | |
131 | </ul> |
|
131 | </ul> | |
132 |
|
132 | |||
133 | </div> |
|
133 | </div> | |
134 | <div class="clear"></div> |
|
134 | <div class="clear"></div> | |
135 | </div> |
|
135 | </div> | |
136 | </%def> |
|
136 | </%def> | |
137 |
|
137 | |||
138 | <%def name="dt_info_panel(elements)"> |
|
138 | <%def name="dt_info_panel(elements)"> | |
139 | <dl class="dl-horizontal"> |
|
139 | <dl class="dl-horizontal"> | |
140 | %for dt, dd, title, show_items in elements: |
|
140 | %for dt, dd, title, show_items in elements: | |
141 | <dt>${dt}:</dt> |
|
141 | <dt>${dt}:</dt> | |
142 | <dd title="${h.tooltip(title)}"> |
|
142 | <dd title="${h.tooltip(title)}"> | |
143 | %if callable(dd): |
|
143 | %if callable(dd): | |
144 | ## allow lazy evaluation of elements |
|
144 | ## allow lazy evaluation of elements | |
145 | ${dd()} |
|
145 | ${dd()} | |
146 | %else: |
|
146 | %else: | |
147 | ${dd} |
|
147 | ${dd} | |
148 | %endif |
|
148 | %endif | |
149 | %if show_items: |
|
149 | %if show_items: | |
150 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> |
|
150 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> | |
151 | %endif |
|
151 | %endif | |
152 | </dd> |
|
152 | </dd> | |
153 |
|
153 | |||
154 | %if show_items: |
|
154 | %if show_items: | |
155 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> |
|
155 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> | |
156 | %for item in show_items: |
|
156 | %for item in show_items: | |
157 | <dt></dt> |
|
157 | <dt></dt> | |
158 | <dd>${item}</dd> |
|
158 | <dd>${item}</dd> | |
159 | %endfor |
|
159 | %endfor | |
160 | </div> |
|
160 | </div> | |
161 | %endif |
|
161 | %endif | |
162 |
|
162 | |||
163 | %endfor |
|
163 | %endfor | |
164 | </dl> |
|
164 | </dl> | |
165 | </%def> |
|
165 | </%def> | |
166 |
|
166 | |||
167 | <%def name="gravatar(email, size=16)"> |
|
167 | <%def name="gravatar(email, size=16)"> | |
168 | <% |
|
168 | <% | |
169 | if (size > 16): |
|
169 | if (size > 16): | |
170 | gravatar_class = 'gravatar gravatar-large' |
|
170 | gravatar_class = 'gravatar gravatar-large' | |
171 | else: |
|
171 | else: | |
172 | gravatar_class = 'gravatar' |
|
172 | gravatar_class = 'gravatar' | |
173 | %> |
|
173 | %> | |
174 | <%doc> |
|
174 | <%doc> | |
175 | TODO: johbo: For now we serve double size images to make it smooth |
|
175 | TODO: johbo: For now we serve double size images to make it smooth | |
176 | for retina. This is how it worked until now. Should be replaced |
|
176 | for retina. This is how it worked until now. Should be replaced | |
177 | with a better solution at some point. |
|
177 | with a better solution at some point. | |
178 | </%doc> |
|
178 | </%doc> | |
179 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> |
|
179 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> | |
180 | </%def> |
|
180 | </%def> | |
181 |
|
181 | |||
182 |
|
182 | |||
183 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> |
|
183 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> | |
184 | <% email = h.email_or_none(contact) %> |
|
184 | <% email = h.email_or_none(contact) %> | |
185 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> |
|
185 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> | |
186 | ${self.gravatar(email, size)} |
|
186 | ${self.gravatar(email, size)} | |
187 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> |
|
187 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> | |
188 | </div> |
|
188 | </div> | |
189 | </%def> |
|
189 | </%def> | |
190 |
|
190 | |||
191 |
|
191 | |||
192 | <%def name="repo_page_title(repo_instance)"> |
|
192 | <%def name="repo_page_title(repo_instance)"> | |
193 | <div class="title-content repo-title"> |
|
193 | <div class="title-content repo-title"> | |
194 |
|
194 | |||
195 | <div class="title-main"> |
|
195 | <div class="title-main"> | |
196 | ## SVN/HG/GIT icons |
|
196 | ## SVN/HG/GIT icons | |
197 | %if h.is_hg(repo_instance): |
|
197 | %if h.is_hg(repo_instance): | |
198 | <i class="icon-hg"></i> |
|
198 | <i class="icon-hg"></i> | |
199 | %endif |
|
199 | %endif | |
200 | %if h.is_git(repo_instance): |
|
200 | %if h.is_git(repo_instance): | |
201 | <i class="icon-git"></i> |
|
201 | <i class="icon-git"></i> | |
202 | %endif |
|
202 | %endif | |
203 | %if h.is_svn(repo_instance): |
|
203 | %if h.is_svn(repo_instance): | |
204 | <i class="icon-svn"></i> |
|
204 | <i class="icon-svn"></i> | |
205 | %endif |
|
205 | %endif | |
206 |
|
206 | |||
207 | ## public/private |
|
207 | ## public/private | |
208 | %if repo_instance.private: |
|
208 | %if repo_instance.private: | |
209 | <i class="icon-repo-private"></i> |
|
209 | <i class="icon-repo-private"></i> | |
210 | %else: |
|
210 | %else: | |
211 | <i class="icon-repo-public"></i> |
|
211 | <i class="icon-repo-public"></i> | |
212 | %endif |
|
212 | %endif | |
213 |
|
213 | |||
214 | ## repo name with group name |
|
214 | ## repo name with group name | |
215 | ${h.breadcrumb_repo_link(repo_instance)} |
|
215 | ${h.breadcrumb_repo_link(repo_instance)} | |
216 |
|
216 | |||
217 | ## Context Actions |
|
217 | ## Context Actions | |
218 | <div class="pull-right"> |
|
218 | <div class="pull-right"> | |
219 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
219 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
220 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> |
|
220 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> | |
221 |
|
221 | |||
222 | <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}"> |
|
222 | <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}"> | |
223 | % if c.repository_is_user_following: |
|
223 | % if c.repository_is_user_following: | |
224 | <i class="icon-eye-off"></i>${_('Unwatch')} |
|
224 | <i class="icon-eye-off"></i>${_('Unwatch')} | |
225 | % else: |
|
225 | % else: | |
226 | <i class="icon-eye"></i>${_('Watch')} |
|
226 | <i class="icon-eye"></i>${_('Watch')} | |
227 | % endif |
|
227 | % endif | |
228 |
|
228 | |||
229 | </a> |
|
229 | </a> | |
230 | %else: |
|
230 | %else: | |
231 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> |
|
231 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> | |
232 | %endif |
|
232 | %endif | |
233 | </div> |
|
233 | </div> | |
234 |
|
234 | |||
235 | </div> |
|
235 | </div> | |
236 |
|
236 | |||
237 | ## FORKED |
|
237 | ## FORKED | |
238 | %if repo_instance.fork: |
|
238 | %if repo_instance.fork: | |
239 | <p class="discreet"> |
|
239 | <p class="discreet"> | |
240 | <i class="icon-code-fork"></i> ${_('Fork of')} |
|
240 | <i class="icon-code-fork"></i> ${_('Fork of')} | |
241 | ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))} |
|
241 | ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))} | |
242 | </p> |
|
242 | </p> | |
243 | %endif |
|
243 | %endif | |
244 |
|
244 | |||
245 | ## IMPORTED FROM REMOTE |
|
245 | ## IMPORTED FROM REMOTE | |
246 | %if repo_instance.clone_uri: |
|
246 | %if repo_instance.clone_uri: | |
247 | <p class="discreet"> |
|
247 | <p class="discreet"> | |
248 | <i class="icon-code-fork"></i> ${_('Clone from')} |
|
248 | <i class="icon-code-fork"></i> ${_('Clone from')} | |
249 | <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a> |
|
249 | <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a> | |
250 | </p> |
|
250 | </p> | |
251 | %endif |
|
251 | %endif | |
252 |
|
252 | |||
253 | ## LOCKING STATUS |
|
253 | ## LOCKING STATUS | |
254 | %if repo_instance.locked[0]: |
|
254 | %if repo_instance.locked[0]: | |
255 | <p class="locking_locked discreet"> |
|
255 | <p class="locking_locked discreet"> | |
256 | <i class="icon-repo-lock"></i> |
|
256 | <i class="icon-repo-lock"></i> | |
257 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} |
|
257 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} | |
258 | </p> |
|
258 | </p> | |
259 | %elif repo_instance.enable_locking: |
|
259 | %elif repo_instance.enable_locking: | |
260 | <p class="locking_unlocked discreet"> |
|
260 | <p class="locking_unlocked discreet"> | |
261 | <i class="icon-repo-unlock"></i> |
|
261 | <i class="icon-repo-unlock"></i> | |
262 | ${_('Repository not locked. Pull repository to lock it.')} |
|
262 | ${_('Repository not locked. Pull repository to lock it.')} | |
263 | </p> |
|
263 | </p> | |
264 | %endif |
|
264 | %endif | |
265 |
|
265 | |||
266 | </div> |
|
266 | </div> | |
267 | </%def> |
|
267 | </%def> | |
268 |
|
268 | |||
269 | <%def name="repo_menu(active=None)"> |
|
269 | <%def name="repo_menu(active=None)"> | |
270 | <% |
|
270 | <% | |
271 | def is_active(selected): |
|
271 | def is_active(selected): | |
272 | if selected == active: |
|
272 | if selected == active: | |
273 | return "active" |
|
273 | return "active" | |
274 | %> |
|
274 | %> | |
275 |
|
275 | |||
276 | <!--- REPO CONTEXT BAR --> |
|
276 | <!--- REPO CONTEXT BAR --> | |
277 | <div id="context-bar"> |
|
277 | <div id="context-bar"> | |
278 | <div class="wrapper"> |
|
278 | <div class="wrapper"> | |
279 |
|
279 | |||
280 | <div class="title"> |
|
280 | <div class="title"> | |
281 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
281 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
282 | </div> |
|
282 | </div> | |
283 |
|
283 | |||
284 | <ul id="context-pages" class="navigation horizontal-list"> |
|
284 | <ul id="context-pages" class="navigation horizontal-list"> | |
285 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> |
|
285 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> | |
286 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> |
|
286 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> | |
287 | <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li> |
|
287 | <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li> | |
288 | <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li> |
|
288 | <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li> | |
289 |
|
289 | |||
290 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" |
|
290 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" | |
291 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
291 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: | |
292 | <li class="${is_active('showpullrequest')}"> |
|
292 | <li class="${is_active('showpullrequest')}"> | |
293 | <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}"> |
|
293 | <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}"> | |
294 | <div class="menulabel"> |
|
294 | <div class="menulabel"> | |
295 | %if c.repository_pull_requests == 1: |
|
295 | %if c.repository_pull_requests == 1: | |
296 | ${c.repository_pull_requests} ${_('Pull Request')} |
|
296 | ${c.repository_pull_requests} ${_('Pull Request')} | |
297 | %else: |
|
297 | %else: | |
298 | ${c.repository_pull_requests} ${_('Pull Requests')} |
|
298 | ${c.repository_pull_requests} ${_('Pull Requests')} | |
299 | %endif |
|
299 | %endif | |
300 | </div> |
|
300 | </div> | |
301 | </a> |
|
301 | </a> | |
302 | </li> |
|
302 | </li> | |
303 | %endif |
|
303 | %endif | |
304 |
|
304 | |||
305 | <li class="${is_active('artifacts')}"><a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}"><div class="menulabel">${_('Artifacts')} (BETA)</div></a></li> |
|
305 | <li class="${is_active('artifacts')}"><a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}"><div class="menulabel">${_('Artifacts')} (BETA)</div></a></li> | |
306 |
|
306 | |||
307 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): |
|
307 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
308 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li> |
|
308 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li> | |
309 | %endif |
|
309 | %endif | |
310 |
|
310 | |||
|
311 | ## determine if we have "any" option available | |||
|
312 | <% | |||
|
313 | can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking | |||
|
314 | has_actions = (c.rhodecode_user.username != h.DEFAULT_USER and c.rhodecode_db_repo.repo_type in ['git','hg'] ) or can_lock | |||
|
315 | %> | |||
311 | <li class="${is_active('options')}"> |
|
316 | <li class="${is_active('options')}"> | |
312 | <a class="menulink dropdown"> |
|
317 | % if has_actions: | |
313 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> |
|
318 | <a class="menulink dropdown"> | |
314 | </a> |
|
319 | <div class="menulabel">${_('Options')}<div class="show_more"></div></div> | |
315 | <ul class="submenu"> |
|
320 | </a> | |
|
321 | <ul class="submenu"> | |||
|
322 | <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork this repository')}</a></li> | |||
|
323 | <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> | |||
|
324 | %if can_lock: | |||
|
325 | %if c.rhodecode_db_repo.locked[0]: | |||
|
326 | <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li> | |||
|
327 | %else: | |||
|
328 | <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li> | |||
|
329 | %endif | |||
|
330 | %endif | |||
|
331 | </ul> | |||
|
332 | % else: | |||
|
333 | <a class="menulink disabled"> | |||
|
334 | <div class="menulabel">${_('Options')}<div class="show_more"></div></div> | |||
|
335 | </a> | |||
|
336 | % endif | |||
|
337 | </li> | |||
316 |
|
|
338 | ||
317 | %if c.rhodecode_db_repo.fork: |
|
|||
318 | <li> |
|
|||
319 | <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" |
|
|||
320 | href="${h.route_path('repo_compare', |
|
|||
321 | repo_name=c.rhodecode_db_repo.fork.repo_name, |
|
|||
322 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], |
|
|||
323 | source_ref=c.rhodecode_db_repo.landing_rev[1], |
|
|||
324 | target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], |
|
|||
325 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], |
|
|||
326 | _query=dict(merge=1))}" |
|
|||
327 | > |
|
|||
328 | ${_('Compare fork')} |
|
|||
329 | </a> |
|
|||
330 | </li> |
|
|||
331 | %endif |
|
|||
332 |
|
||||
333 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: |
|
|||
334 | %if c.rhodecode_db_repo.locked[0]: |
|
|||
335 | <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li> |
|
|||
336 | %else: |
|
|||
337 | <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li> |
|
|||
338 | %endif |
|
|||
339 | %endif |
|
|||
340 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
|||
341 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
|||
342 | <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li> |
|
|||
343 | <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> |
|
|||
344 | %endif |
|
|||
345 | %endif |
|
|||
346 | </ul> |
|
|||
347 | </li> |
|
|||
348 | </ul> |
|
339 | </ul> | |
349 | </div> |
|
340 | </div> | |
350 | <div class="clear"></div> |
|
341 | <div class="clear"></div> | |
351 | </div> |
|
342 | </div> | |
352 | % if c.rhodecode_db_repo.archived: |
|
343 | % if c.rhodecode_db_repo.archived: | |
353 | <div class="alert alert-warning text-center"> |
|
344 | <div class="alert alert-warning text-center"> | |
354 | <strong>${_('This repository has been archived. It is now read-only.')}</strong> |
|
345 | <strong>${_('This repository has been archived. It is now read-only.')}</strong> | |
355 | </div> |
|
346 | </div> | |
356 | % endif |
|
347 | % endif | |
357 | <!--- REPO END CONTEXT BAR --> |
|
348 | <!--- REPO END CONTEXT BAR --> | |
358 |
|
349 | |||
359 | </%def> |
|
350 | </%def> | |
360 |
|
351 | |||
361 | <%def name="repo_group_page_title(repo_group_instance)"> |
|
352 | <%def name="repo_group_page_title(repo_group_instance)"> | |
362 | <div class="title-content"> |
|
353 | <div class="title-content"> | |
363 | <div class="title-main"> |
|
354 | <div class="title-main"> | |
364 | ## Repository Group icon |
|
355 | ## Repository Group icon | |
365 | <i class="icon-repo-group"></i> |
|
356 | <i class="icon-repo-group"></i> | |
366 |
|
357 | |||
367 | ## repo name with group name |
|
358 | ## repo name with group name | |
368 | ${h.breadcrumb_repo_group_link(repo_group_instance)} |
|
359 | ${h.breadcrumb_repo_group_link(repo_group_instance)} | |
369 | </div> |
|
360 | </div> | |
370 |
|
361 | |||
371 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
362 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> | |
372 | <div class="repo-group-desc discreet"> |
|
363 | <div class="repo-group-desc discreet"> | |
373 | ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)} |
|
364 | ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)} | |
374 | </div> |
|
365 | </div> | |
375 |
|
366 | |||
376 | </div> |
|
367 | </div> | |
377 | </%def> |
|
368 | </%def> | |
378 |
|
369 | |||
379 | <%def name="repo_group_menu(active=None)"> |
|
370 | <%def name="repo_group_menu(active=None)"> | |
380 | <% |
|
371 | <% | |
381 | def is_active(selected): |
|
372 | def is_active(selected): | |
382 | if selected == active: |
|
373 | if selected == active: | |
383 | return "active" |
|
374 | return "active" | |
384 |
|
375 | |||
385 | gr_name = c.repo_group.group_name if c.repo_group else None |
|
376 | gr_name = c.repo_group.group_name if c.repo_group else None | |
386 | # create repositories with write permission on group is set to true |
|
377 | # create repositories with write permission on group is set to true | |
387 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() |
|
378 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() | |
388 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') |
|
379 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') | |
389 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') |
|
380 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') | |
390 |
|
381 | |||
391 | %> |
|
382 | %> | |
392 |
|
383 | |||
393 | <!--- REPO GROUP CONTEXT BAR --> |
|
384 | <!--- REPO GROUP CONTEXT BAR --> | |
394 | <div id="context-bar"> |
|
385 | <div id="context-bar"> | |
395 | <div class="wrapper"> |
|
386 | <div class="wrapper"> | |
396 | <div class="title"> |
|
387 | <div class="title"> | |
397 | ${self.repo_group_page_title(c.repo_group)} |
|
388 | ${self.repo_group_page_title(c.repo_group)} | |
398 | </div> |
|
389 | </div> | |
399 |
|
390 | |||
400 | <ul id="context-pages" class="navigation horizontal-list"> |
|
391 | <ul id="context-pages" class="navigation horizontal-list"> | |
401 | <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li> |
|
392 | <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li> | |
402 | % if c.is_super_admin or group_admin: |
|
393 | % if c.is_super_admin or group_admin: | |
403 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a></li> |
|
394 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a></li> | |
404 | % endif |
|
395 | % endif | |
405 |
|
396 | ## determine if we have "any" option available | ||
|
397 | <% | |||
|
398 | can_create_repos = c.is_super_admin or group_admin or (group_write and create_on_write) | |||
|
399 | can_create_repo_groups = c.is_super_admin or group_admin | |||
|
400 | has_actions = can_create_repos or can_create_repo_groups | |||
|
401 | %> | |||
406 | <li class="${is_active('options')}"> |
|
402 | <li class="${is_active('options')}"> | |
407 | <a class="menulink dropdown"> |
|
403 | % if has_actions: | |
|
404 | <a class="menulink dropdown"> | |||
408 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> |
|
405 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> | |
409 | </a> |
|
406 | </a> | |
410 | <ul class="submenu"> |
|
407 | <ul class="submenu"> | |
411 | %if c.is_super_admin or group_admin or (group_write and create_on_write): |
|
408 | %if can_create_repos: | |
412 | <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li> |
|
409 | <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li> | |
413 | %endif |
|
410 | %endif | |
414 |
%if c |
|
411 | %if can_create_repo_groups: | |
415 | <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Repository Group')}</a></li> |
|
412 | <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Repository Group')}</a></li> | |
416 | %endif |
|
413 | %endif | |
417 |
|
|
414 | </ul> | |
|
415 | % else: | |||
|
416 | <a class="menulink disabled"> | |||
|
417 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> | |||
|
418 | </a> | |||
|
419 | % endif | |||
418 | </li> |
|
420 | </li> | |
419 | </ul> |
|
421 | </ul> | |
420 | </div> |
|
422 | </div> | |
421 | <div class="clear"></div> |
|
423 | <div class="clear"></div> | |
422 | </div> |
|
424 | </div> | |
423 |
|
425 | |||
424 | <!--- REPO GROUP CONTEXT BAR --> |
|
426 | <!--- REPO GROUP CONTEXT BAR --> | |
425 |
|
427 | |||
426 | </%def> |
|
428 | </%def> | |
427 |
|
429 | |||
428 |
|
430 | |||
429 | <%def name="usermenu(active=False)"> |
|
431 | <%def name="usermenu(active=False)"> | |
430 | ## USER MENU |
|
432 | ## USER MENU | |
431 | <li id="quick_login_li" class="${'active' if active else ''}"> |
|
433 | <li id="quick_login_li" class="${'active' if active else ''}"> | |
432 | % if c.rhodecode_user.username == h.DEFAULT_USER: |
|
434 | % if c.rhodecode_user.username == h.DEFAULT_USER: | |
433 | <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}"> |
|
435 | <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}"> | |
434 | ${gravatar(c.rhodecode_user.email, 20)} |
|
436 | ${gravatar(c.rhodecode_user.email, 20)} | |
435 | <span class="user"> |
|
437 | <span class="user"> | |
436 | <span>${_('Sign in')}</span> |
|
438 | <span>${_('Sign in')}</span> | |
437 | </span> |
|
439 | </span> | |
438 | </a> |
|
440 | </a> | |
439 | % else: |
|
441 | % else: | |
440 | ## logged in user |
|
442 | ## logged in user | |
441 | <a id="quick_login_link" class="menulink childs"> |
|
443 | <a id="quick_login_link" class="menulink childs"> | |
442 | ${gravatar(c.rhodecode_user.email, 20)} |
|
444 | ${gravatar(c.rhodecode_user.email, 20)} | |
443 | <span class="user"> |
|
445 | <span class="user"> | |
444 | <span class="menu_link_user">${c.rhodecode_user.username}</span> |
|
446 | <span class="menu_link_user">${c.rhodecode_user.username}</span> | |
445 | <div class="show_more"></div> |
|
447 | <div class="show_more"></div> | |
446 | </span> |
|
448 | </span> | |
447 | </a> |
|
449 | </a> | |
448 | ## subnav with menu for logged in user |
|
450 | ## subnav with menu for logged in user | |
449 | <div class="user-menu submenu"> |
|
451 | <div class="user-menu submenu"> | |
450 | <div id="quick_login"> |
|
452 | <div id="quick_login"> | |
451 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
453 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
452 | <div class=""> |
|
454 | <div class=""> | |
453 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> |
|
455 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> | |
454 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> |
|
456 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> | |
455 | <div class="email">${c.rhodecode_user.email}</div> |
|
457 | <div class="email">${c.rhodecode_user.email}</div> | |
456 | </div> |
|
458 | </div> | |
457 | <div class=""> |
|
459 | <div class=""> | |
458 | <ol class="links"> |
|
460 | <ol class="links"> | |
459 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> |
|
461 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> | |
460 | % if c.rhodecode_user.personal_repo_group: |
|
462 | % if c.rhodecode_user.personal_repo_group: | |
461 | <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li> |
|
463 | <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li> | |
462 | % endif |
|
464 | % endif | |
463 | <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li> |
|
465 | <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li> | |
464 | ## bookmark-items |
|
466 | ## bookmark-items | |
465 | <li class="bookmark-items"> |
|
467 | <li class="bookmark-items"> | |
466 | ${_('Bookmarks')} |
|
468 | ${_('Bookmarks')} | |
467 | <div class="pull-right"> |
|
469 | <div class="pull-right"> | |
468 | <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a> |
|
470 | <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a> | |
469 | </div> |
|
471 | </div> | |
470 | </li> |
|
472 | </li> | |
471 | % if not c.bookmark_items: |
|
473 | % if not c.bookmark_items: | |
472 | <li> |
|
474 | <li> | |
473 | <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a> |
|
475 | <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a> | |
474 | </li> |
|
476 | </li> | |
475 | % endif |
|
477 | % endif | |
476 | % for item in c.bookmark_items: |
|
478 | % for item in c.bookmark_items: | |
477 | <li> |
|
479 | <li> | |
478 | % if item.repository: |
|
480 | % if item.repository: | |
479 | <div> |
|
481 | <div> | |
480 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
482 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
481 | <code>${item.position}</code> |
|
483 | <code>${item.position}</code> | |
482 | % if item.repository.repo_type == 'hg': |
|
484 | % if item.repository.repo_type == 'hg': | |
483 | <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i> |
|
485 | <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i> | |
484 | % elif item.repository.repo_type == 'git': |
|
486 | % elif item.repository.repo_type == 'git': | |
485 | <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i> |
|
487 | <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i> | |
486 | % elif item.repository.repo_type == 'svn': |
|
488 | % elif item.repository.repo_type == 'svn': | |
487 | <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i> |
|
489 | <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i> | |
488 | % endif |
|
490 | % endif | |
489 | ${(item.title or h.shorter(item.repository.repo_name, 30))} |
|
491 | ${(item.title or h.shorter(item.repository.repo_name, 30))} | |
490 | </a> |
|
492 | </a> | |
491 | </div> |
|
493 | </div> | |
492 | % elif item.repository_group: |
|
494 | % elif item.repository_group: | |
493 | <div> |
|
495 | <div> | |
494 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
496 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
495 | <code>${item.position}</code> |
|
497 | <code>${item.position}</code> | |
496 | <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i> |
|
498 | <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i> | |
497 | ${(item.title or h.shorter(item.repository_group.group_name, 30))} |
|
499 | ${(item.title or h.shorter(item.repository_group.group_name, 30))} | |
498 | </a> |
|
500 | </a> | |
499 | </div> |
|
501 | </div> | |
500 | % else: |
|
502 | % else: | |
501 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
503 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
502 | <code>${item.position}</code> |
|
504 | <code>${item.position}</code> | |
503 | ${item.title} |
|
505 | ${item.title} | |
504 | </a> |
|
506 | </a> | |
505 | % endif |
|
507 | % endif | |
506 | </li> |
|
508 | </li> | |
507 | % endfor |
|
509 | % endfor | |
508 |
|
510 | |||
509 | <li class="logout"> |
|
511 | <li class="logout"> | |
510 | ${h.secure_form(h.route_path('logout'), request=request)} |
|
512 | ${h.secure_form(h.route_path('logout'), request=request)} | |
511 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} |
|
513 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} | |
512 | ${h.end_form()} |
|
514 | ${h.end_form()} | |
513 | </li> |
|
515 | </li> | |
514 | </ol> |
|
516 | </ol> | |
515 | </div> |
|
517 | </div> | |
516 | %endif |
|
518 | %endif | |
517 | </div> |
|
519 | </div> | |
518 | </div> |
|
520 | </div> | |
519 | ## unread counter |
|
521 | ## unread counter | |
520 | <div class="pill_container"> |
|
522 | <div class="pill_container"> | |
521 | <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a> |
|
523 | <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a> | |
522 | </div> |
|
524 | </div> | |
523 | % endif |
|
525 | % endif | |
524 | </li> |
|
526 | </li> | |
525 | </%def> |
|
527 | </%def> | |
526 |
|
528 | |||
527 | <%def name="menu_items(active=None)"> |
|
529 | <%def name="menu_items(active=None)"> | |
528 | <% |
|
530 | <% | |
529 | def is_active(selected): |
|
531 | def is_active(selected): | |
530 | if selected == active: |
|
532 | if selected == active: | |
531 | return "active" |
|
533 | return "active" | |
532 | return "" |
|
534 | return "" | |
533 | %> |
|
535 | %> | |
534 |
|
536 | |||
535 | <ul id="quick" class="main_nav navigation horizontal-list"> |
|
537 | <ul id="quick" class="main_nav navigation horizontal-list"> | |
536 | ## notice box for important system messages |
|
538 | ## notice box for important system messages | |
537 | <li style="display: none"> |
|
539 | <li style="display: none"> | |
538 | <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false"> |
|
540 | <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false"> | |
539 | <div class="menulabel-notice" > |
|
541 | <div class="menulabel-notice" > | |
540 | 0 |
|
542 | 0 | |
541 | </div> |
|
543 | </div> | |
542 | </a> |
|
544 | </a> | |
543 | </li> |
|
545 | </li> | |
544 |
|
546 | |||
545 | ## Main filter |
|
547 | ## Main filter | |
546 | <li> |
|
548 | <li> | |
547 | <div class="menulabel main_filter_box"> |
|
549 | <div class="menulabel main_filter_box"> | |
548 | <div class="main_filter_input_box"> |
|
550 | <div class="main_filter_input_box"> | |
549 | <ul class="searchItems"> |
|
551 | <ul class="searchItems"> | |
550 |
|
552 | |||
551 | % if c.template_context['search_context']['repo_id']: |
|
553 | % if c.template_context['search_context']['repo_id']: | |
552 | <li class="searchTag searchTagFilter searchTagHidable" > |
|
554 | <li class="searchTag searchTagFilter searchTagHidable" > | |
553 | ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}"> |
|
555 | ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}"> | |
554 | <span class="tag"> |
|
556 | <span class="tag"> | |
555 | This repo |
|
557 | This repo | |
556 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a> |
|
558 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a> | |
557 | </span> |
|
559 | </span> | |
558 | ##</a> |
|
560 | ##</a> | |
559 | </li> |
|
561 | </li> | |
560 | % elif c.template_context['search_context']['repo_group_id']: |
|
562 | % elif c.template_context['search_context']['repo_group_id']: | |
561 | <li class="searchTag searchTagFilter searchTagHidable"> |
|
563 | <li class="searchTag searchTagFilter searchTagHidable"> | |
562 | ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}"> |
|
564 | ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}"> | |
563 | <span class="tag"> |
|
565 | <span class="tag"> | |
564 | This group |
|
566 | This group | |
565 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a> |
|
567 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a> | |
566 | </span> |
|
568 | </span> | |
567 | ##</a> |
|
569 | ##</a> | |
568 | </li> |
|
570 | </li> | |
569 | % endif |
|
571 | % endif | |
570 |
|
572 | |||
571 | <li class="searchTagInput"> |
|
573 | <li class="searchTagInput"> | |
572 | <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" /> |
|
574 | <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" /> | |
573 | </li> |
|
575 | </li> | |
574 | <li class="searchTag searchTagHelp"> |
|
576 | <li class="searchTag searchTagHelp"> | |
575 | <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a> |
|
577 | <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a> | |
576 | </li> |
|
578 | </li> | |
577 | </ul> |
|
579 | </ul> | |
578 | </div> |
|
580 | </div> | |
579 | </div> |
|
581 | </div> | |
580 |
|
582 | |||
581 | <div id="main_filter_help" style="display: none"> |
|
583 | <div id="main_filter_help" style="display: none"> | |
582 | - Use '/' key to quickly access this field. |
|
584 | - Use '/' key to quickly access this field. | |
583 |
|
585 | |||
584 | - Enter a name of repository, or repository group for quick search. |
|
586 | - Enter a name of repository, or repository group for quick search. | |
585 |
|
587 | |||
586 | - Prefix query to allow special search: |
|
588 | - Prefix query to allow special search: | |
587 |
|
589 | |||
588 | user:admin, to search for usernames, always global |
|
590 | user:admin, to search for usernames, always global | |
589 |
|
591 | |||
590 | user_group:devops, to search for user groups, always global |
|
592 | user_group:devops, to search for user groups, always global | |
591 |
|
593 | |||
592 | commit:efced4, to search for commits, scoped to repositories or groups |
|
594 | commit:efced4, to search for commits, scoped to repositories or groups | |
593 |
|
595 | |||
594 | file:models.py, to search for file paths, scoped to repositories or groups |
|
596 | file:models.py, to search for file paths, scoped to repositories or groups | |
595 |
|
597 | |||
596 | % if c.template_context['search_context']['repo_id']: |
|
598 | % if c.template_context['search_context']['repo_id']: | |
597 | For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a> |
|
599 | For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a> | |
598 | % elif c.template_context['search_context']['repo_group_id']: |
|
600 | % elif c.template_context['search_context']['repo_group_id']: | |
599 | For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a> |
|
601 | For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a> | |
600 | % else: |
|
602 | % else: | |
601 | For advanced full text search visit: <a href="${h.route_path('search')}">global search</a> |
|
603 | For advanced full text search visit: <a href="${h.route_path('search')}">global search</a> | |
602 | % endif |
|
604 | % endif | |
603 | </div> |
|
605 | </div> | |
604 | </li> |
|
606 | </li> | |
605 |
|
607 | |||
606 | ## ROOT MENU |
|
608 | ## ROOT MENU | |
607 | <li class="${is_active('home')}"> |
|
609 | <li class="${is_active('home')}"> | |
608 | <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}"> |
|
610 | <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}"> | |
609 | <div class="menulabel">${_('Home')}</div> |
|
611 | <div class="menulabel">${_('Home')}</div> | |
610 | </a> |
|
612 | </a> | |
611 | </li> |
|
613 | </li> | |
612 |
|
614 | |||
613 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
615 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
614 | <li class="${is_active('journal')}"> |
|
616 | <li class="${is_active('journal')}"> | |
615 | <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}"> |
|
617 | <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}"> | |
616 | <div class="menulabel">${_('Journal')}</div> |
|
618 | <div class="menulabel">${_('Journal')}</div> | |
617 | </a> |
|
619 | </a> | |
618 | </li> |
|
620 | </li> | |
619 | %else: |
|
621 | %else: | |
620 | <li class="${is_active('journal')}"> |
|
622 | <li class="${is_active('journal')}"> | |
621 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}"> |
|
623 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}"> | |
622 | <div class="menulabel">${_('Public journal')}</div> |
|
624 | <div class="menulabel">${_('Public journal')}</div> | |
623 | </a> |
|
625 | </a> | |
624 | </li> |
|
626 | </li> | |
625 | %endif |
|
627 | %endif | |
626 |
|
628 | |||
627 | <li class="${is_active('gists')}"> |
|
629 | <li class="${is_active('gists')}"> | |
628 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}"> |
|
630 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}"> | |
629 | <div class="menulabel">${_('Gists')}</div> |
|
631 | <div class="menulabel">${_('Gists')}</div> | |
630 | </a> |
|
632 | </a> | |
631 | </li> |
|
633 | </li> | |
632 |
|
634 | |||
633 | % if c.is_super_admin or c.is_delegated_admin: |
|
635 | % if c.is_super_admin or c.is_delegated_admin: | |
634 | <li class="${is_active('admin')}"> |
|
636 | <li class="${is_active('admin')}"> | |
635 | <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}"> |
|
637 | <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}"> | |
636 | <div class="menulabel">${_('Admin')} </div> |
|
638 | <div class="menulabel">${_('Admin')} </div> | |
637 | </a> |
|
639 | </a> | |
638 | </li> |
|
640 | </li> | |
639 | % endif |
|
641 | % endif | |
640 |
|
642 | |||
641 | ## render extra user menu |
|
643 | ## render extra user menu | |
642 | ${usermenu(active=(active=='my_account'))} |
|
644 | ${usermenu(active=(active=='my_account'))} | |
643 |
|
645 | |||
644 | % if c.debug_style: |
|
646 | % if c.debug_style: | |
645 | <li> |
|
647 | <li> | |
646 | <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}"> |
|
648 | <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}"> | |
647 | <div class="menulabel">${_('[Style]')}</div> |
|
649 | <div class="menulabel">${_('[Style]')}</div> | |
648 | </a> |
|
650 | </a> | |
649 | </li> |
|
651 | </li> | |
650 | % endif |
|
652 | % endif | |
651 | </ul> |
|
653 | </ul> | |
652 |
|
654 | |||
653 | <script type="text/javascript"> |
|
655 | <script type="text/javascript"> | |
654 | var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True"; |
|
656 | var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True"; | |
655 |
|
657 | |||
656 | var formatRepoResult = function(result, container, query, escapeMarkup) { |
|
658 | var formatRepoResult = function(result, container, query, escapeMarkup) { | |
657 | return function(data, escapeMarkup) { |
|
659 | return function(data, escapeMarkup) { | |
658 | if (!data.repo_id){ |
|
660 | if (!data.repo_id){ | |
659 | return data.text; // optgroup text Repositories |
|
661 | return data.text; // optgroup text Repositories | |
660 | } |
|
662 | } | |
661 |
|
663 | |||
662 | var tmpl = ''; |
|
664 | var tmpl = ''; | |
663 | var repoType = data['repo_type']; |
|
665 | var repoType = data['repo_type']; | |
664 | var repoName = data['text']; |
|
666 | var repoName = data['text']; | |
665 |
|
667 | |||
666 | if(data && data.type == 'repo'){ |
|
668 | if(data && data.type == 'repo'){ | |
667 | if(repoType === 'hg'){ |
|
669 | if(repoType === 'hg'){ | |
668 | tmpl += '<i class="icon-hg"></i> '; |
|
670 | tmpl += '<i class="icon-hg"></i> '; | |
669 | } |
|
671 | } | |
670 | else if(repoType === 'git'){ |
|
672 | else if(repoType === 'git'){ | |
671 | tmpl += '<i class="icon-git"></i> '; |
|
673 | tmpl += '<i class="icon-git"></i> '; | |
672 | } |
|
674 | } | |
673 | else if(repoType === 'svn'){ |
|
675 | else if(repoType === 'svn'){ | |
674 | tmpl += '<i class="icon-svn"></i> '; |
|
676 | tmpl += '<i class="icon-svn"></i> '; | |
675 | } |
|
677 | } | |
676 | if(data['private']){ |
|
678 | if(data['private']){ | |
677 | tmpl += '<i class="icon-lock" ></i> '; |
|
679 | tmpl += '<i class="icon-lock" ></i> '; | |
678 | } |
|
680 | } | |
679 | else if(visualShowPublicIcon){ |
|
681 | else if(visualShowPublicIcon){ | |
680 | tmpl += '<i class="icon-unlock-alt"></i> '; |
|
682 | tmpl += '<i class="icon-unlock-alt"></i> '; | |
681 | } |
|
683 | } | |
682 | } |
|
684 | } | |
683 | tmpl += escapeMarkup(repoName); |
|
685 | tmpl += escapeMarkup(repoName); | |
684 | return tmpl; |
|
686 | return tmpl; | |
685 |
|
687 | |||
686 | }(result, escapeMarkup); |
|
688 | }(result, escapeMarkup); | |
687 | }; |
|
689 | }; | |
688 |
|
690 | |||
689 | var formatRepoGroupResult = function(result, container, query, escapeMarkup) { |
|
691 | var formatRepoGroupResult = function(result, container, query, escapeMarkup) { | |
690 | return function(data, escapeMarkup) { |
|
692 | return function(data, escapeMarkup) { | |
691 | if (!data.repo_group_id){ |
|
693 | if (!data.repo_group_id){ | |
692 | return data.text; // optgroup text Repositories |
|
694 | return data.text; // optgroup text Repositories | |
693 | } |
|
695 | } | |
694 |
|
696 | |||
695 | var tmpl = ''; |
|
697 | var tmpl = ''; | |
696 | var repoGroupName = data['text']; |
|
698 | var repoGroupName = data['text']; | |
697 |
|
699 | |||
698 | if(data){ |
|
700 | if(data){ | |
699 |
|
701 | |||
700 | tmpl += '<i class="icon-repo-group"></i> '; |
|
702 | tmpl += '<i class="icon-repo-group"></i> '; | |
701 |
|
703 | |||
702 | } |
|
704 | } | |
703 | tmpl += escapeMarkup(repoGroupName); |
|
705 | tmpl += escapeMarkup(repoGroupName); | |
704 | return tmpl; |
|
706 | return tmpl; | |
705 |
|
707 | |||
706 | }(result, escapeMarkup); |
|
708 | }(result, escapeMarkup); | |
707 | }; |
|
709 | }; | |
708 |
|
710 | |||
709 | var escapeRegExChars = function (value) { |
|
711 | var escapeRegExChars = function (value) { | |
710 | return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
712 | return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
711 | }; |
|
713 | }; | |
712 |
|
714 | |||
713 | var getRepoIcon = function(repo_type) { |
|
715 | var getRepoIcon = function(repo_type) { | |
714 | if (repo_type === 'hg') { |
|
716 | if (repo_type === 'hg') { | |
715 | return '<i class="icon-hg"></i> '; |
|
717 | return '<i class="icon-hg"></i> '; | |
716 | } |
|
718 | } | |
717 | else if (repo_type === 'git') { |
|
719 | else if (repo_type === 'git') { | |
718 | return '<i class="icon-git"></i> '; |
|
720 | return '<i class="icon-git"></i> '; | |
719 | } |
|
721 | } | |
720 | else if (repo_type === 'svn') { |
|
722 | else if (repo_type === 'svn') { | |
721 | return '<i class="icon-svn"></i> '; |
|
723 | return '<i class="icon-svn"></i> '; | |
722 | } |
|
724 | } | |
723 | return '' |
|
725 | return '' | |
724 | }; |
|
726 | }; | |
725 |
|
727 | |||
726 | var autocompleteMainFilterFormatResult = function (data, value, org_formatter) { |
|
728 | var autocompleteMainFilterFormatResult = function (data, value, org_formatter) { | |
727 |
|
729 | |||
728 | if (value.split(':').length === 2) { |
|
730 | if (value.split(':').length === 2) { | |
729 | value = value.split(':')[1] |
|
731 | value = value.split(':')[1] | |
730 | } |
|
732 | } | |
731 |
|
733 | |||
732 | var searchType = data['type']; |
|
734 | var searchType = data['type']; | |
733 | var valueDisplay = data['value_display']; |
|
735 | var valueDisplay = data['value_display']; | |
734 |
|
736 | |||
735 | var pattern = '(' + escapeRegExChars(value) + ')'; |
|
737 | var pattern = '(' + escapeRegExChars(value) + ')'; | |
736 |
|
738 | |||
737 | valueDisplay = Select2.util.escapeMarkup(valueDisplay); |
|
739 | valueDisplay = Select2.util.escapeMarkup(valueDisplay); | |
738 |
|
740 | |||
739 | // highlight match |
|
741 | // highlight match | |
740 | if (searchType != 'text') { |
|
742 | if (searchType != 'text') { | |
741 | valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>'); |
|
743 | valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>'); | |
742 | } |
|
744 | } | |
743 |
|
745 | |||
744 | var icon = ''; |
|
746 | var icon = ''; | |
745 |
|
747 | |||
746 | if (searchType === 'hint') { |
|
748 | if (searchType === 'hint') { | |
747 | icon += '<i class="icon-repo-group"></i> '; |
|
749 | icon += '<i class="icon-repo-group"></i> '; | |
748 | } |
|
750 | } | |
749 | // full text search |
|
751 | // full text search | |
750 | else if (searchType === 'search') { |
|
752 | else if (searchType === 'search') { | |
751 | icon += '<i class="icon-more"></i> '; |
|
753 | icon += '<i class="icon-more"></i> '; | |
752 | } |
|
754 | } | |
753 | // repository |
|
755 | // repository | |
754 | else if (searchType === 'repo') { |
|
756 | else if (searchType === 'repo') { | |
755 |
|
757 | |||
756 | var repoIcon = getRepoIcon(data['repo_type']); |
|
758 | var repoIcon = getRepoIcon(data['repo_type']); | |
757 | icon += repoIcon; |
|
759 | icon += repoIcon; | |
758 |
|
760 | |||
759 | if (data['private']) { |
|
761 | if (data['private']) { | |
760 | icon += '<i class="icon-lock" ></i> '; |
|
762 | icon += '<i class="icon-lock" ></i> '; | |
761 | } |
|
763 | } | |
762 | else if (visualShowPublicIcon) { |
|
764 | else if (visualShowPublicIcon) { | |
763 | icon += '<i class="icon-unlock-alt"></i> '; |
|
765 | icon += '<i class="icon-unlock-alt"></i> '; | |
764 | } |
|
766 | } | |
765 | } |
|
767 | } | |
766 | // repository groups |
|
768 | // repository groups | |
767 | else if (searchType === 'repo_group') { |
|
769 | else if (searchType === 'repo_group') { | |
768 | icon += '<i class="icon-repo-group"></i> '; |
|
770 | icon += '<i class="icon-repo-group"></i> '; | |
769 | } |
|
771 | } | |
770 | // user group |
|
772 | // user group | |
771 | else if (searchType === 'user_group') { |
|
773 | else if (searchType === 'user_group') { | |
772 | icon += '<i class="icon-group"></i> '; |
|
774 | icon += '<i class="icon-group"></i> '; | |
773 | } |
|
775 | } | |
774 | // user |
|
776 | // user | |
775 | else if (searchType === 'user') { |
|
777 | else if (searchType === 'user') { | |
776 | icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']); |
|
778 | icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']); | |
777 | } |
|
779 | } | |
778 | // commit |
|
780 | // commit | |
779 | else if (searchType === 'commit') { |
|
781 | else if (searchType === 'commit') { | |
780 | var repo_data = data['repo_data']; |
|
782 | var repo_data = data['repo_data']; | |
781 | var repoIcon = getRepoIcon(repo_data['repository_type']); |
|
783 | var repoIcon = getRepoIcon(repo_data['repository_type']); | |
782 | if (repoIcon) { |
|
784 | if (repoIcon) { | |
783 | icon += repoIcon; |
|
785 | icon += repoIcon; | |
784 | } else { |
|
786 | } else { | |
785 | icon += '<i class="icon-tag"></i>'; |
|
787 | icon += '<i class="icon-tag"></i>'; | |
786 | } |
|
788 | } | |
787 | } |
|
789 | } | |
788 | // file |
|
790 | // file | |
789 | else if (searchType === 'file') { |
|
791 | else if (searchType === 'file') { | |
790 | var repo_data = data['repo_data']; |
|
792 | var repo_data = data['repo_data']; | |
791 | var repoIcon = getRepoIcon(repo_data['repository_type']); |
|
793 | var repoIcon = getRepoIcon(repo_data['repository_type']); | |
792 | if (repoIcon) { |
|
794 | if (repoIcon) { | |
793 | icon += repoIcon; |
|
795 | icon += repoIcon; | |
794 | } else { |
|
796 | } else { | |
795 | icon += '<i class="icon-tag"></i>'; |
|
797 | icon += '<i class="icon-tag"></i>'; | |
796 | } |
|
798 | } | |
797 | } |
|
799 | } | |
798 | // generic text |
|
800 | // generic text | |
799 | else if (searchType === 'text') { |
|
801 | else if (searchType === 'text') { | |
800 | icon = ''; |
|
802 | icon = ''; | |
801 | } |
|
803 | } | |
802 |
|
804 | |||
803 | var tmpl = '<div class="ac-container-wrap">{0}{1}</div>'; |
|
805 | var tmpl = '<div class="ac-container-wrap">{0}{1}</div>'; | |
804 | return tmpl.format(icon, valueDisplay); |
|
806 | return tmpl.format(icon, valueDisplay); | |
805 | }; |
|
807 | }; | |
806 |
|
808 | |||
807 | var handleSelect = function(element, suggestion) { |
|
809 | var handleSelect = function(element, suggestion) { | |
808 | if (suggestion.type === "hint") { |
|
810 | if (suggestion.type === "hint") { | |
809 | // we skip action |
|
811 | // we skip action | |
810 | $('#main_filter').focus(); |
|
812 | $('#main_filter').focus(); | |
811 | } |
|
813 | } | |
812 | else if (suggestion.type === "text") { |
|
814 | else if (suggestion.type === "text") { | |
813 | // we skip action |
|
815 | // we skip action | |
814 | $('#main_filter').focus(); |
|
816 | $('#main_filter').focus(); | |
815 |
|
817 | |||
816 | } else { |
|
818 | } else { | |
817 | window.location = suggestion['url']; |
|
819 | window.location = suggestion['url']; | |
818 | } |
|
820 | } | |
819 | }; |
|
821 | }; | |
820 |
|
822 | |||
821 | var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) { |
|
823 | var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) { | |
822 | if (queryLowerCase.split(':').length === 2) { |
|
824 | if (queryLowerCase.split(':').length === 2) { | |
823 | queryLowerCase = queryLowerCase.split(':')[1] |
|
825 | queryLowerCase = queryLowerCase.split(':')[1] | |
824 | } |
|
826 | } | |
825 | if (suggestion.type === "text") { |
|
827 | if (suggestion.type === "text") { | |
826 | // special case we don't want to "skip" display for |
|
828 | // special case we don't want to "skip" display for | |
827 | return true |
|
829 | return true | |
828 | } |
|
830 | } | |
829 | return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1; |
|
831 | return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1; | |
830 | }; |
|
832 | }; | |
831 |
|
833 | |||
832 | var cleanContext = { |
|
834 | var cleanContext = { | |
833 | repo_view_type: null, |
|
835 | repo_view_type: null, | |
834 |
|
836 | |||
835 | repo_id: null, |
|
837 | repo_id: null, | |
836 | repo_name: "", |
|
838 | repo_name: "", | |
837 |
|
839 | |||
838 | repo_group_id: null, |
|
840 | repo_group_id: null, | |
839 | repo_group_name: null |
|
841 | repo_group_name: null | |
840 | }; |
|
842 | }; | |
841 | var removeGoToFilter = function () { |
|
843 | var removeGoToFilter = function () { | |
842 | $('.searchTagHidable').hide(); |
|
844 | $('.searchTagHidable').hide(); | |
843 | $('#main_filter').autocomplete( |
|
845 | $('#main_filter').autocomplete( | |
844 | 'setOptions', {params:{search_context: cleanContext}}); |
|
846 | 'setOptions', {params:{search_context: cleanContext}}); | |
845 | }; |
|
847 | }; | |
846 |
|
848 | |||
847 | $('#main_filter').autocomplete({ |
|
849 | $('#main_filter').autocomplete({ | |
848 | serviceUrl: pyroutes.url('goto_switcher_data'), |
|
850 | serviceUrl: pyroutes.url('goto_switcher_data'), | |
849 | params: { |
|
851 | params: { | |
850 | "search_context": templateContext.search_context |
|
852 | "search_context": templateContext.search_context | |
851 | }, |
|
853 | }, | |
852 | minChars:2, |
|
854 | minChars:2, | |
853 | maxHeight:400, |
|
855 | maxHeight:400, | |
854 | deferRequestBy: 300, //miliseconds |
|
856 | deferRequestBy: 300, //miliseconds | |
855 | tabDisabled: true, |
|
857 | tabDisabled: true, | |
856 | autoSelectFirst: false, |
|
858 | autoSelectFirst: false, | |
857 | formatResult: autocompleteMainFilterFormatResult, |
|
859 | formatResult: autocompleteMainFilterFormatResult, | |
858 | lookupFilter: autocompleteMainFilterResult, |
|
860 | lookupFilter: autocompleteMainFilterResult, | |
859 | onSelect: function (element, suggestion) { |
|
861 | onSelect: function (element, suggestion) { | |
860 | handleSelect(element, suggestion); |
|
862 | handleSelect(element, suggestion); | |
861 | return false; |
|
863 | return false; | |
862 | }, |
|
864 | }, | |
863 | onSearchError: function (element, query, jqXHR, textStatus, errorThrown) { |
|
865 | onSearchError: function (element, query, jqXHR, textStatus, errorThrown) { | |
864 | if (jqXHR !== 'abort') { |
|
866 | if (jqXHR !== 'abort') { | |
865 | alert("Error during search.\nError code: {0}".format(textStatus)); |
|
867 | alert("Error during search.\nError code: {0}".format(textStatus)); | |
866 | window.location = ''; |
|
868 | window.location = ''; | |
867 | } |
|
869 | } | |
868 | } |
|
870 | } | |
869 | }); |
|
871 | }); | |
870 |
|
872 | |||
871 | showMainFilterBox = function () { |
|
873 | showMainFilterBox = function () { | |
872 | $('#main_filter_help').toggle(); |
|
874 | $('#main_filter_help').toggle(); | |
873 | }; |
|
875 | }; | |
874 |
|
876 | |||
875 | $('#main_filter').on('keydown.autocomplete', function (e) { |
|
877 | $('#main_filter').on('keydown.autocomplete', function (e) { | |
876 |
|
878 | |||
877 | var BACKSPACE = 8; |
|
879 | var BACKSPACE = 8; | |
878 | var el = $(e.currentTarget); |
|
880 | var el = $(e.currentTarget); | |
879 | if(e.which === BACKSPACE){ |
|
881 | if(e.which === BACKSPACE){ | |
880 | var inputVal = el.val(); |
|
882 | var inputVal = el.val(); | |
881 | if (inputVal === ""){ |
|
883 | if (inputVal === ""){ | |
882 | removeGoToFilter() |
|
884 | removeGoToFilter() | |
883 | } |
|
885 | } | |
884 | } |
|
886 | } | |
885 | }); |
|
887 | }); | |
886 |
|
888 | |||
887 | </script> |
|
889 | </script> | |
888 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> |
|
890 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> | |
889 | </%def> |
|
891 | </%def> | |
890 |
|
892 | |||
891 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
|
893 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
892 | <div class="modal-dialog"> |
|
894 | <div class="modal-dialog"> | |
893 | <div class="modal-content"> |
|
895 | <div class="modal-content"> | |
894 | <div class="modal-header"> |
|
896 | <div class="modal-header"> | |
895 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|
897 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
896 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> |
|
898 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> | |
897 | </div> |
|
899 | </div> | |
898 | <div class="modal-body"> |
|
900 | <div class="modal-body"> | |
899 | <div class="block-left"> |
|
901 | <div class="block-left"> | |
900 | <table class="keyboard-mappings"> |
|
902 | <table class="keyboard-mappings"> | |
901 | <tbody> |
|
903 | <tbody> | |
902 | <tr> |
|
904 | <tr> | |
903 | <th></th> |
|
905 | <th></th> | |
904 | <th>${_('Site-wide shortcuts')}</th> |
|
906 | <th>${_('Site-wide shortcuts')}</th> | |
905 | </tr> |
|
907 | </tr> | |
906 | <% |
|
908 | <% | |
907 | elems = [ |
|
909 | elems = [ | |
908 | ('/', 'Use quick search box'), |
|
910 | ('/', 'Use quick search box'), | |
909 | ('g h', 'Goto home page'), |
|
911 | ('g h', 'Goto home page'), | |
910 | ('g g', 'Goto my private gists page'), |
|
912 | ('g g', 'Goto my private gists page'), | |
911 | ('g G', 'Goto my public gists page'), |
|
913 | ('g G', 'Goto my public gists page'), | |
912 | ('g 0-9', 'Goto bookmarked items from 0-9'), |
|
914 | ('g 0-9', 'Goto bookmarked items from 0-9'), | |
913 | ('n r', 'New repository page'), |
|
915 | ('n r', 'New repository page'), | |
914 | ('n g', 'New gist page'), |
|
916 | ('n g', 'New gist page'), | |
915 | ] |
|
917 | ] | |
916 | %> |
|
918 | %> | |
917 | %for key, desc in elems: |
|
919 | %for key, desc in elems: | |
918 | <tr> |
|
920 | <tr> | |
919 | <td class="keys"> |
|
921 | <td class="keys"> | |
920 | <span class="key tag">${key}</span> |
|
922 | <span class="key tag">${key}</span> | |
921 | </td> |
|
923 | </td> | |
922 | <td>${desc}</td> |
|
924 | <td>${desc}</td> | |
923 | </tr> |
|
925 | </tr> | |
924 | %endfor |
|
926 | %endfor | |
925 | </tbody> |
|
927 | </tbody> | |
926 | </table> |
|
928 | </table> | |
927 | </div> |
|
929 | </div> | |
928 | <div class="block-left"> |
|
930 | <div class="block-left"> | |
929 | <table class="keyboard-mappings"> |
|
931 | <table class="keyboard-mappings"> | |
930 | <tbody> |
|
932 | <tbody> | |
931 | <tr> |
|
933 | <tr> | |
932 | <th></th> |
|
934 | <th></th> | |
933 | <th>${_('Repositories')}</th> |
|
935 | <th>${_('Repositories')}</th> | |
934 | </tr> |
|
936 | </tr> | |
935 | <% |
|
937 | <% | |
936 | elems = [ |
|
938 | elems = [ | |
937 | ('g s', 'Goto summary page'), |
|
939 | ('g s', 'Goto summary page'), | |
938 | ('g c', 'Goto changelog page'), |
|
940 | ('g c', 'Goto changelog page'), | |
939 | ('g f', 'Goto files page'), |
|
941 | ('g f', 'Goto files page'), | |
940 | ('g F', 'Goto files page with file search activated'), |
|
942 | ('g F', 'Goto files page with file search activated'), | |
941 | ('g p', 'Goto pull requests page'), |
|
943 | ('g p', 'Goto pull requests page'), | |
942 | ('g o', 'Goto repository settings'), |
|
944 | ('g o', 'Goto repository settings'), | |
943 | ('g O', 'Goto repository permissions settings'), |
|
945 | ('g O', 'Goto repository permissions settings'), | |
944 | ] |
|
946 | ] | |
945 | %> |
|
947 | %> | |
946 | %for key, desc in elems: |
|
948 | %for key, desc in elems: | |
947 | <tr> |
|
949 | <tr> | |
948 | <td class="keys"> |
|
950 | <td class="keys"> | |
949 | <span class="key tag">${key}</span> |
|
951 | <span class="key tag">${key}</span> | |
950 | </td> |
|
952 | </td> | |
951 | <td>${desc}</td> |
|
953 | <td>${desc}</td> | |
952 | </tr> |
|
954 | </tr> | |
953 | %endfor |
|
955 | %endfor | |
954 | </tbody> |
|
956 | </tbody> | |
955 | </table> |
|
957 | </table> | |
956 | </div> |
|
958 | </div> | |
957 | </div> |
|
959 | </div> | |
958 | <div class="modal-footer"> |
|
960 | <div class="modal-footer"> | |
959 | </div> |
|
961 | </div> | |
960 | </div><!-- /.modal-content --> |
|
962 | </div><!-- /.modal-content --> | |
961 | </div><!-- /.modal-dialog --> |
|
963 | </div><!-- /.modal-dialog --> | |
962 | </div><!-- /.modal --> |
|
964 | </div><!-- /.modal --> | |
963 |
|
965 |
@@ -1,297 +1,313 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.mako"/> |
|
2 | <%inherit file="/base/base.mako"/> | |
3 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
3 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> | |
4 |
|
4 | |||
5 | <%def name="title()"> |
|
5 | <%def name="title()"> | |
6 | %if c.compare_home: |
|
6 | %if c.compare_home: | |
7 | ${_('%s Compare') % c.repo_name} |
|
7 | ${_('%s Compare') % c.repo_name} | |
8 | %else: |
|
8 | %else: | |
9 | ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.source_repo.repo_name, c.source_ref)} > ${'%s@%s' % (c.target_repo.repo_name, c.target_ref)} |
|
9 | ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.source_repo.repo_name, c.source_ref)} > ${'%s@%s' % (c.target_repo.repo_name, c.target_ref)} | |
10 | %endif |
|
10 | %endif | |
11 | %if c.rhodecode_name: |
|
11 | %if c.rhodecode_name: | |
12 | · ${h.branding(c.rhodecode_name)} |
|
12 | · ${h.branding(c.rhodecode_name)} | |
13 | %endif |
|
13 | %endif | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="breadcrumbs_links()"></%def> |
|
16 | <%def name="breadcrumbs_links()"></%def> | |
17 |
|
17 | |||
18 | <%def name="menu_bar_nav()"> |
|
18 | <%def name="menu_bar_nav()"> | |
19 | ${self.menu_items(active='repositories')} |
|
19 | ${self.menu_items(active='repositories')} | |
20 | </%def> |
|
20 | </%def> | |
21 |
|
21 | |||
22 | <%def name="menu_bar_subnav()"> |
|
22 | <%def name="menu_bar_subnav()"> | |
23 | ${self.repo_menu(active='compare')} |
|
23 | ${self.repo_menu(active='compare')} | |
24 | </%def> |
|
24 | </%def> | |
25 |
|
25 | |||
26 | <%def name="main()"> |
|
26 | <%def name="main()"> | |
27 | <script type="text/javascript"> |
|
27 | <script type="text/javascript"> | |
28 | // set fake commitId on this commit-range page |
|
28 | // set fake commitId on this commit-range page | |
29 | templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}"; |
|
29 | templateContext.commit_data.commit_id = "${h.EmptyCommit().raw_id}"; | |
30 | </script> |
|
30 | </script> | |
31 |
|
31 | |||
32 | <div class="box"> |
|
32 | <div class="box"> | |
33 | <div class="summary changeset"> |
|
33 | <div class="summary changeset"> | |
34 | <div class="summary-detail"> |
|
34 | <div class="summary-detail"> | |
35 | <div class="summary-detail-header"> |
|
35 | <div class="summary-detail-header"> | |
36 | <span class="breadcrumbs files_location"> |
|
36 | <span class="breadcrumbs files_location"> | |
37 | <h4> |
|
37 | <h4> | |
38 | ${_('Compare Commits')} |
|
38 | ${_('Compare Commits')} | |
39 | % if c.file_path: |
|
39 | % if c.file_path: | |
40 | ${_('for file')} <a href="#${'a_' + h.FID('',c.file_path)}">${c.file_path}</a> |
|
40 | ${_('for file')} <a href="#${'a_' + h.FID('',c.file_path)}">${c.file_path}</a> | |
41 | % endif |
|
41 | % endif | |
42 |
|
42 | |||
43 | % if c.commit_ranges: |
|
43 | % if c.commit_ranges: | |
44 | <code> |
|
44 | <code> | |
45 | r${c.source_commit.idx}:${h.short_id(c.source_commit.raw_id)}...r${c.target_commit.idx}:${h.short_id(c.target_commit.raw_id)} |
|
45 | r${c.source_commit.idx}:${h.short_id(c.source_commit.raw_id)}...r${c.target_commit.idx}:${h.short_id(c.target_commit.raw_id)} | |
46 | </code> |
|
46 | </code> | |
47 | % endif |
|
47 | % endif | |
48 | </h4> |
|
48 | </h4> | |
49 | </span> |
|
49 | </span> | |
|
50 | ||||
50 | <div class="clear-fix"></div> |
|
51 | <div class="clear-fix"></div> | |
51 | </div> |
|
52 | </div> | |
52 |
|
53 | |||
53 | <div class="fieldset"> |
|
54 | <div class="fieldset"> | |
54 | <div class="left-label-summary"> |
|
55 | <div class="left-label-summary"> | |
55 | <p class="spacing">${_('Target')}:</p> |
|
56 | <p class="spacing">${_('Target')}:</p> | |
56 | <div class="right-label-summary"> |
|
57 | <div class="right-label-summary"> | |
57 | <div class="code-header" > |
|
58 | <div class="code-header" > | |
58 | <div class="compare_header"> |
|
59 | <div class="compare_header"> | |
59 | ## The hidden elements are replaced with a select2 widget |
|
60 | ## The hidden elements are replaced with a select2 widget | |
60 | ${h.hidden('compare_source')} |
|
61 | ${h.hidden('compare_source')} | |
61 | </div> |
|
62 | </div> | |
62 | </div> |
|
63 | </div> | |
63 | </div> |
|
64 | </div> | |
64 | </div> |
|
65 | </div> | |
65 | </div> |
|
66 | </div> | |
66 |
|
67 | |||
67 | <div class="fieldset"> |
|
68 | <div class="fieldset"> | |
68 | <div class="left-label-summary"> |
|
69 | <div class="left-label-summary"> | |
69 | <p class="spacing">${_('Source')}:</p> |
|
70 | <p class="spacing">${_('Source')}:</p> | |
70 | <div class="right-label-summary"> |
|
71 | <div class="right-label-summary"> | |
71 | <div class="code-header" > |
|
72 | <div class="code-header" > | |
72 | <div class="compare_header"> |
|
73 | <div class="compare_header"> | |
73 | ## The hidden elements are replaced with a select2 widget |
|
74 | ## The hidden elements are replaced with a select2 widget | |
74 | ${h.hidden('compare_target')} |
|
75 | ${h.hidden('compare_target')} | |
75 | </div> |
|
76 | </div> | |
76 | </div> |
|
77 | </div> | |
77 | </div> |
|
78 | </div> | |
78 | </div> |
|
79 | </div> | |
79 | </div> |
|
80 | </div> | |
80 |
|
81 | |||
81 | <div class="fieldset"> |
|
82 | <div class="fieldset"> | |
82 | <div class="left-label-summary"> |
|
83 | <div class="left-label-summary"> | |
83 | <p class="spacing">${_('Actions')}:</p> |
|
84 | <p class="spacing">${_('Actions')}:</p> | |
84 | <div class="right-label-summary"> |
|
85 | <div class="right-label-summary"> | |
85 | <div class="code-header" > |
|
86 | <div class="code-header" > | |
86 | <div class="compare_header"> |
|
87 | <div class="compare_header"> | |
87 | <div class="compare-buttons"> |
|
88 | <div class="compare-buttons"> | |
88 | % if c.compare_home: |
|
89 | % if c.compare_home: | |
89 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> |
|
90 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> | |
|
91 | %if c.rhodecode_db_repo.fork: | |||
|
92 | ||||
|
93 | <a class="btn btn-default" title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" | |||
|
94 | href="${h.route_path('repo_compare', | |||
|
95 | repo_name=c.rhodecode_db_repo.fork.repo_name, | |||
|
96 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], | |||
|
97 | source_ref=c.rhodecode_db_repo.landing_rev[1], | |||
|
98 | target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], | |||
|
99 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], | |||
|
100 | _query=dict(merge=1))}" | |||
|
101 | > | |||
|
102 | ${_('Compare with origin')} | |||
|
103 | </a> | |||
|
104 | ||||
|
105 | %endif | |||
90 |
|
106 | |||
91 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> |
|
107 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> | |
92 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
108 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> | |
93 | <div id="changeset_compare_view_content"> |
|
109 | <div id="changeset_compare_view_content"> | |
94 | <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div> |
|
110 | <div class="help-block">${_('Compare commits, branches, bookmarks or tags.')}</div> | |
95 | </div> |
|
111 | </div> | |
96 |
|
112 | |||
97 | % elif c.preview_mode: |
|
113 | % elif c.preview_mode: | |
98 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a> |
|
114 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Compare Commits')}</a> | |
99 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> |
|
115 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Swap')}</a> | |
100 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
116 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> | |
101 |
|
117 | |||
102 | % else: |
|
118 | % else: | |
103 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> |
|
119 | <a id="compare_revs" class="btn btn-primary"> ${_('Compare Commits')}</a> | |
104 | <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a> |
|
120 | <a id="btn-swap" class="btn btn-primary" href="${c.swap_url}">${_('Swap')}</a> | |
105 |
|
121 | |||
106 | ## allow comment only if there are commits to comment on |
|
122 | ## allow comment only if there are commits to comment on | |
107 | % if c.diffset and c.diffset.files and c.commit_ranges: |
|
123 | % if c.diffset and c.diffset.files and c.commit_ranges: | |
108 | <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a> |
|
124 | <a id="compare_changeset_status_toggle" class="btn btn-primary">${_('Comment')}</a> | |
109 | % else: |
|
125 | % else: | |
110 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> |
|
126 | <a class="btn disabled tooltip" disabled="disabled" title="${_('Action unavailable in current view')}">${_('Comment')}</a> | |
111 | % endif |
|
127 | % endif | |
112 | % endif |
|
128 | % endif | |
113 | </div> |
|
129 | </div> | |
114 | </div> |
|
130 | </div> | |
115 | </div> |
|
131 | </div> | |
116 | </div> |
|
132 | </div> | |
117 | </div> |
|
133 | </div> | |
118 | </div> |
|
134 | </div> | |
119 |
|
135 | |||
120 | ## commit status form |
|
136 | ## commit status form | |
121 | <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;"> |
|
137 | <div class="fieldset" id="compare_changeset_status" style="display: none; margin-bottom: -80px;"> | |
122 | <div class="left-label-summary"> |
|
138 | <div class="left-label-summary"> | |
123 | <p class="spacing">${_('Commit status')}:</p> |
|
139 | <p class="spacing">${_('Commit status')}:</p> | |
124 | <div class="right-label-summary"> |
|
140 | <div class="right-label-summary"> | |
125 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
141 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | |
126 | ## main comment form and it status |
|
142 | ## main comment form and it status | |
127 | <% |
|
143 | <% | |
128 | def revs(_revs): |
|
144 | def revs(_revs): | |
129 | form_inputs = [] |
|
145 | form_inputs = [] | |
130 | for cs in _revs: |
|
146 | for cs in _revs: | |
131 | tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id} |
|
147 | tmpl = '<input type="hidden" data-commit-id="%(cid)s" name="commit_ids" value="%(cid)s">' % {'cid': cs.raw_id} | |
132 | form_inputs.append(tmpl) |
|
148 | form_inputs.append(tmpl) | |
133 | return form_inputs |
|
149 | return form_inputs | |
134 | %> |
|
150 | %> | |
135 | <div> |
|
151 | <div> | |
136 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id='0'*16), None, is_compare=True, form_extras=revs(c.commit_ranges))} |
|
152 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id='0'*16), None, is_compare=True, form_extras=revs(c.commit_ranges))} | |
137 | </div> |
|
153 | </div> | |
138 | </div> |
|
154 | </div> | |
139 | </div> |
|
155 | </div> | |
140 | </div> |
|
156 | </div> | |
141 | <div class="clear-fix"></div> |
|
157 | <div class="clear-fix"></div> | |
142 | </div> <!-- end summary-detail --> |
|
158 | </div> <!-- end summary-detail --> | |
143 | </div> <!-- end summary --> |
|
159 | </div> <!-- end summary --> | |
144 |
|
160 | |||
145 | ## use JS script to load it quickly before potentially large diffs render long time |
|
161 | ## use JS script to load it quickly before potentially large diffs render long time | |
146 | ## this prevents from situation when large diffs block rendering of select2 fields |
|
162 | ## this prevents from situation when large diffs block rendering of select2 fields | |
147 | <script type="text/javascript"> |
|
163 | <script type="text/javascript"> | |
148 |
|
164 | |||
149 | var cache = {}; |
|
165 | var cache = {}; | |
150 |
|
166 | |||
151 | var formatSelection = function(repoName){ |
|
167 | var formatSelection = function(repoName){ | |
152 | return function(data, container, escapeMarkup) { |
|
168 | return function(data, container, escapeMarkup) { | |
153 | var selection = data ? this.text(data) : ""; |
|
169 | var selection = data ? this.text(data) : ""; | |
154 | return escapeMarkup('{0}@{1}'.format(repoName, selection)); |
|
170 | return escapeMarkup('{0}@{1}'.format(repoName, selection)); | |
155 | } |
|
171 | } | |
156 | }; |
|
172 | }; | |
157 |
|
173 | |||
158 | var feedCompareData = function(query, cachedValue){ |
|
174 | var feedCompareData = function(query, cachedValue){ | |
159 | var data = {results: []}; |
|
175 | var data = {results: []}; | |
160 | //filter results |
|
176 | //filter results | |
161 | $.each(cachedValue.results, function() { |
|
177 | $.each(cachedValue.results, function() { | |
162 | var section = this.text; |
|
178 | var section = this.text; | |
163 | var children = []; |
|
179 | var children = []; | |
164 | $.each(this.children, function() { |
|
180 | $.each(this.children, function() { | |
165 | if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { |
|
181 | if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { | |
166 | children.push({ |
|
182 | children.push({ | |
167 | 'id': this.id, |
|
183 | 'id': this.id, | |
168 | 'text': this.text, |
|
184 | 'text': this.text, | |
169 | 'type': this.type |
|
185 | 'type': this.type | |
170 | }) |
|
186 | }) | |
171 | } |
|
187 | } | |
172 | }); |
|
188 | }); | |
173 | data.results.push({ |
|
189 | data.results.push({ | |
174 | 'text': section, |
|
190 | 'text': section, | |
175 | 'children': children |
|
191 | 'children': children | |
176 | }) |
|
192 | }) | |
177 | }); |
|
193 | }); | |
178 | //push the typed in changeset |
|
194 | //push the typed in changeset | |
179 | data.results.push({ |
|
195 | data.results.push({ | |
180 | 'text': _gettext('specify commit'), |
|
196 | 'text': _gettext('specify commit'), | |
181 | 'children': [{ |
|
197 | 'children': [{ | |
182 | 'id': query.term, |
|
198 | 'id': query.term, | |
183 | 'text': query.term, |
|
199 | 'text': query.term, | |
184 | 'type': 'rev' |
|
200 | 'type': 'rev' | |
185 | }] |
|
201 | }] | |
186 | }); |
|
202 | }); | |
187 | query.callback(data); |
|
203 | query.callback(data); | |
188 | }; |
|
204 | }; | |
189 |
|
205 | |||
190 | var loadCompareData = function(repoName, query, cache){ |
|
206 | var loadCompareData = function(repoName, query, cache){ | |
191 | $.ajax({ |
|
207 | $.ajax({ | |
192 | url: pyroutes.url('repo_refs_data', {'repo_name': repoName}), |
|
208 | url: pyroutes.url('repo_refs_data', {'repo_name': repoName}), | |
193 | data: {}, |
|
209 | data: {}, | |
194 | dataType: 'json', |
|
210 | dataType: 'json', | |
195 | type: 'GET', |
|
211 | type: 'GET', | |
196 | success: function(data) { |
|
212 | success: function(data) { | |
197 | cache[repoName] = data; |
|
213 | cache[repoName] = data; | |
198 | query.callback({results: data.results}); |
|
214 | query.callback({results: data.results}); | |
199 | } |
|
215 | } | |
200 | }) |
|
216 | }) | |
201 | }; |
|
217 | }; | |
202 |
|
218 | |||
203 | var enable_fields = ${"false" if c.preview_mode else "true"}; |
|
219 | var enable_fields = ${"false" if c.preview_mode else "true"}; | |
204 | $("#compare_source").select2({ |
|
220 | $("#compare_source").select2({ | |
205 | placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}", |
|
221 | placeholder: "${'%s@%s' % (c.source_repo.repo_name, c.source_ref)}", | |
206 | containerCssClass: "drop-menu", |
|
222 | containerCssClass: "drop-menu", | |
207 | dropdownCssClass: "drop-menu-dropdown", |
|
223 | dropdownCssClass: "drop-menu-dropdown", | |
208 | formatSelection: formatSelection("${c.source_repo.repo_name}"), |
|
224 | formatSelection: formatSelection("${c.source_repo.repo_name}"), | |
209 | dropdownAutoWidth: true, |
|
225 | dropdownAutoWidth: true, | |
210 | query: function(query) { |
|
226 | query: function(query) { | |
211 | var repoName = '${c.source_repo.repo_name}'; |
|
227 | var repoName = '${c.source_repo.repo_name}'; | |
212 | var cachedValue = cache[repoName]; |
|
228 | var cachedValue = cache[repoName]; | |
213 |
|
229 | |||
214 | if (cachedValue){ |
|
230 | if (cachedValue){ | |
215 | feedCompareData(query, cachedValue); |
|
231 | feedCompareData(query, cachedValue); | |
216 | } |
|
232 | } | |
217 | else { |
|
233 | else { | |
218 | loadCompareData(repoName, query, cache); |
|
234 | loadCompareData(repoName, query, cache); | |
219 | } |
|
235 | } | |
220 | } |
|
236 | } | |
221 | }).select2("enable", enable_fields); |
|
237 | }).select2("enable", enable_fields); | |
222 |
|
238 | |||
223 | $("#compare_target").select2({ |
|
239 | $("#compare_target").select2({ | |
224 | placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}", |
|
240 | placeholder: "${'%s@%s' % (c.target_repo.repo_name, c.target_ref)}", | |
225 | dropdownAutoWidth: true, |
|
241 | dropdownAutoWidth: true, | |
226 | containerCssClass: "drop-menu", |
|
242 | containerCssClass: "drop-menu", | |
227 | dropdownCssClass: "drop-menu-dropdown", |
|
243 | dropdownCssClass: "drop-menu-dropdown", | |
228 | formatSelection: formatSelection("${c.target_repo.repo_name}"), |
|
244 | formatSelection: formatSelection("${c.target_repo.repo_name}"), | |
229 | query: function(query) { |
|
245 | query: function(query) { | |
230 | var repoName = '${c.target_repo.repo_name}'; |
|
246 | var repoName = '${c.target_repo.repo_name}'; | |
231 | var cachedValue = cache[repoName]; |
|
247 | var cachedValue = cache[repoName]; | |
232 |
|
248 | |||
233 | if (cachedValue){ |
|
249 | if (cachedValue){ | |
234 | feedCompareData(query, cachedValue); |
|
250 | feedCompareData(query, cachedValue); | |
235 | } |
|
251 | } | |
236 | else { |
|
252 | else { | |
237 | loadCompareData(repoName, query, cache); |
|
253 | loadCompareData(repoName, query, cache); | |
238 | } |
|
254 | } | |
239 | } |
|
255 | } | |
240 | }).select2("enable", enable_fields); |
|
256 | }).select2("enable", enable_fields); | |
241 | var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"}; |
|
257 | var initial_compare_source = {id: "${c.source_ref}", type:"${c.source_ref_type}"}; | |
242 | var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"}; |
|
258 | var initial_compare_target = {id: "${c.target_ref}", type:"${c.target_ref_type}"}; | |
243 |
|
259 | |||
244 | $('#compare_revs').on('click', function(e) { |
|
260 | $('#compare_revs').on('click', function(e) { | |
245 | var source = $('#compare_source').select2('data') || initial_compare_source; |
|
261 | var source = $('#compare_source').select2('data') || initial_compare_source; | |
246 | var target = $('#compare_target').select2('data') || initial_compare_target; |
|
262 | var target = $('#compare_target').select2('data') || initial_compare_target; | |
247 | if (source && target) { |
|
263 | if (source && target) { | |
248 | var url_data = { |
|
264 | var url_data = { | |
249 | repo_name: "${c.repo_name}", |
|
265 | repo_name: "${c.repo_name}", | |
250 | source_ref: source.id, |
|
266 | source_ref: source.id, | |
251 | source_ref_type: source.type, |
|
267 | source_ref_type: source.type, | |
252 | target_ref: target.id, |
|
268 | target_ref: target.id, | |
253 | target_ref_type: target.type |
|
269 | target_ref_type: target.type | |
254 | }; |
|
270 | }; | |
255 | window.location = pyroutes.url('repo_compare', url_data); |
|
271 | window.location = pyroutes.url('repo_compare', url_data); | |
256 | } |
|
272 | } | |
257 | }); |
|
273 | }); | |
258 | $('#compare_changeset_status_toggle').on('click', function(e) { |
|
274 | $('#compare_changeset_status_toggle').on('click', function(e) { | |
259 | $('#compare_changeset_status').toggle(); |
|
275 | $('#compare_changeset_status').toggle(); | |
260 | }); |
|
276 | }); | |
261 |
|
277 | |||
262 | </script> |
|
278 | </script> | |
263 |
|
279 | |||
264 | ## table diff data |
|
280 | ## table diff data | |
265 | <div class="table"> |
|
281 | <div class="table"> | |
266 |
|
282 | |||
267 |
|
283 | |||
268 | % if not c.compare_home: |
|
284 | % if not c.compare_home: | |
269 | <div id="changeset_compare_view_content"> |
|
285 | <div id="changeset_compare_view_content"> | |
270 | <div class="pull-left"> |
|
286 | <div class="pull-left"> | |
271 | <div class="btn-group"> |
|
287 | <div class="btn-group"> | |
272 | <a |
|
288 | <a | |
273 | class="btn" |
|
289 | class="btn" | |
274 | href="#" |
|
290 | href="#" | |
275 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> |
|
291 | onclick="$('.compare_select').show();$('.compare_select_hidden').hide(); return false"> | |
276 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
292 | ${_ungettext('Expand %s commit','Expand %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} | |
277 | </a> |
|
293 | </a> | |
278 | <a |
|
294 | <a | |
279 | class="btn" |
|
295 | class="btn" | |
280 | href="#" |
|
296 | href="#" | |
281 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> |
|
297 | onclick="$('.compare_select').hide();$('.compare_select_hidden').show(); return false"> | |
282 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} |
|
298 | ${_ungettext('Collapse %s commit','Collapse %s commits', len(c.commit_ranges)) % len(c.commit_ranges)} | |
283 | </a> |
|
299 | </a> | |
284 | </div> |
|
300 | </div> | |
285 | </div> |
|
301 | </div> | |
286 | <div style="padding:0 10px 10px 0px" class="pull-left"></div> |
|
302 | <div style="padding:0 10px 10px 0px" class="pull-left"></div> | |
287 | ## commit compare generated below |
|
303 | ## commit compare generated below | |
288 | <%include file="compare_commits.mako"/> |
|
304 | <%include file="compare_commits.mako"/> | |
289 | ${cbdiffs.render_diffset_menu(c.diffset)} |
|
305 | ${cbdiffs.render_diffset_menu(c.diffset)} | |
290 | ${cbdiffs.render_diffset(c.diffset)} |
|
306 | ${cbdiffs.render_diffset(c.diffset)} | |
291 | </div> |
|
307 | </div> | |
292 | % endif |
|
308 | % endif | |
293 |
|
309 | |||
294 | </div> |
|
310 | </div> | |
295 | </div> |
|
311 | </div> | |
296 |
|
312 | |||
297 | </%def> |
|
313 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now