cubicweb/pyramid/debug_toolbar_templates/cw.dbtmako
author Simon Chabot <simon.chabot@logilab.fr>
Thu, 12 Mar 2020 15:37:59 +0100
changeset 12929 edfee40475bb
parent 12776 3cbcbaead477
permissions -rw-r--r--
[debugtoolbar] Do not render CW controller panel when no controller got collected This can happen on pure pyramid applications for instance.

% if controller:

<h3>Controller</h3>

<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th>Kind</th>
            <th>Request</th>
            <th>Path</th>
            <th>Controller</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>${controller["kind"]}</td>
            <td>${controller["request"]} ${source_code_url(controller["request"]) | n}</td>
            <td>${controller["path"]}</td>
            <td>${controller["controller"]} ${source_code_url(controller["controller"]) | n}</td>
        </tr>
    </tbody>
</table>

<h3>Configuration</h3>

<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th>Key</th>
            <th>Value</th>
            <th>Default</th>
            <th>Help</th>
        </tr>
    </thead>
    <tbody>
        % for key, metadata in sorted(controller["config"].options, key=lambda x: x[0]):
            % if hasattr(controller["config"].config, key.replace("-", "_")):
            <% value = getattr(controller["config"].config, key.replace("-", "_")) %>
            <tr>
                <td>${key}</td>
                % if value != metadata["default"]:
                <td><b>${value}</b></td>
                % else:
                <td>${value}</td>
                % endif
                <td>${metadata["default"]}</td>
                <td>${metadata["help"]}</td>
            </tr>
            % endif
        % endfor
    </tbody>
</table>



<h3>Useful links</h3>

<!-- link on the default home as an admin -->
<ul>
    <li><a href="/siteconfig">site configuration</a></li>
    <li><a href="/schema">data model schema</a></li>
    <li><a href="/cwuser">users and groups</a></li>
    <li><a href="/cwsource">data sources</a></li>
    <li><a href="/siteinfo">Site information</a></li>
</ul>
% else:
<p>No controller store got collected.</p>
% endif