blogger
Révision | f2f590b02c9096c7e90db705f95a845a070c12ea (tree) |
---|---|
l'heure | 2017-09-08 07:34:14 |
Auteur | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2424 bugtrack: Define bugtrack list style by CSS
@@ -24,8 +24,9 @@ function plugin_bugtrack_init() | ||
24 | 24 | 'priority_list' => array('緊急', '重要', '普通', '低'), |
25 | 25 | 'state_list' => array('提案', '着手', '完了', '保留', '却下'), |
26 | 26 | 'state_sort' => array('着手', '保留', '完了', '提案', '却下'), |
27 | - 'state_bgcolor' => array('#ccccff', '#ffcc99', '#ccffcc', '#ffccff', '#cccccc', '#ff3333'), | |
28 | - 'header_bgcolor' => '#ffffcc', | |
27 | + 'state_class' => array('bugtrack_state_proposal', 'bugtrack_state_accept', | |
28 | + 'bugrack_state_resolved', 'bugtrack_state_pending', 'bugtrack_state_cancel', | |
29 | + 'bugtrack_state_undef'), | |
29 | 30 | 'base' => 'ページ', |
30 | 31 | 'summary' => 'サマリ', |
31 | 32 | 'nosummary'=> 'ここにサマリを記入して下さい', |
@@ -373,18 +374,19 @@ function plugin_bugtrack_list_convert() | ||
373 | 374 | |
374 | 375 | $state_no = array_search($state, $_plugin_bugtrack['state_sort']); |
375 | 376 | if ($state_no === NULL || $state_no === FALSE) $state_no = $count_list; |
376 | - $bgcolor = htmlsc($_plugin_bugtrack['state_bgcolor'][$state_no]); | |
377 | + $cssclass = htmlsc($_plugin_bugtrack['state_class'][$state_no]); | |
377 | 378 | |
378 | 379 | $row = <<<EOD |
379 | - <tr> | |
380 | - <td style="background-color:$bgcolor">$page_link</td> | |
381 | - <td style="background-color:$bgcolor">$state</td> | |
382 | - <td style="background-color:$bgcolor">$priority</td> | |
383 | - <td style="background-color:$bgcolor">$category</td> | |
384 | - <td style="background-color:$bgcolor">$name</td> | |
385 | - <td style="background-color:$bgcolor">$summary</td> | |
380 | + <tr class="$cssclass"> | |
381 | + <td>$page_link</td> | |
382 | + <td>$state</td> | |
383 | + <td>$priority</td> | |
384 | + <td>$category</td> | |
385 | + <td>$name</td> | |
386 | + <td>$summary</td> | |
386 | 387 | </tr> |
387 | 388 | EOD; |
389 | + $row = preg_replace('#(?<=>)\n\s+#', '', $row) . "\n"; // Reduce space size | |
388 | 390 | $rec = &$data[$i]; |
389 | 391 | $rec[] = $state_no; // color number |
390 | 392 | $rec[] = $row; // HTML content |
@@ -407,10 +409,9 @@ EOD; | ||
407 | 409 | list($page_name, $no, $summary, $name, $priority, $state, $category, $filetime, $state_no, $html) = $line; |
408 | 410 | $table[$state_no][$no] = $html; |
409 | 411 | } |
410 | - $table_html = ' <tr>' . "\n"; | |
411 | - $bgcolor = htmlsc($_plugin_bugtrack['header_bgcolor']); | |
412 | + $table_html = ' <tr class="bugtrack_list_header">' . "\n"; | |
412 | 413 | foreach (array('pagename', 'state', 'priority', 'category', 'name', 'summary') as $item) |
413 | - $table_html .= ' <th style="background-color:' . $bgcolor . '">' . | |
414 | + $table_html .= ' <th>' . | |
414 | 415 | htmlsc($_plugin_bugtrack[$item]) . '</th>' . "\n"; |
415 | 416 | $table_html .= ' </tr>' . "\n"; |
416 | 417 | for ($i = 0; $i <= $count_list; ++$i) { |
@@ -451,11 +452,10 @@ function plugin_bugtrack_list_pageinfo($page, $no = NULL, $recurse = TRUE, $file | ||
451 | 452 | $$item = ''; // Data not found |
452 | 453 | } |
453 | 454 | } |
454 | - | |
455 | 455 | if (preg_match("/\*([^\n]*)/", $body, $matches)) { |
456 | 456 | $summary = $matches[1]; |
457 | 457 | make_heading($summary); |
458 | + $summary = trim($summary); | |
458 | 459 | } |
459 | - | |
460 | 460 | return array($page, $no, $summary, $name, $priority, $state, $category, $filetime); |
461 | 461 | } |
@@ -618,6 +618,29 @@ span.topicpath-top { | ||
618 | 618 | user-select: none; |
619 | 619 | } |
620 | 620 | |
621 | +/* bugtrack.inc.php */ | |
622 | +tr.bugtrack_list_header th { | |
623 | + background-color: #ffffcc; | |
624 | +} | |
625 | +tr.bugtrack_state_proposal td { | |
626 | + background-color: #ccccff; | |
627 | +} | |
628 | +tr.bugtrack_state_accept td { | |
629 | + background-color: #ffcc99; | |
630 | +} | |
631 | +tr.bugrack_state_resolved td { | |
632 | + background-color: #ccffcc; | |
633 | +} | |
634 | +tr.bugtrack_state_pending td { | |
635 | + background-color: #ffccff; | |
636 | +} | |
637 | +tr.bugtrack_state_cancel td { | |
638 | + background-color: #cccccc; | |
639 | +} | |
640 | +tr.bugtrack_state_undef td { | |
641 | + background-color: #ff3333; | |
642 | +} | |
643 | + | |
621 | 644 | @media print { |
622 | 645 | a:link, |
623 | 646 | a:visited { |
@@ -494,6 +494,29 @@ span.topicpath-top { | ||
494 | 494 | user-select: none; |
495 | 495 | } |
496 | 496 | |
497 | +/* bugtrack.inc.php */ | |
498 | +tr.bugtrack_list_header th { | |
499 | + background-color: #ffffcc; | |
500 | +} | |
501 | +tr.bugtrack_state_proposal td { | |
502 | + background-color: #ccccff; | |
503 | +} | |
504 | +tr.bugtrack_state_accept td { | |
505 | + background-color: #ffcc99; | |
506 | +} | |
507 | +tr.bugrack_state_resolved td { | |
508 | + background-color: #ccffcc; | |
509 | +} | |
510 | +tr.bugtrack_state_pending td { | |
511 | + background-color: #ffccff; | |
512 | +} | |
513 | +tr.bugtrack_state_cancel td { | |
514 | + background-color: #cccccc; | |
515 | +} | |
516 | +tr.bugtrack_state_undef td { | |
517 | + background-color: #ff3333; | |
518 | +} | |
519 | + | |
497 | 520 | @media print { |
498 | 521 | img#logo, |
499 | 522 | div#navigator, |