mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(fastapi): hide keywords when there are none or they can't be edited
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
363afff332
commit
20f5519b99
1 changed files with 29 additions and 27 deletions
|
@ -33,34 +33,36 @@
|
|||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<th>{{ "Keywords" | tr }}:</th>
|
||||
{% if request.user.has_credential("CRED_PKGBASE_SET_KEYWORDS", approved=[pkgbase.Maintainer]) %}
|
||||
<td>
|
||||
<form method="post"
|
||||
action="/pkgbase/{{ pkgbase.Name }}/keywords"
|
||||
>
|
||||
<div>
|
||||
<input type="text"
|
||||
name="keywords"
|
||||
value="{{ pkgbase.keywords | join(' ', attribute='Keyword') }}"
|
||||
/>
|
||||
<input type="submit" value="{{ 'Update' | tr }}"/>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
{% else %}
|
||||
<td>
|
||||
{% for keyword in pkgbase.keywords.all() %}
|
||||
<a class="keyword"
|
||||
href="/packages/?K={{ keyword.Keyword }}&SB=p"
|
||||
{% if pkgbase.keywords.count() or request.user.has_credential("CRED_PKGBASE_SET_KEYWORDS", approved=[pkgbase.Maintainer]) %}
|
||||
<tr>
|
||||
<th>{{ "Keywords" | tr }}:</th>
|
||||
{% if request.user.has_credential("CRED_PKGBASE_SET_KEYWORDS", approved=[pkgbase.Maintainer]) %}
|
||||
<td>
|
||||
<form method="post"
|
||||
action="/pkgbase/{{ pkgbase.Name }}/keywords"
|
||||
>
|
||||
{{ keyword.Keyword }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
<div>
|
||||
<input type="text"
|
||||
name="keywords"
|
||||
value="{{ pkgbase.keywords | join(' ', attribute='Keyword') }}"
|
||||
/>
|
||||
<input type="submit" value="{{ 'Update' | tr }}"/>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
{% else %}
|
||||
<td>
|
||||
{% for keyword in pkgbase.keywords.all() %}
|
||||
<a class="keyword"
|
||||
href="/packages/?K={{ keyword.Keyword }}&SB=p"
|
||||
>
|
||||
{{ keyword.Keyword }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if licenses and licenses.count() and show_package_details %}
|
||||
<tr>
|
||||
<th>{{ "Licenses" | tr }}:</th>
|
||||
|
|
Loading…
Add table
Reference in a new issue