byceps/byceps

View on GitHub
byceps/blueprints/admin/orga/templates/macros/admin/orga.html

Summary

Maintainability
Test Coverage
{% macro render_relative_days_until(days_until_next_birthday) %}
  {%- set is_soon = (days_until_next_birthday <= 7) %}

  {%- if is_soon %}<strong>{% endif %}

  {%- if days_until_next_birthday == 0 -%}
  {{ _('today') }}
  {%- elif days_until_next_birthday == 1 -%}
  {{ _('tomorrow') }}
  {%- else -%}
  {{ _('in %(days)s days', days=days_until_next_birthday) }}
  {%- endif %}

  {%- if is_soon %}</strong>{% endif %}
{%- endmacro %}


{% macro render_time_element(date, label) -%}
  <time datetime="{{ date.isoformat() }}" title="{{ date|dateformat }}">{{ label }}</time>
{%- endmacro %}


{% macro render_random_age_adjective() %}
  {%- set adjectives = [
    'agile',
    'atemberaubende',
    'bemerkenswerte',
    'beneidenswerte',
    'fantastische',
    'beschauliche',
    'bombastische',
    'eindrucksvolle',
    'epische',
    'erbarmungslose',
    'erfrischende',
    'erheiternde',
    'erquickende',
    'fantastische',
    'ganze',
    'grandiose',
    'herzallerliebste',
    'kolossale',
    'krasse',
    'legendäre',
    'niedliche',
    'passable',
    'phänomenale',
    'possierliche',
    'quirlige',
    'schmeichelhafte',
    'sensationelle',
    'sportliche',
    'überschaubare',
    'umwerfende',
    'unbegreifliche',
    'unbeschreibliche',
    'unbezahlbare',
    'unfassbare',
    'unglaubliche',
    'wahnsinnige',
    'wilde',
    'zarte',
    'zierliche',
    'zuckersüße',
  ] %}
  {{- adjectives|random }}
{%- endmacro %}