byceps/byceps

View on GitHub
byceps/blueprints/admin/shop/shop/templates/admin/shop/shop/dashboard.html

Summary

Maintainability
Test Coverage
{% extends 'layout/admin/base.html' %}
{% from 'macros/admin/dashboard.html' import render_bigstats_cell %}
{% from 'macros/admin/shop/order.html' import render_order_payment_state %}
{% from 'macros/misc.html' import render_tag %}
{% set current_page = 'shop_shop_admin_dashboard' %}
{% set current_page_brand = brand %}
{% set current_page_shop = shop %}
{% set page_title = [_('Dashboard'), _('Shop'), brand.title] %}

{% block head %}
    <link rel="stylesheet" href="{{ url_for('static', filename='style/admin_dashboard.css') }}">
{%- endblock %}

{% block body %}

  <div class="grid">
    {{ render_bigstats_cell(order_counts_by_payment_state[PaymentState.open]|numberformat, ngettext('order', 'orders', order_counts_by_payment_state[PaymentState.open]) ~ '<br>'|safe ~ render_order_payment_state(PaymentState.open), icon_name='pending', href=url_for('shop_order_admin.index_for_shop', shop_id=shop.id, only_payment_state='open'), additional_classes='cell--fitted') }}
    {{ render_bigstats_cell(order_counts_by_payment_state[PaymentState.paid]|numberformat, ngettext('order', 'orders', order_counts_by_payment_state[PaymentState.paid]) ~ '<br>'|safe ~ render_order_payment_state(PaymentState.paid), icon_name='success', href=url_for('shop_order_admin.index_for_shop', shop_id=shop.id, only_payment_state='paid'), additional_classes='cell--fitted') }}
    {{ render_bigstats_cell(cancellation_request_quantities_by_state.open|numberformat, 'Stornierungsanfrage(n)<br>'|safe ~ render_tag(_('open'), class='color-info'), icon_name='pending', href=url_for('shop_cancellation_request_admin.index', shop_id=shop.id), additional_classes='cell--fitted') }}
    {{ render_bigstats_cell(cancellation_request_quantities_by_state.accepted|numberformat, 'Stornierungsanfrage(n)<br>'|safe ~ render_tag(_('accepted'), class='color-success'), icon_name='success', href=url_for('shop_cancellation_request_admin.index', shop_id=shop.id), additional_classes='cell--fitted') }}
  </div>

  <h2>{{ _('Recent Events') }}</h2>
{% include 'admin/shop/order/_view_events.html' %}

{%- endblock %}