Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first draft at prettifying introspection

  • Loading branch information...
commit e42e2436b53e6ac5a2214803600b7f1960afb8bd 1 parent 829799d
@blaflamme blaflamme authored
View
85 pyramid_debugtoolbar/panels/templates/introspection.mako
@@ -1,33 +1,54 @@
-<h4>
-<table>
- % for category_name, entries in categorized:
- <th><h4>${category_name.capitalize()}</h4></th>
- % for entry in entries:
- <% intro = entry['introspectable'] %>
- <tr>
- <td>
- <h5><a name="${intro.category_name}${intro.discriminator_hash}">${intro.type_name} ${intro.title}</a></h5>
- <dl>
- % for k, v in sorted(intro.items()):
- % if v:
- <dt>${k}</dt><dd>${debug_repr(v)|n}</dd>
- % endif
- % endfor
- </dl>
- <h6>Source</h6>
- <code>${nl2br(str(intro.action_info))|n}</code>
- % if entry['related']:
- <h7>References</h7>
- <ul>
- % for ref in entry['related']:
- <li>
- <a href="#${ref.category_name}${ref.discriminator_hash}">${ref.type_name} ${ref.title}</a>
- </li>
- % endfor
- </ul>
- % endif
- </td>
+% for category_name, entries in categorized:
+<h4>${category_name.capitalize()}</h4>
+
+ % for entry in entries:
+ <% intro = entry['introspectable'] %>
+ <table>
+ <thead>
+ <tr>
+ <th colspan="2"><a name="${intro.category_name}${intro.discriminator_hash}">${intro.type_name} ${intro.title}</a></th>
</tr>
- % endfor
- % endfor
-</table>
+ </thead>
+ <tbody>
+ <% i = 0 %>
+ % for k, v in sorted(intro.items()):
+ % if v:
+ <tr class="${i%2 and 'pDebugEven' or 'pDebugOdd'}">
+ <td>${k}</td>
+ <td>${debug_repr(v)|n}</td>
+ </tr>
+ <% i += 1 %>
+ % endif
+ % endfor
+ </tbody>
+ <thead>
+ <tr>
+ <th colspan="2">Source</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td colspan="2">
+ <code>${nl2br(str(intro.action_info))|n}</code>
+ </td>
+ </tr>
+ </tbody>
+ % if entry['related']:
+ <thead>
+ <tr>
+ <th colspan="2">References</th>
+ </tr>
+ </thead>
+ <tbody>
+ % for i, ref in enumerate(entry['related']):
+ <tr class="${i%2 and 'pDebugEven' or 'pDebugOdd'}">
+ <td colspan="2">
+ <a href="#${ref.category_name}${ref.discriminator_hash}">${ref.type_name} ${ref.title}</a>
+ </td>
+ </tr>
+ % endfor
+ </tbody>
+ % endif
+ </table>
+ % endfor
+% endfor
View
6 pyramid_debugtoolbar/static/css/toolbar.css
@@ -171,7 +171,7 @@
overflow:auto;
}
-#pDebug tr.pDebugOdd {
+#pDebug tr.pDebugEven {
background-color:#f5f5f5;
}
@@ -265,6 +265,10 @@
text-align:left;
font-weight:bold;
font-size:14px;
+ background-color: #e5e5e5;
+}
+#pDebug .panelContent thead th a {
+ font-size: 14px;
}
#pDebug .panelContent tbody th {
width:12em;
View
44 pyramid_debugtoolbar/templates/introspection_index.mako
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
- <head>
- <title>Pyramid Debug Toolbar Introspector</title>
- <link rel="stylesheet" href="${static_path}css/introspection.css"
- type="text/css">
- </head>
- <body>
- <h1>Pyramid Configuration Introspection</h1>
- <table>
- % for category_name, entries in categorized:
- <th><h2>${category_name.capitalize()}</h2></th>
- % for entry in entries:
- <% intro = entry['introspectable'] %>
- <tr>
- <td>
- <h3><a name="${intro.category_name}${intro.discriminator_hash}">${intro.type_name} ${intro.title}</a></h3>
- <dl>
- % for k, v in sorted(intro.items()):
- % if v:
- <dt>${k}</dt><dd>${debug_repr(v)|n}</dd>
- % endif
- % endfor
- </dl>
- <h4>Source</h4>
- <pre>${nl2br(str(intro.action_info))|n}</pre>
- % if entry['related']:
- <h4>References</h4>
- <ul>
- % for ref in entry['related']:
- <li>
- <h5><a href="#${ref.category_name}${ref.discriminator_hash}">${ref.type_name} ${ref.title}</a></h5>
- </li>
- % endfor
- </ul>
- % endif
- </td>
- </tr>
- % endfor
- % endfor
- </table>
-</body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.