##// END OF EJS Templates
Slight changes to diff view and style....
Jean-Philippe Lang -
r1509:53b570398132
parent child
Show More
@@ -1,61 +1,64
1 1 <% Redmine::UnifiedDiff.new(diff, diff_type).each do |table_file| -%>
2 2 <div class="autoscroll">
3 3 <% if diff_type == 'sbs' -%>
4 4 <table class="filecontent CodeRay">
5 5 <thead>
6 6 <tr><th colspan="4" class="filename"><%= table_file.file_name %></th></tr>
7 7 </thead>
8 8 <tbody>
9 9 <% prev_line_left, prev_line_right = nil, nil -%>
10 10 <% table_file.keys.sort.each do |key| -%>
11 11 <% if prev_line_left && prev_line_right && (table_file[key].nb_line_left != prev_line_left+1) && (table_file[key].nb_line_right != prev_line_right+1) -%>
12 <tr class="spacing"><td colspan="4"></td></tr>
12 <tr class="spacing">
13 <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
13 14 <% end -%>
14 15 <tr>
15 16 <th class="line-num"><%= table_file[key].nb_line_left %></th>
16 17 <td class="line-code <%= table_file[key].type_diff_left %>">
17 18 <pre><%=to_utf8 table_file[key].line_left %></pre>
18 19 </td>
19 20 <th class="line-num"><%= table_file[key].nb_line_right %></th>
20 21 <td class="line-code <%= table_file[key].type_diff_right %>">
21 22 <pre><%=to_utf8 table_file[key].line_right %></pre>
22 23 </td>
23 24 </tr>
24 25 <% prev_line_left, prev_line_right = table_file[key].nb_line_left.to_i, table_file[key].nb_line_right.to_i -%>
25 26 <% end -%>
26 27 </tbody>
27 28 </table>
28 29
29 30 <% else -%>
30 31 <table class="filecontent CodeRay">
31 32 <thead>
32 33 <tr><th colspan="3" class="filename"><%= table_file.file_name %></th></tr>
33 34 </thead>
34 35 <tbody>
35 36 <% prev_line_left, prev_line_right = nil, nil -%>
36 37 <% table_file.keys.sort.each do |key, line| %>
37 38 <% if prev_line_left && prev_line_right && (table_file[key].nb_line_left != prev_line_left+1) && (table_file[key].nb_line_right != prev_line_right+1) -%>
38 <tr class="spacing"><td colspan="3"></td></tr>
39 <tr class="spacing">
40 <th class="line-num">...</th><th class="line-num">...</th><td></td>
41 </tr>
39 42 <% end -%>
40 43 <tr>
41 44 <th class="line-num"><%= table_file[key].nb_line_left %></th>
42 45 <th class="line-num"><%= table_file[key].nb_line_right %></th>
43 46 <% if table_file[key].line_left.empty? -%>
44 47 <td class="line-code <%= table_file[key].type_diff_right %>">
45 48 <pre><%=to_utf8 table_file[key].line_right %></pre>
46 49 </td>
47 50 <% else -%>
48 51 <td class="line-code <%= table_file[key].type_diff_left %>">
49 52 <pre><%=to_utf8 table_file[key].line_left %></pre>
50 53 </td>
51 54 <% end -%>
52 55 </tr>
53 56 <% prev_line_left = table_file[key].nb_line_left.to_i if table_file[key].nb_line_left.to_i > 0 -%>
54 57 <% prev_line_right = table_file[key].nb_line_right.to_i if table_file[key].nb_line_right.to_i > 0 -%>
55 58 <% end -%>
56 59 </tbody>
57 60 </table>
58 61 <% end -%>
59 62
60 63 </div>
61 64 <% end -%>
@@ -1,150 +1,152
1 1
2 2 table.filecontent { border: 1px solid #ccc; border-collapse: collapse; width:98%; }
3 3 table.filecontent th { border: 1px solid #ccc; background-color: #eee; }
4 table.filecontent th.filename { background-color: #ddc; text-align: left; }
5 table.filecontent tr.spacing td { border: 1px solid #d7d7d7; height: 0.4em; }
4 table.filecontent th.filename { background-color: #e4e4d4; text-align: left; padding: 0.2em;}
5 table.filecontent tr.spacing th { text-align:center; }
6 table.filecontent tr.spacing td { height: 0.4em; background: #EAF2F5;}
6 7 table.filecontent th.line-num {
7 8 border: 1px solid #d7d7d7;
8 9 font-size: 0.8em;
9 10 text-align: right;
10 11 width: 2%;
11 12 padding-right: 3px;
13 color: #999;
12 14 }
13 15 table.filecontent td.line-code pre {
14 16 white-space: pre-wrap; /* CSS2.1 compliant */
15 17 white-space: -moz-pre-wrap; /* Mozilla-based browsers */
16 18 white-space: -o-pre-wrap; /* Opera 7+ */
17 19 }
18 20
19 21 /* 12 different colors for the annonate view */
20 22 table.annotate tr.bloc-0 {background: #FFFFBF;}
21 23 table.annotate tr.bloc-1 {background: #EABFFF;}
22 24 table.annotate tr.bloc-2 {background: #BFFFFF;}
23 25 table.annotate tr.bloc-3 {background: #FFD9BF;}
24 26 table.annotate tr.bloc-4 {background: #E6FFBF;}
25 27 table.annotate tr.bloc-5 {background: #BFCFFF;}
26 28 table.annotate tr.bloc-6 {background: #FFBFEF;}
27 29 table.annotate tr.bloc-7 {background: #FFE6BF;}
28 30 table.annotate tr.bloc-8 {background: #FFE680;}
29 31 table.annotate tr.bloc-9 {background: #AA80FF;}
30 32 table.annotate tr.bloc-10 {background: #FFBFDC;}
31 33 table.annotate tr.bloc-11 {background: #BFE4FF;}
32 34
33 35 table.annotate td.revision {
34 36 text-align: center;
35 37 width: 2%;
36 38 padding-left: 1em;
37 39 background: inherit;
38 40 }
39 41
40 42 table.annotate td.author {
41 43 text-align: center;
42 44 border-right: 1px solid #d7d7d7;
43 45 white-space: nowrap;
44 46 padding-left: 1em;
45 47 padding-right: 1em;
46 48 width: 3%;
47 49 background: inherit;
48 50 font-size: 90%;
49 51 }
50 52
51 53 table.annotate td.line-code { background-color: #fafafa; }
52 54
53 55 div.action_M { background: #fd8 }
54 56 div.action_D { background: #f88 }
55 57 div.action_A { background: #bfb }
56 58
57 59 /************* Coderay styles *************/
58 60
59 61 table.CodeRay {
60 62 background-color: #fafafa;
61 63 }
62 64 .CodeRay pre { margin: 0px }
63 65
64 66 span.CodeRay { white-space: pre; border: 0px; padding: 2px }
65 67
66 68 .CodeRay .no { padding: 0px 4px }
67 69 .CodeRay .code { }
68 70
69 71 ol.CodeRay { font-size: 10pt }
70 72 ol.CodeRay li { white-space: pre }
71 73
72 74 .CodeRay .code pre { overflow: auto }
73 75
74 76 .CodeRay .debug { color:white ! important; background:blue ! important; }
75 77
76 78 .CodeRay .af { color:#00C }
77 79 .CodeRay .an { color:#007 }
78 80 .CodeRay .av { color:#700 }
79 81 .CodeRay .aw { color:#C00 }
80 82 .CodeRay .bi { color:#509; font-weight:bold }
81 83 .CodeRay .c { color:#666; }
82 84
83 85 .CodeRay .ch { color:#04D }
84 86 .CodeRay .ch .k { color:#04D }
85 87 .CodeRay .ch .dl { color:#039 }
86 88
87 89 .CodeRay .cl { color:#B06; font-weight:bold }
88 90 .CodeRay .co { color:#036; font-weight:bold }
89 91 .CodeRay .cr { color:#0A0 }
90 92 .CodeRay .cv { color:#369 }
91 93 .CodeRay .df { color:#099; font-weight:bold }
92 94 .CodeRay .di { color:#088; font-weight:bold }
93 95 .CodeRay .dl { color:black }
94 96 .CodeRay .do { color:#970 }
95 97 .CodeRay .ds { color:#D42; font-weight:bold }
96 98 .CodeRay .e { color:#666; font-weight:bold }
97 99 .CodeRay .en { color:#800; font-weight:bold }
98 100 .CodeRay .er { color:#F00; background-color:#FAA }
99 101 .CodeRay .ex { color:#F00; font-weight:bold }
100 102 .CodeRay .fl { color:#60E; font-weight:bold }
101 103 .CodeRay .fu { color:#06B; font-weight:bold }
102 104 .CodeRay .gv { color:#d70; font-weight:bold }
103 105 .CodeRay .hx { color:#058; font-weight:bold }
104 106 .CodeRay .i { color:#00D; font-weight:bold }
105 107 .CodeRay .ic { color:#B44; font-weight:bold }
106 108
107 109 .CodeRay .il { background: #eee }
108 110 .CodeRay .il .il { background: #ddd }
109 111 .CodeRay .il .il .il { background: #ccc }
110 112 .CodeRay .il .idl { font-weight: bold; color: #888 }
111 113
112 114 .CodeRay .in { color:#B2B; font-weight:bold }
113 115 .CodeRay .iv { color:#33B }
114 116 .CodeRay .la { color:#970; font-weight:bold }
115 117 .CodeRay .lv { color:#963 }
116 118 .CodeRay .oc { color:#40E; font-weight:bold }
117 119 .CodeRay .of { color:#000; font-weight:bold }
118 120 .CodeRay .op { }
119 121 .CodeRay .pc { color:#038; font-weight:bold }
120 122 .CodeRay .pd { color:#369; font-weight:bold }
121 123 .CodeRay .pp { color:#579 }
122 124 .CodeRay .pt { color:#339; font-weight:bold }
123 125 .CodeRay .r { color:#080; font-weight:bold }
124 126
125 127 .CodeRay .rx { background-color:#fff0ff }
126 128 .CodeRay .rx .k { color:#808 }
127 129 .CodeRay .rx .dl { color:#404 }
128 130 .CodeRay .rx .mod { color:#C2C }
129 131 .CodeRay .rx .fu { color:#404; font-weight: bold }
130 132
131 133 .CodeRay .s { background-color:#fff0f0 }
132 134 .CodeRay .s .s { background-color:#ffe0e0 }
133 135 .CodeRay .s .s .s { background-color:#ffd0d0 }
134 136 .CodeRay .s .k { color:#D20 }
135 137 .CodeRay .s .dl { color:#710 }
136 138
137 139 .CodeRay .sh { background-color:#f0fff0 }
138 140 .CodeRay .sh .k { color:#2B2 }
139 141 .CodeRay .sh .dl { color:#161 }
140 142
141 143 .CodeRay .sy { color:#A60 }
142 144 .CodeRay .sy .k { color:#A60 }
143 145 .CodeRay .sy .dl { color:#630 }
144 146
145 147 .CodeRay .ta { color:#070 }
146 148 .CodeRay .tf { color:#070; font-weight:bold }
147 149 .CodeRay .ts { color:#D70; font-weight:bold }
148 150 .CodeRay .ty { color:#339; font-weight:bold }
149 151 .CodeRay .v { color:#036 }
150 152 .CodeRay .xt { color:#444 }
General Comments 0
You need to be logged in to leave comments. Login now