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 • 4.54 kiB
HTML document, ASCII text
        
            
1
{% extends "repo.html" %}
2
{% set active_page = "users" %}
3
4
{% block title %}
5
Users of {{ username }}/{{ repository }}
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.accessLevel == 2 %}
19
<section class="card-main flexible-space">
20
<h3>{{ relationship.user.username }}</h3>
21
{% if relationship.user.username == username %}
22
Administrator / Owner
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">Remove</option>
29
<option value="0" {% if relationship.accessLevel == 0 %}selected{% endif %}>
30
{% if repoData.visibility %}
31
Contributor
32
{% else %}
33
Read-only
34
{% endif %}
35
</option>
36
<option value="1" {% if relationship.accessLevel == 1 %}selected{% endif %}>Read-write</option>
37
<option value="2" {% if relationship.accessLevel == 2 %}selected{% endif %}>Administrator</option>
38
</select>
39
<button type="submit">Update</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
Administrator / Owner
49
{% elif relationship.accessLevel == 0 %}
50
{% if repo.visibility %}
51
Contributor
52
{% else %}
53
Read-only
54
{% endif %}
55
{% elif relationship.accessLevel == 1 %}
56
Read-write
57
{% elif relationship.accessLevel == 2 %}
58
Administrator
59
{% endif %}
60
</section>
61
{% endif %}
62
</article>
63
{% endfor %}
64
{% if user_relationship.accessLevel == 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">Username</label>
69
<input id="new-username" name="new-username" required>
70
</x-vbox>
71
<x-vbox class="nopad">
72
<label for="new-level">Level</label>
73
<select id="new-level" name="new-level" required>
74
{% if repo.visibility == 0 %}
75
<option value="0">Read-only</option>
76
{% endif %}
77
<option value="1">Read-write</option>
78
<option value="2">Administrator</option>
79
</select>
80
</x-vbox>
81
<button type="submit">Add</button>
82
</x-hbox>
83
</form>
84
{% endif %}
85
</x-vbox>
86
</x-frame>
87
</x-vbox>
88
{% endblock %}