data_capture/templates/price_lists/details.html

Summary

Maintainability
Test Coverage
{% extends 'data_capture/base.html' %}

{% block title %}{{ price_list.contract_number }} Price List Details{% endblock %}

{% block body %}
  <div class="container">
    <div class="card">
      <div class="content">
        <p><a href="{% url 'data_capture:price_lists' %}">&laquo; Back to your price lists</a></p>
        <div class=" price-list__status-header">
          <h1 class="h1--deemphasized">Uploaded price list details</h1>
          <h2 class="h2--emphasized">{{ price_list.vendor_name }}</h2>
          {% if price_list.get_status_display == 'approved' %}
            <span class="label label--approved">Approved</span>
            <p>This price list's data will appear in CALC search results.</p>
          {% elif price_list.get_status_display == 'unreviewed' %}
            <span class="label label--pending">Pending review</span>
              <p>This price list has not yet been reviewed by a CALC administrator.</p>
          {% elif price_list.get_status_display == 'rejected' %}
            <span class="label label--rejected">Rejected</span>
            <p>This price list has been rejected by a CALC administrator.</p>
          {% elif price_list.get_status_display == 'retired' %}
            <span class="label label--retired">Retired</span>
            <p>The data from this price list will no longer be displayed in CALC search results.</p>
          {% endif %}
        </div>

        {% include 'data_capture/messages.html' %}
      </div><!--content-->
    </div><!--card-->
    <div class="card">
      <div class="content">
        <div data-edit-contract-details {% if not show_edit_form %}style="display:none;"{% endif %}>
          <form method="post">
            {% csrf_token %}
            {% load frontend %}
            {{ form.non_field_errors }}

            <p>Schedule: {{ price_list.get_schedule_title }}</p>

            {% fieldset form.vendor_name %}
            {% fieldset form.is_small_business %}
            {% fieldset form.contractor_site %}

            <div class="date-range {% if form.contract_start.errors or form.contract_end.errors%}fieldset-error{% endif %}">
              {% fieldset form.contract_start %}
              <p>to</p>
              {% fieldset form.contract_end %}
            </div>

            {% fieldset form.escalation_rate %}

            <div class="form-button-row align-left clearfix">
              <div class="submit-group">
                <button type="submit" class="usa-button">Save changes</button>
              </div>

              <a type="submit" class="usa-button usa-button-secondary" href="{{ details_without_edit_url }}">Discard changes</a>
            </div>
          </form>
        </div>

        {% if not show_edit_form %}
          <div data-contract-details>
            <div class="row">
              <div class="columns eight">
                {% include "price_lists/_details_list.html" %}
              </div>
            </div>

            <div class="row">
              <div class="columns eight">
                <p><a href="{{ details_with_edit_url }}" class="usa-button" data-edit-btn>Edit</a></p>
                {% if price_list.get_status_display == 'approved' %}
                  <p class="help-text">Making changes to these details will remove this price list's data from CALC until an administrator reviews it again.</p>
                {% endif %}
              </div>
            </div>
          </div>
        {% endif %}

        {% if price_list_rows %}
          <div class="row">
            <div class="columns twelve">
              <h3>Valid price list rows</h3>
              {% include 'price_lists/_price_list_rows_table.html' %}
            </div>
          </div>
        {% endif %}

        <div class="row">
          <div class="columns twelve">
            <br />
            <a href="{% url 'data_capture:replace_step_1' id=price_list.pk %}" class="usa-button usa-button-primary">Upload replacement price list</a>
            {% if price_list.get_status_display == 'approved' %}
              <p class="help-text">Uploading a new price list will remove this price list's data from CALC until an administrator reviews it again.</p>
            {% endif %}
          </div>
        </div>

        {% if gleaned_data.invalid_rows %}
          <div class="row">
            <div class="columns twelve">
              <expandable-area>
                <h3>Invalid price list rows</h3>
                <p>These rows are invalid and will not be included in CALC.</p>
                {{ gleaned_data.to_error_table }}
              </expandable-area>
            </div>
          </div>
        {% endif %}
      </div><!--card-->
    </div>
  </div>
{% endblock body %}