Skip to content
Snippets Groups Projects

Práva organizátorů

Merged Jiří Setnička requested to merge jirka/users into master
All threads resolved!
3 files
+ 140
8
Compare changes
  • Side-by-side
  • Inline

Files

+ 45
3
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block body %}
<h2>{% if user.is_org %}Organizátor:{% elif user.is_admin %}Správce:{% else %}Soutěžící:{% endif %} {{ user.first_name }} {{ user.last_name }}</h2>
@@ -20,19 +21,60 @@
{% if user.is_org or user.is_admin %}
<h3>Role</h3>
{% if can_assign_rights %}
<h4>Přidělení nové role</h4>
<p>Lze přidělit jen roli, která je podmnožinou nějaké vlastní role (včetně omezení na oblast, kolo, &hellip;).</p>
{% if role_errors %}
<div class="alert alert-danger" role="alert">
{{ role_errors|join("<br>") }}
</div>
{% endif %}
<form action="" method="POST" class="form form-inline" role="form">
{{ form_add_role.csrf_token() }}
<div class="form-group ">
{{ wtf.form_field(form_add_role.role) }}
</div>
<div class="form-group ">
{{ wtf.form_field(form_add_role.place_code, placeholder='Kód / #ID', size=8) }}
</div>
<div class="form-group ">
{{ wtf.form_field(form_add_role.year, size=2, maxlength=2) }}
</div>
<div class="form-group ">
{{ wtf.form_field(form_add_role.category) }}
</div>
<div class="form-group ">
{{ wtf.form_field(form_add_role.seq) }}
</div>
<div class="form-group">
{{ wtf.form_field(form_add_role.submit) }}
</div>
</form>
{% endif %}
<table class="data full">
<thead>
<tr>
<th>Role</th><th>Ročník</th><th>Kategorie</th><th>Kolo</th><th>Oblast</th>
<th>Role</th><th>Oblast</th><th>Ročník</th><th>Kategorie</th><th>Kolo</th><th>Akce</th>
</tr>
</thead>
{% for role in user.roles %}
<tr>
<td>{{ role.role.name }}</td>
<td>{{ roles_by_type[role.role].name }}</td>
<td><a href="{{ url_for('org_place', id=role.place_id) }}">{{ role.place.type_name() + ": " + role.place.name or '*' }}</a></td>
<td>{{ role.year or '*' }}</td>
<td>{{ role.category or '*' }}</td>
<td>{{ role.seq or '*' }}</td>
<td>{{ role.place.type_name() + ": " + role.place.name or '*' }}</td>
<td>
{% if can_assign_rights %}
<form action="" method="POST">
{{ form_remove_role.csrf_token() }}
<input type="hidden" name="remove_role_id" value="{{ role.user_role_id }}">
<button type="submit" class="btn btn-xs btn-danger">Odebrat</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
Loading