<commit_before>{% extends 'layout/admin/base.html' %}
{% from 'macros/admin_dashboard.html' import render_bigstats_cell, render_cell %}
{% from 'macros/icons.html' import render_icon %}
{% from 'macros/orga_admin.html' import render_random_age_adjective, render_relative_days_until, render_time_element %}
{% from 'macros/user_admin.html' import render_user_avatar_20_and_link %}
{% set current_page = 'admin_dashboard_global' %}
{% set title = 'Dashboard' %}
{% set layout_main_raw = True %}

{% block head %}
    <link rel="stylesheet" href="{{ url_for('.static', filename='style/admin_dashboard.css') }}">
    <style>
      .dashboard h2 {
        font-size: 0.9rem;
        font-weight: normal;
        opacity: 0.7;
        text-transform: uppercase;
      }

      .parties li {
        line-height: 1.3;
      }
      .parties li + li {
        margin-top: 10px;
      }

      .parties a {
        border-color: transparent;
        border-radius: 3px;
        border-style: solid;
        border-width: 1px;
        display: block;
      }
      .parties a:hover {
        background-color: #eeeeee;
        border-color: #cccccc;
        margin: -5px -10px !important;
        padding: 5px 10px !important;
      }

      .parties time {
        font-size: 0.6875rem; /* 11px / 16px */
        opacity: 0.5;
      }

      .birthdays {
        line-height: 1.7;
      }
      .birthdays .hastoday {
        font-weight: bold;
      }
      .birthdays a {
        font-weight: bold;
      }
      .birthdays time {
        cursor: help;
        border-bottom: #666666 dotted 1px;
      }
    </style>
{%- endblock %}

{% block body %}

  <div class="grid dashboard">
    {%- call render_cell() %}
      <h2>Aktive Parties</h2>
      <ol class="parties">
      {%- for party in active_parties %}
        <li>
          <a href="{{ url_for('admin_dashboard.view_party', party_id=party.id) }}">
            <strong>{{ party.title }}</strong><br>
            <time datetime="{{ party.starts_at|format_date_iso }}">
              {{ party.starts_at|format_date_short }}
              {{- '–' -}}
              {{ party.ends_at|format_date_short }}
            </time>
          </a>
        </li>
      {%- endfor %}
      </ol>
    {%- endcall %}
    {{ render_bigstats_cell(brand_count, 'Marken', href=url_for('brand_admin.index'), icon_name='brand') }}
    {{ 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, 'Benutzer', href=url_for('user_admin.index'), icon_name='users') }}
    {{ render_bigstats_cell(recent_users_count, 'neue Benutzer in den letzten 7 Tagen', href=url_for('user_admin.index'), icon_name='users', color='#008800') }}
    {{ render_bigstats_cell(disabled_user_count, 'nicht aktivierte Benutzer', href=url_for('user_admin.index', only='disabled'), icon_name='users', color='#cc0000') }}
    {%- call render_cell('birthday', 'wider') %}
      <ol class="birthdays">
      {%- for user in orgas_with_next_birthdays %}
        {%- with is_today = user.detail.is_birthday_today %}
        <li{% if is_today %} class="hastoday"{% elif user.detail.days_until_next_birthday > 14 %} class="dimmed"{% endif %}>
          {{ render_user_avatar_20_and_link(user) }}
          {% if is_today %}{{ render_icon('birthday') }}{% endif %}
          {%- set relative_days_label = render_relative_days_until(user) %}
          wird {{ render_time_element(user.detail.date_of_birth, relative_days_label) }}
          {{ render_random_age_adjective() }} {{ user.detail.age if is_today else user.detail.age + 1 }} Jahre alt.
        </li>
        {%- endwith %}
      {%- endfor %}
      </ol>
    {%- endcall %}
  </div>

