{# Grants: one line to read, and the editor inside a form (see grants.py). Roles: as tags, and as checkboxes to give. #} {% macro grants_of(grants, names) %}{% for grant in grants %}{{ grant_summary(grant, names) }}{% else %}—{% endfor %}{% endmacro %} {% macro role_tags(roles) %}{% for role in roles %}{{ role }} {% else %}—{% endfor %}{% endmacro %} {% macro role_checks(choices, held) %}
Roles
{% for role in choices %}{% endfor %}
{% endmacro %} {% macro grant_summary(grant, names) %}
on {% for account in grant.accounts %}{{ "every account" if account == "*" else names.get(account, account) }} {% endfor %} may {% for right in grant.allow %}{{ right }} {% endfor %} {% if grant.recipients is not none %}sending to {{ grant.recipients | join(", ") }}{% endif %} {% if grant.max_sends_per_day is not none %}at most {{ grant.max_sends_per_day }} mails a day{% endif %}
{% endmacro %} {% macro grant_editor(rows, account_choices, groups, group_ops) %} {% for row in rows %} {% set i = loop.index0 %} {% set adding = loop.last %}
{{ "Add a grant" if adding else "Grant " ~ loop.index }}
Accounts
{% for id, email in account_choices %} {% endfor %}
Rights {% for caption, names in groups %} {{ caption }}
{% for group in names %} {% endfor %}
{% endfor %}
Operation names, beyond the groups.
From one account, in any 24 hours. Empty: no limit.
One per line. Empty: to anyone.
{% if not adding %}{% endif %}
{% endfor %} {% endmacro %}