Commits

Marius Gedminas committed b0c1d1d

CSS tweaks; removing all errors removes the header too.

  • Participants
  • Parent commits e1c5976

Comments (0)

Files changed (2)

File dozer/media/css/profile.css

 del {text-decoration: line-through;}
 
 /* tables still need 'cellspacing="0"' in the markup */
-table {border: 1px solid #cccdcd; border-left: 0; border-bottom: 0; border-collapse: collapse; border-spacing: 0;}
+table {border: 0; border-collapse: collapse; border-spacing: 0;}
 /* @end */
 
 /* @group Defaults */
 
 #environment th { text-align: right; }
 #environment td { text-align: left; }
+#profile-list { width: 100%; }
+#profile-list td.time, #profile-list td.cost { text-align: right; }
+#profile-list td.cost, #profile-list td.pid { width: 100px; }
+#profile-list td.time { width: 120px; }
+#profile-list td.delete { width: 48px; }
 #profile-list td { text-align: left; }
+#profile-list tr:hover { background: #444; }

File dozer/templates/list_profiles.mako

 <p><a href="/_profiler/delete">Delete all</a></p>
 <table id="profile-list">
     <tr>
-        <th>URL</th>
-        <th>Cost</th>
-        <th>Time</th>
-        <th>Profile ID</th>
-        <th></th>
+        <th class="url">URL</th>
+        <th class="cost">Cost</th>
+        <th class="time">Time</th>
+        <th class="pid">Profile ID</th>
+        <th class="delete"></th>
     </tr>
     % for created_time, environ, total_cost, profile_id in profiles:
     <tr pid="${profile_id}">
-        <td>${environ['SCRIPT_NAME'] + environ['PATH_INFO'] + environ['QUERY_STRING']|h}</td>
-        <td>${total_cost} ms</td>
-        <td>${'%i' % int(now-created_time)} seconds ago</td>
-        <td><a href="/_profiler/show/${profile_id}">${profile_id}</a></td>
-        <td><a href="/_profiler/delete/${profile_id}" class="delete">delete</a></td>
+        <td class="url">${environ['SCRIPT_NAME'] + environ['PATH_INFO'] + environ['QUERY_STRING']|h}</td>
+        <td class="cost">${total_cost} ms</td>
+        <td class="time">${'%i' % int(now-created_time)} seconds ago</td>
+        <td class="pid"><a href="/_profiler/show/${profile_id}">${profile_id}</a></td>
+        <td class="delete"><a href="/_profiler/delete/${profile_id}" class="delete">delete</a></td>
     </tr>
     % endfor
     % if errors:
-    <tr>
-        <th colspan="2">Error</th>
-        <th>Time</th>
-        <th>Profile ID</th>
-        <th></th>
+    <tr id="error-header">
+        <th class="error" colspan="2">Error</th>
+        <th class="time">Time</th>
+        <th class="pid">Profile ID</th>
+        <th class="delete"></th>
     </tr>
     % for created_time, error, profile_id in errors:
-    <tr pid="${profile_id}">
-        <td colspan="2">${error|h}</td>
-        <td>${'%i' % int(now-created_time)} seconds ago</td>
-        <td>${profile_id}</td>
-        <td><a href="/_profiler/delete/${profile_id}" class="delete">delete</a></td>
+    <tr pid="${profile_id}" class="error">
+        <td class="error" colspan="2">${error|h}</td>
+        <td class="time">${'%i' % int(now-created_time)} seconds ago</td>
+        <td class="pid">${profile_id}</td>
+        <td class="delete"><a href="/_profiler/delete/${profile_id}" class="delete">delete</a></td>
     </tr>
     % endfor
     % endif
       url: "/_profiler/delete/"+tr.attr("pid"),
       success: function(msg){
         tr.remove();
+        if ($("tr.error").length == 0) $("#error-header").remove();
       }
     });
     return false;