{%- endblock %}
<commit_msg>Move birthday box next to (long-ish) active party list box on global admin dashboard<commit_after>{% extends 'layout/admin/base.html' %}
{% from 'macros/admin_dashboard.html' import render_bigstats_cell, render_cell %}
{% from 'macros/icons.html' import render_icon %}
{% from 'macros/orga_admin.html' import render_random_age_adjective, render_relative_days_until, render_time_element %}
{% from 'macros/user_admin.html' import render_user_avatar_20_and_link %}
{% set current_page = 'admin_dashboard_global' %}
{% set title = 'Dashboard' %}
{% set layout_main_raw = True %}

{% block head %}
    <link rel="stylesheet" href="{{ url_for('.static', filename='style/admin_dashboard.css') }}">
    <style>
      .dashboard h2 {
        font-size: 0.9rem;
        font-weight: normal;
        opacity: 0.7;
        text-transform: uppercase;
      }

      .parties li {
        line-height: 1.3;
      }
      .parties li + li {
        margin-top: 10px;
      }

      .parties a {
        border-color: transparent;
        border-radius: 3px;
        border-style: solid;
        border-width: 1px;
        display: block;
      }
      .parties a:hover {
        background-color: #eeeeee;
        border-color: #cccccc;
        margin: -5px -10px !important;
        padding: 5px 10px !important;
      }

      .parties time {
        font-size: 0.6875rem; /* 11px / 16px */
        opacity: 0.5;
      }

      .birthdays {
        line-height: 1.7;
      }
      .birthdays .hastoday {
        font-weight: bold;
      }
      .birthdays a {
        font-weight: bold;
      }
      .birthdays time {
        cursor: help;
        border-bottom: #666666 dotted 1px;
      }
    </style>
{%- endblock %}

{% block body %}

  <div class="grid dashboard">
    {%- call render_cell() %}
      <h2>Aktive Parties</h2>
      <ol class="parties">
      {%- for party in active_parties %}
        <li>
          <a href="{{ url_for('admin_dashboard.view_party', party_id=party.id) }}">
            <strong>{{ party.title }}</strong><br>
            <time datetime="{{ party.starts_at|format_date_iso }}">
              {{ party.starts_at|format_date_short }}
              {{- '–' -}}
              {{ party.ends_at|format_date_short }}
            </time>
          </a>
        </li>
      {%- endfor %}
      </ol>
    {%- endcall %}
    {%- call render_cell('birthday', 'wider') %}
      <ol class="birthdays">
      {%- for user in orgas_with_next_birthdays %}
        {%- with is_today = user.detail.is_birthday_today %}
        <li{% if is_today %} class="hastoday"{% elif user.detail.days_until_next_birthday > 14 %} class="dimmed"{% endif %}>
          {{ render_user_avatar_20_and_link(user) }}
          {% if is_today %}{{ render_icon('birthday') }}{% endif %}
          {%- set relative_days_label = render_relative_days_until(user) %}
          wird {{ render_time_element(user.detail.date_of_birth, relative_days_label) }}
          {{ render_random_age_adjective() }} {{ user.detail.age if is_today else user.detail.age + 1 }} Jahre alt.
        </li>
        {%- endwith %}
      {%- endfor %}
      </ol>
    {%- endcall %}
    {{ render_bigstats_cell(brand_count, 'Marken', href=url_for('brand_admin.index'), icon_name='brand') }}
    {{ 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, 'Benutzer', href=url_for('user_admin.index'), icon_name='users') }}
    {{ render_bigstats_cell(recent_users_count, 'neue Benutzer in den letzten 7 Tagen', href=url_for('user_admin.index'), icon_name='users', color='#008800') }}
    {{ render_bigstats_cell(disabled_user_count, 'nicht aktivierte Benutzer', href=url_for('user_admin.index', only='disabled'), icon_name='users', color='#cc0000') }}
  </div>

{%- endblock %}

{'fraction_non_alphanumeric': 0.15458627325208468, 'fraction_numerical': 0.014624759461193073, 'mean_word_length': 2.675624705327676, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6649978', 'n_tokens_mistral': 2797, 'n_tokens_neox': 2573, 'n_words': 475}