contentdb/app/templates/macros/releases.html

103 lines
3.1 KiB
HTML
Raw Normal View History

2021-07-24 04:56:43 +02:00
{% macro render_releases_edit(releases, package) %}
{% for rel in releases %}
<a class="list-group-item list-group-item-action" href="{{ rel.getEditURL() }}">
{{ rel.title }}
<span class="text-muted ml-1">
{% 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 &le;{{ rel.max_rel.name }}]
{% endif %}
</span>
<br />
<small style="color:#999;">
{% if rel.commit_hash %}
[{{ rel.commit_hash | truncate(5, end='') }}]
{% endif %}
created {{ rel.releaseDate | date }}.
</small>
</a>
{% endfor %}
{% endmacro %}
{% macro render_releases_download(releases, package) %}
2021-05-04 04:15:26 +02:00
{% for rel in releases %}
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE") %}
2021-07-24 04:56:43 +02:00
<a class="list-group-item list-group-item-action" href="{{ rel.getDownloadURL() }}">
{{ rel.title }}
<span class="text-muted ml-1">
{% 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 &le;{{ rel.max_rel.name }}]
2021-05-04 04:15:26 +02:00
{% endif %}
2021-07-24 04:56:43 +02:00
</span>
<br />
<small style="color:#999;">
{% if rel.commit_hash %}
[{{ rel.commit_hash | truncate(5, end='') }}]
{% endif %}
created {{ rel.releaseDate | date }}.
</small>
</a>
{% endif %}
{% endfor %}
{% endmacro %}
{% macro render_releases(releases, package, current_user) -%}
{% for rel in releases %}
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE") %}
<div class="list-group-item">
<a class="btn btn-sm btn-primary float-right" href="{{ rel.getEditURL() }}">Edit
{% if not rel.task_id and not rel.approved and rel.checkPerm(current_user, "APPROVE_RELEASE") %}
/ Approve
2021-05-04 04:15:26 +02:00
{% endif %}
2021-07-24 04:56:43 +02:00
</a>
2021-05-04 04:15:26 +02:00
{% if not rel.approved %}<i>{% endif %}
<a href="{{ rel.getDownloadURL() }}" rel="nofollow" download="{{ rel.getDownloadFileName() }}">
{{ rel.title }}
</a>
2021-07-24 04:56:43 +02:00
<span class="text-muted ml-1">
2021-05-04 04:15:26 +02:00
{% 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 &le;{{ rel.max_rel.name }}]
{% endif %}
</span>
<br>
<small style="color:#999;">
{% if rel.commit_hash %}
[{{ rel.commit_hash | truncate(5, end='') }}]
{% endif %}
created {{ rel.releaseDate | date }}.
</small>
{% if (package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE")) and rel.task_id %}
2021-07-24 05:30:14 +02:00
<a href="{{ url_for('tasks.check', id=rel.task_id, r=package.getURL("packages.view")) }}">Importing...</a>
2021-05-04 04:15:26 +02:00
{% elif not rel.approved %}
Waiting for approval.
{% endif %}
{% if not rel.approved %}</i>{% endif %}
2021-07-24 04:56:43 +02:00
</div>
2021-05-04 04:15:26 +02:00
{% endif %}
{% else %}
2021-07-24 04:56:43 +02:00
<div class="list-group-item">No releases available.</div>
2021-05-04 04:15:26 +02:00
{% endfor %}
{% endmacro %}