mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 14:37:36 +01:00
Add permissions check in outdated macro
This commit is contained in:
parent
33bf3304a1
commit
c5fa76dab0
@ -1,4 +1,4 @@
|
|||||||
{% macro render_outdated_packages(outdated_packages) -%}
|
{% macro render_outdated_packages(outdated_packages, current_player) -%}
|
||||||
<ul class="list-group mt-3">
|
<ul class="list-group mt-3">
|
||||||
{% for package in outdated_packages %}
|
{% for package in outdated_packages %}
|
||||||
{% set config = package.update_config %}
|
{% set config = package.update_config %}
|
||||||
@ -30,21 +30,25 @@
|
|||||||
|
|
||||||
<div class="col-sm-auto">
|
<div class="col-sm-auto">
|
||||||
{% set release_title = config.last_tag or (config.outdated_at | isodate) %}
|
{% set release_title = config.last_tag or (config.outdated_at | isodate) %}
|
||||||
<a class="btn btn-sm btn-primary mr-2"
|
{% if package.checkPerm(current_player, "MAKE_RELEASE") %}
|
||||||
href="{{ package.getCreateReleaseURL(title=release_title, ref=config.last_tag or config.last_commit) }}">
|
<a class="btn btn-sm btn-primary mr-2"
|
||||||
<i class="fas fa-plus mr-1"></i>
|
href="{{ package.getCreateReleaseURL(title=release_title, ref=config.last_tag or config.last_commit) }}">
|
||||||
{{ _("Release") }}
|
<i class="fas fa-plus mr-1"></i>
|
||||||
</a>
|
{{ _("Release") }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<a class="btn btn-sm btn-secondary mr-2" href="{{ package.repo }}">
|
<a class="btn btn-sm btn-secondary mr-2" href="{{ package.repo }}">
|
||||||
<i class="fas fa-code-branch mr-1"></i>
|
<i class="fas fa-code-branch mr-1"></i>
|
||||||
{{ _("Repo") }}
|
{{ _("Repo") }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="btn btn-sm btn-secondary" href="{{ package.getUpdateConfigURL() }}">
|
{% if package.checkPerm(current_player, "MAKE_RELEASE") %}
|
||||||
<i class="fas fa-cog mr-1"></i>
|
<a class="btn btn-sm btn-secondary" href="{{ package.getUpdateConfigURL() }}">
|
||||||
{{ _("Update settings") }}
|
<i class="fas fa-cog mr-1"></i>
|
||||||
</a>
|
{{ _("Update settings") }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -18,5 +18,5 @@
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
{% from "macros/todo.html" import render_outdated_packages %}
|
{% from "macros/todo.html" import render_outdated_packages %}
|
||||||
{{ render_outdated_packages(outdated_packages) }}
|
{{ render_outdated_packages(outdated_packages, current_user) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% from "macros/todo.html" import render_outdated_packages %}
|
{% from "macros/todo.html" import render_outdated_packages %}
|
||||||
{{ render_outdated_packages(outdated_packages) }}
|
{{ render_outdated_packages(outdated_packages, current_user) }}
|
||||||
|
|
||||||
|
|
||||||
<h2 class="mt-5">{{ _("Unadded Topics") }}</h2>
|
<h2 class="mt-5">{{ _("Unadded Topics") }}</h2>
|
||||||
|
Loading…
Reference in New Issue
Block a user