set access

This commit is contained in:
Egor Matveev
2022-02-03 00:10:17 +03:00
parent 3bde9c11b9
commit c22663d962
2 changed files with 12 additions and 0 deletions

View File

@@ -5,9 +5,15 @@
{% if group.creator %}Владелец группы: <img src="{{ group.creator.userinfo.profile_pic_url }}" width="30px" height="30px" style="border-radius: 50%; margin-right: 10px;"><a href="/account?username={{ group.creator.username }}">{{ group.creator.username }}</a> {% endif %}
<hr><hr>
<h2>Сеты</h2>
{% if group.creator == user or user.username in group.editors %}
{% for set in group.sets.all %}
<a href="/set?set_id={{ set.id }}">{{ set.name }}</a><br>
{% endfor %}
{% else %}
{% for set in group.available_sets %}
<a href="/set?set_id={{ set.id }}">{{ set.name }}</a><br>
{% endfor %}
{% endif %}
{% if group.creator == user or user.username in group.editors %}
<button type="button" class="btn btn-primary" style="margin-top: 20px;" data-toggle="modal" data-target="#example"><i class="fa fa-pencil"></i> Редактировать</button>
<div class="modal fade" id="example" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">