~homeworkprod/byceps-whereabouts

a1881d440ba10658674f24b5409e2283d9505bbf — Jochen Kupperschmidt 2 months ago df54397 main
Adjust admin UI to new style classes
M byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/create_form.html => byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/create_form.html +1 -1
@@ 11,7 11,7 @@

{% block body %}

<h1>{{ page_title }}</h1>
<h1 class="title">{{ page_title }}</h1>

<form action="{{ url_for('.create', party_id=party.id) }}" method="post">
  <div class="box">

M byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/index.html => byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/index.html +46 -42
@@ 8,61 8,65 @@
{% set page_title = 'Orga-Verbleib' %}

{% block head %}
    <meta http-equiv="refresh" content="10">
    <style>
    .grid.statuses {
      --column-min-width: 8rem;
    }
<meta http-equiv="refresh" content="10">
<style>
.grid.statuses {
  --column-min-width: 8rem;
}

    .statuses .row {
      gap: 0.5rem;
    }
    </style>
.grid:is(.statuses, .whereabouts) {
  gap: 1.5rem;
}

.statuses .row {
  gap: 0.5rem;
}
</style>
{%- endblock %}

{% block body %}

  <div class="row row--space-between">
    <div>
      <h1>{{ page_title }}</h1>
    </div>
    {%- if has_current_user_permission('whereabouts.administrate') %}
    <div>
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.create_form', party_id=party.id) }}">{{ render_icon('add') }} <span>{{ _('Add') }}</span></a>
      </div>
<div class="block row row--space-between">
  <div>
    <h1 class="title">{{ page_title }}</h1>
  </div>
  {%- if has_current_user_permission('whereabouts.administrate') %}
  <div>
    <div class="button-row is-right-aligned">
      <a class="button" href="{{ url_for('.create_form', party_id=party.id) }}">{{ render_icon('add') }} <span>{{ _('Add') }}</span></a>
    </div>
    {%- endif %}
  </div>
  {%- endif %}
</div>

  {%- if whereabouts_list %}
    <div class="grid" style="--column-min-width: 24rem;">
    {%- for whereabouts in whereabouts_list|sort(attribute='position') %}
      {%- with statuses = recent_statuses_by_whereabouts[whereabouts.id] %}
        {%- if statuses or not whereabouts.hide_if_empty %}
      <div>
        <h2>{{ whereabouts.description }} {{ render_extra_in_heading(statuses|length) }}</h2>
{%- if whereabouts_list %}
  <div class="block grid whereabouts" style="--column-min-width: 24rem;">
  {%- for whereabouts in whereabouts_list|sort(attribute='position') %}
    {%- with statuses = recent_statuses_by_whereabouts[whereabouts.id] %}
      {%- if statuses or not whereabouts.hide_if_empty %}
    <div>
      <h2 class="title">{{ whereabouts.description }} {{ render_extra_in_heading(statuses|length) }}</h2>

          {%- if statuses %}
        {%- if statuses %}
{{ render_statuses(statuses) }}
          {%- else %}
        <div class="box dimmed">{{ _('nobody') }}</div>
          {%- endif %}
      </div>
        {%- else %}
      <div class="box dimmed">{{ _('nobody') }}</div>
        {%- endif %}
      {%- endwith %}
    {%- endfor %}
    </div>
      {%- endif %}
    {%- endwith %}
  {%- endfor %}
  </div>

    {% if stale_statuses %}
    <h2>🙁 Long time no see</h2>
  {% if stale_statuses %}
  <h2 class="title">🙁 Long time no see</h2>
{{ render_statuses(stale_statuses) }}
    {% endif %}
  {%- else %}
  <div class="box">
    <div class="dimmed-box centered">{{ _('No whereabouts defined.') }}</div>
  </div>
  {%- endif %}
  {% endif %}
{%- else %}
<div class="box">
  <div class="dimmed-box centered">{{ _('No whereabouts defined.') }}</div>
</div>
{%- endif %}

{%- endblock %}



@@ 75,7 79,7 @@
{%- endmacro %}

{% macro render_status(status) -%}
  <div class="row">
  <div class="block row">
    <div>{{ render_user_avatar(status.user, size=40) }}</div>
    <div>
      {{ render_user_admin_link(status.user, disguised=true) }}<br>

M byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/user_sound_create_form.html => byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/user_sound_create_form.html +1 -1
@@ 11,7 11,7 @@

{% block body %}

<h1>{{ page_title }}</h1>
<h1 class="title">{{ page_title }}</h1>

<form action="{{ url_for('.user_sound_create') }}" method="post">
  <div class="box">

M byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/user_sound_index.html => byceps/blueprints/admin/whereabouts/templates/admin/whereabouts/user_sound_index.html +27 -27
@@ 9,42 9,42 @@

{% block body %}

<h1>{{ page_title }}</h1>
<h1 class="title">{{ page_title }}</h1>

<div class="row row--space-between">
<div class="block row row--space-between">
  <div>
    <h2>User Sounds {{ render_extra_in_heading(user_sounds|length) }}</h2>
    <h2 class="title">User Sounds {{ render_extra_in_heading(user_sounds|length) }}</h2>
  </div>
  {%- if has_current_user_permission('whereabouts.administrate') %}
  <div>
    <div class="button-row button-row--right">
      <a class="button" href="{{ url_for('.user_sound_create_form') }}">{{ render_icon('add') }} <span>{{ _('Add sound') }}</span></a>
    <div class="button-row is-right-aligned">
      <a class="button is-compact" href="{{ url_for('.user_sound_create_form') }}">{{ render_icon('add') }} <span>{{ _('Add sound') }}</span></a>
    </div>
  </div>
  {%- endif %}
</div>

  {%- if user_sounds %}
  <table class="itemlist itemlist--v-centered">
    <thead>
      <tr>
        <th>{{ _('User') }}</th>
        <th>{{ _('Sound filename') }}</th>
      </tr>
    </thead>
    <tbody>
      {%- for user_sound in user_sounds|sort(attribute='user.screen_name') %}
      <tr>
        <td>{{ render_user_avatar_and_admin_link(user_sound.user, size=32) }}</td>
        <td>{{ user_sound.filename|fallback }}</td>
      </tr>
      {%- endfor %}
    </tbody>
  </table>
  {%- else %}
  <div class="box">
    <div class="dimmed-box centered">{{ _('None defined') }}</div>
  </div>
  {%- endif %}
{%- if user_sounds %}
<table class="itemlist is-vcentered is-wide">
  <thead>
    <tr>
      <th>{{ _('User') }}</th>
      <th>{{ _('Sound filename') }}</th>
    </tr>
  </thead>
  <tbody>
    {%- for user_sound in user_sounds|sort(attribute='user.screen_name') %}
    <tr>
      <td>{{ render_user_avatar_and_admin_link(user_sound.user, size=32) }}</td>
      <td>{{ user_sound.filename|fallback }}</td>
    </tr>
    {%- endfor %}
  </tbody>
</table>
{%- else %}
<div class="box">
  <div class="dimmed-box centered">{{ _('None defined') }}</div>
</div>
{%- endif %}

{%- endblock %}