Index: trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php |
— | — | @@ -62,12 +62,11 @@ |
63 | 63 | $table .= Html::openElement( 'tbody' ); |
64 | 64 | foreach ( $rows as $row ) { |
65 | 65 | $table .= Html::openElement( 'tr' ); |
66 | | - foreach ( $row as $class => $column ) { |
67 | | - $attr = is_string( $class ) |
68 | | - ? array( 'class' => 'articleFeedback-table-column-' . $class ) : array(); |
| 66 | + foreach ( $row as $column ) { |
| 67 | + $attr = array(); |
69 | 68 | if ( is_array( $column ) ) { |
70 | | - if ( isset( $column['attr'] ) ) { |
71 | | - $attr = array_merge( $attr, $column['attr'] ); |
| 69 | + if ( isset( $column['attr'] ) && is_array( $column['attr'] ) ) { |
| 70 | + $attr = $column['attr']; |
72 | 71 | } |
73 | 72 | if ( isset( $column['text'] ) ) { |
74 | 73 | $table .= Html::element( 'td', $attr, $column['text'] ); |
— | — | @@ -103,9 +102,20 @@ |
104 | 103 | $pageTitle = Title::newFromId( $page['page'] ); |
105 | 104 | $row['page'] = Linker::link( $pageTitle, $pageTitle->getPrefixedText() ); |
106 | 105 | foreach ( $page['ratings'] as $id => $value ) { |
107 | | - $row['rating-' . $id] = $value; |
| 106 | + $row[] = array( |
| 107 | + 'text' => round( $value, 2 ), |
| 108 | + 'attr' => array( |
| 109 | + 'class' => 'articleFeedback-table-column-rating' |
| 110 | + ) |
| 111 | + ); |
108 | 112 | } |
109 | | - $row['average articleFeedback-table-cell-score-' . round( $page['average'] )] = $page['average']; |
| 113 | + $row[] = array( |
| 114 | + 'text' => round( $page['average'], 2 ), |
| 115 | + 'attr' => array( |
| 116 | + 'class' => 'articleFeedback-table-column-average ' . |
| 117 | + 'articleFeedback-table-column-score-' . round( $page['average'] ) |
| 118 | + ) |
| 119 | + ); |
110 | 120 | $rows[] = $row; |
111 | 121 | } |
112 | 122 | } |
— | — | @@ -135,7 +145,12 @@ |
136 | 146 | $pageTitle = Title::newFromText( $page['page'] ); |
137 | 147 | $row['page'] = Linker::link( $pageTitle, $pageTitle->getPrefixedText() ); |
138 | 148 | foreach ( $page['changes'] as $id => $value ) { |
139 | | - $row['rating-' . $id] = $value; |
| 149 | + $row[] = array( |
| 150 | + 'text' => round( $value, 2 ), |
| 151 | + 'attr' => array( |
| 152 | + 'class' => 'articleFeedback-table-column-changes' |
| 153 | + ) |
| 154 | + ); |
140 | 155 | } |
141 | 156 | $rows[] = $row; |
142 | 157 | } |
— | — | @@ -167,11 +182,11 @@ |
168 | 183 | $row[] = array( |
169 | 184 | 'attr' => in_array( $category, $page['categories'] ) |
170 | 185 | ? array( |
171 | | - 'class' => 'articleFeedback-table-cell-bad', |
| 186 | + 'class' => 'articleFeedback-table-column-bad', |
172 | 187 | 'data-sort-value' => 0 |
173 | 188 | ) |
174 | 189 | : array( |
175 | | - 'class' => 'articleFeedback-table-cell-good', |
| 190 | + 'class' => 'articleFeedback-table-column-good', |
176 | 191 | 'data-sort-value' => 1 |
177 | 192 | ), |
178 | 193 | 'html' => ' ' |
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.dashboard.css |
— | — | @@ -22,34 +22,30 @@ |
23 | 23 | text-align: left; |
24 | 24 | } |
25 | 25 | |
26 | | -.articleFeedback-table td.articleFeedback-table-column-rating-1, |
27 | | -.articleFeedback-table td.articleFeedback-table-column-rating-2, |
28 | | -.articleFeedback-table td.articleFeedback-table-column-rating-3, |
29 | | -.articleFeedback-table td.articleFeedback-table-column-rating-4, |
30 | 26 | .articleFeedback-table td.articleFeedback-table-column-rating, |
31 | 27 | .articleFeedback-table td.articleFeedback-table-column-average { |
32 | 28 | text-align: right; |
33 | 29 | } |
34 | 30 | |
35 | | -.articleFeedback-table-cell-score-0, |
36 | | -.articleFeedback-table-cell-score-1 { |
| 31 | +.articleFeedback-table-column-score-0, |
| 32 | +.articleFeedback-table-column-score-1 { |
37 | 33 | background-color: #ffcccc; |
38 | 34 | } |
39 | 35 | |
40 | 36 | |
41 | | -.articleFeedback-table-cell-score-2, |
42 | | -.articleFeedback-table-cell-bad { |
| 37 | +.articleFeedback-table-column-score-2, |
| 38 | +.articleFeedback-table-column-bad { |
43 | 39 | background-color: #ffcc99; |
44 | 40 | } |
45 | 41 | |
46 | | -.articleFeedback-table-cell-score-3 { |
| 42 | +.articleFeedback-table-column-score-3 { |
47 | 43 | background-color: #ffff99; |
48 | 44 | } |
49 | 45 | |
50 | | -.articleFeedback-table-cell-score-4, |
51 | | -.articleFeedback-table-cell-good { |
| 46 | +.articleFeedback-table-column-score-4, |
| 47 | +.articleFeedback-table-column-good { |
52 | 48 | background-color: #99ff99; |
53 | 49 | } |
54 | | -.articleFeedback-table-cell-score-5 { |
| 50 | +.articleFeedback-table-column-score-5 { |
55 | 51 | background-color: #55ff55; |
56 | 52 | } |