Index: mergebot/trunk/mergebot/templates/mergebot.html
===================================================================
--- mergebot/trunk/mergebot/templates/mergebot.html	(revision 41)
+++ mergebot/trunk/mergebot/templates/mergebot.html	(revision 42)
@@ -17,44 +17,54 @@
   <div id="content" class="mergebot">
 
-  <div id="content" class="query">
+  <div class="query">
     <h1>Queued</h1>
+
     <table class="listing tickets">
-      <thead><tr>
-        <th>Ticket</th>
-        <th>Summary</th>
+      <thead>
+        <tr>
+          <th>Ticket</th>
+          <th>Summary</th>
 
-        <th>Requestor</th>
-        <th>Action</th>
-        <th>Task ID</th>
-        <th>Task Status</th>
+          <th>Requestor</th>
+          <th>Action</th>
+          <th>Task ID</th>
+          <th>Task Status</th>
 
-        <th>Component</th>
-        <th>Version</th>
-        <th>Actions</th>
-      </tr></thead>
+          <th>Component</th>
+          <th>Version</th>
+          <th>Actions</th>
+        </tr>
+      </thead>
 
-      <tr py:for="task_id, task_status, ticket_id, action, component, version, requestor, summary in queue">
-        <td><a href="${href.ticket(ticket_id)}">#${ticket_id}</a></td>
-        <td><a href="${href.ticket(ticket_id)}">${summary}</a></td>
+      <tbody>
+        <tr py:for="task_id, task_status, ticket_id, action, component, version, requestor, summary in queue">
+          <td><a href="${href.ticket(ticket_id)}">#${ticket_id}</a></td>
+          <td><a href="${href.ticket(ticket_id)}">${summary}</a></td>
 
-        <td>${requestor}</td>
-        <td>${action}</td>
-        <td>${task_id}</td>
-        <td>${task_status}</td>
+          <td>${requestor}</td>
+          <td>${action}</td>
+          <td>${task_id}</td>
+          <td>${task_status}</td>
 
-        <td>${component}</td>
-        <td>${version}</td>
-        <td>
-          <form id="cancel_tasks" method="post" name="cancel-task-%{task_id}" action="">
-            <input type="hidden" name="task" value="${task_id}"/>
-            <input type="submit" name="action" value="Cancel" py:if="task_status in ['Waiting', 'Pending']"/>
-          </form>
-        </td>
-      </tr>
+          <td>${component}</td>
+          <td>${version}</td>
+          <td>
+            <form id="cancel_task-${task_id}" method="post" action="">
+              <div>
+                <input type="hidden" name="task" value="${task_id}"/>
+                <input type="submit" name="action" value="Cancel" py:if="task_status in ['Waiting', 'Pending']"/>
+              </div>
+            </form>
+          </td>
+        </tr>
+        <tr py:if="not queue">
+          <td>Nothing in the queue</td>
+        </tr>
+      </tbody>
     </table>
   </div>
 
   <!-- Tickets that are not in an activity queue: -->
-  <div id="content" class="query">
+  <div class="query">
     <h1>Unqueued</h1>
 
@@ -69,23 +79,30 @@
         <th>Actions</th>
       </tr></thead>
-      <tr py:for="ticket in unqueued">
-        <td><a href="${href.ticket(ticket.info.id)}">${ticket.info.id}</a></td>
-        <td><a href="${href.ticket(ticket.info.id)}">${ticket.info.summary}</a></td>
-        <td>${ticket.info.component}</td>
-        <td>${ticket.info.version}</td>
-        <td>${ticket.info.status}</td>
-        <td>${ticket.info.mergebotstate}</td>
-        <td>
-          <form id="ops" method="post" name="ops-${ticket.info.id}" action="">
-            <input type="hidden" name="ticket" value="${ticket.info.id}" />
-            <input type="hidden" name="component" value="${ticket.info.component}" />
-            <input type="hidden" name="version" value="${ticket.info.version}" />
-            <input type="submit" name="action" value="Branch" py:if="ticket.branch"/>
-            <input type="submit" name="action" value="Rebranch" py:if="ticket.rebranch"/>
-            <input type="submit" name="action" value="Merge" py:if="ticket.merge"/>
-            <input type="submit" name="action" value="CheckMerge" py:if="ticket.checkmerge"/>
-          </form>
-        </td>
-      </tr>
+      <tbody>
+        <tr py:for="ticket in unqueued">
+          <td><a href="${href.ticket(ticket.info.id)}">${ticket.info.id}</a></td>
+          <td><a href="${href.ticket(ticket.info.id)}">${ticket.info.summary}</a></td>
+          <td>${ticket.info.component}</td>
+          <td>${ticket.info.version}</td>
+          <td>${ticket.info.status}</td>
+          <td>${ticket.info.mergebotstate}</td>
+          <td>
+            <form id="ops-${ticket.info.id}" method="post" action="">
+              <div>
+                <input type="hidden" name="ticket" value="${ticket.info.id}" />
+                <input type="hidden" name="component" value="${ticket.info.component}" />
+                <input type="hidden" name="version" value="${ticket.info.version}" />
+                <input type="submit" name="action" value="Branch" py:if="ticket.branch"/>
+                <input type="submit" name="action" value="Rebranch" py:if="ticket.rebranch"/>
+                <input type="submit" name="action" value="Merge" py:if="ticket.merge"/>
+                <input type="submit" name="action" value="CheckMerge" py:if="ticket.checkmerge"/>
+              </div>
+            </form>
+          </td>
+        </tr>
+        <tr py:if="not unqueued">
+          <td>No tickets available for MergeBot operations</td>
+        </tr>
+      </tbody>
     </table>
   </div>
