By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 repo-users.html

View raw Download
text/html • 5.05 kiB
HTML document, ASCII text
        
            
1
{% extends "repo.html" %}
2
{% set active_page = "users" %}
3
4
{% block title %}
5
{% trans username=username, repository=repository %}Users of {{ username }}/{{ repository }}{% endtrans %}
6
{% endblock %}
7
{% block content %}
8
<x-vbox>
9
<x-frame style="--width: 896px;" class="flexible-space">
10
<x-vbox>
11
{% for relationship in relationships %}
12
<article class="card card-horizontal">
13
<figure class="branch-icon">
14
<a href="/{{ relationship.user.username }}">
15
<img src="/info/{{ relationship.user.username }}/avatar" style="width: 48px; height: 48px;">
16
</a>
17
</figure>
18
{% if user_relationship.access_level == 2 %}
19
<section class="card-main flexible-space">
20
<h3>{{ relationship.user.username }}</h3>
21
{% if relationship.user.username == username %}
22
{% trans %}Administrator / Owner{% endtrans %}
23
{% else %}
24
<form method="post">
25
<input type="hidden" name="update-username" value="{{ relationship.user.username }}">
26
<x-hbox>
27
<select id="update-level" name="update-level">
28
<option value="-1">{% trans %}Remove{% endtrans %}</option>
29
<option value="0" {% if relationship.access_level == 0 %}selected{% endif %}>
30
{% if repoData.visibility %}
31
{% trans %}Contributor{% endtrans %}
32
{% else %}
33
{% trans %}Read-only{% endtrans %}
34
{% endif %}
35
</option>
36
<option value="1" {% if relationship.access_level == 1 %}selected{% endif %}>{% trans %}Read-write{% endtrans %}</option>
37
<option value="2" {% if relationship.access_level == 2 %}selected{% endif %}>{% trans %}Administrator{% endtrans %}</option>
38
</select>
39
<button type="submit">{% trans %}Update{% endtrans %}</button>
40
</x-hbox>
41
</form>
42
{% endif %}
43
</section>
44
{% else %}
45
<section class="card-main flexible-space">
46
<h3>{{ relationship.user.username }}</h3>
47
{% if relationship.user.username == username %}
48
{% trans %}Administrator / Owner{% endtrans %}
49
{% elif relationship.access_level == 0 %}
50
{% if repo.visibility %}
51
{% trans %}Contributor{% endtrans %}
52
{% else %}
53
{% trans %}Read-only{% endtrans %}
54
{% endif %}
55
{% elif relationship.access_level == 1 %}
56
{% trans %}Read-write{% endtrans %}
57
{% elif relationship.access_level == 2 %}
58
{% trans %}Administrator{% endtrans %}
59
{% endif %}
60
</section>
61
{% endif %}
62
</article>
63
{% endfor %}
64
{% if user_relationship.access_level == 2 %}
65
<form method="POST">
66
<x-hbox style="align-items: flex-end;">
67
<x-vbox class="nopad flexible-space">
68
<label for="new-username">{% trans %}Username{% endtrans %}</label>
69
<input id="new-username" name="new-username" required>
70
</x-vbox>
71
<x-vbox class="nopad">
72
<label for="new-level">{% trans %}Level{% endtrans %}</label>
73
<select id="new-level" name="new-level" required>
74
{% if repo.visibility == 0 %}
75
<option value="0">{% trans %}Read-only{% endtrans %}</option>
76
{% endif %}
77
<option value="1">{% trans %}Read-write{% endtrans %}</option>
78
<option value="2">{% trans %}Administrator{% endtrans %}</option>
79
</select>
80
</x-vbox>
81
<button type="submit">{% trans %}Add{% endtrans %}</button>
82
</x-hbox>
83
</form>
84
{% endif %}
85
</x-vbox>
86
</x-frame>
87
</x-vbox>
88
{% endblock %}
89