← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jameinel/maas/shared-node-listing into lp:maas

 

John A Meinel has proposed merging lp:~jameinel/maas/shared-node-listing into lp:maas.

Commit message:
Pull out common HTML template between nodes and tags into nodes_listing.html.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jameinel/maas/shared-node-listing/+merge/127434

This is a small patch that move the 'display a list of nodes' into a separate template that can be included on multiple pages.

It then changes 'nodes/' and 'tags/' so that they both use that template. This should make it easy to keep them in sync.

-- 
https://code.launchpad.net/~jameinel/maas/shared-node-listing/+merge/127434
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jameinel/maas/shared-node-listing into lp:maas.
=== modified file 'src/maasserver/templates/maasserver/node_list.html'
--- src/maasserver/templates/maasserver/node_list.html	2012-06-22 07:50:12 +0000
+++ src/maasserver/templates/maasserver/node_list.html	2012-10-02 08:14:21 +0000
@@ -37,29 +37,7 @@
         <input type="text" name="query" class="search-box" value="Search nodes" />
       </form>
     {% endcomment %}
-    {% if node_list|length %}
-      <table class="list">
-        <thead>
-          <tr>
-            <th>MAC</th>
-            <th>Status</th>
-          </tr>
-        </thead>
-        {% for node in node_list %}
-          <tr class="node {% cycle 'even' 'odd' %}">
-            <td>
-              <a href="{% url 'node-view' node.system_id %}">
-                {% for macaddress in node.macaddress_set.reverse %}
-                  {{ macaddress }}{% if not forloop.last %},{% endif %}
-                {% endfor %}
-              </a>
-              ({{ node.hostname }})
-            </td>
-            <td>{{ node.display_status }}</td>
-          </tr>
-        {% endfor %}
-      </table>
-    {% endif%}
+    {% include "maasserver/nodes_listing.html" %}
     <a id="addnode" href="#" class="button right space-top">+ Add node</a>
     <div class="clear"></div>
     <a class="right space-top" href="{% url "enlist-preseed-view" %}">View enlistment preseed</a>

=== added file 'src/maasserver/templates/maasserver/nodes_listing.html'
--- src/maasserver/templates/maasserver/nodes_listing.html	1970-01-01 00:00:00 +0000
+++ src/maasserver/templates/maasserver/nodes_listing.html	2012-10-02 08:14:21 +0000
@@ -0,0 +1,24 @@
+{% if node_list|length %}
+  <table class="list">
+    <thead>
+      <tr>
+        <th>MAC</th>
+        <th>Status</th>
+      </tr>
+    </thead>
+    {% for node in node_list %}
+      <tr class="node {% cycle 'even' 'odd' %}">
+        <td>
+          <a href="{% url 'node-view' node.system_id %}">
+            {% for macaddress in node.macaddress_set.reverse %}
+              {{ macaddress }}{% if not forloop.last %},{% endif %}
+            {% endfor %}
+          </a>
+          ({{ node.hostname }})
+        </td>
+        <td>{{ node.display_status }}</td>
+      </tr>
+    {% endfor %}
+  </table>
+{% endif%}
+

=== modified file 'src/maasserver/templates/maasserver/tag_view.html'
--- src/maasserver/templates/maasserver/tag_view.html	2012-10-01 08:59:12 +0000
+++ src/maasserver/templates/maasserver/tag_view.html	2012-10-02 08:14:21 +0000
@@ -35,29 +35,7 @@
   </ul>
   <div id="nodes">
     <h3>Nodes</h3>
-    {% if node_list|length %}
-      <table class="list">
-        <thead>
-          <tr>
-            <th>MAC</th>
-            <th>Status</th>
-          </tr>
-        </thead>
-        {% for node in node_list %}
-          <tr class="node {% cycle 'even' 'odd' %}">
-            <td>
-              <a href="{% url 'node-view' node.system_id %}">
-                {% for macaddress in node.macaddress_set.reverse %}
-                  {{ macaddress }}{% if not forloop.last %},{% endif %}
-                {% endfor %}
-              </a>
-              ({{ node.hostname }})
-            </td>
-            <td>{{ node.display_status }}</td>
-          </tr>
-        {% endfor %}
-      </table>
-    {% endif%}
+    {% include "maasserver/nodes_listing.html" %}
   </div>
 {% endblock %}