Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Merge requests
!6
Práva organizátorů
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Práva organizátorů
jirka/users
into
master
Overview
15
Commits
4
Changes
3
All threads resolved!
Hide all comments
Merged
Jiří Setnička
requested to merge
jirka/users
into
master
4 years ago
Overview
15
Commits
4
Changes
3
All threads resolved!
Hide all comments
0
0
Merge request reports
Viewing commit
daec6d0a
Show latest version
3 files
+
140
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
daec6d0a
Přidávání a odebírání práv v detailu organizátorů
· daec6d0a
Jiří Setnička
authored
4 years ago
mo/web/templates/org_user.html
+
45
−
3
View file @ daec6d0a
Edit in single-file editor
Open in Web IDE
Show full file
{% 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,
…
).
</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