blob: a9cbb662c11a2e3c719cbd9b2d88978ffdbdb7c5 [file] [log] [blame]
DTabidze0d802592024-03-19 17:42:45 +04001<!DOCTYPE html>
2<html lang="en" data-theme="light">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>Group Membership Managment</title>
7 <link rel="stylesheet" href="/static/pico.2.0.6.min.css">
8 <link rel="stylesheet" href="/static/main.css">
9</head>
10<body class="container">
DTabidze2b224bf2024-03-27 13:25:49 +040011 {{- $parentGroupName := .GroupName }}
DTabidze0d802592024-03-19 17:42:45 +040012 <div>
13 <h2 class="headline">{{ .GroupName }} Group Management</h2>
14 <p class="description">{{ .Description }}</p>
15 </div>
16 <hr class="divider">
17 <form action="/add-user" method="post">
18 <input type="hidden" id="group-name" name="group" value="{{ .GroupName }}">
19 <label for="group-name">Username:</label>
20 <input type="text" id="username" name="username" required>
21 <label for="status">Status:</label>
22 <select id="status" name="status" required>
23 <option value="Member" selected>Member</option>
24 <option value="Owner">Owner</option>
25 </select>
26 <button type="submit">Add Member</button>
27 </form>
28 <hr class="divider">
29 <form action="/add-child-group" method="post">
30 <input type="hidden" id="parent-group" name="parent-group" value="{{ .GroupName }}">
31 <label for="child-group">Select Child Group:</label>
32 <select id="child-group" name="child-group" required>
33 {{- range .AvailableGroups }}
34 <option value="{{ . }}">{{ . }}</option>
35 {{- end }}
36 </select>
37 <button type="submit">Create Child Group</button>
38 </form>
39 <h4>Owners</h4>
40 <table>
41 <tr>
42 <th>Username</th>
43 <th>Action</th>
44 </tr>
45 {{- range .Owners }}
46 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040047 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040048 <td>
49 <form action="/remove-group-owner/{{ $parentGroupName }}/{{ . }}" method="post" onsubmit="return confirm('Are you sure you want to revoke user {{ . }} ownership of the {{ $parentGroupName }} group?')">
50 <button type="submit" class="button">Remove</button>
51 </form>
52 </td>
DTabidze0d802592024-03-19 17:42:45 +040053 </tr>
54 {{- end }}
55 </table>
56 <h4>Members</h4>
57 <table>
58 <tr>
59 <th>Username</th>
60 <th>Action</th>
61 </tr>
62 {{- range .Members }}
63 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040064 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040065 <td>
66 <form action="/remove-group-member/{{ $parentGroupName }}/{{ . }}" method="post" onsubmit="return confirm('Are you sure you want to remove user {{ . }} user from {{ $parentGroupName }} group?')">
67 <button type="submit" class="button">Remove</button>
68 </form>
69 </td>
DTabidze0d802592024-03-19 17:42:45 +040070 </tr>
71 {{- end }}
72 </table>
DTabidzec0b4d8f2024-03-22 17:25:10 +040073 <h4>Transitive Groups</h4>
74 <table>
75 <tr>
76 <th>Group Name</th>
77 <th>Description</th>
78 </tr>
79 {{- range .TransitiveGroups }}
80 <tr>
81 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
82 <td>{{ .Description }}</td>
83 </tr>
84 {{- end }}
85 </table>
86 <h3>Child Groups</h3>
87 <table>
88 <tr>
89 <th>Group Name</th>
90 <th>Description</th>
DTabidze2b224bf2024-03-27 13:25:49 +040091 <th>Action</th>
DTabidzec0b4d8f2024-03-22 17:25:10 +040092 </tr>
93 {{- range .ChildGroups }}
94 <tr>
95 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
96 <td>{{ .Description }}</td>
DTabidze2b224bf2024-03-27 13:25:49 +040097 <td>
98 <form action="/remove-child-group/{{ $parentGroupName }}/{{ .Name }}" method="post" onsubmit="return confirm('Are you sure you want to remove group {{ .Name }} as a child of the group {{ $parentGroupName }}?')">
99 <button type="submit" class="button">Remove</button>
100 </form>
101 </td>
DTabidzec0b4d8f2024-03-22 17:25:10 +0400102 </tr>
103 {{- end }}
104 </table>
DTabidze0d802592024-03-19 17:42:45 +0400105</body>
106</html>