| 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> |
| Davit Tabidze | c0d2bf5 | 2024-04-03 15:39:33 +0400 | [diff] [blame^] | 25 | {{- range .AllGroups }} |
| 26 | <option value="{{ .Name }}">{{ .Name }}</option> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 27 | {{- end }} |
| 28 | </select> |
| 29 | <button type="submit">Create Child Group</button> |
| 30 | </form> |
| Davit Tabidze | c0d2bf5 | 2024-04-03 15:39:33 +0400 | [diff] [blame^] | 31 | <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> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 41 | <h4>Owners</h4> |
| 42 | <table> |
| 43 | <tr> |
| 44 | <th>Username</th> |
| 45 | <th>Action</th> |
| 46 | </tr> |
| 47 | {{- range .Owners }} |
| 48 | <tr> |
| DTabidze | 5d735e3 | 2024-03-26 16:01:06 +0400 | [diff] [blame] | 49 | <td><a href="/user/{{ . }}">{{ . }}</a></td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 50 | <td> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 51 | <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> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 53 | </form> |
| 54 | </td> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 55 | </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> |
| DTabidze | 5d735e3 | 2024-03-26 16:01:06 +0400 | [diff] [blame] | 66 | <td><a href="/user/{{ . }}">{{ . }}</a></td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 67 | <td> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 68 | <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] | 69 | <button type="submit" class="button">Remove</button> |
| 70 | </form> |
| 71 | </td> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 72 | </tr> |
| 73 | {{- end }} |
| 74 | </table> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 75 | <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 Tabidze | c0d2bf5 | 2024-04-03 15:39:33 +0400 | [diff] [blame^] | 88 | <h4>Child Groups</h4> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 89 | <table> |
| 90 | <tr> |
| 91 | <th>Group Name</th> |
| 92 | <th>Description</th> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 93 | <th>Action</th> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 94 | </tr> |
| 95 | {{- range .ChildGroups }} |
| 96 | <tr> |
| 97 | <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td> |
| 98 | <td>{{ .Description }}</td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame] | 99 | <td> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 100 | <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] | 101 | <button type="submit" class="button">Remove</button> |
| 102 | </form> |
| 103 | </td> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 104 | </tr> |
| 105 | {{- end }} |
| 106 | </table> |
| Davit Tabidze | c0d2bf5 | 2024-04-03 15:39:33 +0400 | [diff] [blame^] | 107 | <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> |
| DTabidze | 0757f8a | 2024-03-28 16:49:09 +0400 | [diff] [blame] | 120 | <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> |
| DTabidze | 4b44ff4 | 2024-04-02 03:16:26 +0400 | [diff] [blame] | 130 | {{ end }} |