← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/maas/maas-fix-list into lp:maas

 

Raphaël Badin has proposed merging lp:~rvb/maas/maas-fix-list into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rvb/maas/maas-fix-list/+merge/92719

This branch fixes the display of the node list page.  It is a simple and temporary fix (this page will be completely dynamic [read Javascripty] eventually) but I'd  like to get this in because I want Huw to design tables in the UI (I'll be creating many tables this week) so I'd like to have a proper table already in before I ask him that.

Drive-by fix: set the proper settings so that missing variables won't be silently replaced by '' in dev mode.
-- 
https://code.launchpad.net/~rvb/maas/maas-fix-list/+merge/92719
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/maas/maas-fix-list into lp:maas.
=== modified file 'src/maas/development.py'
--- src/maas/development.py	2012-02-09 17:09:23 +0000
+++ src/maas/development.py	2012-02-13 08:20:34 +0000
@@ -18,6 +18,9 @@
 # cluster is running in the branch.
 TEST_RUNNER = 'maastesting.runner.TestRunner'
 
+# Invalid strings should be visible.
+TEMPLATE_STRING_IF_INVALID = '#### INVALID STRING ####'
+
 # Location where python-oops should store errors.
 OOPS_REPOSITORY = 'logs'
 

=== modified file 'src/maasserver/static/css/modifiers.css'
--- src/maasserver/static/css/modifiers.css	2012-02-10 05:49:17 +0000
+++ src/maasserver/static/css/modifiers.css	2012-02-13 08:20:34 +0000
@@ -6,7 +6,9 @@
 .clear {
     clear: both;
     }
-
+table {
+    width: 100%;
+    }
 /* XXX: move this yui stuff somewhere more sensible */
 .yui3-widget-mask {
     background-color: #000;

=== modified file 'src/maasserver/templates/maasserver/node_list.html'
--- src/maasserver/templates/maasserver/node_list.html	2012-02-09 00:42:27 +0000
+++ src/maasserver/templates/maasserver/node_list.html	2012-02-13 08:20:34 +0000
@@ -25,18 +25,23 @@
     <table>
       <thead>
         <tr>
-          <td>System ID</td>
-          <td>Hostname</td>
-          <td>MAC</td>
-          <td>Status</td>
+          <th>System ID</th>
+          <th>Hostname</th>
+          <th>MAC</th>
+          <th>Status</th>
         </tr>
       </thead>
       {% for node in node_list %}
-        <tr class="node">
-        <td class="node-system_id">{{ node.system_id }}</td>
-        <td>{{ node.hostname }}</td>
-        <td>{{ node.mac_address_set }}</td>
-        <td>{{ node.display_status }}</td>
+        <tr class="node {% cycle 'even' 'odd' %}">
+          <td class="node-system_id">{{ node.system_id }}</td>
+          <td>{{ node.hostname }}</td>
+          <td>
+            {{ node.macaddress_set.reverse|first }}
+            {% if node.macaddress_set.count > 1 %}
+            ,… ({{ node.macaddress_set.count|add:"-1" }} more MAC Address(es))
+            {% endif %}
+          </td>
+          <td>{{ node.display_status }}</td>
         </tr>
       {% endfor %}
     </table>