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