Skip to content

Commit

Permalink
first draft at prettifying introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
blaflamme committed Dec 9, 2011
1 parent 829799d commit e42e243
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 77 deletions.
85 changes: 53 additions & 32 deletions 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
6 changes: 5 additions & 1 deletion pyramid_debugtoolbar/static/css/toolbar.css
Expand Up @@ -171,7 +171,7 @@
overflow:auto;
}

#pDebug tr.pDebugOdd {
#pDebug tr.pDebugEven {
background-color:#f5f5f5;
}

Expand Down Expand Up @@ -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;
Expand Down
44 changes: 0 additions & 44 deletions pyramid_debugtoolbar/templates/introspection_index.mako

This file was deleted.

0 comments on commit e42e243

Please sign in to comment.