559Labs/django-dtg-store-manager

View on GitHub
src/business/templates/app_creative/home.html

Summary

Maintainability
Test Coverage
{% extends "base.html" %}
{% load staticfiles crispy_forms_tags humanize %}
{% load render_table from django_tables2 %}
{% block title %}{{ block.super }}{{ active_apptitle }}{% endblock %}

{% block navbar-left %}
  {% include "_navbar.html" %}
{% endblock %}

{% block navbar-secondary %}{% endblock %}

{% block container %}
<form method="post">
  <div class="container business-head">
    <div class="row">
      <div class="col-md-12">
        <h3><small><span class="glyphicon glyphicon-picture"></span></small>
          Creative Management {% if active_collection %}<small>/ {{ active_collection }}</small>{% endif %}
          <span class="pull-right">
            <div class="btn-group" role="group">
              <a href="{% url 'business:app_creative_collection_create' %}" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> New</a>
              {% if active_collection %}
              <a href="{% url 'business:app_creative_collection_update' active_collection.pk %}" role="button" class="btn btn-default btn-sm">
                <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit</a>
              {% endif %}
            </div>
            {% if active_collection %}
            <div class="btn-group" role="group">
              <a href="{% url 'business:app_creative_design_create' %}?collection={{ active_collection.pk }}" role="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> New Design</a>
            </div>
            <div class="btn-group" role="group">
              <a href="{% url 'business:app_creative_layout_create' %}?collection={{ active_collection.pk }}" role="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> New Layout</a>
            </div>
            {% endif %}
          </span>
        </h3>
      </div>
    </div>
  </div>
  <div class="container business-body">
    {% if active_collection %}
    <div class="row">
      <div class="col-md-3" id="navSidebar">
        <div class="list-group">
          {% for cc in creativecollections %}
          <a href="{% url 'business:app_creative_home' collection=cc.pk %}" class="list-group-item {% if active_collection == cc %} active{% endif %}">
            <span class="badge" data-toggle="tooltip" data-placement="bottom" title="{{ cc.num_designs }} Designs / {{ cc.num_layouts }} Layouts">
              {{ cc.num_designs }} / {{ cc.num_layouts }}</span>
            {{ cc }}
          </a>
          {% endfor %}
        </div>
      </div>
      <div class="col-md-9" id="pageContent">

        <ul class="nav nav-tabs" role="tablist">
          <li role="presentation" class="active"><a href="#detail" aria-controls="detail" role="tab" data-toggle="tab">About</a></li>
          <li role="presentation"><a href="#designs" aria-controls="designs" role="tab" data-toggle="tab">Designs ({{ active_collection.num_designs }})</a></li>
          <li role="presentation"><a href="#layouts" aria-controls="layouts" role="tab" data-toggle="tab">Layouts ({{ active_collection.num_layouts }})</a></li>
        </ul>

        <div class="tab-content">

          <div role="tabpanel" class="tab-pane active" id="detail">
            <table class="table table-striped">
              <tr>
                <th>Name</th>
                <td>{{ active_collection.name }}</td>
              </tr>
              <tr>
                <th>SKU Code Base</th>
                <td>{{active_collection.code}}</td>
              </tr>
              <tr>
                <th>Brand</th>
                <td><a href="{% url 'business:app_store_brand_update' pk=active_collection.bzbrand.pk %}">{{active_collection.bzbrand}}</a></td>
              </tr>
              <tr>
                <th>Designs</th>
                <td>{{active_collection.num_designs|apnumber|title}}</td>
              </tr>
              <tr>
                <th>Layouts</th>
                <td>{{active_collection.num_layouts|apnumber|title}}</td>
              </tr>
              <tr>
                <th>Created</th>
                <td>{{ active_collection.date_added|naturaltime|title }}</td>
              </tr>
              <tr>
                <th>Updated</th>
                <td>{{ active_collection.date_updated|naturaltime|title }}</td>
              </tr>
            </table>
          </div>

          <div role="tabpanel" class="tab-pane" id="designs">
            {% render_table table_designs %}
          </div>

          <div role="tabpanel" class="tab-pane" id="layouts">
            {% render_table table_layouts %}
          </div>

        </div>
      </div>
    </div>
    {% else %}
    <h4>No Collections Found</h4>
    <p>Get started by clicking that little "+New" button above.</p>
    {% endif %}

  </div>
</form>
{% endblock %}

{% block scripts %}
<script>$(function () { $('[data-toggle="tooltip"]').tooltip() })</script>
{% endblock %}