##// END OF EJS Templates
summary: move the RSS button to the right pane of repo name
marcink -
r3666:73c9ff94 new-ui
parent child Browse files
Show More
@@ -1,571 +1,576 b''
1 1 //
2 2 // Typography
3 3 // modified from Bootstrap
4 4 // --------------------------------------------------
5 5
6 6 // Base
7 7 body {
8 8 font-size: @basefontsize;
9 9 font-family: @text-light;
10 10 letter-spacing: .02em;
11 11 color: @grey2;
12 12 }
13 13
14 14 #content, label{
15 15 font-size: @basefontsize;
16 16 }
17 17
18 18 label {
19 19 color: @grey2;
20 20 }
21 21
22 22 ::selection { background: @rchighlightblue; }
23 23
24 24 // Headings
25 25 // -------------------------
26 26
27 27 h1, h2, h3, h4, h5, h6,
28 28 .h1, .h2, .h3, .h4, .h5, .h6 {
29 29 margin: 0 0 @textmargin 0;
30 30 padding: 0;
31 31 line-height: 1.8em;
32 32 color: @text-color;
33 33 a {
34 34 color: @rcblue;
35 35 }
36 36 }
37 37
38 38 h1, .h1 { font-size: 1.54em; font-weight: @text-bold-weight; font-family: @text-bold; }
39 39 h2, .h2 { font-size: 1.23em; font-weight: @text-semibold-weight; font-family: @text-semibold; }
40 40 h3, .h3 { font-size: 1.23em; font-family: @text-regular; }
41 41 h4, .h4 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
42 42 h5, .h5 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
43 43 h6, .h6 { font-size: 1em; font-weight: @text-bold-weight; font-family: @text-bold; }
44 44
45 45 // Breadcrumbs
46 46 .breadcrumbs {
47 47 font-size: @repo-title-fontsize;
48 48 margin: 0;
49 49
50 50 h4 {
51 51 font-size: @basefontsize;
52 52 margin-bottom: 15px;
53 53 }
54 54 }
55 55
56 56 .breadcrumbs_light {
57 57 float:left;
58 58 font-size: 1.3em;
59 59 line-height: 38px;
60 60 }
61 61
62 62 // Body text
63 63 // -------------------------
64 64
65 65 p {
66 66 margin: 0 0 @textmargin 0;
67 67 padding: 0;
68 68 line-height: 2em;
69 69 }
70 70
71 71 .lead {
72 72 margin-bottom: @textmargin;
73 73 font-weight: 300;
74 74 line-height: 1.4;
75 75
76 76 @media (min-width: @screen-sm-min) {
77 77 font-size: (@basefontsize * 1.5);
78 78 }
79 79 }
80 80
81 81 a,
82 82 .link {
83 83 color: @rcblue;
84 84 text-decoration: none;
85 85 outline: none;
86 86 cursor: pointer;
87 87
88 88 &:focus {
89 89 outline: none;
90 90 }
91 91
92 92 &:hover {
93 93 color: @rcdarkblue;
94 94 }
95 95 }
96 96
97 97 img {
98 98 border: none;
99 99 outline: none;
100 100 }
101 101
102 102 strong {
103 103 font-weight: @text-bold-weight;
104 104 font-family: @text-bold;
105 105 }
106 106
107 107 em {
108 108 font-family: @text-italic;
109 109 font-style: italic;
110 110 }
111 111
112 112 strong em,
113 113 em strong {
114 114 font-style: italic;
115 115 font-weight: @text-bold-italic-weight;
116 116 font-family: @text-bold-italic;
117 117 }
118 118
119 119 //TODO: lisa: b and i are depreciated, but we are still using them in places.
120 120 // Should probably make some decision whether to keep or lose these.
121 121 b {
122 122
123 123 }
124 124
125 125 i {
126 126 font-style: normal;
127 127 }
128 128
129 129 label {
130 130 color: @text-color;
131 131
132 132 input[type="checkbox"] {
133 133 margin-right: 1em;
134 134 }
135 135 input[type="radio"] {
136 136 margin-right: 1em;
137 137 }
138 138 }
139 139
140 140 code,
141 141 .code {
142 142 font-size: .95em;
143 143 font-family: @text-code;
144 144 color: @grey3;
145 145
146 146 a {
147 147 color: lighten(@rcblue,10%)
148 148 }
149 149 }
150 150
151 151 pre {
152 152 margin: 0;
153 153 padding: 0;
154 154 border: 0;
155 155 outline: 0;
156 156 font-size: @basefontsize*.95;
157 157 line-height: 1.4em;
158 158 font-family: @text-code;
159 159 color: @grey3;
160 160 }
161 161
162 162 // Emphasis & misc
163 163 // -------------------------
164 164 .discreet {
165 165 color: @grey4;
166 166 font-size: 85%;
167 167 font-weight: normal;
168 168
169 169 a {
170 170 color: @grey4;
171 171
172 172 &:hover {
173 173 color: @rcdarkblue;
174 174 }
175 175 }
176 176 }
177 177
178 178 small,
179 179 .small {
180 180 font-size: 75%;
181 181 font-weight: normal;
182 182 line-height: 1em;
183 183 }
184 184
185 185 mark,
186 186 .mark {
187 187 padding: .2em;
188 188 }
189 189
190 190 // Alignment
191 191 .text-left { text-align: left; }
192 192 .text-right { text-align: right; }
193 193 .text-center { text-align: center; }
194 194 .text-justify { text-align: justify; }
195 195 .text-nowrap { white-space: nowrap; }
196 196
197 197 // Transformation
198 198 .text-lowercase { text-transform: lowercase; }
199 199 .text-uppercase { text-transform: uppercase; }
200 200 .text-capitalize { text-transform: capitalize; }
201 201
202 202 // Contextual colors
203 203 .text-muted {
204 204 color: @grey4;
205 205 }
206 206 .text-primary {
207 207 color: @rcblue;
208 208 }
209 209 .text-success {
210 210 color: @alert1;
211 211 }
212 212 .text-info {
213 213 color: @alert4;
214 214 }
215 215 .text-warning {
216 216 color: @alert3;
217 217 }
218 218 .text-danger {
219 219 color: @alert2;
220 220 }
221 221
222 222 // Contextual backgrounds
223 223 .bg-primary {
224 224 background-color: white;
225 225 }
226 226 .bg-success {
227 227 background-color: @alert1;
228 228 }
229 229 .bg-info {
230 230 background-color: @alert4;
231 231 }
232 232 .bg-warning {
233 233 background-color: @alert3;
234 234 }
235 235 .bg-danger {
236 236 background-color: @alert2;
237 237 }
238 238
239 239
240 240 // Page header
241 241 // -------------------------
242 242
243 243 .page-header {
244 244 margin: @pagepadding 0 @textmargin;
245 245 border-bottom: @border-thickness solid @grey5;
246 246 }
247 247
248 248 .title {
249 249 clear: both;
250 250 float: left;
251 251 width: 100%;
252 252 margin: @pagepadding/2 0 @pagepadding/4;
253 253 min-height: 25px;
254 254
255 255 .breadcrumbs {
256 256 float: left;
257 257 clear: both;
258 258 width: 700px;
259 259 margin: 0;
260 260
261 261 .q_filter_box {
262 262 margin-right: @padding;
263 263 }
264 264 }
265 265
266 266 h1 a {
267 267 color: @rcblue;
268 268 }
269 269
270 270 input{
271 271 margin-right: @padding;
272 272 }
273 273
274 274 h5, .h5 {
275 275 color: @grey1;
276 276 margin-bottom: @space;
277 277
278 278 span {
279 279 display: inline-block;
280 280 }
281 281 }
282 282
283 283 p {
284 284 margin-bottom: 0;
285 285 }
286 286
287 287 .links {
288 288 float: right;
289 289 display: inline;
290 290 margin: 0;
291 291 padding-left: 0;
292 292 list-style: none;
293 293 text-align: right;
294 294
295 295 li {
296 296 float: right;
297 297 list-style-type: none;
298 298 }
299 299
300 300 a {
301 301 display: inline-block;
302 302 margin-left: @textmargin/2;
303 303 }
304 304 }
305 305
306 306 .title-content {
307
308 &.repo-title {
309 float: none
310 }
311
307 312 float: left;
308 313 margin: 0;
309 314 padding: 0;
310 315
311 316 & + .breadcrumbs {
312 317 margin-top: @padding;
313 318 }
314 319
315 320 & + .links {
316 321 margin-top: -@button-padding;
317 322
318 323 & + .breadcrumbs {
319 324 margin-top: @padding;
320 325 }
321 326 }
322 327
323 328 .repo-group-desc {
324 329 padding: 8px 0px 0px 0px;
325 330 }
326 331 }
327 332
328 333 .title-main {
329 334 font-size: @repo-title-fontsize;
330 335 }
331 336
332 337 .title-description {
333 338 margin-top: .5em;
334 339 }
335 340
336 341 .q_filter_box {
337 342 width: 200px;
338 343 }
339 344
340 345 }
341 346
342 347 #readme .title {
343 348 text-transform: none;
344 349 }
345 350
346 351 // Lists
347 352 // -------------------------
348 353
349 354 // Unordered and Ordered lists
350 355 ul,
351 356 ol {
352 357 margin-top: 0;
353 358 margin-bottom: @textmargin;
354 359 ul,
355 360 ol {
356 361 margin-bottom: 0;
357 362 }
358 363 }
359 364
360 365 li {
361 366 line-height: 2em;
362 367 }
363 368
364 369 ul li {
365 370 position: relative;
366 371 list-style-type: disc;
367 372
368 373 p:first-child {
369 374 display:inline;
370 375 }
371 376 }
372 377
373 378 // List options
374 379
375 380 // Unstyled keeps list items block level, just removes default browser padding and list-style
376 381 .list-unstyled {
377 382 padding-left: 0;
378 383 list-style: none;
379 384 li:before { content: none; }
380 385 }
381 386
382 387 // Inline turns list items into inline-block
383 388 .list-inline {
384 389 .list-unstyled();
385 390 margin-left: -5px;
386 391
387 392 > li {
388 393 display: inline-block;
389 394 padding-left: 5px;
390 395 padding-right: 5px;
391 396 }
392 397 }
393 398
394 399 // Description Lists
395 400
396 401 dl {
397 402 margin-top: 0; // Remove browser default
398 403 margin-bottom: @textmargin;
399 404 }
400 405
401 406 dt,
402 407 dd {
403 408 line-height: 1.4em;
404 409 }
405 410
406 411 dt {
407 412 margin: @textmargin 0 0 0;
408 413 font-weight: @text-bold-weight;
409 414 font-family: @text-bold;
410 415 }
411 416
412 417 dd {
413 418 margin-left: 0; // Undo browser default
414 419 }
415 420
416 421 // Horizontal description lists
417 422 // Defaults to being stacked without any of the below styles applied, until the
418 423 // grid breakpoint is reached (default of ~768px).
419 424 // These are used in forms as well; see style guide.
420 425 // TODO: lisa: These should really not be used in forms.
421 426
422 427 .dl-horizontal {
423 428
424 429 overflow: hidden;
425 430 margin-bottom: @space;
426 431
427 432 dt, dd {
428 433 float: left;
429 434 margin: 5px 0 5px 0;
430 435 }
431 436
432 437 dt {
433 438 clear: left;
434 439 width: @label-width - @form-vertical-margin;
435 440 }
436 441
437 442 dd {
438 443 &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present
439 444 margin-left: @form-vertical-margin;
440 445 max-width: @form-max-width - (@label-width - @form-vertical-margin) - @form-vertical-margin;
441 446 }
442 447
443 448 pre {
444 449 margin: 0;
445 450 }
446 451
447 452 &.settings {
448 453 dt {
449 454 text-align: left;
450 455 }
451 456 }
452 457
453 458 @media (min-width: 768px) {
454 459 dt {
455 460 float: left;
456 461 width: 185px;
457 462 clear: left;
458 463 text-align: right;
459 464 }
460 465 dd {
461 466 margin-left: 20px;
462 467 }
463 468 }
464 469 }
465 470
466 471
467 472 // Misc
468 473 // -------------------------
469 474
470 475 // Abbreviations and acronyms
471 476 abbr[title],
472 477 abbr[data-original-title] {
473 478 cursor: help;
474 479 border-bottom: @border-thickness dotted @grey4;
475 480 }
476 481 .initialism {
477 482 font-size: 90%;
478 483 text-transform: uppercase;
479 484 }
480 485
481 486 // Blockquotes
482 487 blockquote {
483 488 padding: 1em 2em;
484 489 margin: 0 0 2em;
485 490 font-size: @basefontsize;
486 491 border-left: 2px solid @grey6;
487 492
488 493 p,
489 494 ul,
490 495 ol {
491 496 &:last-child {
492 497 margin-bottom: 0;
493 498 }
494 499 }
495 500
496 501 footer,
497 502 small,
498 503 .small {
499 504 display: block;
500 505 font-size: 80%;
501 506
502 507 &:before {
503 508 content: '\2014 \00A0'; // em dash, nbsp
504 509 }
505 510 }
506 511 }
507 512
508 513 // Opposite alignment of blockquote
509 514 //
510 515 .blockquote-reverse,
511 516 blockquote.pull-right {
512 517 padding-right: 15px;
513 518 padding-left: 0;
514 519 border-right: 5px solid @grey6;
515 520 border-left: 0;
516 521 text-align: right;
517 522
518 523 // Account for citation
519 524 footer,
520 525 small,
521 526 .small {
522 527 &:before { content: ''; }
523 528 &:after {
524 529 content: '\00A0 \2014'; // nbsp, em dash
525 530 }
526 531 }
527 532 }
528 533
529 534 // Addresses
530 535 address {
531 536 margin-bottom: 2em;
532 537 font-style: normal;
533 538 line-height: 1.8em;
534 539 }
535 540
536 541 .error-message {
537 542 display: block;
538 543 margin: @padding/3 0;
539 544 color: @alert2;
540 545 }
541 546
542 547 .issue-tracker-link {
543 548 color: @rcblue;
544 549 }
545 550
546 551 .info_text{
547 552 font-size: @basefontsize;
548 553 color: @grey4;
549 554 font-family: @text-regular;
550 555 }
551 556
552 557 .help-block-inline {
553 558 margin: 0;
554 559 }
555 560
556 561 // help block text
557 562 .help-block {
558 563 display: block;
559 564 margin: 0 0 @padding;
560 565 color: @grey4;
561 566 font-family: @text-light;
562 567 &.pre-formatting {
563 568 white-space: pre-wrap;
564 569 }
565 570 }
566 571
567 572 .error-message {
568 573 display: block;
569 574 margin: @padding/3 0;
570 575 color: @alert2;
571 576 }
@@ -1,942 +1,951 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="root.mako"/>
3 3
4 4 <%include file="/ejs_templates/templates.html"/>
5 5
6 6 <div class="outerwrapper">
7 7 <!-- HEADER -->
8 8 <div class="header">
9 9 <div id="header-inner" class="wrapper">
10 10 <div id="logo">
11 11 <div class="logo-wrapper">
12 12 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
13 13 </div>
14 14 % if c.rhodecode_name:
15 15 <div class="branding">
16 16 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
17 17 </div>
18 18 % endif
19 19 </div>
20 20 <!-- MENU BAR NAV -->
21 21 ${self.menu_bar_nav()}
22 22 <!-- END MENU BAR NAV -->
23 23 </div>
24 24 </div>
25 25 ${self.menu_bar_subnav()}
26 26 <!-- END HEADER -->
27 27
28 28 <!-- CONTENT -->
29 29 <div id="content" class="wrapper">
30 30
31 31 <rhodecode-toast id="notifications"></rhodecode-toast>
32 32
33 33 <div class="main">
34 34 ${next.main()}
35 35 </div>
36 36 </div>
37 37 <!-- END CONTENT -->
38 38
39 39 </div>
40 40 <!-- FOOTER -->
41 41 <div id="footer">
42 42 <div id="footer-inner" class="title wrapper">
43 43 <div>
44 44 <p class="footer-link-right">
45 45 % if c.visual.show_version:
46 46 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
47 47 % endif
48 48 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
49 49 % if c.visual.rhodecode_support_url:
50 50 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
51 51 % endif
52 52 </p>
53 53 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
54 54 <p class="server-instance" style="display:${sid}">
55 55 ## display hidden instance ID if specially defined
56 56 % if c.rhodecode_instanceid:
57 57 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
58 58 % endif
59 59 </p>
60 60 </div>
61 61 </div>
62 62 </div>
63 63
64 64 <!-- END FOOTER -->
65 65
66 66 ### MAKO DEFS ###
67 67
68 68 <%def name="menu_bar_subnav()">
69 69 </%def>
70 70
71 71 <%def name="breadcrumbs(class_='breadcrumbs')">
72 72 <div class="${class_}">
73 73 ${self.breadcrumbs_links()}
74 74 </div>
75 75 </%def>
76 76
77 77 <%def name="admin_menu(active=None)">
78 78 <%
79 79 def is_active(selected):
80 80 if selected == active:
81 81 return "active"
82 82 %>
83 83
84 84 <div id="context-bar">
85 85 <div class="wrapper">
86 86 <div class="title">
87 87 <div class="title-content">
88 88 <div class="title-main">
89 89 % if c.is_super_admin:
90 90 ${_('Super Admin Panel')}
91 91 % else:
92 92 ${_('Delegated Admin Panel')}
93 93 % endif
94 94 </div>
95 95 </div>
96 96 </div>
97 97
98 98 <ul id="context-pages" class="navigation horizontal-list">
99 99
100 100 ## super admin case
101 101 % if c.is_super_admin:
102 102 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
103 103 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
104 104 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
105 105 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
106 106 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
107 107 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
108 108 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
109 109 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
110 110 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
111 111 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
112 112
113 113 ## delegated admin
114 114 % elif c.is_delegated_admin:
115 115 <%
116 116 repositories=c.auth_user.repositories_admin or c.can_create_repo
117 117 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
118 118 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
119 119 %>
120 120
121 121 %if repositories:
122 122 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
123 123 %endif
124 124 %if repository_groups:
125 125 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
126 126 %endif
127 127 %if user_groups:
128 128 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
129 129 %endif
130 130 % endif
131 131 </ul>
132 132
133 133 </div>
134 134 <div class="clear"></div>
135 135 </div>
136 136 </%def>
137 137
138 138 <%def name="dt_info_panel(elements)">
139 139 <dl class="dl-horizontal">
140 140 %for dt, dd, title, show_items in elements:
141 141 <dt>${dt}:</dt>
142 142 <dd title="${h.tooltip(title)}">
143 143 %if callable(dd):
144 144 ## allow lazy evaluation of elements
145 145 ${dd()}
146 146 %else:
147 147 ${dd}
148 148 %endif
149 149 %if show_items:
150 150 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
151 151 %endif
152 152 </dd>
153 153
154 154 %if show_items:
155 155 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
156 156 %for item in show_items:
157 157 <dt></dt>
158 158 <dd>${item}</dd>
159 159 %endfor
160 160 </div>
161 161 %endif
162 162
163 163 %endfor
164 164 </dl>
165 165 </%def>
166 166
167 167 <%def name="gravatar(email, size=16)">
168 168 <%
169 169 if (size > 16):
170 170 gravatar_class = 'gravatar gravatar-large'
171 171 else:
172 172 gravatar_class = 'gravatar'
173 173 %>
174 174 <%doc>
175 175 TODO: johbo: For now we serve double size images to make it smooth
176 176 for retina. This is how it worked until now. Should be replaced
177 177 with a better solution at some point.
178 178 </%doc>
179 179 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
180 180 </%def>
181 181
182 182
183 183 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
184 184 <% email = h.email_or_none(contact) %>
185 185 <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
186 186 ${self.gravatar(email, size)}
187 187 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
188 188 </div>
189 189 </%def>
190 190
191 191
192 192 <%def name="repo_page_title(repo_instance)">
193 <div class="title-content">
193 <div class="title-content repo-title">
194 194 <div class="title-main">
195 195 ## SVN/HG/GIT icons
196 196 %if h.is_hg(repo_instance):
197 197 <i class="icon-hg"></i>
198 198 %endif
199 199 %if h.is_git(repo_instance):
200 200 <i class="icon-git"></i>
201 201 %endif
202 202 %if h.is_svn(repo_instance):
203 203 <i class="icon-svn"></i>
204 204 %endif
205 205
206 206 ## public/private
207 207 %if repo_instance.private:
208 208 <i class="icon-repo-private"></i>
209 209 %else:
210 210 <i class="icon-repo-public"></i>
211 211 %endif
212 212
213 213 ## repo name with group name
214 214 ${h.breadcrumb_repo_link(repo_instance)}
215 215
216 ## Context Actions
217 <div class="pull-right">
218 %if c.rhodecode_user.username != h.DEFAULT_USER:
219 <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 %else:
221 <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>
222 %endif
223 </div>
224
216 225 </div>
217 226
218 227 ## FORKED
219 228 %if repo_instance.fork:
220 229 <p class="discreet">
221 230 <i class="icon-code-fork"></i> ${_('Fork of')}
222 231 ${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))}
223 232 </p>
224 233 %endif
225 234
226 235 ## IMPORTED FROM REMOTE
227 236 %if repo_instance.clone_uri:
228 237 <p class="discreet">
229 238 <i class="icon-code-fork"></i> ${_('Clone from')}
230 239 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
231 240 </p>
232 241 %endif
233 242
234 243 ## LOCKING STATUS
235 244 %if repo_instance.locked[0]:
236 245 <p class="locking_locked discreet">
237 246 <i class="icon-repo-lock"></i>
238 247 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
239 248 </p>
240 249 %elif repo_instance.enable_locking:
241 250 <p class="locking_unlocked discreet">
242 251 <i class="icon-repo-unlock"></i>
243 252 ${_('Repository not locked. Pull repository to lock it.')}
244 253 </p>
245 254 %endif
246 255
247 256 </div>
248 257 </%def>
249 258
250 259 <%def name="repo_menu(active=None)">
251 260 <%
252 261 def is_active(selected):
253 262 if selected == active:
254 263 return "active"
255 264 %>
256 265
257 266 <!--- REPO CONTEXT BAR -->
258 267 <div id="context-bar">
259 268 <div class="wrapper">
260 269
261 270 <div class="title">
262 271 ${self.repo_page_title(c.rhodecode_db_repo)}
263 272 </div>
264 273
265 274 <ul id="context-pages" class="navigation horizontal-list">
266 275 <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>
267 276 <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>
268 277 <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>
269 278 <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>
270 279
271 280 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
272 281 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
273 282 <li class="${is_active('showpullrequest')}">
274 283 <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)}">
275 284 <div class="menulabel">
276 285 %if c.repository_pull_requests == 1:
277 286 ${c.repository_pull_requests} ${_('Pull Request')}
278 287 %else:
279 288 ${c.repository_pull_requests} ${_('Pull Requests')}
280 289 %endif
281 290 </div>
282 291 </a>
283 292 </li>
284 293 %endif
285 294
286 295 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
287 296 <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>
288 297 %endif
289 298
290 299 <li class="${is_active('options')}">
291 300 <a class="menulink dropdown">
292 301 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
293 302 </a>
294 303 <ul class="submenu">
295 304
296 305 %if c.rhodecode_db_repo.fork:
297 306 <li>
298 307 <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
299 308 href="${h.route_path('repo_compare',
300 309 repo_name=c.rhodecode_db_repo.fork.repo_name,
301 310 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
302 311 source_ref=c.rhodecode_db_repo.landing_rev[1],
303 312 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
304 313 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
305 314 _query=dict(merge=1))}"
306 315 >
307 316 ${_('Compare fork')}
308 317 </a>
309 318 </li>
310 319 %endif
311 320
312 321 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
313 322 %if c.rhodecode_db_repo.locked[0]:
314 323 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
315 324 %else:
316 325 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
317 326 %endif
318 327 %endif
319 328 %if c.rhodecode_user.username != h.DEFAULT_USER:
320 329 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
321 330 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li>
322 331 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
323 332 %endif
324 333 %endif
325 334 </ul>
326 335 </li>
327 336 </ul>
328 337 </div>
329 338 <div class="clear"></div>
330 339 </div>
331 340 % if c.rhodecode_db_repo.archived:
332 341 <div class="alert alert-warning text-center">
333 342 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
334 343 </div>
335 344 % endif
336 345 <!--- REPO END CONTEXT BAR -->
337 346
338 347 </%def>
339 348
340 349 <%def name="repo_group_page_title(repo_group_instance)">
341 350 <div class="title-content">
342 351 <div class="title-main">
343 352 ## Repository Group icon
344 353 <i class="icon-folder-close"></i>
345 354
346 355 ## repo name with group name
347 356 ${h.breadcrumb_repo_group_link(repo_group_instance)}
348 357 </div>
349 358
350 359 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
351 360 <div class="repo-group-desc discreet">
352 361 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
353 362 </div>
354 363
355 364 </div>
356 365 </%def>
357 366
358 367 <%def name="repo_group_menu(active=None)">
359 368 <%
360 369 def is_active(selected):
361 370 if selected == active:
362 371 return "active"
363 372
364 373 gr_name = c.repo_group.group_name if c.repo_group else None
365 374 # create repositories with write permission on group is set to true
366 375 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
367 376 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
368 377 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
369 378
370 379 %>
371 380
372 381 <!--- REPO GROUP CONTEXT BAR -->
373 382 <div id="context-bar">
374 383 <div class="wrapper">
375 384 <div class="title">
376 385 ${self.repo_group_page_title(c.repo_group)}
377 386 </div>
378 387
379 388 <ul id="context-pages" class="navigation horizontal-list">
380 389 <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>
381 390 % if c.is_super_admin or group_admin:
382 391 <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>
383 392 % endif
384 393
385 394 <li class="${is_active('options')}">
386 395 <a class="menulink dropdown">
387 396 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
388 397 </a>
389 398 <ul class="submenu">
390 399 %if c.is_super_admin or group_admin or (group_write and create_on_write):
391 400 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
392 401 %endif
393 402 %if c.is_super_admin or group_admin:
394 403 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li>
395 404 %endif
396 405 </ul>
397 406 </li>
398 407 </ul>
399 408 </div>
400 409 <div class="clear"></div>
401 410 </div>
402 411
403 412 <!--- REPO GROUP CONTEXT BAR -->
404 413
405 414 </%def>
406 415
407 416
408 417 <%def name="usermenu(active=False)">
409 418 ## USER MENU
410 419 <li id="quick_login_li" class="${'active' if active else ''}">
411 420 % if c.rhodecode_user.username == h.DEFAULT_USER:
412 421 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
413 422 ${gravatar(c.rhodecode_user.email, 20)}
414 423 <span class="user">
415 424 <span>${_('Sign in')}</span>
416 425 </span>
417 426 </a>
418 427 % else:
419 428 ## logged in user
420 429 <a id="quick_login_link" class="menulink childs">
421 430 ${gravatar(c.rhodecode_user.email, 20)}
422 431 <span class="user">
423 432 <span class="menu_link_user">${c.rhodecode_user.username}</span>
424 433 <div class="show_more"></div>
425 434 </span>
426 435 </a>
427 436 ## subnav with menu for logged in user
428 437 <div class="user-menu submenu">
429 438 <div id="quick_login">
430 439 %if c.rhodecode_user.username != h.DEFAULT_USER:
431 440 <div class="">
432 441 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
433 442 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
434 443 <div class="email">${c.rhodecode_user.email}</div>
435 444 </div>
436 445 <div class="">
437 446 <ol class="links">
438 447 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
439 448 % if c.rhodecode_user.personal_repo_group:
440 449 <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>
441 450 % endif
442 451 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
443 452 ## bookmark-items
444 453 <li class="bookmark-items">
445 454 ${_('Bookmarks')}
446 455 <div class="pull-right">
447 456 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
448 457 </div>
449 458 </li>
450 459 % if not c.bookmark_items:
451 460 <li>
452 461 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
453 462 </li>
454 463 % endif
455 464 % for item in c.bookmark_items:
456 465 <li>
457 466 % if item.repository:
458 467 <div>
459 468 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
460 469 <code>${item.position}</code>
461 470 % if item.repository.repo_type == 'hg':
462 471 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
463 472 % elif item.repository.repo_type == 'git':
464 473 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
465 474 % elif item.repository.repo_type == 'svn':
466 475 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
467 476 % endif
468 477 ${(item.title or h.shorter(item.repository.repo_name, 30))}
469 478 </a>
470 479 </div>
471 480 % elif item.repository_group:
472 481 <div>
473 482 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
474 483 <code>${item.position}</code>
475 484 <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i>
476 485 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
477 486 </a>
478 487 </div>
479 488 % else:
480 489 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
481 490 <code>${item.position}</code>
482 491 ${item.title}
483 492 </a>
484 493 % endif
485 494 </li>
486 495 % endfor
487 496
488 497 <li class="logout">
489 498 ${h.secure_form(h.route_path('logout'), request=request)}
490 499 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
491 500 ${h.end_form()}
492 501 </li>
493 502 </ol>
494 503 </div>
495 504 %endif
496 505 </div>
497 506 </div>
498 507 ## unread counter
499 508 <div class="pill_container">
500 509 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
501 510 </div>
502 511 % endif
503 512 </li>
504 513 </%def>
505 514
506 515 <%def name="menu_items(active=None)">
507 516 <%
508 517 def is_active(selected):
509 518 if selected == active:
510 519 return "active"
511 520 return ""
512 521 %>
513 522
514 523 <ul id="quick" class="main_nav navigation horizontal-list">
515 524 ## notice box for important system messages
516 525 <li style="display: none">
517 526 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
518 527 <div class="menulabel-notice" >
519 528 0
520 529 </div>
521 530 </a>
522 531 </li>
523 532
524 533 ## Main filter
525 534 <li>
526 535 <div class="menulabel main_filter_box">
527 536 <div class="main_filter_input_box">
528 537 <ul class="searchItems">
529 538
530 539 % if c.template_context['search_context']['repo_id']:
531 540 <li class="searchTag searchTagFilter searchTagHidable" >
532 541 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
533 542 <span class="tag">
534 543 This repo
535 544 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
536 545 </span>
537 546 ##</a>
538 547 </li>
539 548 % elif c.template_context['search_context']['repo_group_id']:
540 549 <li class="searchTag searchTagFilter searchTagHidable">
541 550 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
542 551 <span class="tag">
543 552 This group
544 553 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
545 554 </span>
546 555 ##</a>
547 556 </li>
548 557 % endif
549 558
550 559 <li class="searchTagInput">
551 560 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
552 561 </li>
553 562 <li class="searchTag searchTagHelp">
554 563 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
555 564 </li>
556 565 </ul>
557 566 </div>
558 567 </div>
559 568
560 569 <div id="main_filter_help" style="display: none">
561 570 - Use '/' key to quickly access this field.
562 571
563 572 - Enter a name of repository, or repository group for quick search.
564 573
565 574 - Prefix query to allow special search:
566 575
567 576 user:admin, to search for usernames, always global
568 577
569 578 user_group:devops, to search for user groups, always global
570 579
571 580 commit:efced4, to search for commits, scoped to repositories or groups
572 581
573 582 file:models.py, to search for file paths, scoped to repositories or groups
574 583
575 584 % if c.template_context['search_context']['repo_id']:
576 585 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>
577 586 % elif c.template_context['search_context']['repo_group_id']:
578 587 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>
579 588 % else:
580 589 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
581 590 % endif
582 591 </div>
583 592 </li>
584 593
585 594 ## ROOT MENU
586 595 <li class="${is_active('home')}">
587 596 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
588 597 <div class="menulabel">${_('Home')}</div>
589 598 </a>
590 599 </li>
591 600
592 601 %if c.rhodecode_user.username != h.DEFAULT_USER:
593 602 <li class="${is_active('journal')}">
594 603 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
595 604 <div class="menulabel">${_('Journal')}</div>
596 605 </a>
597 606 </li>
598 607 %else:
599 608 <li class="${is_active('journal')}">
600 609 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
601 610 <div class="menulabel">${_('Public journal')}</div>
602 611 </a>
603 612 </li>
604 613 %endif
605 614
606 615 <li class="${is_active('gists')}">
607 616 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
608 617 <div class="menulabel">${_('Gists')}</div>
609 618 </a>
610 619 </li>
611 620
612 621 % if c.is_super_admin or c.is_delegated_admin:
613 622 <li class="${is_active('admin')}">
614 623 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
615 624 <div class="menulabel">${_('Admin')} </div>
616 625 </a>
617 626 </li>
618 627 % endif
619 628
620 629 ## render extra user menu
621 630 ${usermenu(active=(active=='my_account'))}
622 631
623 632 % if c.debug_style:
624 633 <li>
625 634 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
626 635 <div class="menulabel">${_('[Style]')}</div>
627 636 </a>
628 637 </li>
629 638 % endif
630 639 </ul>
631 640
632 641 <script type="text/javascript">
633 642 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
634 643
635 644 var formatRepoResult = function(result, container, query, escapeMarkup) {
636 645 return function(data, escapeMarkup) {
637 646 if (!data.repo_id){
638 647 return data.text; // optgroup text Repositories
639 648 }
640 649
641 650 var tmpl = '';
642 651 var repoType = data['repo_type'];
643 652 var repoName = data['text'];
644 653
645 654 if(data && data.type == 'repo'){
646 655 if(repoType === 'hg'){
647 656 tmpl += '<i class="icon-hg"></i> ';
648 657 }
649 658 else if(repoType === 'git'){
650 659 tmpl += '<i class="icon-git"></i> ';
651 660 }
652 661 else if(repoType === 'svn'){
653 662 tmpl += '<i class="icon-svn"></i> ';
654 663 }
655 664 if(data['private']){
656 665 tmpl += '<i class="icon-lock" ></i> ';
657 666 }
658 667 else if(visualShowPublicIcon){
659 668 tmpl += '<i class="icon-unlock-alt"></i> ';
660 669 }
661 670 }
662 671 tmpl += escapeMarkup(repoName);
663 672 return tmpl;
664 673
665 674 }(result, escapeMarkup);
666 675 };
667 676
668 677 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
669 678 return function(data, escapeMarkup) {
670 679 if (!data.repo_group_id){
671 680 return data.text; // optgroup text Repositories
672 681 }
673 682
674 683 var tmpl = '';
675 684 var repoGroupName = data['text'];
676 685
677 686 if(data){
678 687
679 688 tmpl += '<i class="icon-folder-close"></i> ';
680 689
681 690 }
682 691 tmpl += escapeMarkup(repoGroupName);
683 692 return tmpl;
684 693
685 694 }(result, escapeMarkup);
686 695 };
687 696
688 697 var escapeRegExChars = function (value) {
689 698 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
690 699 };
691 700
692 701 var getRepoIcon = function(repo_type) {
693 702 if (repo_type === 'hg') {
694 703 return '<i class="icon-hg"></i> ';
695 704 }
696 705 else if (repo_type === 'git') {
697 706 return '<i class="icon-git"></i> ';
698 707 }
699 708 else if (repo_type === 'svn') {
700 709 return '<i class="icon-svn"></i> ';
701 710 }
702 711 return ''
703 712 };
704 713
705 714 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
706 715
707 716 if (value.split(':').length === 2) {
708 717 value = value.split(':')[1]
709 718 }
710 719
711 720 var searchType = data['type'];
712 721 var valueDisplay = data['value_display'];
713 722
714 723 var pattern = '(' + escapeRegExChars(value) + ')';
715 724
716 725 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
717 726
718 727 // highlight match
719 728 if (searchType != 'text') {
720 729 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
721 730 }
722 731
723 732 var icon = '';
724 733
725 734 if (searchType === 'hint') {
726 735 icon += '<i class="icon-folder-close"></i> ';
727 736 }
728 737 // full text search
729 738 else if (searchType === 'search') {
730 739 icon += '<i class="icon-more"></i> ';
731 740 }
732 741 // repository
733 742 else if (searchType === 'repo') {
734 743
735 744 var repoIcon = getRepoIcon(data['repo_type']);
736 745 icon += repoIcon;
737 746
738 747 if (data['private']) {
739 748 icon += '<i class="icon-lock" ></i> ';
740 749 }
741 750 else if (visualShowPublicIcon) {
742 751 icon += '<i class="icon-unlock-alt"></i> ';
743 752 }
744 753 }
745 754 // repository groups
746 755 else if (searchType === 'repo_group') {
747 756 icon += '<i class="icon-folder-close"></i> ';
748 757 }
749 758 // user group
750 759 else if (searchType === 'user_group') {
751 760 icon += '<i class="icon-group"></i> ';
752 761 }
753 762 // user
754 763 else if (searchType === 'user') {
755 764 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
756 765 }
757 766 // commit
758 767 else if (searchType === 'commit') {
759 768 var repo_data = data['repo_data'];
760 769 var repoIcon = getRepoIcon(repo_data['repository_type']);
761 770 if (repoIcon) {
762 771 icon += repoIcon;
763 772 } else {
764 773 icon += '<i class="icon-tag"></i>';
765 774 }
766 775 }
767 776 // file
768 777 else if (searchType === 'file') {
769 778 var repo_data = data['repo_data'];
770 779 var repoIcon = getRepoIcon(repo_data['repository_type']);
771 780 if (repoIcon) {
772 781 icon += repoIcon;
773 782 } else {
774 783 icon += '<i class="icon-tag"></i>';
775 784 }
776 785 }
777 786 // generic text
778 787 else if (searchType === 'text') {
779 788 icon = '';
780 789 }
781 790
782 791 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
783 792 return tmpl.format(icon, valueDisplay);
784 793 };
785 794
786 795 var handleSelect = function(element, suggestion) {
787 796 if (suggestion.type === "hint") {
788 797 // we skip action
789 798 $('#main_filter').focus();
790 799 }
791 800 else if (suggestion.type === "text") {
792 801 // we skip action
793 802 $('#main_filter').focus();
794 803
795 804 } else {
796 805 window.location = suggestion['url'];
797 806 }
798 807 };
799 808
800 809 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
801 810 if (queryLowerCase.split(':').length === 2) {
802 811 queryLowerCase = queryLowerCase.split(':')[1]
803 812 }
804 813 if (suggestion.type === "text") {
805 814 // special case we don't want to "skip" display for
806 815 return true
807 816 }
808 817 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
809 818 };
810 819
811 820 var cleanContext = {
812 821 repo_view_type: null,
813 822
814 823 repo_id: null,
815 824 repo_name: "",
816 825
817 826 repo_group_id: null,
818 827 repo_group_name: null
819 828 };
820 829 var removeGoToFilter = function () {
821 830 $('.searchTagHidable').hide();
822 831 $('#main_filter').autocomplete(
823 832 'setOptions', {params:{search_context: cleanContext}});
824 833 };
825 834
826 835 $('#main_filter').autocomplete({
827 836 serviceUrl: pyroutes.url('goto_switcher_data'),
828 837 params: {
829 838 "search_context": templateContext.search_context
830 839 },
831 840 minChars:2,
832 841 maxHeight:400,
833 842 deferRequestBy: 300, //miliseconds
834 843 tabDisabled: true,
835 844 autoSelectFirst: false,
836 845 formatResult: autocompleteMainFilterFormatResult,
837 846 lookupFilter: autocompleteMainFilterResult,
838 847 onSelect: function (element, suggestion) {
839 848 handleSelect(element, suggestion);
840 849 return false;
841 850 },
842 851 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
843 852 if (jqXHR !== 'abort') {
844 853 alert("Error during search.\nError code: {0}".format(textStatus));
845 854 window.location = '';
846 855 }
847 856 }
848 857 });
849 858
850 859 showMainFilterBox = function () {
851 860 $('#main_filter_help').toggle();
852 861 };
853 862
854 863 $('#main_filter').on('keydown.autocomplete', function (e) {
855 864
856 865 var BACKSPACE = 8;
857 866 var el = $(e.currentTarget);
858 867 if(e.which === BACKSPACE){
859 868 var inputVal = el.val();
860 869 if (inputVal === ""){
861 870 removeGoToFilter()
862 871 }
863 872 }
864 873 });
865 874
866 875 </script>
867 876 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
868 877 </%def>
869 878
870 879 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
871 880 <div class="modal-dialog">
872 881 <div class="modal-content">
873 882 <div class="modal-header">
874 883 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
875 884 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
876 885 </div>
877 886 <div class="modal-body">
878 887 <div class="block-left">
879 888 <table class="keyboard-mappings">
880 889 <tbody>
881 890 <tr>
882 891 <th></th>
883 892 <th>${_('Site-wide shortcuts')}</th>
884 893 </tr>
885 894 <%
886 895 elems = [
887 896 ('/', 'Use quick search box'),
888 897 ('g h', 'Goto home page'),
889 898 ('g g', 'Goto my private gists page'),
890 899 ('g G', 'Goto my public gists page'),
891 900 ('g 0-9', 'Goto bookmarked items from 0-9'),
892 901 ('n r', 'New repository page'),
893 902 ('n g', 'New gist page'),
894 903 ]
895 904 %>
896 905 %for key, desc in elems:
897 906 <tr>
898 907 <td class="keys">
899 908 <span class="key tag">${key}</span>
900 909 </td>
901 910 <td>${desc}</td>
902 911 </tr>
903 912 %endfor
904 913 </tbody>
905 914 </table>
906 915 </div>
907 916 <div class="block-left">
908 917 <table class="keyboard-mappings">
909 918 <tbody>
910 919 <tr>
911 920 <th></th>
912 921 <th>${_('Repositories')}</th>
913 922 </tr>
914 923 <%
915 924 elems = [
916 925 ('g s', 'Goto summary page'),
917 926 ('g c', 'Goto changelog page'),
918 927 ('g f', 'Goto files page'),
919 928 ('g F', 'Goto files page with file search activated'),
920 929 ('g p', 'Goto pull requests page'),
921 930 ('g o', 'Goto repository settings'),
922 931 ('g O', 'Goto repository permissions settings'),
923 932 ]
924 933 %>
925 934 %for key, desc in elems:
926 935 <tr>
927 936 <td class="keys">
928 937 <span class="key tag">${key}</span>
929 938 </td>
930 939 <td>${desc}</td>
931 940 </tr>
932 941 %endfor
933 942 </tbody>
934 943 </table>
935 944 </div>
936 945 </div>
937 946 <div class="modal-footer">
938 947 </div>
939 948 </div><!-- /.modal-content -->
940 949 </div><!-- /.modal-dialog -->
941 950 </div><!-- /.modal -->
942 951
@@ -1,267 +1,252 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <%def name="refs_counters(branches, closed_branches, tags, bookmarks)">
4 4 <span class="branchtag tag">
5 5 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
6 6 <i class="icon-branch"></i>
7 7 % if len(branches) == 1:
8 8 <span>${len(branches)}</span> ${_('Branch')}
9 9 % else:
10 10 <span>${len(branches)}</span> ${_('Branches')}
11 11 % endif
12 12 </a>
13 13 </span>
14 14
15 15 %if closed_branches:
16 16 <span class="branchtag tag">
17 17 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
18 18 <i class="icon-branch"></i>
19 19 % if len(closed_branches) == 1:
20 20 <span>${len(closed_branches)}</span> ${_('Closed Branch')}
21 21 % else:
22 22 <span>${len(closed_branches)}</span> ${_('Closed Branches')}
23 23 % endif
24 24 </a>
25 25 </span>
26 26 %endif
27 27
28 28 <span class="tagtag tag">
29 29 <a href="${h.route_path('tags_home',repo_name=c.repo_name)}" class="childs">
30 30 <i class="icon-tag"></i>
31 31 % if len(tags) == 1:
32 32 <span>${len(tags)}</span> ${_('Tag')}
33 33 % else:
34 34 <span>${len(tags)}</span> ${_('Tags')}
35 35 % endif
36 36 </a>
37 37 </span>
38 38
39 39 %if bookmarks:
40 40 <span class="booktag tag">
41 41 <a href="${h.route_path('bookmarks_home',repo_name=c.repo_name)}" class="childs">
42 42 <i class="icon-bookmark"></i>
43 43 % if len(bookmarks) == 1:
44 44 <span>${len(bookmarks)}</span> ${_('Bookmark')}
45 45 % else:
46 46 <span>${len(bookmarks)}</span> ${_('Bookmarks')}
47 47 % endif
48 48 </a>
49 49 </span>
50 50 %endif
51 51 </%def>
52 52
53 53 <%def name="summary_detail(breadcrumbs_links, show_downloads=True)">
54 54 <% summary = lambda n:{False:'summary-short'}.get(n) %>
55 55
56 56 <div id="summary-menu-stats" class="summary-detail">
57 57 <div class="fieldset">
58 58 <div class="left-content">
59 59 <div class="left-clone">
60 60 <select id="clone_option" name="clone_option">
61 61 <option value="http" selected="selected">HTTP</option>
62 62 <option value="http_id">HTTP UID</option>
63 63 % if c.ssh_enabled:
64 64 <option value="ssh">SSH</option>
65 65 % endif
66 66 </select>
67 67 </div>
68 68
69 69 <div class="right-clone">
70 70 <%
71 71 maybe_disabled = ''
72 72 if h.is_svn_without_proxy(c.rhodecode_db_repo):
73 73 maybe_disabled = 'disabled'
74 74 %>
75 75
76 76 <span id="clone_option_http">
77 77 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url}"/>
78 78 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i>
79 79 </span>
80 80
81 81 <span style="display: none;" id="clone_option_http_id">
82 82 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_id}"/>
83 83 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}"></i>
84 84 </span>
85 85
86 86 <span style="display: none;" id="clone_option_ssh">
87 87 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_ssh}"/>
88 88 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_ssh}" title="${_('Copy the clone by ssh url')}"></i>
89 89 </span>
90 90
91 91 % if maybe_disabled:
92 92 <p class="help-block">${_('SVN Protocol is disabled. To enable it, see the')} <a href="${h.route_url('enterprise_svn_setup')}" target="_blank">${_('documentation here')}</a>.</p>
93 93 % endif
94 94 </div>
95 95 </div>
96 96
97 97 <div class="right-content">
98 98 <div class="commit-info">
99 99 <div class="tags">
100 100 <% commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision') %>
101 101 % if c.rhodecode_repo:
102 102 ${refs_counters(
103 103 c.rhodecode_repo.branches,
104 104 c.rhodecode_repo.branches_closed,
105 105 c.rhodecode_repo.tags,
106 106 c.rhodecode_repo.bookmarks)}
107 107 % else:
108 108 ## missing requirements can make c.rhodecode_repo None
109 109 ${refs_counters([], [], [], [])}
110 110 % endif
111 111
112 112 ## commits
113 113 <span class="tag">
114 114 % if commit_rev == -1:
115 115 <i class="icon-tag"></i>
116 116 % if commit_rev == -1:
117 117 <span>0</span> ${_('Commit')}
118 118 % else:
119 119 <span>0</span> ${_('Commits')}
120 120 % endif
121 121 % else:
122 122 <a href="${h.route_path('repo_changelog', repo_name=c.repo_name)}">
123 123 <i class="icon-tag"></i>
124 124 % if commit_rev == 1:
125 125 <span>${commit_rev}</span> ${_('Commit')}
126 126 % else:
127 127 <span>${commit_rev}</span> ${_('Commits')}
128 128 % endif
129 129 </a>
130 130 % endif
131 131 </span>
132 132
133 133 ## forks
134 134 <span class="tag">
135 135 <a title="${_('Number of Repository Forks')}" href="${h.route_path('repo_forks_show_all', repo_name=c.repo_name)}">
136 136 <i class="icon-code-fork"></i>
137 137 <span>${c.repository_forks}</span> ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>
138 138 </span>
139 139 </div>
140 140 </div>
141 141 </div>
142 142 </div>
143 143 ## owner, description, downloads, statistics
144 144
145 145 ## Owner
146 146 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
147 147 <div class="left-label-summary">
148 148 <p>${_('Owner')}</p>
149 149 <div class="right-label-summary">
150 150 ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, 16)}
151 151 </div>
152 152
153 153 </div>
154 154 </div>
155 155
156 156 ## Description
157 157 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
158 158 <div class="left-label-summary">
159 159 <p>${_('Description')}</p>
160 160
161 161 <div class="right-label-summary input ${summary(c.show_stats)}">
162 162 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
163 163 ${dt.repo_desc(c.rhodecode_db_repo.description_safe, c.visual.stylify_metatags)}
164 164 </div>
165 165 </div>
166 166 </div>
167 167
168 168 ## Downloads
169 169 % if show_downloads:
170 170 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
171 171 <div class="left-label-summary">
172 172 <p>${_('Downloads')}</p>
173 173
174 174 <div class="right-label-summary input ${summary(c.show_stats)} downloads">
175 175 % if c.rhodecode_repo and len(c.rhodecode_repo.commit_ids) == 0:
176 176 <span class="disabled">
177 177 ${_('There are no downloads yet')}
178 178 </span>
179 179 % elif not c.enable_downloads:
180 180 <span class="disabled">
181 181 ${_('Downloads are disabled for this repository')}.
182 182 </span>
183 183 % if c.is_super_admin:
184 184 ${h.link_to(_('Enable downloads'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_downloads'))}
185 185 % endif
186 186 % else:
187 187 <span class="enabled">
188 188 <a id="archive_link" class="btn btn-small" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
189 189 <i class="icon-archive"></i> tip.zip
190 190 ## replaced by some JS on select
191 191 </a>
192 192 </span>
193 193 ${h.hidden('download_options')}
194 194 % endif
195 195 </div>
196 196 </div>
197 197 </div>
198 198 % endif
199 199
200 ## Context Action
201 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
202 <div class="left-label-summary">
203 <p>${_('Feed')}</p>
204
205 <div class="right-label-summary">
206 %if c.rhodecode_user.username != h.DEFAULT_USER:
207 <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>
208 %else:
209 <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>
210 %endif
211 </div>
212 </div>
213 </div>
214
215 200 ## Repo size
216 201 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
217 202 <div class="left-label-summary">
218 203 <p>${_('Repository size')}</p>
219 204
220 205 <div class="right-label-summary">
221 206 <div class="tags">
222 207 ## repo size
223 208 % if commit_rev == -1:
224 209 <span class="stats-bullet">0 B</span>
225 210 % else:
226 211 <span>
227 212 <a href="#showSize" onclick="calculateSize(); $(this).hide(); return false" id="show-repo-size">Show repository size</a>
228 213 </span>
229 214 <span class="stats-bullet" id="repo_size_container" style="display:none">
230 215 ${_('Calculating Repository Size...')}
231 216 </span>
232 217 % endif
233 218 </div>
234 219 </div>
235 220 </div>
236 221 </div>
237 222
238 223 ## Statistics
239 224 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
240 225 <div class="left-label-summary">
241 226 <p>${_('Code Statistics')}</p>
242 227
243 228 <div class="right-label-summary input ${summary(c.show_stats)} statistics">
244 229 % if c.show_stats:
245 230 <div id="lang_stats" class="enabled">
246 231 <a href="#showSize" onclick="calculateSize(); $('#show-repo-size').hide(); $(this).hide(); return false" id="show-repo-size">Show code statistics</a>
247 232 </div>
248 233 % else:
249 234 <span class="disabled">
250 235 ${_('Statistics are disabled for this repository')}.
251 236 </span>
252 237 % if c.is_super_admin:
253 238 ${h.link_to(_('Enable statistics'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_statistics'))}
254 239 % endif
255 240 % endif
256 241 </div>
257 242
258 243 </div>
259 244 </div>
260 245
261 246
262 247 </div><!--end summary-detail-->
263 248
264 249 <div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details">
265 250 ${_('Show More')}
266 251 </div>
267 252 </%def>
General Comments 0
You need to be logged in to leave comments. Login now