{% macro icon(name, cls="") %}{% endmacro %} {#- Start, pause, stop and restart of a container website. In the list the buttons are icons. -#} {% macro power(site, list=false) %} {%- set off = {"paused": "Paused", "stopped": "Stopped"} -%} {%- for act, label, ic, busy, ask in ( ("start", "Resume" if site.power == "paused" else "Start", "play", "Starting…", ""), ("restart", "Restart", "refresh", "Restarting…", ""), ("pause", "Pause", "pause", "Pausing…", "Pause " ~ site.domain ~ "? Visitors see a “temporarily unavailable” page until you resume it. Its databases keep running."), ("stop", "Stop", "stop", "Stopping…", "Stop " ~ site.domain ~ "? Visitors see a “temporarily unavailable” page. The website, its databases and its scheduled tasks are off until you start it.")) -%} {%- if (act == "start" and site.power) or (act in ("restart", "pause") and not site.power) or (act == "stop" and site.power != "stopped") -%}
{{ csrf_field() }}{% if list %}{% else %}{% endif %}
{%- endif -%} {%- endfor -%} {% endmacro %} {% macro csrf_field() %}{% endmacro %} {% macro owner_field(accounts, selected="", label="Account") %} {% if is_admin %}
{% endif %} {% endmacro %} {% macro owner_switch(accounts, owner, base) %} {% if is_admin and accounts %}
{% endif %} {% endmacro %} {% macro empty(title, text) %}

{{ title }}

{{ text }}

{{ caller() if caller else "" }}
{% endmacro %} {% macro state_window(active) %} {{ {'active': 'Running', 'inactive': 'Stopped', 'failed': 'Failed', 'activating': 'Starting', 'deactivating': 'Stopping'}.get(active, active|capitalize) }} {% endmacro %} {% macro meter(used, total, warn=75, bad=90) %} {% set p = pct(used, total) %}
{% endmacro %} {% macro copy(text) %}{% endmacro %}