##// END OF EJS Templates
diffs: added wide-mode button to expand large diffs.
marcink -
r1193:26ee369d default
parent child Browse files
Show More
@@ -1,2202 +1,2206 b''
1 1 //Primary CSS
2 2
3 3 //--- IMPORTS ------------------//
4 4
5 5 @import 'helpers';
6 6 @import 'mixins';
7 7 @import 'rcicons';
8 8 @import 'fonts';
9 9 @import 'variables';
10 10 @import 'bootstrap-variables';
11 11 @import 'form-bootstrap';
12 12 @import 'codemirror';
13 13 @import 'legacy_code_styles';
14 14 @import 'progress-bar';
15 15
16 16 @import 'type';
17 17 @import 'alerts';
18 18 @import 'buttons';
19 19 @import 'tags';
20 20 @import 'code-block';
21 21 @import 'examples';
22 22 @import 'login';
23 23 @import 'main-content';
24 24 @import 'select2';
25 25 @import 'comments';
26 26 @import 'panels-bootstrap';
27 27 @import 'panels';
28 28 @import 'deform';
29 29
30 30 //--- BASE ------------------//
31 31 .noscript-error {
32 32 top: 0;
33 33 left: 0;
34 34 width: 100%;
35 35 z-index: 101;
36 36 text-align: center;
37 37 font-family: @text-semibold;
38 38 font-size: 120%;
39 39 color: white;
40 40 background-color: @alert2;
41 41 padding: 5px 0 5px 0;
42 42 }
43 43
44 44 html {
45 45 display: table;
46 46 height: 100%;
47 47 width: 100%;
48 48 }
49 49
50 50 body {
51 51 display: table-cell;
52 52 width: 100%;
53 53 }
54 54
55 55 //--- LAYOUT ------------------//
56 56
57 57 .hidden{
58 58 display: none !important;
59 59 }
60 60
61 61 .box{
62 62 float: left;
63 63 width: 100%;
64 64 }
65 65
66 66 .browser-header {
67 67 clear: both;
68 68 }
69 69 .main {
70 70 clear: both;
71 71 padding:0 0 @pagepadding;
72 72 height: auto;
73 73
74 74 &:after { //clearfix
75 75 content:"";
76 76 clear:both;
77 77 width:100%;
78 78 display:block;
79 79 }
80 80 }
81 81
82 82 .action-link{
83 83 margin-left: @padding;
84 84 padding-left: @padding;
85 85 border-left: @border-thickness solid @border-default-color;
86 86 }
87 87
88 88 input + .action-link, .action-link.first{
89 89 border-left: none;
90 90 }
91 91
92 92 .action-link.last{
93 93 margin-right: @padding;
94 94 padding-right: @padding;
95 95 }
96 96
97 97 .action-link.active,
98 98 .action-link.active a{
99 99 color: @grey4;
100 100 }
101 101
102 102 ul.simple-list{
103 103 list-style: none;
104 104 margin: 0;
105 105 padding: 0;
106 106 }
107 107
108 108 .main-content {
109 109 padding-bottom: @pagepadding;
110 110 }
111 111
112 .wide-mode-wrapper {
113 max-width:2400px !important;
114 }
115
112 116 .wrapper {
113 117 position: relative;
114 118 max-width: @wrapper-maxwidth;
115 119 margin: 0 auto;
116 120 }
117 121
118 122 #content {
119 123 clear: both;
120 124 padding: 0 @contentpadding;
121 125 }
122 126
123 127 .advanced-settings-fields{
124 128 input{
125 129 margin-left: @textmargin;
126 130 margin-right: @padding/2;
127 131 }
128 132 }
129 133
130 134 .cs_files_title {
131 135 margin: @pagepadding 0 0;
132 136 }
133 137
134 138 input.inline[type="file"] {
135 139 display: inline;
136 140 }
137 141
138 142 .error_page {
139 143 margin: 10% auto;
140 144
141 145 h1 {
142 146 color: @grey2;
143 147 }
144 148
145 149 .alert {
146 150 margin: @padding 0;
147 151 }
148 152
149 153 .error-branding {
150 154 font-family: @text-semibold;
151 155 color: @grey4;
152 156 }
153 157
154 158 .error_message {
155 159 font-family: @text-regular;
156 160 }
157 161
158 162 .sidebar {
159 163 min-height: 275px;
160 164 margin: 0;
161 165 padding: 0 0 @sidebarpadding @sidebarpadding;
162 166 border: none;
163 167 }
164 168
165 169 .main-content {
166 170 position: relative;
167 171 margin: 0 @sidebarpadding @sidebarpadding;
168 172 padding: 0 0 0 @sidebarpadding;
169 173 border-left: @border-thickness solid @grey5;
170 174
171 175 @media (max-width:767px) {
172 176 clear: both;
173 177 width: 100%;
174 178 margin: 0;
175 179 border: none;
176 180 }
177 181 }
178 182
179 183 .inner-column {
180 184 float: left;
181 185 width: 29.75%;
182 186 min-height: 150px;
183 187 margin: @sidebarpadding 2% 0 0;
184 188 padding: 0 2% 0 0;
185 189 border-right: @border-thickness solid @grey5;
186 190
187 191 @media (max-width:767px) {
188 192 clear: both;
189 193 width: 100%;
190 194 border: none;
191 195 }
192 196
193 197 ul {
194 198 padding-left: 1.25em;
195 199 }
196 200
197 201 &:last-child {
198 202 margin: @sidebarpadding 0 0;
199 203 border: none;
200 204 }
201 205
202 206 h4 {
203 207 margin: 0 0 @padding;
204 208 font-family: @text-semibold;
205 209 }
206 210 }
207 211 }
208 212 .error-page-logo {
209 213 width: 130px;
210 214 height: 160px;
211 215 }
212 216
213 217 // HEADER
214 218 .header {
215 219
216 220 // TODO: johbo: Fix login pages, so that they work without a min-height
217 221 // for the header and then remove the min-height. I chose a smaller value
218 222 // intentionally here to avoid rendering issues in the main navigation.
219 223 min-height: 49px;
220 224
221 225 position: relative;
222 226 vertical-align: bottom;
223 227 padding: 0 @header-padding;
224 228 background-color: @grey2;
225 229 color: @grey5;
226 230
227 231 .title {
228 232 overflow: visible;
229 233 }
230 234
231 235 &:before,
232 236 &:after {
233 237 content: "";
234 238 clear: both;
235 239 width: 100%;
236 240 }
237 241
238 242 // TODO: johbo: Avoids breaking "Repositories" chooser
239 243 .select2-container .select2-choice .select2-arrow {
240 244 display: none;
241 245 }
242 246 }
243 247
244 248 #header-inner {
245 249 &.title {
246 250 margin: 0;
247 251 }
248 252 &:before,
249 253 &:after {
250 254 content: "";
251 255 clear: both;
252 256 }
253 257 }
254 258
255 259 // Gists
256 260 #files_data {
257 261 clear: both; //for firefox
258 262 }
259 263 #gistid {
260 264 margin-right: @padding;
261 265 }
262 266
263 267 // Global Settings Editor
264 268 .textarea.editor {
265 269 float: left;
266 270 position: relative;
267 271 max-width: @texteditor-width;
268 272
269 273 select {
270 274 position: absolute;
271 275 top:10px;
272 276 right:0;
273 277 }
274 278
275 279 .CodeMirror {
276 280 margin: 0;
277 281 }
278 282
279 283 .help-block {
280 284 margin: 0 0 @padding;
281 285 padding:.5em;
282 286 background-color: @grey6;
283 287 }
284 288 }
285 289
286 290 ul.auth_plugins {
287 291 margin: @padding 0 @padding @legend-width;
288 292 padding: 0;
289 293
290 294 li {
291 295 margin-bottom: @padding;
292 296 line-height: 1em;
293 297 list-style-type: none;
294 298
295 299 .auth_buttons .btn {
296 300 margin-right: @padding;
297 301 }
298 302
299 303 &:before { content: none; }
300 304 }
301 305 }
302 306
303 307
304 308 // My Account PR list
305 309
306 310 #show_closed {
307 311 margin: 0 1em 0 0;
308 312 }
309 313
310 314 .pullrequestlist {
311 315 .closed {
312 316 background-color: @grey6;
313 317 }
314 318 .td-status {
315 319 padding-left: .5em;
316 320 }
317 321 .log-container .truncate {
318 322 height: 2.75em;
319 323 white-space: pre-line;
320 324 }
321 325 table.rctable .user {
322 326 padding-left: 0;
323 327 }
324 328 table.rctable {
325 329 td.td-description,
326 330 .rc-user {
327 331 min-width: auto;
328 332 }
329 333 }
330 334 }
331 335
332 336 // Pull Requests
333 337
334 338 .pullrequests_section_head {
335 339 display: block;
336 340 clear: both;
337 341 margin: @padding 0;
338 342 font-family: @text-bold;
339 343 }
340 344
341 345 .pr-origininfo, .pr-targetinfo {
342 346 position: relative;
343 347
344 348 .tag {
345 349 display: inline-block;
346 350 margin: 0 1em .5em 0;
347 351 }
348 352
349 353 .clone-url {
350 354 display: inline-block;
351 355 margin: 0 0 .5em 0;
352 356 padding: 0;
353 357 line-height: 1.2em;
354 358 }
355 359 }
356 360
357 361 .pr-pullinfo {
358 362 clear: both;
359 363 margin: .5em 0;
360 364 }
361 365
362 366 #pr-title-input {
363 367 width: 72%;
364 368 font-size: 1em;
365 369 font-family: @text-bold;
366 370 margin: 0;
367 371 padding: 0 0 0 @padding/4;
368 372 line-height: 1.7em;
369 373 color: @text-color;
370 374 letter-spacing: .02em;
371 375 }
372 376
373 377 #pullrequest_title {
374 378 width: 100%;
375 379 box-sizing: border-box;
376 380 }
377 381
378 382 #pr_open_message {
379 383 border: @border-thickness solid #fff;
380 384 border-radius: @border-radius;
381 385 padding: @padding-large-vertical @padding-large-vertical @padding-large-vertical 0;
382 386 text-align: right;
383 387 overflow: hidden;
384 388 }
385 389
386 390 .pr-submit-button {
387 391 float: right;
388 392 margin: 0 0 0 5px;
389 393 }
390 394
391 395 .pr-spacing-container {
392 396 padding: 20px;
393 397 clear: both
394 398 }
395 399
396 400 #pr-description-input {
397 401 margin-bottom: 0;
398 402 }
399 403
400 404 .pr-description-label {
401 405 vertical-align: top;
402 406 }
403 407
404 408 .perms_section_head {
405 409 min-width: 625px;
406 410
407 411 h2 {
408 412 margin-bottom: 0;
409 413 }
410 414
411 415 .label-checkbox {
412 416 float: left;
413 417 }
414 418
415 419 &.field {
416 420 margin: @space 0 @padding;
417 421 }
418 422
419 423 &:first-child.field {
420 424 margin-top: 0;
421 425
422 426 .label {
423 427 margin-top: 0;
424 428 padding-top: 0;
425 429 }
426 430
427 431 .radios {
428 432 padding-top: 0;
429 433 }
430 434 }
431 435
432 436 .radios {
433 437 float: right;
434 438 position: relative;
435 439 width: 405px;
436 440 }
437 441 }
438 442
439 443 //--- MODULES ------------------//
440 444
441 445
442 446 // Server Announcement
443 447 #server-announcement {
444 448 width: 95%;
445 449 margin: @padding auto;
446 450 padding: @padding;
447 451 border-width: 2px;
448 452 border-style: solid;
449 453 .border-radius(2px);
450 454 font-family: @text-bold;
451 455
452 456 &.info { border-color: @alert4; background-color: @alert4-inner; }
453 457 &.warning { border-color: @alert3; background-color: @alert3-inner; }
454 458 &.error { border-color: @alert2; background-color: @alert2-inner; }
455 459 &.success { border-color: @alert1; background-color: @alert1-inner; }
456 460 &.neutral { border-color: @grey3; background-color: @grey6; }
457 461 }
458 462
459 463 // Fixed Sidebar Column
460 464 .sidebar-col-wrapper {
461 465 padding-left: @sidebar-all-width;
462 466
463 467 .sidebar {
464 468 width: @sidebar-width;
465 469 margin-left: -@sidebar-all-width;
466 470 }
467 471 }
468 472
469 473 .sidebar-col-wrapper.scw-small {
470 474 padding-left: @sidebar-small-all-width;
471 475
472 476 .sidebar {
473 477 width: @sidebar-small-width;
474 478 margin-left: -@sidebar-small-all-width;
475 479 }
476 480 }
477 481
478 482
479 483 // FOOTER
480 484 #footer {
481 485 padding: 0;
482 486 text-align: center;
483 487 vertical-align: middle;
484 488 color: @grey2;
485 489 background-color: @grey6;
486 490
487 491 p {
488 492 margin: 0;
489 493 padding: 1em;
490 494 line-height: 1em;
491 495 }
492 496
493 497 .server-instance { //server instance
494 498 display: none;
495 499 }
496 500
497 501 .title {
498 502 float: none;
499 503 margin: 0 auto;
500 504 }
501 505 }
502 506
503 507 button.close {
504 508 padding: 0;
505 509 cursor: pointer;
506 510 background: transparent;
507 511 border: 0;
508 512 .box-shadow(none);
509 513 -webkit-appearance: none;
510 514 }
511 515
512 516 .close {
513 517 float: right;
514 518 font-size: 21px;
515 519 font-family: @text-bootstrap;
516 520 line-height: 1em;
517 521 font-weight: bold;
518 522 color: @grey2;
519 523
520 524 &:hover,
521 525 &:focus {
522 526 color: @grey1;
523 527 text-decoration: none;
524 528 cursor: pointer;
525 529 }
526 530 }
527 531
528 532 // GRID
529 533 .sorting,
530 534 .sorting_desc,
531 535 .sorting_asc {
532 536 cursor: pointer;
533 537 }
534 538 .sorting_desc:after {
535 539 content: "\00A0\25B2";
536 540 font-size: .75em;
537 541 }
538 542 .sorting_asc:after {
539 543 content: "\00A0\25BC";
540 544 font-size: .68em;
541 545 }
542 546
543 547
544 548 .user_auth_tokens {
545 549
546 550 &.truncate {
547 551 white-space: nowrap;
548 552 overflow: hidden;
549 553 text-overflow: ellipsis;
550 554 }
551 555
552 556 .fields .field .input {
553 557 margin: 0;
554 558 }
555 559
556 560 input#description {
557 561 width: 100px;
558 562 margin: 0;
559 563 }
560 564
561 565 .drop-menu {
562 566 // TODO: johbo: Remove this, should work out of the box when
563 567 // having multiple inputs inline
564 568 margin: 0 0 0 5px;
565 569 }
566 570 }
567 571 #user_list_table {
568 572 .closed {
569 573 background-color: @grey6;
570 574 }
571 575 }
572 576
573 577
574 578 input {
575 579 &.disabled {
576 580 opacity: .5;
577 581 }
578 582 }
579 583
580 584 // remove extra padding in firefox
581 585 input::-moz-focus-inner { border:0; padding:0 }
582 586
583 587 .adjacent input {
584 588 margin-bottom: @padding;
585 589 }
586 590
587 591 .permissions_boxes {
588 592 display: block;
589 593 }
590 594
591 595 //TODO: lisa: this should be in tables
592 596 .show_more_col {
593 597 width: 20px;
594 598 }
595 599
596 600 //FORMS
597 601
598 602 .medium-inline,
599 603 input#description.medium-inline {
600 604 display: inline;
601 605 width: @medium-inline-input-width;
602 606 min-width: 100px;
603 607 }
604 608
605 609 select {
606 610 //reset
607 611 -webkit-appearance: none;
608 612 -moz-appearance: none;
609 613
610 614 display: inline-block;
611 615 height: 28px;
612 616 width: auto;
613 617 margin: 0 @padding @padding 0;
614 618 padding: 0 18px 0 8px;
615 619 line-height:1em;
616 620 font-size: @basefontsize;
617 621 border: @border-thickness solid @rcblue;
618 622 background:white url("../images/dt-arrow-dn.png") no-repeat 100% 50%;
619 623 color: @rcblue;
620 624
621 625 &:after {
622 626 content: "\00A0\25BE";
623 627 }
624 628
625 629 &:focus {
626 630 outline: none;
627 631 }
628 632 }
629 633
630 634 option {
631 635 &:focus {
632 636 outline: none;
633 637 }
634 638 }
635 639
636 640 input,
637 641 textarea {
638 642 padding: @input-padding;
639 643 border: @input-border-thickness solid @border-highlight-color;
640 644 .border-radius (@border-radius);
641 645 font-family: @text-light;
642 646 font-size: @basefontsize;
643 647
644 648 &.input-sm {
645 649 padding: 5px;
646 650 }
647 651
648 652 &#description {
649 653 min-width: @input-description-minwidth;
650 654 min-height: 1em;
651 655 padding: 10px;
652 656 }
653 657 }
654 658
655 659 .field-sm {
656 660 input,
657 661 textarea {
658 662 padding: 5px;
659 663 }
660 664 }
661 665
662 666 textarea {
663 667 display: block;
664 668 clear: both;
665 669 width: 100%;
666 670 min-height: 100px;
667 671 margin-bottom: @padding;
668 672 .box-sizing(border-box);
669 673 overflow: auto;
670 674 }
671 675
672 676 label {
673 677 font-family: @text-light;
674 678 }
675 679
676 680 // GRAVATARS
677 681 // centers gravatar on username to the right
678 682
679 683 .gravatar {
680 684 display: inline;
681 685 min-width: 16px;
682 686 min-height: 16px;
683 687 margin: -5px 0;
684 688 padding: 0;
685 689 line-height: 1em;
686 690 border: 1px solid @grey4;
687 691
688 692 &.gravatar-large {
689 693 margin: -0.5em .25em -0.5em 0;
690 694 }
691 695
692 696 & + .user {
693 697 display: inline;
694 698 margin: 0;
695 699 padding: 0 0 0 .17em;
696 700 line-height: 1em;
697 701 }
698 702 }
699 703
700 704 .user-inline-data {
701 705 display: inline-block;
702 706 float: left;
703 707 padding-left: .5em;
704 708 line-height: 1.3em;
705 709 }
706 710
707 711 .rc-user { // gravatar + user wrapper
708 712 float: left;
709 713 position: relative;
710 714 min-width: 100px;
711 715 max-width: 200px;
712 716 min-height: (@gravatar-size + @border-thickness * 2); // account for border
713 717 display: block;
714 718 padding: 0 0 0 (@gravatar-size + @basefontsize/2 + @border-thickness * 2);
715 719
716 720
717 721 .gravatar {
718 722 display: block;
719 723 position: absolute;
720 724 top: 0;
721 725 left: 0;
722 726 min-width: @gravatar-size;
723 727 min-height: @gravatar-size;
724 728 margin: 0;
725 729 }
726 730
727 731 .user {
728 732 display: block;
729 733 max-width: 175px;
730 734 padding-top: 2px;
731 735 overflow: hidden;
732 736 text-overflow: ellipsis;
733 737 }
734 738 }
735 739
736 740 .gist-gravatar,
737 741 .journal_container {
738 742 .gravatar-large {
739 743 margin: 0 .5em -10px 0;
740 744 }
741 745 }
742 746
743 747
744 748 // ADMIN SETTINGS
745 749
746 750 // Tag Patterns
747 751 .tag_patterns {
748 752 .tag_input {
749 753 margin-bottom: @padding;
750 754 }
751 755 }
752 756
753 757 .locked_input {
754 758 position: relative;
755 759
756 760 input {
757 761 display: inline;
758 762 margin-top: 3px;
759 763 }
760 764
761 765 br {
762 766 display: none;
763 767 }
764 768
765 769 .error-message {
766 770 float: left;
767 771 width: 100%;
768 772 }
769 773
770 774 .lock_input_button {
771 775 display: inline;
772 776 }
773 777
774 778 .help-block {
775 779 clear: both;
776 780 }
777 781 }
778 782
779 783 // Notifications
780 784
781 785 .notifications_buttons {
782 786 margin: 0 0 @space 0;
783 787 padding: 0;
784 788
785 789 .btn {
786 790 display: inline-block;
787 791 }
788 792 }
789 793
790 794 .notification-list {
791 795
792 796 div {
793 797 display: inline-block;
794 798 vertical-align: middle;
795 799 }
796 800
797 801 .container {
798 802 display: block;
799 803 margin: 0 0 @padding 0;
800 804 }
801 805
802 806 .delete-notifications {
803 807 margin-left: @padding;
804 808 text-align: right;
805 809 cursor: pointer;
806 810 }
807 811
808 812 .read-notifications {
809 813 margin-left: @padding/2;
810 814 text-align: right;
811 815 width: 35px;
812 816 cursor: pointer;
813 817 }
814 818
815 819 .icon-minus-sign {
816 820 color: @alert2;
817 821 }
818 822
819 823 .icon-ok-sign {
820 824 color: @alert1;
821 825 }
822 826 }
823 827
824 828 .user_settings {
825 829 float: left;
826 830 clear: both;
827 831 display: block;
828 832 width: 100%;
829 833
830 834 .gravatar_box {
831 835 margin-bottom: @padding;
832 836
833 837 &:after {
834 838 content: " ";
835 839 clear: both;
836 840 width: 100%;
837 841 }
838 842 }
839 843
840 844 .fields .field {
841 845 clear: both;
842 846 }
843 847 }
844 848
845 849 .advanced_settings {
846 850 margin-bottom: @space;
847 851
848 852 .help-block {
849 853 margin-left: 0;
850 854 }
851 855
852 856 button + .help-block {
853 857 margin-top: @padding;
854 858 }
855 859 }
856 860
857 861 // admin settings radio buttons and labels
858 862 .label-2 {
859 863 float: left;
860 864 width: @label2-width;
861 865
862 866 label {
863 867 color: @grey1;
864 868 }
865 869 }
866 870 .checkboxes {
867 871 float: left;
868 872 width: @checkboxes-width;
869 873 margin-bottom: @padding;
870 874
871 875 .checkbox {
872 876 width: 100%;
873 877
874 878 label {
875 879 margin: 0;
876 880 padding: 0;
877 881 }
878 882 }
879 883
880 884 .checkbox + .checkbox {
881 885 display: inline-block;
882 886 }
883 887
884 888 label {
885 889 margin-right: 1em;
886 890 }
887 891 }
888 892
889 893 // CHANGELOG
890 894 .container_header {
891 895 float: left;
892 896 display: block;
893 897 width: 100%;
894 898 margin: @padding 0 @padding;
895 899
896 900 #filter_changelog {
897 901 float: left;
898 902 margin-right: @padding;
899 903 }
900 904
901 905 .breadcrumbs_light {
902 906 display: inline-block;
903 907 }
904 908 }
905 909
906 910 .info_box {
907 911 float: right;
908 912 }
909 913
910 914
911 915 #graph_nodes {
912 916 padding-top: 43px;
913 917 }
914 918
915 919 #graph_content{
916 920
917 921 // adjust for table headers so that graph renders properly
918 922 // #graph_nodes padding - table cell padding
919 923 padding-top: (@space - (@basefontsize * 2.4));
920 924
921 925 &.graph_full_width {
922 926 width: 100%;
923 927 max-width: 100%;
924 928 }
925 929 }
926 930
927 931 #graph {
928 932 .flag_status {
929 933 margin: 0;
930 934 }
931 935
932 936 .pagination-left {
933 937 float: left;
934 938 clear: both;
935 939 }
936 940
937 941 .log-container {
938 942 max-width: 345px;
939 943
940 944 .message{
941 945 max-width: 340px;
942 946 }
943 947 }
944 948
945 949 .graph-col-wrapper {
946 950 padding-left: 110px;
947 951
948 952 #graph_nodes {
949 953 width: 100px;
950 954 margin-left: -110px;
951 955 float: left;
952 956 clear: left;
953 957 }
954 958 }
955 959 }
956 960
957 961 #filter_changelog {
958 962 float: left;
959 963 }
960 964
961 965
962 966 //--- THEME ------------------//
963 967
964 968 #logo {
965 969 float: left;
966 970 margin: 9px 0 0 0;
967 971
968 972 .header {
969 973 background-color: transparent;
970 974 }
971 975
972 976 a {
973 977 display: inline-block;
974 978 }
975 979
976 980 img {
977 981 height:30px;
978 982 }
979 983 }
980 984
981 985 .logo-wrapper {
982 986 float:left;
983 987 }
984 988
985 989 .branding{
986 990 float: left;
987 991 padding: 9px 2px;
988 992 line-height: 1em;
989 993 font-size: @navigation-fontsize;
990 994 }
991 995
992 996 img {
993 997 border: none;
994 998 outline: none;
995 999 }
996 1000 user-profile-header
997 1001 label {
998 1002
999 1003 input[type="checkbox"] {
1000 1004 margin-right: 1em;
1001 1005 }
1002 1006 input[type="radio"] {
1003 1007 margin-right: 1em;
1004 1008 }
1005 1009 }
1006 1010
1007 1011 .flag_status {
1008 1012 margin: 2px 8px 6px 2px;
1009 1013 &.under_review {
1010 1014 .circle(5px, @alert3);
1011 1015 }
1012 1016 &.approved {
1013 1017 .circle(5px, @alert1);
1014 1018 }
1015 1019 &.rejected,
1016 1020 &.forced_closed{
1017 1021 .circle(5px, @alert2);
1018 1022 }
1019 1023 &.not_reviewed {
1020 1024 .circle(5px, @grey5);
1021 1025 }
1022 1026 }
1023 1027
1024 1028 .flag_status_comment_box {
1025 1029 margin: 5px 6px 0px 2px;
1026 1030 }
1027 1031 .test_pattern_preview {
1028 1032 margin: @space 0;
1029 1033
1030 1034 p {
1031 1035 margin-bottom: 0;
1032 1036 border-bottom: @border-thickness solid @border-default-color;
1033 1037 color: @grey3;
1034 1038 }
1035 1039
1036 1040 .btn {
1037 1041 margin-bottom: @padding;
1038 1042 }
1039 1043 }
1040 1044 #test_pattern_result {
1041 1045 display: none;
1042 1046 &:extend(pre);
1043 1047 padding: .9em;
1044 1048 color: @grey3;
1045 1049 background-color: @grey7;
1046 1050 border-right: @border-thickness solid @border-default-color;
1047 1051 border-bottom: @border-thickness solid @border-default-color;
1048 1052 border-left: @border-thickness solid @border-default-color;
1049 1053 }
1050 1054
1051 1055 #repo_vcs_settings {
1052 1056 #inherit_overlay_vcs_default {
1053 1057 display: none;
1054 1058 }
1055 1059 #inherit_overlay_vcs_custom {
1056 1060 display: custom;
1057 1061 }
1058 1062 &.inherited {
1059 1063 #inherit_overlay_vcs_default {
1060 1064 display: block;
1061 1065 }
1062 1066 #inherit_overlay_vcs_custom {
1063 1067 display: none;
1064 1068 }
1065 1069 }
1066 1070 }
1067 1071
1068 1072 .issue-tracker-link {
1069 1073 color: @rcblue;
1070 1074 }
1071 1075
1072 1076 // Issue Tracker Table Show/Hide
1073 1077 #repo_issue_tracker {
1074 1078 #inherit_overlay {
1075 1079 display: none;
1076 1080 }
1077 1081 #custom_overlay {
1078 1082 display: custom;
1079 1083 }
1080 1084 &.inherited {
1081 1085 #inherit_overlay {
1082 1086 display: block;
1083 1087 }
1084 1088 #custom_overlay {
1085 1089 display: none;
1086 1090 }
1087 1091 }
1088 1092 }
1089 1093 table.issuetracker {
1090 1094 &.readonly {
1091 1095 tr, td {
1092 1096 color: @grey3;
1093 1097 }
1094 1098 }
1095 1099 .edit {
1096 1100 display: none;
1097 1101 }
1098 1102 .editopen {
1099 1103 .edit {
1100 1104 display: inline;
1101 1105 }
1102 1106 .entry {
1103 1107 display: none;
1104 1108 }
1105 1109 }
1106 1110 tr td.td-action {
1107 1111 min-width: 117px;
1108 1112 }
1109 1113 td input {
1110 1114 max-width: none;
1111 1115 min-width: 30px;
1112 1116 width: 80%;
1113 1117 }
1114 1118 .issuetracker_pref input {
1115 1119 width: 40%;
1116 1120 }
1117 1121 input.edit_issuetracker_update {
1118 1122 margin-right: 0;
1119 1123 width: auto;
1120 1124 }
1121 1125 }
1122 1126
1123 1127 table.integrations {
1124 1128 .td-icon {
1125 1129 width: 20px;
1126 1130 .integration-icon {
1127 1131 height: 20px;
1128 1132 width: 20px;
1129 1133 }
1130 1134 }
1131 1135 }
1132 1136
1133 1137 .integrations {
1134 1138 a.integration-box {
1135 1139 color: @text-color;
1136 1140 &:hover {
1137 1141 .panel {
1138 1142 background: #fbfbfb;
1139 1143 }
1140 1144 }
1141 1145 .integration-icon {
1142 1146 width: 30px;
1143 1147 height: 30px;
1144 1148 margin-right: 20px;
1145 1149 float: left;
1146 1150 }
1147 1151
1148 1152 .panel-body {
1149 1153 padding: 10px;
1150 1154 }
1151 1155 .panel {
1152 1156 margin-bottom: 10px;
1153 1157 }
1154 1158 h2 {
1155 1159 display: inline-block;
1156 1160 margin: 0;
1157 1161 min-width: 140px;
1158 1162 }
1159 1163 }
1160 1164 }
1161 1165
1162 1166 //Permissions Settings
1163 1167 #add_perm {
1164 1168 margin: 0 0 @padding;
1165 1169 cursor: pointer;
1166 1170 }
1167 1171
1168 1172 .perm_ac {
1169 1173 input {
1170 1174 width: 95%;
1171 1175 }
1172 1176 }
1173 1177
1174 1178 .autocomplete-suggestions {
1175 1179 width: auto !important; // overrides autocomplete.js
1176 1180 margin: 0;
1177 1181 border: @border-thickness solid @rcblue;
1178 1182 border-radius: @border-radius;
1179 1183 color: @rcblue;
1180 1184 background-color: white;
1181 1185 }
1182 1186 .autocomplete-selected {
1183 1187 background: #F0F0F0;
1184 1188 }
1185 1189 .ac-container-wrap {
1186 1190 margin: 0;
1187 1191 padding: 8px;
1188 1192 border-bottom: @border-thickness solid @rclightblue;
1189 1193 list-style-type: none;
1190 1194 cursor: pointer;
1191 1195
1192 1196 &:hover {
1193 1197 background-color: @rclightblue;
1194 1198 }
1195 1199
1196 1200 img {
1197 1201 height: @gravatar-size;
1198 1202 width: @gravatar-size;
1199 1203 margin-right: 1em;
1200 1204 }
1201 1205
1202 1206 strong {
1203 1207 font-weight: normal;
1204 1208 }
1205 1209 }
1206 1210
1207 1211 // Settings Dropdown
1208 1212 .user-menu .container {
1209 1213 padding: 0 4px;
1210 1214 margin: 0;
1211 1215 }
1212 1216
1213 1217 .user-menu .gravatar {
1214 1218 cursor: pointer;
1215 1219 }
1216 1220
1217 1221 .codeblock {
1218 1222 margin-bottom: @padding;
1219 1223 clear: both;
1220 1224
1221 1225 .stats{
1222 1226 overflow: hidden;
1223 1227 }
1224 1228
1225 1229 .message{
1226 1230 textarea{
1227 1231 margin: 0;
1228 1232 }
1229 1233 }
1230 1234
1231 1235 .code-header {
1232 1236 .stats {
1233 1237 line-height: 2em;
1234 1238
1235 1239 .revision_id {
1236 1240 margin-left: 0;
1237 1241 }
1238 1242 .buttons {
1239 1243 padding-right: 0;
1240 1244 }
1241 1245 }
1242 1246
1243 1247 .item{
1244 1248 margin-right: 0.5em;
1245 1249 }
1246 1250 }
1247 1251
1248 1252 #editor_container{
1249 1253 position: relative;
1250 1254 margin: @padding;
1251 1255 }
1252 1256 }
1253 1257
1254 1258 #file_history_container {
1255 1259 display: none;
1256 1260 }
1257 1261
1258 1262 .file-history-inner {
1259 1263 margin-bottom: 10px;
1260 1264 }
1261 1265
1262 1266 // Pull Requests
1263 1267 .summary-details {
1264 1268 width: 72%;
1265 1269 }
1266 1270 .pr-summary {
1267 1271 border-bottom: @border-thickness solid @grey5;
1268 1272 margin-bottom: @space;
1269 1273 }
1270 1274 .reviewers-title {
1271 1275 width: 25%;
1272 1276 min-width: 200px;
1273 1277 }
1274 1278 .reviewers {
1275 1279 width: 25%;
1276 1280 min-width: 200px;
1277 1281 }
1278 1282 .reviewers ul li {
1279 1283 position: relative;
1280 1284 width: 100%;
1281 1285 margin-bottom: 8px;
1282 1286 }
1283 1287 .reviewers_member {
1284 1288 width: 100%;
1285 1289 overflow: auto;
1286 1290 }
1287 1291 .reviewer_reason {
1288 1292 padding-left: 20px;
1289 1293 }
1290 1294 .reviewer_status {
1291 1295 display: inline-block;
1292 1296 vertical-align: top;
1293 1297 width: 7%;
1294 1298 min-width: 20px;
1295 1299 height: 1.2em;
1296 1300 margin-top: 3px;
1297 1301 line-height: 1em;
1298 1302 }
1299 1303
1300 1304 .reviewer_name {
1301 1305 display: inline-block;
1302 1306 max-width: 83%;
1303 1307 padding-right: 20px;
1304 1308 vertical-align: middle;
1305 1309 line-height: 1;
1306 1310
1307 1311 .rc-user {
1308 1312 min-width: 0;
1309 1313 margin: -2px 1em 0 0;
1310 1314 }
1311 1315
1312 1316 .reviewer {
1313 1317 float: left;
1314 1318 }
1315 1319
1316 1320 &.to-delete {
1317 1321 .user,
1318 1322 .reviewer {
1319 1323 text-decoration: line-through;
1320 1324 }
1321 1325 }
1322 1326 }
1323 1327
1324 1328 .reviewer_member_remove {
1325 1329 position: absolute;
1326 1330 right: 0;
1327 1331 top: 0;
1328 1332 width: 16px;
1329 1333 margin-bottom: 10px;
1330 1334 padding: 0;
1331 1335 color: black;
1332 1336 }
1333 1337 .reviewer_member_status {
1334 1338 margin-top: 5px;
1335 1339 }
1336 1340 .pr-summary #summary{
1337 1341 width: 100%;
1338 1342 }
1339 1343 .pr-summary .action_button:hover {
1340 1344 border: 0;
1341 1345 cursor: pointer;
1342 1346 }
1343 1347 .pr-details-title {
1344 1348 padding-bottom: 8px;
1345 1349 border-bottom: @border-thickness solid @grey5;
1346 1350
1347 1351 .action_button.disabled {
1348 1352 color: @grey4;
1349 1353 cursor: inherit;
1350 1354 }
1351 1355 .action_button {
1352 1356 color: @rcblue;
1353 1357 }
1354 1358 }
1355 1359 .pr-details-content {
1356 1360 margin-top: @textmargin;
1357 1361 margin-bottom: @textmargin;
1358 1362 }
1359 1363 .pr-description {
1360 1364 white-space:pre-wrap;
1361 1365 }
1362 1366 .group_members {
1363 1367 margin-top: 0;
1364 1368 padding: 0;
1365 1369 list-style: outside none none;
1366 1370
1367 1371 img {
1368 1372 height: @gravatar-size;
1369 1373 width: @gravatar-size;
1370 1374 margin-right: .5em;
1371 1375 margin-left: 3px;
1372 1376 }
1373 1377
1374 1378 .to-delete {
1375 1379 .user {
1376 1380 text-decoration: line-through;
1377 1381 }
1378 1382 }
1379 1383 }
1380 1384
1381 1385 // new entry in group_members
1382 1386 .td-author-new-entry {
1383 1387 background-color: rgba(red(@alert1), green(@alert1), blue(@alert1), 0.3);
1384 1388 }
1385 1389
1386 1390 .usergroup_member_remove {
1387 1391 width: 16px;
1388 1392 margin-bottom: 10px;
1389 1393 padding: 0;
1390 1394 color: black !important;
1391 1395 cursor: pointer;
1392 1396 }
1393 1397
1394 1398 .reviewer_ac .ac-input {
1395 1399 width: 92%;
1396 1400 margin-bottom: 1em;
1397 1401 }
1398 1402
1399 1403 .compare_view_commits tr{
1400 1404 height: 20px;
1401 1405 }
1402 1406 .compare_view_commits td {
1403 1407 vertical-align: top;
1404 1408 padding-top: 10px;
1405 1409 }
1406 1410 .compare_view_commits .author {
1407 1411 margin-left: 5px;
1408 1412 }
1409 1413
1410 1414 .compare_view_files {
1411 1415 width: 100%;
1412 1416
1413 1417 td {
1414 1418 vertical-align: middle;
1415 1419 }
1416 1420 }
1417 1421
1418 1422 .compare_view_filepath {
1419 1423 color: @grey1;
1420 1424 }
1421 1425
1422 1426 .show_more {
1423 1427 display: inline-block;
1424 1428 position: relative;
1425 1429 vertical-align: middle;
1426 1430 width: 4px;
1427 1431 height: @basefontsize;
1428 1432
1429 1433 &:after {
1430 1434 content: "\00A0\25BE";
1431 1435 display: inline-block;
1432 1436 width:10px;
1433 1437 line-height: 5px;
1434 1438 font-size: 12px;
1435 1439 cursor: pointer;
1436 1440 }
1437 1441 }
1438 1442
1439 1443 .journal_more .show_more {
1440 1444 display: inline;
1441 1445
1442 1446 &:after {
1443 1447 content: none;
1444 1448 }
1445 1449 }
1446 1450
1447 1451 .open .show_more:after,
1448 1452 .select2-dropdown-open .show_more:after {
1449 1453 .rotate(180deg);
1450 1454 margin-left: 4px;
1451 1455 }
1452 1456
1453 1457
1454 1458 .compare_view_commits .collapse_commit:after {
1455 1459 cursor: pointer;
1456 1460 content: "\00A0\25B4";
1457 1461 margin-left: -3px;
1458 1462 font-size: 17px;
1459 1463 color: @grey4;
1460 1464 }
1461 1465
1462 1466 .diff_links {
1463 1467 margin-left: 8px;
1464 1468 }
1465 1469
1466 1470 p.ancestor {
1467 1471 margin: @padding 0;
1468 1472 }
1469 1473
1470 1474 .cs_icon_td input[type="checkbox"] {
1471 1475 display: none;
1472 1476 }
1473 1477
1474 1478 .cs_icon_td .expand_file_icon:after {
1475 1479 cursor: pointer;
1476 1480 content: "\00A0\25B6";
1477 1481 font-size: 12px;
1478 1482 color: @grey4;
1479 1483 }
1480 1484
1481 1485 .cs_icon_td .collapse_file_icon:after {
1482 1486 cursor: pointer;
1483 1487 content: "\00A0\25BC";
1484 1488 font-size: 12px;
1485 1489 color: @grey4;
1486 1490 }
1487 1491
1488 1492 /*new binary
1489 1493 NEW_FILENODE = 1
1490 1494 DEL_FILENODE = 2
1491 1495 MOD_FILENODE = 3
1492 1496 RENAMED_FILENODE = 4
1493 1497 COPIED_FILENODE = 5
1494 1498 CHMOD_FILENODE = 6
1495 1499 BIN_FILENODE = 7
1496 1500 */
1497 1501 .cs_files_expand {
1498 1502 font-size: @basefontsize + 5px;
1499 1503 line-height: 1.8em;
1500 1504 float: right;
1501 1505 }
1502 1506
1503 1507 .cs_files_expand span{
1504 1508 color: @rcblue;
1505 1509 cursor: pointer;
1506 1510 }
1507 1511 .cs_files {
1508 1512 clear: both;
1509 1513 padding-bottom: @padding;
1510 1514
1511 1515 .cur_cs {
1512 1516 margin: 10px 2px;
1513 1517 font-weight: bold;
1514 1518 }
1515 1519
1516 1520 .node {
1517 1521 float: left;
1518 1522 }
1519 1523
1520 1524 .changes {
1521 1525 float: right;
1522 1526 color: white;
1523 1527 font-size: @basefontsize - 4px;
1524 1528 margin-top: 4px;
1525 1529 opacity: 0.6;
1526 1530 filter: Alpha(opacity=60); /* IE8 and earlier */
1527 1531
1528 1532 .added {
1529 1533 background-color: @alert1;
1530 1534 float: left;
1531 1535 text-align: center;
1532 1536 }
1533 1537
1534 1538 .deleted {
1535 1539 background-color: @alert2;
1536 1540 float: left;
1537 1541 text-align: center;
1538 1542 }
1539 1543
1540 1544 .bin {
1541 1545 background-color: @alert1;
1542 1546 text-align: center;
1543 1547 }
1544 1548
1545 1549 /*new binary*/
1546 1550 .bin.bin1 {
1547 1551 background-color: @alert1;
1548 1552 text-align: center;
1549 1553 }
1550 1554
1551 1555 /*deleted binary*/
1552 1556 .bin.bin2 {
1553 1557 background-color: @alert2;
1554 1558 text-align: center;
1555 1559 }
1556 1560
1557 1561 /*mod binary*/
1558 1562 .bin.bin3 {
1559 1563 background-color: @grey2;
1560 1564 text-align: center;
1561 1565 }
1562 1566
1563 1567 /*rename file*/
1564 1568 .bin.bin4 {
1565 1569 background-color: @alert4;
1566 1570 text-align: center;
1567 1571 }
1568 1572
1569 1573 /*copied file*/
1570 1574 .bin.bin5 {
1571 1575 background-color: @alert4;
1572 1576 text-align: center;
1573 1577 }
1574 1578
1575 1579 /*chmod file*/
1576 1580 .bin.bin6 {
1577 1581 background-color: @grey2;
1578 1582 text-align: center;
1579 1583 }
1580 1584 }
1581 1585 }
1582 1586
1583 1587 .cs_files .cs_added, .cs_files .cs_A,
1584 1588 .cs_files .cs_added, .cs_files .cs_M,
1585 1589 .cs_files .cs_added, .cs_files .cs_D {
1586 1590 height: 16px;
1587 1591 padding-right: 10px;
1588 1592 margin-top: 7px;
1589 1593 text-align: left;
1590 1594 }
1591 1595
1592 1596 .cs_icon_td {
1593 1597 min-width: 16px;
1594 1598 width: 16px;
1595 1599 }
1596 1600
1597 1601 .pull-request-merge {
1598 1602 padding: 10px 0;
1599 1603 margin-top: 10px;
1600 1604 margin-bottom: 20px;
1601 1605 }
1602 1606
1603 1607 .pull-request-merge .pull-request-wrap {
1604 1608 height: 25px;
1605 1609 padding: 5px 0;
1606 1610 }
1607 1611
1608 1612 .pull-request-merge span {
1609 1613 margin-right: 10px;
1610 1614 }
1611 1615 #close_pull_request {
1612 1616 margin-right: 0px;
1613 1617 }
1614 1618
1615 1619 .empty_data {
1616 1620 color: @grey4;
1617 1621 }
1618 1622
1619 1623 #changeset_compare_view_content {
1620 1624 margin-bottom: @space;
1621 1625 clear: both;
1622 1626 width: 100%;
1623 1627 box-sizing: border-box;
1624 1628 .border-radius(@border-radius);
1625 1629
1626 1630 .help-block {
1627 1631 margin: @padding 0;
1628 1632 color: @text-color;
1629 1633 }
1630 1634
1631 1635 .empty_data {
1632 1636 margin: @padding 0;
1633 1637 }
1634 1638
1635 1639 .alert {
1636 1640 margin-bottom: @space;
1637 1641 }
1638 1642 }
1639 1643
1640 1644 .table_disp {
1641 1645 .status {
1642 1646 width: auto;
1643 1647
1644 1648 .flag_status {
1645 1649 float: left;
1646 1650 }
1647 1651 }
1648 1652 }
1649 1653
1650 1654 .status_box_menu {
1651 1655 margin: 0;
1652 1656 }
1653 1657
1654 1658 .notification-table{
1655 1659 margin-bottom: @space;
1656 1660 display: table;
1657 1661 width: 100%;
1658 1662
1659 1663 .container{
1660 1664 display: table-row;
1661 1665
1662 1666 .notification-header{
1663 1667 border-bottom: @border-thickness solid @border-default-color;
1664 1668 }
1665 1669
1666 1670 .notification-subject{
1667 1671 display: table-cell;
1668 1672 }
1669 1673 }
1670 1674 }
1671 1675
1672 1676 // Notifications
1673 1677 .notification-header{
1674 1678 display: table;
1675 1679 width: 100%;
1676 1680 padding: floor(@basefontsize/2) 0;
1677 1681 line-height: 1em;
1678 1682
1679 1683 .desc, .delete-notifications, .read-notifications{
1680 1684 display: table-cell;
1681 1685 text-align: left;
1682 1686 }
1683 1687
1684 1688 .desc{
1685 1689 width: 1163px;
1686 1690 }
1687 1691
1688 1692 .delete-notifications, .read-notifications{
1689 1693 width: 35px;
1690 1694 min-width: 35px; //fixes when only one button is displayed
1691 1695 }
1692 1696 }
1693 1697
1694 1698 .notification-body {
1695 1699 .markdown-block,
1696 1700 .rst-block {
1697 1701 padding: @padding 0;
1698 1702 }
1699 1703
1700 1704 .notification-subject {
1701 1705 padding: @textmargin 0;
1702 1706 border-bottom: @border-thickness solid @border-default-color;
1703 1707 }
1704 1708 }
1705 1709
1706 1710
1707 1711 .notifications_buttons{
1708 1712 float: right;
1709 1713 }
1710 1714
1711 1715 #notification-status{
1712 1716 display: inline;
1713 1717 }
1714 1718
1715 1719 // Repositories
1716 1720
1717 1721 #summary.fields{
1718 1722 display: table;
1719 1723
1720 1724 .field{
1721 1725 display: table-row;
1722 1726
1723 1727 .label-summary{
1724 1728 display: table-cell;
1725 1729 min-width: @label-summary-minwidth;
1726 1730 padding-top: @padding/2;
1727 1731 padding-bottom: @padding/2;
1728 1732 padding-right: @padding/2;
1729 1733 }
1730 1734
1731 1735 .input{
1732 1736 display: table-cell;
1733 1737 padding: @padding/2;
1734 1738
1735 1739 input{
1736 1740 min-width: 29em;
1737 1741 padding: @padding/4;
1738 1742 }
1739 1743 }
1740 1744 .statistics, .downloads{
1741 1745 .disabled{
1742 1746 color: @grey4;
1743 1747 }
1744 1748 }
1745 1749 }
1746 1750 }
1747 1751
1748 1752 #summary{
1749 1753 width: 70%;
1750 1754 }
1751 1755
1752 1756
1753 1757 // Journal
1754 1758 .journal.title {
1755 1759 h5 {
1756 1760 float: left;
1757 1761 margin: 0;
1758 1762 width: 70%;
1759 1763 }
1760 1764
1761 1765 ul {
1762 1766 float: right;
1763 1767 display: inline-block;
1764 1768 margin: 0;
1765 1769 width: 30%;
1766 1770 text-align: right;
1767 1771
1768 1772 li {
1769 1773 display: inline;
1770 1774 font-size: @journal-fontsize;
1771 1775 line-height: 1em;
1772 1776
1773 1777 &:before { content: none; }
1774 1778 }
1775 1779 }
1776 1780 }
1777 1781
1778 1782 .filterexample {
1779 1783 position: absolute;
1780 1784 top: 95px;
1781 1785 left: @contentpadding;
1782 1786 color: @rcblue;
1783 1787 font-size: 11px;
1784 1788 font-family: @text-regular;
1785 1789 cursor: help;
1786 1790
1787 1791 &:hover {
1788 1792 color: @rcdarkblue;
1789 1793 }
1790 1794
1791 1795 @media (max-width:768px) {
1792 1796 position: relative;
1793 1797 top: auto;
1794 1798 left: auto;
1795 1799 display: block;
1796 1800 }
1797 1801 }
1798 1802
1799 1803
1800 1804 #journal{
1801 1805 margin-bottom: @space;
1802 1806
1803 1807 .journal_day{
1804 1808 margin-bottom: @textmargin/2;
1805 1809 padding-bottom: @textmargin/2;
1806 1810 font-size: @journal-fontsize;
1807 1811 border-bottom: @border-thickness solid @border-default-color;
1808 1812 }
1809 1813
1810 1814 .journal_container{
1811 1815 margin-bottom: @space;
1812 1816
1813 1817 .journal_user{
1814 1818 display: inline-block;
1815 1819 }
1816 1820 .journal_action_container{
1817 1821 display: block;
1818 1822 margin-top: @textmargin;
1819 1823
1820 1824 div{
1821 1825 display: inline;
1822 1826 }
1823 1827
1824 1828 div.journal_action_params{
1825 1829 display: block;
1826 1830 }
1827 1831
1828 1832 div.journal_repo:after{
1829 1833 content: "\A";
1830 1834 white-space: pre;
1831 1835 }
1832 1836
1833 1837 div.date{
1834 1838 display: block;
1835 1839 margin-bottom: @textmargin;
1836 1840 }
1837 1841 }
1838 1842 }
1839 1843 }
1840 1844
1841 1845 // Files
1842 1846 .edit-file-title {
1843 1847 border-bottom: @border-thickness solid @border-default-color;
1844 1848
1845 1849 .breadcrumbs {
1846 1850 margin-bottom: 0;
1847 1851 }
1848 1852 }
1849 1853
1850 1854 .edit-file-fieldset {
1851 1855 margin-top: @sidebarpadding;
1852 1856
1853 1857 .fieldset {
1854 1858 .left-label {
1855 1859 width: 13%;
1856 1860 }
1857 1861 .right-content {
1858 1862 width: 87%;
1859 1863 max-width: 100%;
1860 1864 }
1861 1865 .filename-label {
1862 1866 margin-top: 13px;
1863 1867 }
1864 1868 .commit-message-label {
1865 1869 margin-top: 4px;
1866 1870 }
1867 1871 .file-upload-input {
1868 1872 input {
1869 1873 display: none;
1870 1874 }
1871 1875 }
1872 1876 p {
1873 1877 margin-top: 5px;
1874 1878 }
1875 1879
1876 1880 }
1877 1881 .custom-path-link {
1878 1882 margin-left: 5px;
1879 1883 }
1880 1884 #commit {
1881 1885 resize: vertical;
1882 1886 }
1883 1887 }
1884 1888
1885 1889 .delete-file-preview {
1886 1890 max-height: 250px;
1887 1891 }
1888 1892
1889 1893 .new-file,
1890 1894 #filter_activate,
1891 1895 #filter_deactivate {
1892 1896 float: left;
1893 1897 margin: 0 0 0 15px;
1894 1898 }
1895 1899
1896 1900 h3.files_location{
1897 1901 line-height: 2.4em;
1898 1902 }
1899 1903
1900 1904 .browser-nav {
1901 1905 display: table;
1902 1906 margin-bottom: @space;
1903 1907
1904 1908
1905 1909 .info_box {
1906 1910 display: inline-table;
1907 1911 height: 2.5em;
1908 1912
1909 1913 .browser-cur-rev, .info_box_elem {
1910 1914 display: table-cell;
1911 1915 vertical-align: middle;
1912 1916 }
1913 1917
1914 1918 .info_box_elem {
1915 1919 border-top: @border-thickness solid @rcblue;
1916 1920 border-bottom: @border-thickness solid @rcblue;
1917 1921
1918 1922 #at_rev, a {
1919 1923 padding: 0.6em 0.9em;
1920 1924 margin: 0;
1921 1925 .box-shadow(none);
1922 1926 border: 0;
1923 1927 height: 12px;
1924 1928 }
1925 1929
1926 1930 input#at_rev {
1927 1931 max-width: 50px;
1928 1932 text-align: right;
1929 1933 }
1930 1934
1931 1935 &.previous {
1932 1936 border: @border-thickness solid @rcblue;
1933 1937 .disabled {
1934 1938 color: @grey4;
1935 1939 cursor: not-allowed;
1936 1940 }
1937 1941 }
1938 1942
1939 1943 &.next {
1940 1944 border: @border-thickness solid @rcblue;
1941 1945 .disabled {
1942 1946 color: @grey4;
1943 1947 cursor: not-allowed;
1944 1948 }
1945 1949 }
1946 1950 }
1947 1951
1948 1952 .browser-cur-rev {
1949 1953
1950 1954 span{
1951 1955 margin: 0;
1952 1956 color: @rcblue;
1953 1957 height: 12px;
1954 1958 display: inline-block;
1955 1959 padding: 0.7em 1em ;
1956 1960 border: @border-thickness solid @rcblue;
1957 1961 margin-right: @padding;
1958 1962 }
1959 1963 }
1960 1964 }
1961 1965
1962 1966 .search_activate {
1963 1967 display: table-cell;
1964 1968 vertical-align: middle;
1965 1969
1966 1970 input, label{
1967 1971 margin: 0;
1968 1972 padding: 0;
1969 1973 }
1970 1974
1971 1975 input{
1972 1976 margin-left: @textmargin;
1973 1977 }
1974 1978
1975 1979 }
1976 1980 }
1977 1981
1978 1982 .browser-cur-rev{
1979 1983 margin-bottom: @textmargin;
1980 1984 }
1981 1985
1982 1986 #node_filter_box_loading{
1983 1987 .info_text;
1984 1988 }
1985 1989
1986 1990 .browser-search {
1987 1991 margin: -25px 0px 5px 0px;
1988 1992 }
1989 1993
1990 1994 .node-filter {
1991 1995 font-size: @repo-title-fontsize;
1992 1996 padding: 4px 0px 0px 0px;
1993 1997
1994 1998 .node-filter-path {
1995 1999 float: left;
1996 2000 color: @grey4;
1997 2001 }
1998 2002 .node-filter-input {
1999 2003 float: left;
2000 2004 margin: -2px 0px 0px 2px;
2001 2005 input {
2002 2006 padding: 2px;
2003 2007 border: none;
2004 2008 font-size: @repo-title-fontsize;
2005 2009 }
2006 2010 }
2007 2011 }
2008 2012
2009 2013
2010 2014 .browser-result{
2011 2015 td a{
2012 2016 margin-left: 0.5em;
2013 2017 display: inline-block;
2014 2018
2015 2019 em{
2016 2020 font-family: @text-bold;
2017 2021 }
2018 2022 }
2019 2023 }
2020 2024
2021 2025 .browser-highlight{
2022 2026 background-color: @grey5-alpha;
2023 2027 }
2024 2028
2025 2029
2026 2030 // Search
2027 2031
2028 2032 .search-form{
2029 2033 #q {
2030 2034 width: @search-form-width;
2031 2035 }
2032 2036 .fields{
2033 2037 margin: 0 0 @space;
2034 2038 }
2035 2039
2036 2040 label{
2037 2041 display: inline-block;
2038 2042 margin-right: @textmargin;
2039 2043 padding-top: 0.25em;
2040 2044 }
2041 2045
2042 2046
2043 2047 .results{
2044 2048 clear: both;
2045 2049 margin: 0 0 @padding;
2046 2050 }
2047 2051 }
2048 2052
2049 2053 div.search-feedback-items {
2050 2054 display: inline-block;
2051 2055 padding:0px 0px 0px 96px;
2052 2056 }
2053 2057
2054 2058 div.search-code-body {
2055 2059 background-color: #ffffff; padding: 5px 0 5px 10px;
2056 2060 pre {
2057 2061 .match { background-color: #faffa6;}
2058 2062 .break { display: block; width: 100%; background-color: #DDE7EF; color: #747474; }
2059 2063 }
2060 2064 }
2061 2065
2062 2066 .expand_commit.search {
2063 2067 .show_more.open {
2064 2068 height: auto;
2065 2069 max-height: none;
2066 2070 }
2067 2071 }
2068 2072
2069 2073 .search-results {
2070 2074
2071 2075 h2 {
2072 2076 margin-bottom: 0;
2073 2077 }
2074 2078 .codeblock {
2075 2079 border: none;
2076 2080 background: transparent;
2077 2081 }
2078 2082
2079 2083 .codeblock-header {
2080 2084 border: none;
2081 2085 background: transparent;
2082 2086 }
2083 2087
2084 2088 .code-body {
2085 2089 border: @border-thickness solid @border-default-color;
2086 2090 .border-radius(@border-radius);
2087 2091 }
2088 2092
2089 2093 .td-commit {
2090 2094 &:extend(pre);
2091 2095 border-bottom: @border-thickness solid @border-default-color;
2092 2096 }
2093 2097
2094 2098 .message {
2095 2099 height: auto;
2096 2100 max-width: 350px;
2097 2101 white-space: normal;
2098 2102 text-overflow: initial;
2099 2103 overflow: visible;
2100 2104
2101 2105 .match { background-color: #faffa6;}
2102 2106 .break { background-color: #DDE7EF; width: 100%; color: #747474; display: block; }
2103 2107 }
2104 2108
2105 2109 }
2106 2110
2107 2111 table.rctable td.td-search-results div {
2108 2112 max-width: 100%;
2109 2113 }
2110 2114
2111 2115 #tip-box, .tip-box{
2112 2116 padding: @menupadding/2;
2113 2117 display: block;
2114 2118 border: @border-thickness solid @border-highlight-color;
2115 2119 .border-radius(@border-radius);
2116 2120 background-color: white;
2117 2121 z-index: 99;
2118 2122 white-space: pre-wrap;
2119 2123 }
2120 2124
2121 2125 #linktt {
2122 2126 width: 79px;
2123 2127 }
2124 2128
2125 2129 #help_kb .modal-content{
2126 2130 max-width: 750px;
2127 2131 margin: 10% auto;
2128 2132
2129 2133 table{
2130 2134 td,th{
2131 2135 border-bottom: none;
2132 2136 line-height: 2.5em;
2133 2137 }
2134 2138 th{
2135 2139 padding-bottom: @textmargin/2;
2136 2140 }
2137 2141 td.keys{
2138 2142 text-align: center;
2139 2143 }
2140 2144 }
2141 2145
2142 2146 .block-left{
2143 2147 width: 45%;
2144 2148 margin-right: 5%;
2145 2149 }
2146 2150 .modal-footer{
2147 2151 clear: both;
2148 2152 }
2149 2153 .key.tag{
2150 2154 padding: 0.5em;
2151 2155 background-color: @rcblue;
2152 2156 color: white;
2153 2157 border-color: @rcblue;
2154 2158 .box-shadow(none);
2155 2159 }
2156 2160 }
2157 2161
2158 2162
2159 2163
2160 2164 //--- IMPORTS FOR REFACTORED STYLES ------------------//
2161 2165
2162 2166 @import 'statistics-graph';
2163 2167 @import 'tables';
2164 2168 @import 'forms';
2165 2169 @import 'diff';
2166 2170 @import 'summary';
2167 2171 @import 'navigation';
2168 2172
2169 2173 //--- SHOW/HIDE SECTIONS --//
2170 2174
2171 2175 .btn-collapse {
2172 2176 float: right;
2173 2177 text-align: right;
2174 2178 font-family: @text-light;
2175 2179 font-size: @basefontsize;
2176 2180 cursor: pointer;
2177 2181 border: none;
2178 2182 color: @rcblue;
2179 2183 }
2180 2184
2181 2185 table.rctable,
2182 2186 table.dataTable {
2183 2187 .btn-collapse {
2184 2188 float: right;
2185 2189 text-align: right;
2186 2190 }
2187 2191 }
2188 2192
2189 2193
2190 2194 // TODO: johbo: Fix for IE10, this avoids that we see a border
2191 2195 // and padding around checkboxes and radio boxes. Move to the right place,
2192 2196 // or better: Remove this once we did the form refactoring.
2193 2197 input[type=checkbox],
2194 2198 input[type=radio] {
2195 2199 padding: 0;
2196 2200 border: none;
2197 2201 }
2198 2202
2199 2203 .toggle-ajax-spinner{
2200 2204 height: 16px;
2201 2205 width: 16px;
2202 2206 }
@@ -1,627 +1,640 b''
1 1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 2 // #
3 3 // # This program is free software: you can redistribute it and/or modify
4 4 // # it under the terms of the GNU Affero General Public License, version 3
5 5 // # (only), as published by the Free Software Foundation.
6 6 // #
7 7 // # This program is distributed in the hope that it will be useful,
8 8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 // # GNU General Public License for more details.
11 11 // #
12 12 // # You should have received a copy of the GNU Affero General Public License
13 13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 // #
15 15 // # This program is dual-licensed. If you wish to learn more about the
16 16 // # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 // # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18
19 19 var firefoxAnchorFix = function() {
20 20 // hack to make anchor links behave properly on firefox, in our inline
21 21 // comments generation when comments are injected firefox is misbehaving
22 22 // when jumping to anchor links
23 23 if (location.href.indexOf('#') > -1) {
24 24 location.href += '';
25 25 }
26 26 };
27 27
28 28 // returns a node from given html;
29 29 var fromHTML = function(html){
30 30 var _html = document.createElement('element');
31 31 _html.innerHTML = html;
32 32 return _html;
33 33 };
34 34
35 35 var tableTr = function(cls, body){
36 36 var _el = document.createElement('div');
37 37 var _body = $(body).attr('id');
38 38 var comment_id = fromHTML(body).children[0].id.split('comment-')[1];
39 39 var id = 'comment-tr-{0}'.format(comment_id);
40 40 var _html = ('<table><tbody><tr id="{0}" class="{1}">'+
41 41 '<td class="add-comment-line tooltip tooltip" title="Add Comment"><span class="add-comment-content"></span></td>'+
42 42 '<td></td>'+
43 43 '<td></td>'+
44 44 '<td></td>'+
45 45 '<td>{2}</td>'+
46 46 '</tr></tbody></table>').format(id, cls, body);
47 47 $(_el).html(_html);
48 48 return _el.children[0].children[0].children[0];
49 49 };
50 50
51 51 function bindDeleteCommentButtons() {
52 52 $('.delete-comment').one('click', function() {
53 53 var comment_id = $(this).data("comment-id");
54 54
55 55 if (comment_id){
56 56 deleteComment(comment_id);
57 57 }
58 58 });
59 59 }
60 60
61 61 var deleteComment = function(comment_id) {
62 62 var url = AJAX_COMMENT_DELETE_URL.replace('__COMMENT_ID__', comment_id);
63 63 var postData = {
64 64 '_method': 'delete',
65 65 'csrf_token': CSRF_TOKEN
66 66 };
67 67
68 68 var success = function(o) {
69 69 window.location.reload();
70 70 };
71 71 ajaxPOST(url, postData, success);
72 72 };
73 73
74 74
75 75 var bindToggleButtons = function() {
76 76 $('.comment-toggle').on('click', function() {
77 77 $(this).parent().nextUntil('tr.line').toggle('inline-comments');
78 78 });
79 79 };
80 80
81 81 var linkifyComments = function(comments) {
82 82 /* TODO: dan: remove this - it should no longer needed */
83 83 for (var i = 0; i < comments.length; i++) {
84 84 var comment_id = $(comments[i]).data('comment-id');
85 85 var prev_comment_id = $(comments[i - 1]).data('comment-id');
86 86 var next_comment_id = $(comments[i + 1]).data('comment-id');
87 87
88 88 // place next/prev links
89 89 if (prev_comment_id) {
90 90 $('#prev_c_' + comment_id).show();
91 91 $('#prev_c_' + comment_id + " a.arrow_comment_link").attr(
92 92 'href', '#comment-' + prev_comment_id).removeClass('disabled');
93 93 }
94 94 if (next_comment_id) {
95 95 $('#next_c_' + comment_id).show();
96 96 $('#next_c_' + comment_id + " a.arrow_comment_link").attr(
97 97 'href', '#comment-' + next_comment_id).removeClass('disabled');
98 98 }
99 99 // place a first link to the total counter
100 100 if (i === 0) {
101 101 $('#inline-comments-counter').attr('href', '#comment-' + comment_id);
102 102 }
103 103 }
104 104
105 105 };
106 106
107 107
108 108 /* Comment form for main and inline comments */
109 109 var CommentForm = (function() {
110 110 "use strict";
111 111
112 112 function CommentForm(formElement, commitId, pullRequestId, lineNo, initAutocompleteActions) {
113 113
114 114 this.withLineNo = function(selector) {
115 115 var lineNo = this.lineNo;
116 116 if (lineNo === undefined) {
117 117 return selector
118 118 } else {
119 119 return selector + '_' + lineNo;
120 120 }
121 121 };
122 122
123 123 this.commitId = commitId;
124 124 this.pullRequestId = pullRequestId;
125 125 this.lineNo = lineNo;
126 126 this.initAutocompleteActions = initAutocompleteActions;
127 127
128 128 this.previewButton = this.withLineNo('#preview-btn');
129 129 this.previewContainer = this.withLineNo('#preview-container');
130 130
131 131 this.previewBoxSelector = this.withLineNo('#preview-box');
132 132
133 133 this.editButton = this.withLineNo('#edit-btn');
134 134 this.editContainer = this.withLineNo('#edit-container');
135 135
136 136 this.cancelButton = this.withLineNo('#cancel-btn');
137 137
138 138 this.statusChange = '#change_status';
139 139 this.cmBox = this.withLineNo('#text');
140 140 this.cm = initCommentBoxCodeMirror(this.cmBox, this.initAutocompleteActions);
141 141
142 142 this.submitForm = formElement;
143 143 this.submitButton = $(this.submitForm).find('input[type="submit"]');
144 144 this.submitButtonText = this.submitButton.val();
145 145
146 146 this.previewUrl = pyroutes.url('changeset_comment_preview',
147 147 {'repo_name': templateContext.repo_name});
148 148
149 149 // based on commitId, or pullReuqestId decide where do we submit
150 150 // out data
151 151 if (this.commitId){
152 152 this.submitUrl = pyroutes.url('changeset_comment',
153 153 {'repo_name': templateContext.repo_name,
154 154 'revision': this.commitId});
155 155
156 156 } else if (this.pullRequestId) {
157 157 this.submitUrl = pyroutes.url('pullrequest_comment',
158 158 {'repo_name': templateContext.repo_name,
159 159 'pull_request_id': this.pullRequestId});
160 160
161 161 } else {
162 162 throw new Error(
163 163 'CommentForm requires pullRequestId, or commitId to be specified.')
164 164 }
165 165
166 166 this.getCmInstance = function(){
167 167 return this.cm
168 168 };
169 169
170 170 var self = this;
171 171
172 172 this.getCommentStatus = function() {
173 173 return $(this.submitForm).find(this.statusChange).val();
174 174 };
175 175
176 176 this.isAllowedToSubmit = function() {
177 177 return !$(this.submitButton).prop('disabled');
178 178 };
179 179
180 180 this.initStatusChangeSelector = function(){
181 181 var formatChangeStatus = function(state, escapeMarkup) {
182 182 var originalOption = state.element;
183 183 return '<div class="flag_status ' + $(originalOption).data('status') + ' pull-left"></div>' +
184 184 '<span>' + escapeMarkup(state.text) + '</span>';
185 185 };
186 186 var formatResult = function(result, container, query, escapeMarkup) {
187 187 return formatChangeStatus(result, escapeMarkup);
188 188 };
189 189
190 190 var formatSelection = function(data, container, escapeMarkup) {
191 191 return formatChangeStatus(data, escapeMarkup);
192 192 };
193 193
194 194 $(this.submitForm).find(this.statusChange).select2({
195 195 placeholder: _gettext('Status Review'),
196 196 formatResult: formatResult,
197 197 formatSelection: formatSelection,
198 198 containerCssClass: "drop-menu status_box_menu",
199 199 dropdownCssClass: "drop-menu-dropdown",
200 200 dropdownAutoWidth: true,
201 201 minimumResultsForSearch: -1
202 202 });
203 203 $(this.submitForm).find(this.statusChange).on('change', function() {
204 204 var status = self.getCommentStatus();
205 205 if (status && !self.lineNo) {
206 206 $(self.submitButton).prop('disabled', false);
207 207 }
208 208 //todo, fix this name
209 209 var placeholderText = _gettext('Comment text will be set automatically based on currently selected status ({0}) ...').format(status);
210 210 self.cm.setOption('placeholder', placeholderText);
211 211 })
212 212 };
213 213
214 214 // reset the comment form into it's original state
215 215 this.resetCommentFormState = function(content) {
216 216 content = content || '';
217 217
218 218 $(this.editContainer).show();
219 219 $(this.editButton).hide();
220 220
221 221 $(this.previewContainer).hide();
222 222 $(this.previewButton).show();
223 223
224 224 this.setActionButtonsDisabled(true);
225 225 self.cm.setValue(content);
226 226 self.cm.setOption("readOnly", false);
227 227 };
228 228
229 229 this.submitAjaxPOST = function(url, postData, successHandler, failHandler) {
230 230 failHandler = failHandler || function() {};
231 231 var postData = toQueryString(postData);
232 232 var request = $.ajax({
233 233 url: url,
234 234 type: 'POST',
235 235 data: postData,
236 236 headers: {'X-PARTIAL-XHR': true}
237 237 })
238 238 .done(function(data) {
239 239 successHandler(data);
240 240 })
241 241 .fail(function(data, textStatus, errorThrown){
242 242 alert(
243 243 "Error while submitting comment.\n" +
244 244 "Error code {0} ({1}).".format(data.status, data.statusText));
245 245 failHandler()
246 246 });
247 247 return request;
248 248 };
249 249
250 250 // overwrite a submitHandler, we need to do it for inline comments
251 251 this.setHandleFormSubmit = function(callback) {
252 252 this.handleFormSubmit = callback;
253 253 };
254 254
255 255 // default handler for for submit for main comments
256 256 this.handleFormSubmit = function() {
257 257 var text = self.cm.getValue();
258 258 var status = self.getCommentStatus();
259 259
260 260 if (text === "" && !status) {
261 261 return;
262 262 }
263 263
264 264 var excludeCancelBtn = false;
265 265 var submitEvent = true;
266 266 self.setActionButtonsDisabled(true, excludeCancelBtn, submitEvent);
267 267 self.cm.setOption("readOnly", true);
268 268 var postData = {
269 269 'text': text,
270 270 'changeset_status': status,
271 271 'csrf_token': CSRF_TOKEN
272 272 };
273 273
274 274 var submitSuccessCallback = function(o) {
275 275 if (status) {
276 276 location.reload(true);
277 277 } else {
278 278 $('#injected_page_comments').append(o.rendered_text);
279 279 self.resetCommentFormState();
280 280 bindDeleteCommentButtons();
281 281 timeagoActivate();
282 282 }
283 283 };
284 284 var submitFailCallback = function(){
285 285 self.resetCommentFormState(text)
286 286 };
287 287 self.submitAjaxPOST(
288 288 self.submitUrl, postData, submitSuccessCallback, submitFailCallback);
289 289 };
290 290
291 291 this.previewSuccessCallback = function(o) {
292 292 $(self.previewBoxSelector).html(o);
293 293 $(self.previewBoxSelector).removeClass('unloaded');
294 294
295 295 // swap buttons
296 296 $(self.previewButton).hide();
297 297 $(self.editButton).show();
298 298
299 299 // unlock buttons
300 300 self.setActionButtonsDisabled(false);
301 301 };
302 302
303 303 this.setActionButtonsDisabled = function(state, excludeCancelBtn, submitEvent) {
304 304 excludeCancelBtn = excludeCancelBtn || false;
305 305 submitEvent = submitEvent || false;
306 306
307 307 $(this.editButton).prop('disabled', state);
308 308 $(this.previewButton).prop('disabled', state);
309 309
310 310 if (!excludeCancelBtn) {
311 311 $(this.cancelButton).prop('disabled', state);
312 312 }
313 313
314 314 var submitState = state;
315 315 if (!submitEvent && this.getCommentStatus() && !this.lineNo) {
316 316 // if the value of commit review status is set, we allow
317 317 // submit button, but only on Main form, lineNo means inline
318 318 submitState = false
319 319 }
320 320 $(this.submitButton).prop('disabled', submitState);
321 321 if (submitEvent) {
322 322 $(this.submitButton).val(_gettext('Submitting...'));
323 323 } else {
324 324 $(this.submitButton).val(this.submitButtonText);
325 325 }
326 326
327 327 };
328 328
329 329 // lock preview/edit/submit buttons on load, but exclude cancel button
330 330 var excludeCancelBtn = true;
331 331 this.setActionButtonsDisabled(true, excludeCancelBtn);
332 332
333 333 // anonymous users don't have access to initialized CM instance
334 334 if (this.cm !== undefined){
335 335 this.cm.on('change', function(cMirror) {
336 336 if (cMirror.getValue() === "") {
337 337 self.setActionButtonsDisabled(true, excludeCancelBtn)
338 338 } else {
339 339 self.setActionButtonsDisabled(false, excludeCancelBtn)
340 340 }
341 341 });
342 342 }
343 343
344 344 $(this.editButton).on('click', function(e) {
345 345 e.preventDefault();
346 346
347 347 $(self.previewButton).show();
348 348 $(self.previewContainer).hide();
349 349 $(self.editButton).hide();
350 350 $(self.editContainer).show();
351 351
352 352 });
353 353
354 354 $(this.previewButton).on('click', function(e) {
355 355 e.preventDefault();
356 356 var text = self.cm.getValue();
357 357
358 358 if (text === "") {
359 359 return;
360 360 }
361 361
362 362 var postData = {
363 363 'text': text,
364 364 'renderer': DEFAULT_RENDERER,
365 365 'csrf_token': CSRF_TOKEN
366 366 };
367 367
368 368 // lock ALL buttons on preview
369 369 self.setActionButtonsDisabled(true);
370 370
371 371 $(self.previewBoxSelector).addClass('unloaded');
372 372 $(self.previewBoxSelector).html(_gettext('Loading ...'));
373 373 $(self.editContainer).hide();
374 374 $(self.previewContainer).show();
375 375
376 376 // by default we reset state of comment preserving the text
377 377 var previewFailCallback = function(){
378 378 self.resetCommentFormState(text)
379 379 };
380 380 self.submitAjaxPOST(
381 381 self.previewUrl, postData, self.previewSuccessCallback, previewFailCallback);
382 382
383 383 });
384 384
385 385 $(this.submitForm).submit(function(e) {
386 386 e.preventDefault();
387 387 var allowedToSubmit = self.isAllowedToSubmit();
388 388 if (!allowedToSubmit){
389 389 return false;
390 390 }
391 391 self.handleFormSubmit();
392 392 });
393 393
394 394 }
395 395
396 396 return CommentForm;
397 397 })();
398 398
399 399 var CommentsController = function() { /* comments controller */
400 400 var self = this;
401 401
402 402 this.cancelComment = function(node) {
403 403 var $node = $(node);
404 404 var $td = $node.closest('td');
405 405 $node.closest('.comment-inline-form').removeClass('comment-inline-form-open');
406 406 return false;
407 407 };
408 408
409 409 this.getLineNumber = function(node) {
410 410 var $node = $(node);
411 411 return $node.closest('td').attr('data-line-number');
412 412 };
413 413
414 414 this.scrollToComment = function(node, offset) {
415 415 if (!node) {
416 416 node = $('.comment-selected');
417 417 if (!node.length) {
418 418 node = $('comment-current')
419 419 }
420 420 }
421 421 $comment = $(node).closest('.comment-current');
422 422 $comments = $('.comment-current');
423 423
424 424 $('.comment-selected').removeClass('comment-selected');
425 425
426 426 var nextIdx = $('.comment-current').index($comment) + offset;
427 427 if (nextIdx >= $comments.length) {
428 428 nextIdx = 0;
429 429 }
430 430 var $next = $('.comment-current').eq(nextIdx);
431 431 var $cb = $next.closest('.cb');
432 432 $cb.removeClass('cb-collapsed');
433 433
434 434 var $filediffCollapseState = $cb.closest('.filediff').prev();
435 435 $filediffCollapseState.prop('checked', false);
436 436 $next.addClass('comment-selected');
437 437 scrollToElement($next);
438 438 return false;
439 439 };
440 440
441 441 this.nextComment = function(node) {
442 442 return self.scrollToComment(node, 1);
443 443 };
444 444
445 445 this.prevComment = function(node) {
446 446 return self.scrollToComment(node, -1);
447 447 };
448 448
449 449 this.deleteComment = function(node) {
450 450 if (!confirm(_gettext('Delete this comment?'))) {
451 451 return false;
452 452 }
453 453 var $node = $(node);
454 454 var $td = $node.closest('td');
455 455 var $comment = $node.closest('.comment');
456 456 var comment_id = $comment.attr('data-comment-id');
457 457 var url = AJAX_COMMENT_DELETE_URL.replace('__COMMENT_ID__', comment_id);
458 458 var postData = {
459 459 '_method': 'delete',
460 460 'csrf_token': CSRF_TOKEN
461 461 };
462 462
463 463 $comment.addClass('comment-deleting');
464 464 $comment.hide('fast');
465 465
466 466 var success = function(response) {
467 467 $comment.remove();
468 468 return false;
469 469 };
470 470 var failure = function(data, textStatus, xhr) {
471 471 alert("error processing request: " + textStatus);
472 472 $comment.show('fast');
473 473 $comment.removeClass('comment-deleting');
474 474 return false;
475 475 };
476 476 ajaxPOST(url, postData, success, failure);
477 477 };
478 478
479 this.toggleWideMode = function (node) {
480 if ($('#content').hasClass('wrapper')) {
481 $('#content').removeClass("wrapper");
482 $('#content').addClass("wide-mode-wrapper");
483 $(node).addClass('btn-success');
484 } else {
485 $('#content').removeClass("wide-mode-wrapper");
486 $('#content').addClass("wrapper");
487 $(node).removeClass('btn-success');
488 }
489 return false;
490 };
491
479 492 this.toggleComments = function(node, show) {
480 493 var $filediff = $(node).closest('.filediff');
481 494 if (show === true) {
482 495 $filediff.removeClass('hide-comments');
483 496 } else if (show === false) {
484 497 $filediff.find('.hide-line-comments').removeClass('hide-line-comments');
485 498 $filediff.addClass('hide-comments');
486 499 } else {
487 500 $filediff.find('.hide-line-comments').removeClass('hide-line-comments');
488 501 $filediff.toggleClass('hide-comments');
489 502 }
490 503 return false;
491 504 };
492 505
493 506 this.toggleLineComments = function(node) {
494 507 self.toggleComments(node, true);
495 508 var $node = $(node);
496 509 $node.closest('tr').toggleClass('hide-line-comments');
497 510 };
498 511
499 512 this.createComment = function(node) {
500 513 var $node = $(node);
501 514 var $td = $node.closest('td');
502 515 var $form = $td.find('.comment-inline-form');
503 516
504 517 if (!$form.length) {
505 518 var tmpl = $('#cb-comment-inline-form-template').html();
506 519 var $filediff = $node.closest('.filediff');
507 520 $filediff.removeClass('hide-comments');
508 521 var f_path = $filediff.attr('data-f-path');
509 522 var lineno = self.getLineNumber(node);
510 523 tmpl = tmpl.format(f_path, lineno);
511 524 $form = $(tmpl);
512 525
513 526 var $comments = $td.find('.inline-comments');
514 527 if (!$comments.length) {
515 528 $comments = $(
516 529 $('#cb-comments-inline-container-template').html());
517 530 $td.append($comments);
518 531 }
519 532
520 533 $td.find('.cb-comment-add-button').before($form);
521 534
522 535 var pullRequestId = templateContext.pull_request_data.pull_request_id;
523 536 var commitId = templateContext.commit_data.commit_id;
524 537 var _form = $form[0];
525 538 var commentForm = new CommentForm(_form, commitId, pullRequestId, lineno, false);
526 539 var cm = commentForm.getCmInstance();
527 540
528 541 // set a CUSTOM submit handler for inline comments.
529 542 commentForm.setHandleFormSubmit(function(o) {
530 543 var text = commentForm.cm.getValue();
531 544
532 545 if (text === "") {
533 546 return;
534 547 }
535 548
536 549 if (lineno === undefined) {
537 550 alert('missing line !');
538 551 return;
539 552 }
540 553 if (f_path === undefined) {
541 554 alert('missing file path !');
542 555 return;
543 556 }
544 557
545 558 var excludeCancelBtn = false;
546 559 var submitEvent = true;
547 560 commentForm.setActionButtonsDisabled(true, excludeCancelBtn, submitEvent);
548 561 commentForm.cm.setOption("readOnly", true);
549 562 var postData = {
550 563 'text': text,
551 564 'f_path': f_path,
552 565 'line': lineno,
553 566 'csrf_token': CSRF_TOKEN
554 567 };
555 568 var submitSuccessCallback = function(json_data) {
556 569 $form.remove();
557 570 try {
558 571 var html = json_data.rendered_text;
559 572 var lineno = json_data.line_no;
560 573 var target_id = json_data.target_id;
561 574
562 575 $comments.find('.cb-comment-add-button').before(html);
563 576
564 577 } catch (e) {
565 578 console.error(e);
566 579 }
567 580
568 581 // re trigger the linkification of next/prev navigation
569 582 linkifyComments($('.inline-comment-injected'));
570 583 timeagoActivate();
571 584 bindDeleteCommentButtons();
572 585 commentForm.setActionButtonsDisabled(false);
573 586
574 587 };
575 588 var submitFailCallback = function(){
576 589 commentForm.resetCommentFormState(text)
577 590 };
578 591 commentForm.submitAjaxPOST(
579 592 commentForm.submitUrl, postData, submitSuccessCallback, submitFailCallback);
580 593 });
581 594
582 595 setTimeout(function() {
583 596 // callbacks
584 597 if (cm !== undefined) {
585 598 cm.focus();
586 599 }
587 600 }, 10);
588 601
589 602 $.Topic('/ui/plugins/code/comment_form_built').prepareOrPublish({
590 603 form: _form,
591 604 parent: $td[0],
592 605 lineno: lineno,
593 606 f_path: f_path}
594 607 );
595 608 }
596 609
597 610 $form.addClass('comment-inline-form-open');
598 611 };
599 612
600 613 this.renderInlineComments = function(file_comments) {
601 614 show_add_button = typeof show_add_button !== 'undefined' ? show_add_button : true;
602 615
603 616 for (var i = 0; i < file_comments.length; i++) {
604 617 var box = file_comments[i];
605 618
606 619 var target_id = $(box).attr('target_id');
607 620
608 621 // actually comments with line numbers
609 622 var comments = box.children;
610 623
611 624 for (var j = 0; j < comments.length; j++) {
612 625 var data = {
613 626 'rendered_text': comments[j].outerHTML,
614 627 'line_no': $(comments[j]).attr('line'),
615 628 'target_id': target_id
616 629 };
617 630 }
618 631 }
619 632
620 633 // since order of injection is random, we're now re-iterating
621 634 // from correct order and filling in links
622 635 linkifyComments($('.inline-comment-injected'));
623 636 bindDeleteCommentButtons();
624 637 firefoxAnchorFix();
625 638 };
626 639
627 640 }; No newline at end of file
@@ -1,572 +1,577 b''
1 1 <%def name="diff_line_anchor(filename, line, type)"><%
2 2 return '%s_%s_%i' % (h.safeid(filename), type, line)
3 3 %></%def>
4 4
5 5 <%def name="action_class(action)"><%
6 6 return {
7 7 '-': 'cb-deletion',
8 8 '+': 'cb-addition',
9 9 ' ': 'cb-context',
10 10 }.get(action, 'cb-empty')
11 11 %></%def>
12 12
13 13 <%def name="op_class(op_id)"><%
14 14 return {
15 15 DEL_FILENODE: 'deletion', # file deleted
16 16 BIN_FILENODE: 'warning' # binary diff hidden
17 17 }.get(op_id, 'addition')
18 18 %></%def>
19 19
20 20 <%def name="link_for(**kw)"><%
21 21 new_args = request.GET.mixed()
22 22 new_args.update(kw)
23 23 return h.url('', **new_args)
24 24 %></%def>
25 25
26 26 <%def name="render_diffset(diffset, commit=None,
27 27
28 28 # collapse all file diff entries when there are more than this amount of files in the diff
29 29 collapse_when_files_over=20,
30 30
31 31 # collapse lines in the diff when more than this amount of lines changed in the file diff
32 32 lines_changed_limit=500,
33 33
34 34 # add a ruler at to the output
35 35 ruler_at_chars=0,
36 36
37 37 # show inline comments
38 38 use_comments=False,
39 39
40 40 # disable new comments
41 41 disable_new_comments=False,
42 42
43 43 )">
44 44
45 45 %if use_comments:
46 46 <div id="cb-comments-inline-container-template" class="js-template">
47 47 ${inline_comments_container([])}
48 48 </div>
49 49 <div class="js-template" id="cb-comment-inline-form-template">
50 50 <div class="comment-inline-form ac">
51 51 %if c.rhodecode_user.username != h.DEFAULT_USER:
52 52 ${h.form('#', method='get')}
53 53 <div id="edit-container_{1}" class="clearfix">
54 54 <div class="comment-title pull-left">
55 55 ${_('Create a comment on line {1}.')}
56 56 </div>
57 57 <div class="comment-help pull-right">
58 58 ${(_('Comments parsed using %s syntax with %s support.') % (
59 59 ('<a href="%s">%s</a>' % (h.url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())),
60 60 ('<span class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user'))
61 61 )
62 62 )|n
63 63 }
64 64 </div>
65 65 <div style="clear: both"></div>
66 66 <textarea id="text_{1}" name="text" class="comment-block-ta ac-input"></textarea>
67 67 </div>
68 68 <div id="preview-container_{1}" class="clearfix" style="display: none;">
69 69 <div class="comment-help">
70 70 ${_('Comment preview')}
71 71 </div>
72 72 <div id="preview-box_{1}" class="preview-box"></div>
73 73 </div>
74 74 <div class="comment-footer">
75 75 <div class="action-buttons">
76 76 <input type="hidden" name="f_path" value="{0}">
77 77 <input type="hidden" name="line" value="{1}">
78 78 <button id="preview-btn_{1}" class="btn btn-secondary">${_('Preview')}</button>
79 79 <button id="edit-btn_{1}" class="btn btn-secondary" style="display: none;">${_('Edit')}</button>
80 80 ${h.submit('save', _('Comment'), class_='btn btn-success save-inline-form')}
81 81 </div>
82 82 <div class="comment-button">
83 83 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
84 84 ${_('Cancel')}
85 85 </button>
86 86 </div>
87 87 ${h.end_form()}
88 88 </div>
89 89 %else:
90 90 ${h.form('', class_='inline-form comment-form-login', method='get')}
91 91 <div class="pull-left">
92 92 <div class="comment-help pull-right">
93 93 ${_('You need to be logged in to comment.')} <a href="${h.route_path('login', _query={'came_from': h.url.current()})}">${_('Login now')}</a>
94 94 </div>
95 95 </div>
96 96 <div class="comment-button pull-right">
97 97 <button type="button" class="cb-comment-cancel" onclick="return Rhodecode.comments.cancelComment(this);">
98 98 ${_('Cancel')}
99 99 </button>
100 100 </div>
101 101 <div class="clearfix"></div>
102 102 ${h.end_form()}
103 103 %endif
104 104 </div>
105 105 </div>
106 106
107 107 %endif
108 108 <%
109 109 collapse_all = len(diffset.files) > collapse_when_files_over
110 110 %>
111 111
112 112 %if c.diffmode == 'sideside':
113 113 <style>
114 114 .wrapper {
115 115 max-width: 1600px !important;
116 116 }
117 117 </style>
118 118 %endif
119 119 %if ruler_at_chars:
120 120 <style>
121 121 .diff table.cb .cb-content:after {
122 122 content: "";
123 123 border-left: 1px solid blue;
124 124 position: absolute;
125 125 top: 0;
126 126 height: 18px;
127 127 opacity: .2;
128 128 z-index: 10;
129 129 ## +5 to account for diff action (+/-)
130 130 left: ${ruler_at_chars + 5}ch;
131 131 </style>
132 132 %endif
133 133 <div class="diffset ${disable_new_comments and 'diffset-comments-disabled'}">
134 134 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
135 135 %if commit:
136 136 <div class="pull-right">
137 137 <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}">
138 138 ${_('Browse Files')}
139 139 </a>
140 140 </div>
141 141 %endif
142 142 <h2 class="clearinner">
143 143 %if commit:
144 144 <a class="tooltip revision" title="${h.tooltip(commit.message)}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))}</a> -
145 145 ${h.age_component(commit.date)} -
146 146 %endif
147 147 %if diffset.limited_diff:
148 148 ${_('The requested commit is too big and content was truncated.')}
149 149
150 150 ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}}
151 151 <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
152 152 %else:
153 153 ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted',
154 154 '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}}
155 155 %endif
156 156 </h2>
157 157 </div>
158 158
159 159 %if not diffset.files:
160 160 <p class="empty_data">${_('No files')}</p>
161 161 %endif
162 162
163 163 <div class="filediffs">
164 164 %for i, filediff in enumerate(diffset.files):
165 165 <%
166 166 lines_changed = filediff['patch']['stats']['added'] + filediff['patch']['stats']['deleted']
167 167 over_lines_changed_limit = lines_changed > lines_changed_limit
168 168 %>
169 169 <input ${collapse_all and 'checked' or ''} class="filediff-collapse-state" id="filediff-collapse-${id(filediff)}" type="checkbox">
170 170 <div
171 171 class="filediff"
172 172 data-f-path="${filediff['patch']['filename']}"
173 173 id="a_${h.FID('', filediff['patch']['filename'])}">
174 174 <label for="filediff-collapse-${id(filediff)}" class="filediff-heading">
175 175 <div class="filediff-collapse-indicator"></div>
176 176 ${diff_ops(filediff)}
177 177 </label>
178 178 ${diff_menu(filediff, use_comments=use_comments)}
179 179 <table class="cb cb-diff-${c.diffmode} code-highlight ${over_lines_changed_limit and 'cb-collapsed' or ''}">
180 180 %if not filediff.hunks:
181 181 %for op_id, op_text in filediff['patch']['stats']['ops'].items():
182 182 <tr>
183 183 <td class="cb-text cb-${op_class(op_id)}" ${c.diffmode == 'unified' and 'colspan=3' or 'colspan=4'}>
184 184 %if op_id == DEL_FILENODE:
185 185 ${_('File was deleted')}
186 186 %elif op_id == BIN_FILENODE:
187 187 ${_('Binary file hidden')}
188 188 %else:
189 189 ${op_text}
190 190 %endif
191 191 </td>
192 192 </tr>
193 193 %endfor
194 194 %endif
195 195 %if over_lines_changed_limit:
196 196 <tr class="cb-warning cb-collapser">
197 197 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
198 198 ${_('This diff has been collapsed as it changes many lines, (%i lines changed)' % lines_changed)}
199 199 <a href="#" class="cb-expand"
200 200 onclick="$(this).closest('table').removeClass('cb-collapsed'); return false;">${_('Show them')}
201 201 </a>
202 202 <a href="#" class="cb-collapse"
203 203 onclick="$(this).closest('table').addClass('cb-collapsed'); return false;">${_('Hide them')}
204 204 </a>
205 205 </td>
206 206 </tr>
207 207 %endif
208 208 %if filediff.patch['is_limited_diff']:
209 209 <tr class="cb-warning cb-collapser">
210 210 <td class="cb-text" ${c.diffmode == 'unified' and 'colspan=4' or 'colspan=6'}>
211 211 ${_('The requested commit is too big and content was truncated.')} <a href="${link_for(fulldiff=1)}" onclick="return confirm('${_("Showing a big diff might take some time and resources, continue?")}')">${_('Show full diff')}</a>
212 212 </td>
213 213 </tr>
214 214 %endif
215 215 %for hunk in filediff.hunks:
216 216 <tr class="cb-hunk">
217 217 <td ${c.diffmode == 'unified' and 'colspan=3' or ''}>
218 218 ## TODO: dan: add ajax loading of more context here
219 219 ## <a href="#">
220 220 <i class="icon-more"></i>
221 221 ## </a>
222 222 </td>
223 223 <td ${c.diffmode == 'sideside' and 'colspan=5' or ''}>
224 224 @@
225 225 -${hunk.source_start},${hunk.source_length}
226 226 +${hunk.target_start},${hunk.target_length}
227 227 ${hunk.section_header}
228 228 </td>
229 229 </tr>
230 230 %if c.diffmode == 'unified':
231 231 ${render_hunk_lines_unified(hunk, use_comments=use_comments)}
232 232 %elif c.diffmode == 'sideside':
233 233 ${render_hunk_lines_sideside(hunk, use_comments=use_comments)}
234 234 %else:
235 235 <tr class="cb-line">
236 236 <td>unknown diff mode</td>
237 237 </tr>
238 238 %endif
239 239 %endfor
240 240 </table>
241 241 </div>
242 242 %endfor
243 243 </div>
244 244 </div>
245 245 </%def>
246 246
247 247 <%def name="diff_ops(filediff)">
248 248 <%
249 249 stats = filediff['patch']['stats']
250 250 from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
251 251 MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE
252 252 %>
253 253 <span class="pill">
254 254 %if filediff.source_file_path and filediff.target_file_path:
255 255 %if filediff.source_file_path != filediff.target_file_path: # file was renamed
256 256 <strong>${filediff.target_file_path}</strong> β¬… <del>${filediff.source_file_path}</del>
257 257 %else:
258 258 ## file was modified
259 259 <strong>${filediff.source_file_path}</strong>
260 260 %endif
261 261 %else:
262 262 %if filediff.source_file_path:
263 263 ## file was deleted
264 264 <strong>${filediff.source_file_path}</strong>
265 265 %else:
266 266 ## file was added
267 267 <strong>${filediff.target_file_path}</strong>
268 268 %endif
269 269 %endif
270 270 </span>
271 271 <span class="pill-group" style="float: left">
272 272 %if filediff.patch['is_limited_diff']:
273 273 <span class="pill tooltip" op="limited" title="The stats for this diff are not complete">limited diff</span>
274 274 %endif
275 275 %if RENAMED_FILENODE in stats['ops']:
276 276 <span class="pill" op="renamed">renamed</span>
277 277 %endif
278 278
279 279 %if NEW_FILENODE in stats['ops']:
280 280 <span class="pill" op="created">created</span>
281 281 %if filediff['target_mode'].startswith('120'):
282 282 <span class="pill" op="symlink">symlink</span>
283 283 %else:
284 284 <span class="pill" op="mode">${nice_mode(filediff['target_mode'])}</span>
285 285 %endif
286 286 %endif
287 287
288 288 %if DEL_FILENODE in stats['ops']:
289 289 <span class="pill" op="removed">removed</span>
290 290 %endif
291 291
292 292 %if CHMOD_FILENODE in stats['ops']:
293 293 <span class="pill" op="mode">
294 294 ${nice_mode(filediff['source_mode'])} ➑ ${nice_mode(filediff['target_mode'])}
295 295 </span>
296 296 %endif
297 297 </span>
298 298
299 299 <a class="pill filediff-anchor" href="#a_${h.FID('', filediff.patch['filename'])}">ΒΆ</a>
300 300
301 301 <span class="pill-group" style="float: right">
302 302 %if BIN_FILENODE in stats['ops']:
303 303 <span class="pill" op="binary">binary</span>
304 304 %if MOD_FILENODE in stats['ops']:
305 305 <span class="pill" op="modified">modified</span>
306 306 %endif
307 307 %endif
308 308 %if stats['added']:
309 309 <span class="pill" op="added">+${stats['added']}</span>
310 310 %endif
311 311 %if stats['deleted']:
312 312 <span class="pill" op="deleted">-${stats['deleted']}</span>
313 313 %endif
314 314 </span>
315 315
316 316 </%def>
317 317
318 318 <%def name="nice_mode(filemode)">
319 319 ${filemode.startswith('100') and filemode[3:] or filemode}
320 320 </%def>
321 321
322 322 <%def name="diff_menu(filediff, use_comments=False)">
323 323 <div class="filediff-menu">
324 324 %if filediff.diffset.source_ref:
325 325 %if filediff.patch['operation'] in ['D', 'M']:
326 326 <a
327 327 class="tooltip"
328 328 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
329 329 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
330 330 >
331 331 ${_('Show file before')}
332 332 </a>
333 333 %else:
334 334 <span
335 335 class="tooltip"
336 336 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
337 337 >
338 338 ${_('Show file before')}
339 339 </span>
340 340 %endif
341 341 %if filediff.patch['operation'] in ['A', 'M']:
342 342 <a
343 343 class="tooltip"
344 344 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
345 345 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
346 346 >
347 347 ${_('Show file after')}
348 348 </a>
349 349 %else:
350 350 <span
351 351 class="tooltip"
352 352 title="${h.tooltip(_('File no longer present at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
353 353 >
354 354 ${_('Show file after')}
355 355 </span>
356 356 %endif
357 357 <a
358 358 class="tooltip"
359 359 title="${h.tooltip(_('Raw diff'))}"
360 360 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
361 361 >
362 362 ${_('Raw diff')}
363 363 </a>
364 364 <a
365 365 class="tooltip"
366 366 title="${h.tooltip(_('Download diff'))}"
367 367 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
368 368 >
369 369 ${_('Download diff')}
370 370 </a>
371 371
372 372 ## TODO: dan: refactor ignorews_url and context_url into the diff renderer same as diffmode=unified/sideside. Also use ajax to load more context (by clicking hunks)
373 373 %if hasattr(c, 'ignorews_url'):
374 374 ${c.ignorews_url(request.GET, h.FID('', filediff['patch']['filename']))}
375 375 %endif
376 376 %if hasattr(c, 'context_url'):
377 377 ${c.context_url(request.GET, h.FID('', filediff['patch']['filename']))}
378 378 %endif
379 379
380 380
381 381 %if use_comments:
382 382 <a href="#" onclick="return Rhodecode.comments.toggleComments(this);">
383 383 <span class="show-comment-button">${_('Show comments')}</span><span class="hide-comment-button">${_('Hide comments')}</span>
384 384 </a>
385 385 %endif
386 386 %endif
387 387 </div>
388 388 </%def>
389 389
390 390
391 391 <%namespace name="commentblock" file="/changeset/changeset_file_comment.html"/>
392 392 <%def name="inline_comments_container(comments)">
393 393 <div class="inline-comments">
394 394 %for comment in comments:
395 395 ${commentblock.comment_block(comment, inline=True)}
396 396 %endfor
397 397
398 398 <span onclick="return Rhodecode.comments.createComment(this)"
399 399 class="btn btn-secondary cb-comment-add-button ${'comment-outdated' if comments and comments[-1].outdated else ''}"
400 400 style="${'display: none;' if comments and comments[-1].outdated else ''}">
401 401 ${_('Add another comment')}
402 402 </span>
403 403
404 404 </div>
405 405 </%def>
406 406
407 407
408 408 <%def name="render_hunk_lines_sideside(hunk, use_comments=False)">
409 409 %for i, line in enumerate(hunk.sideside):
410 410 <%
411 411 old_line_anchor, new_line_anchor = None, None
412 412 if line.original.lineno:
413 413 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, line.original.lineno, 'o')
414 414 if line.modified.lineno:
415 415 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, line.modified.lineno, 'n')
416 416 %>
417 417 <tr class="cb-line">
418 418 <td class="cb-data ${action_class(line.original.action)}"
419 419 data-line-number="${line.original.lineno}"
420 420 >
421 421 <div>
422 422 %if line.original.comments:
423 423 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
424 424 %endif
425 425 </div>
426 426 </td>
427 427 <td class="cb-lineno ${action_class(line.original.action)}"
428 428 data-line-number="${line.original.lineno}"
429 429 %if old_line_anchor:
430 430 id="${old_line_anchor}"
431 431 %endif
432 432 >
433 433 %if line.original.lineno:
434 434 <a name="${old_line_anchor}" href="#${old_line_anchor}">${line.original.lineno}</a>
435 435 %endif
436 436 </td>
437 437 <td class="cb-content ${action_class(line.original.action)}"
438 438 data-line-number="o${line.original.lineno}"
439 439 >
440 440 %if use_comments and line.original.lineno:
441 441 ${render_add_comment_button()}
442 442 %endif
443 443 <span class="cb-code">${line.original.action} ${line.original.content or '' | n}</span>
444 444 %if use_comments and line.original.lineno and line.original.comments:
445 445 ${inline_comments_container(line.original.comments)}
446 446 %endif
447 447 </td>
448 448 <td class="cb-data ${action_class(line.modified.action)}"
449 449 data-line-number="${line.modified.lineno}"
450 450 >
451 451 <div>
452 452 %if line.modified.comments:
453 453 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
454 454 %endif
455 455 </div>
456 456 </td>
457 457 <td class="cb-lineno ${action_class(line.modified.action)}"
458 458 data-line-number="${line.modified.lineno}"
459 459 %if new_line_anchor:
460 460 id="${new_line_anchor}"
461 461 %endif
462 462 >
463 463 %if line.modified.lineno:
464 464 <a name="${new_line_anchor}" href="#${new_line_anchor}">${line.modified.lineno}</a>
465 465 %endif
466 466 </td>
467 467 <td class="cb-content ${action_class(line.modified.action)}"
468 468 data-line-number="n${line.modified.lineno}"
469 469 >
470 470 %if use_comments and line.modified.lineno:
471 471 ${render_add_comment_button()}
472 472 %endif
473 473 <span class="cb-code">${line.modified.action} ${line.modified.content or '' | n}</span>
474 474 %if use_comments and line.modified.lineno and line.modified.comments:
475 475 ${inline_comments_container(line.modified.comments)}
476 476 %endif
477 477 </td>
478 478 </tr>
479 479 %endfor
480 480 </%def>
481 481
482 482
483 483 <%def name="render_hunk_lines_unified(hunk, use_comments=False)">
484 484 %for old_line_no, new_line_no, action, content, comments in hunk.unified:
485 485 <%
486 486 old_line_anchor, new_line_anchor = None, None
487 487 if old_line_no:
488 488 old_line_anchor = diff_line_anchor(hunk.filediff.source_file_path, old_line_no, 'o')
489 489 if new_line_no:
490 490 new_line_anchor = diff_line_anchor(hunk.filediff.target_file_path, new_line_no, 'n')
491 491 %>
492 492 <tr class="cb-line">
493 493 <td class="cb-data ${action_class(action)}">
494 494 <div>
495 495 %if comments:
496 496 <i class="icon-comment" onclick="return Rhodecode.comments.toggleLineComments(this)"></i>
497 497 %endif
498 498 </div>
499 499 </td>
500 500 <td class="cb-lineno ${action_class(action)}"
501 501 data-line-number="${old_line_no}"
502 502 %if old_line_anchor:
503 503 id="${old_line_anchor}"
504 504 %endif
505 505 >
506 506 %if old_line_anchor:
507 507 <a name="${old_line_anchor}" href="#${old_line_anchor}">${old_line_no}</a>
508 508 %endif
509 509 </td>
510 510 <td class="cb-lineno ${action_class(action)}"
511 511 data-line-number="${new_line_no}"
512 512 %if new_line_anchor:
513 513 id="${new_line_anchor}"
514 514 %endif
515 515 >
516 516 %if new_line_anchor:
517 517 <a name="${new_line_anchor}" href="#${new_line_anchor}">${new_line_no}</a>
518 518 %endif
519 519 </td>
520 520 <td class="cb-content ${action_class(action)}"
521 521 data-line-number="${new_line_no and 'n' or 'o'}${new_line_no or old_line_no}"
522 522 >
523 523 %if use_comments:
524 524 ${render_add_comment_button()}
525 525 %endif
526 526 <span class="cb-code">${action} ${content or '' | n}</span>
527 527 %if use_comments and comments:
528 528 ${inline_comments_container(comments)}
529 529 %endif
530 530 </td>
531 531 </tr>
532 532 %endfor
533 533 </%def>
534 534
535 535 <%def name="render_add_comment_button()">
536 536 <button
537 537 class="btn btn-small btn-primary cb-comment-box-opener"
538 538 onclick="return Rhodecode.comments.createComment(this)"
539 539 ><span>+</span></button>
540 540 </%def>
541 541
542 542 <%def name="render_diffset_menu()">
543
543 544 <div class="diffset-menu clearinner">
544 545 <div class="pull-right">
545 546 <div class="btn-group">
546 547 <a
547 548 class="btn ${c.diffmode == 'sideside' and 'btn-primary'} tooltip"
548 549 title="${_('View side by side')}"
549 550 href="${h.url_replace(diffmode='sideside')}">
550 551 <span>${_('Side by Side')}</span>
551 552 </a>
552 553 <a
553 554 class="btn ${c.diffmode == 'unified' and 'btn-primary'} tooltip"
554 555 title="${_('View unified')}" href="${h.url_replace(diffmode='unified')}">
555 556 <span>${_('Unified')}</span>
556 557 </a>
557 558 </div>
558 559 </div>
559 560 <div class="pull-left">
560 561 <div class="btn-group">
561 562 <a
562 563 class="btn"
563 564 href="#"
564 565 onclick="$('input[class=filediff-collapse-state]').prop('checked', false); return false">${_('Expand All')}</a>
565 566 <a
566 567 class="btn"
567 568 href="#"
568 569 onclick="$('input[class=filediff-collapse-state]').prop('checked', true); return false">${_('Collapse All')}</a>
570 <a
571 class="btn"
572 href="#"
573 onclick="return Rhodecode.comments.toggleWideMode(this)">${_('Wide Mode')}</a>
569 574 </div>
570 575 </div>
571 576 </div>
572 577 </%def>
General Comments 0
You need to be logged in to leave comments. Login now