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