https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114724

Revision: 114724
Author:   laner
Date:     2012-04-04 23:58:46 +0000 (Wed, 04 Apr 2012)
Log Message:
-----------
* 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
    trunk/extensions/OpenStackManager/special/SpecialNova.php
    trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
    trunk/extensions/OpenStackManager/special/SpecialNovaProject.php

Modified: trunk/extensions/OpenStackManager/OpenStackManager.i18n.php
===================================================================
--- trunk/extensions/OpenStackManager/OpenStackManager.i18n.php 2012-04-04 
23:45:13 UTC (rev 114723)
+++ trunk/extensions/OpenStackManager/OpenStackManager.i18n.php 2012-04-04 
23:58:46 UTC (rev 114724)
@@ -427,6 +427,7 @@
        'openstackmanager-projects' => 'A set of projects',
        'openstackmanager-setprojects' => 'A message informing the user that a 
project filter has been successfully assigned',
        'openstackmanager-setprojectfilter' => ' A message telling the user 
that a project filter should be applied to see any resources.',
+       'openstackmanager-toggleproject' => 'A message to tell the user they 
can toggle the collapsing and expanding of project sections.',
 );
 
 /** Afrikaans (Afrikaans)

Modified: trunk/extensions/OpenStackManager/special/SpecialNova.php
===================================================================
--- trunk/extensions/OpenStackManager/special/SpecialNova.php   2012-04-04 
23:45:13 UTC (rev 114723)
+++ trunk/extensions/OpenStackManager/special/SpecialNova.php   2012-04-04 
23:58:46 UTC (rev 114724)
@@ -181,12 +181,22 @@
                return Html::rawElement( 'ul', array(), $resourceList );
        }
 
-       function pushResourceColumn( &$row, $value ) {
-               array_push( $row, Html::element( 'td', array(), $value ) );
+       function pushResourceColumn( &$row, $value, $attribs=array() ) {
+               if ( array_key_exists( 'class', $attribs ) ) {
+                       $attribs['class'] = $attribs['class'] . ' Nova_cell';
+               } else {
+                       $attribs['class'] = 'Nova_cell';
+               }
+               array_push( $row, Html::element( 'td', $attribs, $value ) );
        }
 
-       function pushRawResourceColumn( &$row, $value ) {
-               array_push( $row, Html::rawElement( 'td', array(), $value ) );
+       function pushRawResourceColumn( &$row, $value, $attribs=array() ) {
+               if ( array_key_exists( 'class', $attribs ) ) {
+                       $attribs['class'] = $attribs['class'] . ' Nova_cell';
+               } else {
+                       $attribs['class'] = 'Nova_cell';
+               }
+               array_push( $row, Html::rawElement( 'td', $attribs, $value ) );
        }
 
        function createResourceTable( $headers, $rows ) {
@@ -215,11 +225,12 @@
                }
                if ( $actions ) {
                        $actions = implode( ',', $actions );
+                       $actions = '<a class="mw-customtoggle-' . $projectName 
. ' osm-remotetoggle">' . wfMsgHtml( 'openstackmanager-toggleproject' ) . 
'</a>,' . $actions;
                        $actionOut = Html::rawElement( 'span', array( 'id' => 
'novaaction' ), "[$actions]" );
                } else {
                        $actionOut = '';
                }
-               $projectNameOut = Html::rawElement( 'span', array( 'class' => 
'mw-customtoggle-' . $projectName, 'id' => 'novaproject' ), $projectName );
+               $projectNameOut = $this->createResourceLink( $projectName );
                $out = Html::rawElement( 'h2', array(), "$projectNameOut 
$actionOut" );
                $out .= Html::rawElement( 'div', array( 'class' => 
'mw-collapsible', 'id' => 'mw-customcollapsible-' . $projectName ), $data );
 

Modified: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
===================================================================
--- trunk/extensions/OpenStackManager/special/SpecialNovaKey.php        
2012-04-04 23:45:13 UTC (rev 114723)
+++ trunk/extensions/OpenStackManager/special/SpecialNovaKey.php        
2012-04-04 23:58:46 UTC (rev 114724)
@@ -175,8 +175,7 @@
                        $keyRows = Array();
                        foreach ( $keypairs as $hash => $key ) {
                                $keyRow = Array();
-                               # TODO: add Nova_col class back to this column
-                               $this->pushResourceColumn( $keyRow, $key );
+                               $this->pushResourceColumn( $keyRow, $key, 
array( 'class' => 'Nova_col' ) );
                                $actions = Array();
                                array_push( $actions, $this->createActionLink( 
'openstackmanager-delete', array( 'action' => 'delete', 'hash' => $hash ) ) );
                                $this->pushRawResourceColumn( $keyRow, 
$this->createResourceList( $actions) );

Modified: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php
===================================================================
--- trunk/extensions/OpenStackManager/special/SpecialNovaProject.php    
2012-04-04 23:45:13 UTC (rev 114723)
+++ trunk/extensions/OpenStackManager/special/SpecialNovaProject.php    
2012-04-04 23:58:46 UTC (rev 114724)
@@ -216,7 +216,6 @@
                        $this->pushRawResourceColumn( $roleRow,  
$this->createResourceList( $actions ) );
                        array_push( $roleRows, $roleRow );
                }
-               // TODO: add back in Nova_cell class to this column
                $this->pushRawResourceColumn( $projectRow, 
$this->createResourceTable( $headers, $roleRows ) );
                $actions = Array();
                array_push( $actions, $this->createActionLink( 
'openstackmanager-deleteproject', array( 'action' => 'delete', 'projectname' => 
$projectName ) ) );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to