blob: 2f5c89aba5fe4609f47912d5eb35043ea688831a [file] [log] [blame]
DTabidze4b44ff42024-04-02 03:16:26 +04001{{ define "title" }}
2 Group - {{ .GroupName }}
3{{ end }}
4{{ define "content" }}
5{{- $parentGroupName := .GroupName }}
DTabidze0d802592024-03-19 17:42:45 +04006 <div>
7 <h2 class="headline">{{ .GroupName }} Group Management</h2>
8 <p class="description">{{ .Description }}</p>
9 </div>
10 <hr class="divider">
DTabidze078385f2024-03-27 14:49:05 +040011 <form action="/group/{{ .GroupName }}/add-user/" method="post">
12 <label>Username:</label>
DTabidze0d802592024-03-19 17:42:45 +040013 <input type="text" id="username" name="username" required>
14 <label for="status">Status:</label>
15 <select id="status" name="status" required>
16 <option value="Member" selected>Member</option>
17 <option value="Owner">Owner</option>
18 </select>
19 <button type="submit">Add Member</button>
20 </form>
21 <hr class="divider">
DTabidze078385f2024-03-27 14:49:05 +040022 <form action="/group/{{ .GroupName }}/add-child-group" method="post">
DTabidze0d802592024-03-19 17:42:45 +040023 <label for="child-group">Select Child Group:</label>
DTabidze0757f8a2024-03-28 16:49:09 +040024 <select id="child-group" aria-label="Select" name="child-group" required>
DTabidze0d802592024-03-19 17:42:45 +040025 {{- range .AvailableGroups }}
26 <option value="{{ . }}">{{ . }}</option>
27 {{- end }}
28 </select>
29 <button type="submit">Create Child Group</button>
30 </form>
31 <h4>Owners</h4>
32 <table>
33 <tr>
34 <th>Username</th>
35 <th>Action</th>
36 </tr>
37 {{- range .Owners }}
38 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040039 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040040 <td>
DTabidze0757f8a2024-03-28 16:49:09 +040041 <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?">
42 <button type="submit">Remove</button>
DTabidze2b224bf2024-03-27 13:25:49 +040043 </form>
44 </td>
DTabidze0d802592024-03-19 17:42:45 +040045 </tr>
46 {{- end }}
47 </table>
48 <h4>Members</h4>
49 <table>
50 <tr>
51 <th>Username</th>
52 <th>Action</th>
53 </tr>
54 {{- range .Members }}
55 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040056 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040057 <td>
DTabidze0757f8a2024-03-28 16:49:09 +040058 <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 +040059 <button type="submit" class="button">Remove</button>
60 </form>
61 </td>
DTabidze0d802592024-03-19 17:42:45 +040062 </tr>
63 {{- end }}
64 </table>
DTabidzec0b4d8f2024-03-22 17:25:10 +040065 <h4>Transitive Groups</h4>
66 <table>
67 <tr>
68 <th>Group Name</th>
69 <th>Description</th>
70 </tr>
71 {{- range .TransitiveGroups }}
72 <tr>
73 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
74 <td>{{ .Description }}</td>
75 </tr>
76 {{- end }}
77 </table>
78 <h3>Child Groups</h3>
79 <table>
80 <tr>
81 <th>Group Name</th>
82 <th>Description</th>
DTabidze2b224bf2024-03-27 13:25:49 +040083 <th>Action</th>
DTabidzec0b4d8f2024-03-22 17:25:10 +040084 </tr>
85 {{- range .ChildGroups }}
86 <tr>
87 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
88 <td>{{ .Description }}</td>
DTabidze2b224bf2024-03-27 13:25:49 +040089 <td>
DTabidze0757f8a2024-03-28 16:49:09 +040090 <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 +040091 <button type="submit" class="button">Remove</button>
92 </form>
93 </td>
DTabidzec0b4d8f2024-03-22 17:25:10 +040094 </tr>
95 {{- end }}
96 </table>
DTabidze0757f8a2024-03-28 16:49:09 +040097 <dialog id="confirmation" close>
98 <article>
99 <h2>Confirm Your Action</h2>
100 <p id="confirmation-message">Are you sure?</p>
101 <footer>
102 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
103 <button id="confirm-button">Confirm</button>
104 </footer>
105 </article>
106 </dialog>
DTabidze4b44ff42024-04-02 03:16:26 +0400107{{ end }}