Mercurial > hg > reproctool-df
comparison reproctool.cgi @ 22:66a63068fb23
Cleaned up the styles and added colour s on meta level .... the happy colour show.
author | df |
---|---|
date | Sun, 25 Jan 2009 17:21:00 +0000 |
parents | 5ae40a1161e6 |
children | b505b076c493 |
comparison
equal
deleted
inserted
replaced
21:5ae40a1161e6 | 22:66a63068fb23 |
---|---|
1 #!/usr/bin/perl -T | 1 #!/usr/bin/perl -T |
2 | 2 |
3 use warnings; | 3 use warnings; |
4 use strict; | 4 use strict; |
5 | 5 |
6 use Switch; | |
6 use CGI; | 7 use CGI; |
7 use DBI; | 8 use DBI; |
8 use LWP::UserAgent; | 9 use LWP::UserAgent; |
9 | 10 |
10 # Settings | 11 # Settings |
176 my $col = 0; | 177 my $col = 0; |
177 print<<END; | 178 print<<END; |
178 <html> | 179 <html> |
179 <head> | 180 <head> |
180 <style type="text/css"> | 181 <style type="text/css"> |
181 .meta4, .meta5, .meta6, .meta7, .meta8, .meta9 | 182 .reg |
182 { | |
183 color: #FF0000; | |
184 } | |
185 .item | |
186 { | 183 { |
187 text-align: center; | 184 text-align: center; |
188 } | 185 } |
189 </style> | 186 </style> |
190 </head> | 187 </head> |
201 { | 198 { |
202 print "</tr><tr>\n"; | 199 print "</tr><tr>\n"; |
203 $col = 0; | 200 $col = 0; |
204 } | 201 } |
205 | 202 |
206 my ($style, $img, $text, $link, $colour); | 203 my ($img, $text, $link, $colour); |
207 | 204 |
208 if (defined $item->{id}) | 205 if (defined $item->{id}) |
209 { | 206 { |
210 $style = "meta$item->{meta}"; | |
211 if ($igb) | 207 if ($igb) |
212 { | 208 { |
213 $img = "typeicon:$item->{id}"; | 209 $img = "typeicon:$item->{id}"; |
214 $link = "showinfo:$item->{id}"; | 210 $link = "showinfo:$item->{id}"; |
215 } | 211 } |
216 else | 212 else |
217 { | 213 { |
218 $img = "$img_http_path/icons/icons_items_png/64_64/icon$item->{icon}.png"; | 214 $img = "$img_http_path/icons/icons_items_png/64_64/icon$item->{icon}.png"; |
219 } | 215 } |
220 | 216 |
221 if ($item->{meta} == 4) | 217 switch ($item->{meta}) |
218 { | |
219 case 0 { $colour = "#666600"; } | |
220 case 1 { $colour = "#777777"; } | |
221 case 2 { $colour = "#BBBBBB"; } | |
222 case 3 { $colour = "#FFFFFF"; } | |
223 case 4 { $colour = "#00FF00"; } | |
224 case 5 { $colour = "#FF0000"; } | |
225 case [6..30]{ $colour = "#0000BB"; } | |
226 } | |
227 | |
228 if ($item->{meta} >= 4) | |
222 { | 229 { |
223 $text = $item->{name}; | 230 $text = $item->{name}; |
224 $colour = "#FF0000"; | |
225 } | 231 } |
226 else | 232 else |
227 { | 233 { |
228 $text = $item->{reprocessIsk}; | 234 $text = $item->{reprocessIsk}; |
229 } | 235 } |
232 { | 238 { |
233 $text = 'Unknown item'; | 239 $text = 'Unknown item'; |
234 $img = "typeicon:07_15"; | 240 $img = "typeicon:07_15"; |
235 } | 241 } |
236 | 242 |
237 print "<td width='64' class='item'>"; | 243 print "<td width='64' class='reg'>"; |
238 print "<a href='$link'>" if defined $link; | 244 print "<a href='$link'>" if defined $link; |
239 print "<img src='$img' width='64' height='64' border='1' "; | 245 print "<img src='$img' width='64' height='64' border='1' "; |
240 print "title=\"$item->{name}\" alt=\"$item->{name} ($item->{reprocessDetails})\" />"; | 246 print "title=\"$item->{name}\" alt=\"$item->{name} ($item->{reprocessDetails})\" />"; |
241 print "</a>" if defined $link; | 247 print "</a>" if defined $link; |
242 print "<br />"; | 248 print "<br />"; |