blob: 46f833fb88695cdc470ea110f95f5a6a7e5f67fe [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>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +040025 {{- range .AllGroups }}
26 <option value="{{ .Name }}">{{ .Name }}</option>
DTabidze0d802592024-03-19 17:42:45 +040027 {{- end }}
28 </select>
29 <button type="submit">Create Child Group</button>
30 </form>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +040031 <hr class="divider">
32 <form action="/group/{{ .GroupName }}/add-owner-group" method="post">
33 <label for="owner-group">Select Owner Group:</label>
34 <select id="owner-group" aria-label="Select" name="owner-group" required>
35 {{- range .AllGroups }}
36 <option value="{{ .Name }}">{{ .Name }}</option>
37 {{- end }}
38 </select>
39 <button type="submit">Add Owner Group</button>
40 </form>
DTabidze0d802592024-03-19 17:42:45 +040041 <h4>Owners</h4>
42 <table>
43 <tr>
44 <th>Username</th>
45 <th>Action</th>
46 </tr>
47 {{- range .Owners }}
48 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040049 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040050 <td>
DTabidze0757f8a2024-03-28 16:49:09 +040051 <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?">
52 <button type="submit">Remove</button>
DTabidze2b224bf2024-03-27 13:25:49 +040053 </form>
54 </td>
DTabidze0d802592024-03-19 17:42:45 +040055 </tr>
56 {{- end }}
57 </table>
58 <h4>Members</h4>
59 <table>
60 <tr>
61 <th>Username</th>
62 <th>Action</th>
63 </tr>
64 {{- range .Members }}
65 <tr>
DTabidze5d735e32024-03-26 16:01:06 +040066 <td><a href="/user/{{ . }}">{{ . }}</a></td>
DTabidze2b224bf2024-03-27 13:25:49 +040067 <td>
DTabidze0757f8a2024-03-28 16:49:09 +040068 <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 +040069 <button type="submit" class="button">Remove</button>
70 </form>
71 </td>
DTabidze0d802592024-03-19 17:42:45 +040072 </tr>
73 {{- end }}
74 </table>
DTabidzec0b4d8f2024-03-22 17:25:10 +040075 <h4>Transitive Groups</h4>
76 <table>
77 <tr>
78 <th>Group Name</th>
79 <th>Description</th>
80 </tr>
81 {{- range .TransitiveGroups }}
82 <tr>
83 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
84 <td>{{ .Description }}</td>
85 </tr>
86 {{- end }}
87 </table>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +040088 <h4>Child Groups</h4>
DTabidzec0b4d8f2024-03-22 17:25:10 +040089 <table>
90 <tr>
91 <th>Group Name</th>
92 <th>Description</th>
DTabidze2b224bf2024-03-27 13:25:49 +040093 <th>Action</th>
DTabidzec0b4d8f2024-03-22 17:25:10 +040094 </tr>
95 {{- range .ChildGroups }}
96 <tr>
97 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
98 <td>{{ .Description }}</td>
DTabidze2b224bf2024-03-27 13:25:49 +040099 <td>
DTabidze0757f8a2024-03-28 16:49:09 +0400100 <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 +0400101 <button type="submit" class="button">Remove</button>
102 </form>
103 </td>
DTabidzec0b4d8f2024-03-22 17:25:10 +0400104 </tr>
105 {{- end }}
106 </table>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +0400107 <h4>Owner Groups</h4>
108 <table>
109 <tr>
110 <th>Group Name</th>
111 <th>Description</th>
112 </tr>
113 {{- range .OwnerGroups }}
114 <tr>
115 <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td>
116 <td>{{ .Description }}</td>
117 </tr>
118 {{- end }}
119 </table>
DTabidze0757f8a2024-03-28 16:49:09 +0400120 <dialog id="confirmation" close>
121 <article>
122 <h2>Confirm Your Action</h2>
123 <p id="confirmation-message">Are you sure?</p>
124 <footer>
125 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
126 <button id="confirm-button">Confirm</button>
127 </footer>
128 </article>
129 </dialog>
DTabidze4b44ff42024-04-02 03:16:26 +0400130{{ end }}