~homeworkprod/byceps

4c9462969e18c02a20473770c01c840a48241470 — Jochen Kupperschmidt a month ago 1a260ba
Shop active shops on global admin dashboard
A byceps/blueprints/admin/dashboard/templates/admin/dashboard/_active_shops.html => byceps/blueprints/admin/dashboard/templates/admin/dashboard/_active_shops.html +27 -0
@@ 0,0 1,27 @@
{% from 'macros/admin/brand.html' import render_brand_avatar %}
{% from 'macros/admin/dashboard.html' import render_cell %}
{% from 'macros/datetime.html' import render_date %}
{% from 'macros/misc.html' import render_tag %}


<div class="dashboard-section-title">Aktive Shops</div>

<div class="grid">

{%- if active_shops %}
  {%- for shop in active_shops %}
    {%- call render_cell(href=url_for('shop_shop_admin.view', shop_id=shop.id)) %}
  <div>{{ shop.title }}</div>
    {%- endcall %}
  {%- endfor %}
{%- else %}
  {%- call render_cell() %}
  <div style="display: grid; height: 100%; place-items: center;">{{ 'Keine aktiven Shops'|dim }}</div>
  {%- endcall %}
{%- endif %}

{%- call render_cell(href=url_for('shop_shop_admin.index')) %}
  <div style="display: grid; height: 100%; place-items: center;">Alle Shops &rarr;</div>
{%- endcall %}

</div>

M byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_global.html => byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_global.html +2 -0
@@ 14,6 14,8 @@

{%- include 'admin/dashboard/_active_parties.html' %}

{%- include 'admin/dashboard/_active_shops.html' %}

<div class="dashboard-section-title">√úbersicht</div>

  <div class="grid dashboard">

M byceps/blueprints/admin/dashboard/views.py => byceps/blueprints/admin/dashboard/views.py +4 -0
@@ 24,6 24,7 @@ from ....services.seating import (
    area_service as seating_area_service,
    seat_service,
)
from ....services.shop.shop import service as shop_service
from ....services.site import service as site_service
from ....services.ticketing import ticket_service
from ....services.user import stats_service as user_stats_service


@@ 57,6 58,8 @@ def view_global():
        for party in active_parties
    ]

    active_shops = shop_service.get_active_shops()

    brands = brand_service.get_all_brands()
    party_count = party_service.count_parties()



@@ 79,6 82,7 @@ def view_global():
    return {
        'current_sites': current_sites,
        'active_parties_with_ticket_stats': active_parties_with_ticket_stats,
        'active_shops': active_shops,

        'brands': brands,
        'party_count': party_count,