~homeworkprod/byceps

e98920ed0c4e96fb632d9ec4e7b774119f03e488 — Jochen Kupperschmidt a month ago 6c8c693
Display current sites and parties on admin dashboards as separate cells
M byceps/blueprints/admin/dashboard/templates/admin/dashboard/_active_parties.html => byceps/blueprints/admin/dashboard/templates/admin/dashboard/_active_parties.html +17 -12
@@ 1,25 1,30 @@
{% from 'macros/admin/brand.html' import render_brand_avatar %}
{% from 'macros/admin/dashboard.html' import render_cell %}
{% from 'macros/datetime.html' import render_date %}


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

<div class="grid">

{%- if active_parties %}
<ol class="fancy-list">
  {%- for party in active_parties %}
  <li>
    <a href="{{ url_for('admin_dashboard.view_party', party_id=party.id) }}">
      <div style="float: left; margin-right: 0.5rem;">{{ render_brand_avatar(party.brand, '32') }}</div>
      <div class="item">{{ party.title }}</div>
      <div class="supplement">{{ render_date(party.starts_at, smart=False) }}–{{ render_date(party.ends_at, smart=False) }}</div>
    </a>
  </li>
    {%- call render_cell(href=url_for('admin_dashboard.view_party', party_id=party.id)) %}
  <div style="float: left; margin-right: 0.5rem;">{{ render_brand_avatar(party.brand, '32') }}</div>
  <div>{{ party.title }}</div>
  <div class="supplement">{{ render_date(party.starts_at, smart=False) }}–{{ render_date(party.ends_at, smart=False) }}</div>
    {%- endcall %}
  {%- endfor %}
</ol>
{%- else %}
<p>{{ 'keine aktiven Partys'|dim }}</p>
  {%- call render_cell() %}
  <div style="display: grid; height: 100%; place-items: center;">{{ 'Keine aktiven Partys'|dim }}</div>
  {%- endcall %}
{%- endif %}

{%- if brand|default %}
<p style="float: right;"><a href="{{ url_for('party_admin.index_for_brand', brand_id=brand.id) }}">alle Partys &rarr;</a></p>
  {%- call render_cell(href=url_for('party_admin.index_for_brand', brand_id=brand.id)) %}
  <div style="display: grid; height: 100%; place-items: center;">Alle Partys &rarr;</div>
  {%- endcall %}
{%- endif %}

</div>

M byceps/blueprints/admin/dashboard/templates/admin/dashboard/_current_sites.html => byceps/blueprints/admin/dashboard/templates/admin/dashboard/_current_sites.html +17 -12
@@ 1,22 1,27 @@
{% from 'macros/admin/brand.html' import render_brand_avatar %}
{% from 'macros/admin/dashboard.html' import render_cell %}


<h2>Aktuelle Sites</h2>
<div class="dashboard-section-title">Aktuelle Sites</div>

<div class="grid">

{%- if current_sites %}
<ol class="fancy-list">
  {%- for site in current_sites|sort(attribute='title') %}
  <li>
    <a href="{{ url_for('site_admin.view', site_id=site.id) }}">
      <div style="float: left; margin-right: 0.5rem;">{{ render_brand_avatar(site.brand, '32') }}</div>
      <div class="item">{{ site.title }}</div>
      <div class="supplement">{{ site.server_name }}</div>
    </a>
  </li>
    {%- call render_cell(href=url_for('site_admin.view', site_id=site.id)) %}
  <div style="float: left; margin-right: 0.5rem;">{{ render_brand_avatar(site.brand, '32') }}</div>
  <div>{{ site.title }}</div>
  <div class="supplement">{{ site.server_name }}</div>
    {%- endcall %}
  {%- endfor %}
</ol>
{%- else %}
<p>{{ 'keine aktuellen Sites'|dim }}</p>
  {%- call render_cell() %}
  <div style="display: grid; height: 100%; place-items: center;">{{ 'Keine aktuellen Sites'|dim }}</div>
  {%- endcall %}
{%- endif %}

<p style="float: right;"><a href="{{ url_for('site_admin.index') }}">alle Sites &rarr;</a></p>
{%- call render_cell(href=url_for('site_admin.index')) %}
  <div style="display: grid; height: 100%; place-items: center;">Alle Sites &rarr;</div>
{%- endcall %}

</div>

M byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_brand.html => byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_brand.html +5 -5
@@ 11,13 11,13 @@

{% block body %}

  <div class="grid dashboard">
    {%- call render_cell() %}
{%- include 'admin/dashboard/_current_sites.html' %}
    {%- endcall %}
    {%- call render_cell() %}

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

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

  <div class="grid dashboard">
    {{ render_bigstats_cell(party_count, 'Partys', href=url_for('party_admin.index_for_brand', brand_id=brand.id), icon_name='date') }}
    {{ render_bigstats_cell(orga_count, 'Organisatoren', href=url_for('orga_admin.persons_for_brand', brand_id=brand.id), icon_name='users') }}
    {%- if newsletter_list %}

M byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_global.html => byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_global.html +6 -6
@@ 10,16 10,16 @@

{% block body %}

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

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

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

  <div class="grid dashboard">
    {%- call render_cell('brand') %}
{%- include 'admin/dashboard/_brands.html' %}
    {%- endcall %}
    {%- call render_cell() %}
{%- include 'admin/dashboard/_current_sites.html' %}
    {%- endcall %}
    {%- call render_cell() %}
{%- include 'admin/dashboard/_active_parties.html' %}
    {%- endcall %}
    {{ render_bigstats_cell(party_count, 'Partys', href=url_for('party_admin.index'), icon_name='date') }}
    {{ render_bigstats_cell(orga_count, 'Organisatoren', href=url_for('orga_admin.persons'), icon_name='users') }}
    {{ render_bigstats_cell(user_count|separate_thousands, 'Benutzer', href=url_for('user_admin.index'), icon_name='users') }}

M byceps/static/style/admin_dashboard.css => byceps/static/style/admin_dashboard.css +11 -1
@@ 1,7 1,17 @@
.dashboard-section-title {
  color: #666666;
  font-size: 0.75rem; /* 12px / 16px */
  margin-bottom: 1rem;
  margin-left: 0.5rem;
  margin-top: 0;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: var(--inner-gutter);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: var(--inner-gutter);
}

.grid .cell.higher {


@@ 87,7 97,7 @@
  border-color: #cccccc;
}

.fancy-list .supplement {
.supplement {
  color: #999999;
  font-size: 0.6875rem; /* 11px / 16px */
  margin-top: 0.15rem;