{% macro render_releases_edit(releases, package) %} {% for rel in releases %} {{ rel.title }} {% if rel.min_rel and rel.max_rel %} [MT {{ rel.min_rel.name }}-{{ rel.max_rel.name }}] {% elif rel.min_rel %} [MT {{ rel.min_rel.name }}+] {% elif rel.max_rel %} [MT ≤{{ rel.max_rel.name }}] {% endif %} {{ rel.file_size }}
{% if rel.commit_hash %} [{{ rel.commit_hash | truncate(5, end='') }}] {% endif %} {{ _("created %(date)s", date=rel.created_at | date) }}. {% endfor %} {% endmacro %} {% macro render_releases_download(releases, package, current_user) %} {% for rel in releases %} {% if rel.approved or package.check_perm(current_user, "MAKE_RELEASE") or rel.check_perm(current_user, "APPROVE_RELEASE") %} {{ rel.title }} {% if rel.min_rel and rel.max_rel %} [MT {{ rel.min_rel.name }}-{{ rel.max_rel.name }}] {% elif rel.min_rel %} [MT {{ rel.min_rel.name }}+] {% elif rel.max_rel %} [MT ≤{{ rel.max_rel.name }}] {% endif %} {{ rel.file_size }}
{% if rel.commit_hash %} [{{ rel.commit_hash | truncate(5, end='') }}] {% endif %} {{ _("created %(date)s", date=rel.created_at | date) }}. {% endif %} {% endfor %} {% endmacro %} {% macro render_releases(releases, package, current_user) -%} {% for rel in releases %}
{% if not rel.task_id and not rel.approved and rel.check_perm(current_user, "APPROVE_RELEASE") %} {{ _("Edit / Approve") }} {% else %} {{ _("Edit") }} {% endif %} {% if not rel.approved %}{% endif %} {{ rel.title }} {% if rel.min_rel and rel.max_rel %} [MT {{ rel.min_rel.name }}-{{ rel.max_rel.name }}] {% elif rel.min_rel %} [MT {{ rel.min_rel.name }}+] {% elif rel.max_rel %} [MT ≤{{ rel.max_rel.name }}] {% endif %} {{ rel.file_size }}
{% if rel.commit_hash %} [{{ rel.commit_hash | truncate(5, end='') }}] {% endif %} {{ _("created %(date)s", date=rel.created_at | date) }}. {% if (package.check_perm(current_user, "MAKE_RELEASE") or rel.check_perm(current_user, "APPROVE_RELEASE")) and rel.task_id %} {{ _("Importing...") }} {% elif not rel.approved %} {{ _("Waiting for approval.") }} {% endif %} {% if not rel.approved %}{% endif %}
{% else %}
{{ _("No releases available.") }}
{% endfor %} {% endmacro %}