blob: 3995fb783bbdcb69a48bef592266919168409d95 [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">
DTabidze078385f2024-03-27 14:49:05 +040017 <form action="/group/{{ .GroupName }}/add-user/" method="post">
18 <label>Username:</label>
DTabidze0d802592024-03-19 17:42:45 +040019 <input type="text" id="username" name="username" required>
20 <label for="status">Status:</label>
21 <select id="status" name="status" required>
22 <option value="Member" selected>Member</option>
23 <option value="Owner">Owner</option>
24 </select>
25 <button type="submit">Add Member</button>
26 </form>
27 <hr class="divider">
DTabidze078385f2024-03-27 14:49:05 +040028 <form action="/group/{{ .GroupName }}/add-child-group" method="post">
DTabidze0d802592024-03-19 17:42:45 +040029 <label for="child-group">Select Child Group:</label>
30 <select id="child-group" name="child-group" required>
31 {{- range .AvailableGroups }}
32 <option value="{{ . }}">{{ . }}</option>
33 {{- end }}
34 </select>
35 <button type="submit">Create Child Group</button>
36 </form>
37 <h4>Owners</h4>
38 <table>
39 <tr>
40 <th>Username</th>
41 <th>Action</th>
42 </tr>
43 {{- range .Owners }}
44 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040045 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040046 <td>
DTabidze078385f2024-03-27 14:49:05 +040047 <form action="/group/{{ $parentGroupName }}/remove-owner/{{ . }}" method="post" onsubmit="return confirm('Are you sure you want to revoke user {{ . }} ownership of the {{ $parentGroupName }} group?')">
DTabidze2b224bf2024-03-27 13:25:49 +040048 <button type="submit" class="button">Remove</button>
49 </form>
50 </td>
DTabidze0d802592024-03-19 17:42:45 +040051 </tr>
52 {{- end }}
53 </table>
54 <h4>Members</h4>
55 <table>
56 <tr>
57 <th>Username</th>
58 <th>Action</th>
59 </tr>
60 {{- range .Members }}
61 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040062 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040063 <td>
DTabidze078385f2024-03-27 14:49:05 +040064 <form action="/group/{{ $parentGroupName }}/remove-member/{{ . }}" method="post" onsubmit="return confirm('Are you sure you want to remove user {{ . }} user from {{ $parentGroupName }} group?')">
DTabidze2b224bf2024-03-27 13:25:49 +040065 <button type="submit" class="button">Remove</button>
66 </form>
67 </td>
DTabidze0d802592024-03-19 17:42:45 +040068 </tr>
69 {{- end }}
70 </table>
DTabidzec0b4d8f2024-03-22 17:25:10 +040071 <h4>Transitive Groups</h4>
72 <table>
73 <tr>
74 <th>Group Name</th>
75 <th>Description</th>
76 </tr>
77 {{- range .TransitiveGroups }}
78 <tr>
79 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
80 <td>{{ .Description }}</td>
81 </tr>
82 {{- end }}
83 </table>
84 <h3>Child Groups</h3>
85 <table>
86 <tr>
87 <th>Group Name</th>
88 <th>Description</th>
DTabidze2b224bf2024-03-27 13:25:49 +040089 <th>Action</th>
DTabidzec0b4d8f2024-03-22 17:25:10 +040090 </tr>
91 {{- range .ChildGroups }}
92 <tr>
93 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
94 <td>{{ .Description }}</td>
DTabidze2b224bf2024-03-27 13:25:49 +040095 <td>
DTabidze078385f2024-03-27 14:49:05 +040096 <form action="/group/{{ $parentGroupName }}/remove-child-group/{{ .Name }}" method="post" onsubmit="return confirm('Are you sure you want to remove group {{ .Name }} as a child of the group {{ $parentGroupName }}?')">
DTabidze2b224bf2024-03-27 13:25:49 +040097 <button type="submit" class="button">Remove</button>
98 </form>
99 </td>
DTabidzec0b4d8f2024-03-22 17:25:10 +0400100 </tr>
101 {{- end }}
102 </table>
DTabidze0d802592024-03-19 17:42:45 +0400103</body>
104</html>