r114724 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114723‎ | r114724 | r114725 >
Date:23:58, 4 April 2012
Author:laner
Status:deferred
Tags:
Comment:
* Switching the expand/collapse section to be an action in the action list
* Turning the project name back into a link to the project's page
* Adding Nova_cell to all table cells
* Adding Nova_col back onto the keys column in NovaKey
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackManager.i18n.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNova.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaKey.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaProject.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php
@@ -216,7 +216,6 @@
217217 $this->pushRawResourceColumn( $roleRow, $this->createResourceList( $actions ) );
218218 array_push( $roleRows, $roleRow );
219219 }
220 - // TODO: add back in Nova_cell class to this column
221220 $this->pushRawResourceColumn( $projectRow, $this->createResourceTable( $headers, $roleRows ) );
222221 $actions = Array();
223222 array_push( $actions, $this->createActionLink( 'openstackmanager-deleteproject', array( 'action' => 'delete', 'projectname' => $projectName ) ) );
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
@@ -175,8 +175,7 @@
176176 $keyRows = Array();
177177 foreach ( $keypairs as $hash => $key ) {
178178 $keyRow = Array();
179 - # TODO: add Nova_col class back to this column
180 - $this->pushResourceColumn( $keyRow, $key );
 179+ $this->pushResourceColumn( $keyRow, $key, array( 'class' => 'Nova_col' ) );
181180 $actions = Array();
182181 array_push( $actions, $this->createActionLink( 'openstackmanager-delete', array( 'action' => 'delete', 'hash' => $hash ) ) );
183182 $this->pushRawResourceColumn( $keyRow, $this->createResourceList( $actions) );
Index: trunk/extensions/OpenStackManager/special/SpecialNova.php
@@ -181,12 +181,22 @@
182182 return Html::rawElement( 'ul', array(), $resourceList );
183183 }
184184
185 - function pushResourceColumn( &$row, $value ) {
186 - array_push( $row, Html::element( 'td', array(), $value ) );
 185+ function pushResourceColumn( &$row, $value, $attribs=array() ) {
 186+ if ( array_key_exists( 'class', $attribs ) ) {
 187+ $attribs['class'] = $attribs['class'] . ' Nova_cell';
 188+ } else {
 189+ $attribs['class'] = 'Nova_cell';
 190+ }
 191+ array_push( $row, Html::element( 'td', $attribs, $value ) );
187192 }
188193
189 - function pushRawResourceColumn( &$row, $value ) {
190 - array_push( $row, Html::rawElement( 'td', array(), $value ) );
 194+ function pushRawResourceColumn( &$row, $value, $attribs=array() ) {
 195+ if ( array_key_exists( 'class', $attribs ) ) {
 196+ $attribs['class'] = $attribs['class'] . ' Nova_cell';
 197+ } else {
 198+ $attribs['class'] = 'Nova_cell';
 199+ }
 200+ array_push( $row, Html::rawElement( 'td', $attribs, $value ) );
191201 }
192202
193203 function createResourceTable( $headers, $rows ) {
@@ -215,11 +225,12 @@
216226 }
217227 if ( $actions ) {
218228 $actions = implode( ',', $actions );
 229+ $actions = '<a class="mw-customtoggle-' . $projectName . ' osm-remotetoggle">' . wfMsgHtml( 'openstackmanager-toggleproject' ) . '</a>,' . $actions;
219230 $actionOut = Html::rawElement( 'span', array( 'id' => 'novaaction' ), "[$actions]" );
220231 } else {
221232 $actionOut = '';
222233 }
223 - $projectNameOut = Html::rawElement( 'span', array( 'class' => 'mw-customtoggle-' . $projectName, 'id' => 'novaproject' ), $projectName );
 234+ $projectNameOut = $this->createResourceLink( $projectName );
224235 $out = Html::rawElement( 'h2', array(), "$projectNameOut $actionOut" );
225236 $out .= Html::rawElement( 'div', array( 'class' => 'mw-collapsible', 'id' => 'mw-customcollapsible-' . $projectName ), $data );
226237
Index: trunk/extensions/OpenStackManager/OpenStackManager.i18n.php
@@ -427,6 +427,7 @@
428428 'openstackmanager-projects' => 'A set of projects',
429429 'openstackmanager-setprojects' => 'A message informing the user that a project filter has been successfully assigned',
430430 'openstackmanager-setprojectfilter' => ' A message telling the user that a project filter should be applied to see any resources.',
 431+ 'openstackmanager-toggleproject' => 'A message to tell the user they can toggle the collapsing and expanding of project sections.',
431432 );
432433
433434 /** Afrikaans (Afrikaans)

Status & tagging log