| DTabidze | 4b44ff4 | 2024-04-02 03:16:26 +0400 | [diff] [blame] | 1 | {{ define "title" }} |
| 2 | Group - {{ .GroupName }} |
| 3 | {{ end }} |
| 4 | {{ define "content" }} |
| 5 | {{- $parentGroupName := .GroupName }} |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 6 | <div> |
| 7 | <h2 class="headline">{{ .GroupName }} Group Management</h2> |
| 8 | <p class="description">{{ .Description }}</p> |
| 9 | </div> |
| 10 | <hr class="divider"> |
| DTabidze | 078385f | 2024-03-27 14:49:05 +0400 | [diff] [blame] | 11 | <form action="/group/{{ .GroupName }}/add-user/" method="post"> |
| 12 | <label>Username:</label> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 13 | <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"> |
| DTabidze | 078385f | 2024-03-27 14:49:05 +0400 | [diff] [blame] | 22 | <form action="/group/{{ .GroupName }}/add-child-group" method="post"> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 23 | <label for="child-group">Select Child Group:</label> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 24 | <select id="child-group" aria-label="Select" name="child-group" required> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 25 | {{- 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> |
| DTabidze | 5d735e3 | 2024-03-26 16:01:06 +0400 | [diff] [blame] | 39 | <td><a href="/user/{{ . }}">{{ . }}</a></td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 40 | <td> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 41 | <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> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 43 | </form> |
| 44 | </td> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 45 | </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> |
| DTabidze | 5d735e3 | 2024-03-26 16:01:06 +0400 | [diff] [blame] | 56 | <td><a href="/user/{{ . }}">{{ . }}</a></td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 57 | <td> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 58 | <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?"> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 59 | <button type="submit" class="button">Remove</button> |
| 60 | </form> |
| 61 | </td> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 62 | </tr> |
| 63 | {{- end }} |
| 64 | </table> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 65 | <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> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 83 | <th>Action</th> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 84 | </tr> |
| 85 | {{- range .ChildGroups }} |
| 86 | <tr> |
| 87 | <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td> |
| 88 | <td>{{ .Description }}</td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 89 | <td> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 90 | <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>?"> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 91 | <button type="submit" class="button">Remove</button> |
| 92 | </form> |
| 93 | </td> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 94 | </tr> |
| 95 | {{- end }} |
| 96 | </table> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 97 | <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> |
| DTabidze | 4b44ff4 | 2024-04-02 03:16:26 +0400 | [diff] [blame] | 107 | {{ end }} |