calc/templates/admin/index.html

Summary

Maintainability
Test Coverage
{# adapted from https://github.com/django/django/blob/stable/1.8.x/django/contrib/admin/templates/admin/index.html #}
{# Copyright (c) Django Software Foundation and individual contributors. License: https://github.com/django/django/blob/stable/1.8.x/LICENSE #}
{% extends "admin/base_site.html" %}
{% load i18n admin_static %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}{{ block.super }} dashboard{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block content %}
<div id="content-main" class="columns nine">

{% if app_list %}
    {% for app in app_list %}
      <div class="app-{{ app.app_label }} module">
        {% if app.app_label == 'auth' %}
          <h2>Manage users and permissions</h2>
        {% elif app.app_label == 'sites' %}
          <h2>Update site settings</h2>
          <p class="usa-alert usa-alert-warning">This section is governed by the <a href="https://docs.djangoproject.com/en/2.0/ref/contrib/sites/">Django Sites Framework</a>, and enables emails sent from this system to reference the correct absolute base URL. You will probably never need to touch this unless the production database gets wiped or the project's URL changes.</p>
        {% elif app.app_label == 'data_capture' %}
          <h2>Manage pricing data</h2>
          <ul class="usa-accordion">
            <li>
              <button class="usa-accordion-button" aria-expanded="false" aria-controls="admin-options">
                How do I manage pricing data?
              </button>
              <div id="admin-options" class="usa-accordion-content">
                <ul class="usa-unstyled-list">
                  <li>
                      <p><strong>Reviewing and excluding rows of data</strong></p>
                      <p>You can review all rows of submitted (but not yet approved or rejected) pricing data to ensure that the data are accurate. If anything seems wrong or unusual, you can hide or "mute" those rows of data to prevent them from showing up in CALC's data explorer. (Note that this view shows data from multiple submitted price lists.) </p>
                  </li>
                  <li>
                    <p><strong>Editing, approving, and publishing new data</strong></p>
                    <p>CALC refers to new, unpublished price lists as "unreviewed." You can edit unreviewed price list data, including vendor details and price list rows, by clicking on the contract number of an unreviewed price list.</p>
                    <p>Once you have muted any undesirable rows and edited any vendor or pricing data that require it, view unreviewed price lists to approve or reject pricing data. (You can approve a rejected price list later if you reject a list by mistake!)</p>
                  </li>
                  <li>
                    <p><strong>Removing data</strong></p>
                    <p>You can view all approved price lists and choose the price list(s) you want to remove from CALC. This is referred to as "retiring" a price list. The price list will remain available in the admin view, but will no longer be displayed to users in the data explorer.</p>
                  </li>
                  <li>
                    <p><strong>Editing data that has already been published</strong></p>
                    <p>First, remove the data from public use by retiring it as explained above. Then find the price list among the retired price lists and click on the contract number of the desired list. Make any necessary edits, and then return to the retired price lists to approve and re-publish the pricing data.</p>
                  </li>
                  <li>
                    <p><strong>Troubleshooting data submission attempts</strong></p>
                    <p>Attempted price list submissions are submissions that never made it all the way to completion. When you view these, you can "replay" submission attempts to try to see what glitches the user submitting the data might have hit.</p>
                  </li>
                </ul>
              </div>
          </ul>
        {% endif %}
      <table>
      <caption>
          <a href="{{ app.app_url }}" class="section" title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}">{{ app.name }}</a>
      </caption>
      {% for model in app.models %}
          <tr class="model-{{ model.object_name|lower }}">
          {% if model.admin_url %}
              <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
          {% else %}
              <th scope="row">{{ model.name }}</th>
          {% endif %}

          {% if model.add_url %}
              <td><a href="{{ model.add_url }}" class="addlink">{% trans 'Add' %}</a></td>
          {% else %}
              <td>&nbsp;</td>
          {% endif %}

          {% if model.admin_url %}
              <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
          {% else %}
              <td>&nbsp;</td>
          {% endif %}
          </tr>
      {% endfor %}
      </table>
      </div>
    {% endfor %}
{% else %}
    <p>{% trans "You don't have permission to edit anything." %}</p>
{% endif %}
</div>
{% endblock %}

{% block sidebar %}
<div id="content-related" class="sidebar columns three">
    <div class="module" id="recent-actions-module">
        <h2>{% trans 'Recent Actions' %}</h2>
        <h3>{% trans 'My Actions' %}</h3>
            {% load log %}
            {% get_admin_log 10 as admin_log for_user user %}
            {% if not admin_log %}
            <p>{% trans 'None available' %}</p>
            {% else %}
            <ul class="actionlist">
            {% for entry in admin_log %}
            <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
                {% if entry.is_deletion or not entry.get_admin_url %}
                    {{ entry.object_repr }}
                {% else %}
                    <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
                {% endif %}
                <br/>
                {% if entry.content_type %}
                    <span class="mini quiet">{% filter capfirst %}{{ entry.content_type }}{% endfilter %}</span>
                {% else %}
                    <span class="mini quiet">{% trans 'Unknown content' %}</span>
                {% endif %}
            </li>
            {% endfor %}
            </ul>
            {% endif %}
    </div>
</div>
{% endblock %}