blob: 42a2e3821f5d50e15989f2c953d54ceae3a136b3 [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>
DTabidze0757f8a2024-03-28 16:49:09 +040030 <select id="child-group" aria-label="Select" name="child-group" required>
DTabidze0d802592024-03-19 17:42:45 +040031 {{- 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>
DTabidze0757f8a2024-03-28 16:49:09 +040047 <form action="/group/{{ $parentGroupName }}/remove-owner/{{ . }}" method="post" class="remove-form" data-confirmation-message="Are you sure you want to revoke user <strong>{{ . }}</strong>'s ownership of the <strong>{{ $parentGroupName }}</strong> group?">
48 <button type="submit">Remove</button>
DTabidze2b224bf2024-03-27 13:25:49 +040049 </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>
DTabidze0757f8a2024-03-28 16:49:09 +040064 <form action="/group/{{ $parentGroupName }}/remove-member/{{ . }}" method="post" class="remove-form" data-confirmation-message="Are you sure you want to remove user <strong>{{ . }}</strong> user from <strong>{{ $parentGroupName }}</strong> 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>
DTabidze0757f8a2024-03-28 16:49:09 +040096 <form action="/group/{{ $parentGroupName }}/remove-child-group/{{ .Name }}" method="post" class="remove-form" data-confirmation-message="Are you sure you want to remove group <strong>{{ .Name }}</strong> as a child of the group <strong>{{ $parentGroupName }}</strong>?">
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>
DTabidze0757f8a2024-03-28 16:49:09 +0400103 <dialog id="confirmation" close>
104 <article>
105 <h2>Confirm Your Action</h2>
106 <p id="confirmation-message">Are you sure?</p>
107 <footer>
108 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
109 <button id="confirm-button">Confirm</button>
110 </footer>
111 </article>
112 </dialog>
113 <script src="/static/main.js"></script>
DTabidze0d802592024-03-19 17:42:45 +0400114</body>
115</html>