| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 1 | <!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"> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame^] | 11 | {{- $parentGroupName := .GroupName }} |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 12 | <div> |
| 13 | <h2 class="headline">{{ .GroupName }} Group Management</h2> |
| 14 | <p class="description">{{ .Description }}</p> |
| 15 | </div> |
| 16 | <hr class="divider"> |
| 17 | <form action="/add-user" method="post"> |
| 18 | <input type="hidden" id="group-name" name="group" value="{{ .GroupName }}"> |
| 19 | <label for="group-name">Username:</label> |
| 20 | <input type="text" id="username" name="username" required> |
| 21 | <label for="status">Status:</label> |
| 22 | <select id="status" name="status" required> |
| 23 | <option value="Member" selected>Member</option> |
| 24 | <option value="Owner">Owner</option> |
| 25 | </select> |
| 26 | <button type="submit">Add Member</button> |
| 27 | </form> |
| 28 | <hr class="divider"> |
| 29 | <form action="/add-child-group" method="post"> |
| 30 | <input type="hidden" id="parent-group" name="parent-group" value="{{ .GroupName }}"> |
| 31 | <label for="child-group">Select Child Group:</label> |
| 32 | <select id="child-group" name="child-group" required> |
| 33 | {{- range .AvailableGroups }} |
| 34 | <option value="{{ . }}">{{ . }}</option> |
| 35 | {{- end }} |
| 36 | </select> |
| 37 | <button type="submit">Create Child Group</button> |
| 38 | </form> |
| 39 | <h4>Owners</h4> |
| 40 | <table> |
| 41 | <tr> |
| 42 | <th>Username</th> |
| 43 | <th>Action</th> |
| 44 | </tr> |
| 45 | {{- range .Owners }} |
| 46 | <tr> |
| DTabidze | 5d735e3 | 2024-03-26 16:01:06 +0400 | [diff] [blame] | 47 | <td><a href="/user/{{ . }}">{{ . }}</a></td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame^] | 48 | <td> |
| 49 | <form action="/remove-group-owner/{{ $parentGroupName }}/{{ . }}" method="post" onsubmit="return confirm('Are you sure you want to revoke user {{ . }} ownership of the {{ $parentGroupName }} group?')"> |
| 50 | <button type="submit" class="button">Remove</button> |
| 51 | </form> |
| 52 | </td> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 53 | </tr> |
| 54 | {{- end }} |
| 55 | </table> |
| 56 | <h4>Members</h4> |
| 57 | <table> |
| 58 | <tr> |
| 59 | <th>Username</th> |
| 60 | <th>Action</th> |
| 61 | </tr> |
| 62 | {{- range .Members }} |
| 63 | <tr> |
| DTabidze | 5d735e3 | 2024-03-26 16:01:06 +0400 | [diff] [blame] | 64 | <td><a href="/user/{{ . }}">{{ . }}</a></td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame^] | 65 | <td> |
| 66 | <form action="/remove-group-member/{{ $parentGroupName }}/{{ . }}" method="post" onsubmit="return confirm('Are you sure you want to remove user {{ . }} user from {{ $parentGroupName }} group?')"> |
| 67 | <button type="submit" class="button">Remove</button> |
| 68 | </form> |
| 69 | </td> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 70 | </tr> |
| 71 | {{- end }} |
| 72 | </table> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 73 | <h4>Transitive Groups</h4> |
| 74 | <table> |
| 75 | <tr> |
| 76 | <th>Group Name</th> |
| 77 | <th>Description</th> |
| 78 | </tr> |
| 79 | {{- range .TransitiveGroups }} |
| 80 | <tr> |
| 81 | <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td> |
| 82 | <td>{{ .Description }}</td> |
| 83 | </tr> |
| 84 | {{- end }} |
| 85 | </table> |
| 86 | <h3>Child Groups</h3> |
| 87 | <table> |
| 88 | <tr> |
| 89 | <th>Group Name</th> |
| 90 | <th>Description</th> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame^] | 91 | <th>Action</th> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 92 | </tr> |
| 93 | {{- range .ChildGroups }} |
| 94 | <tr> |
| 95 | <td><a href="/group/{{ .Name }}">{{ .Name }}</a></td> |
| 96 | <td>{{ .Description }}</td> |
| DTabidze | 2b224bf | 2024-03-27 13:25:49 +0400 | [diff] [blame^] | 97 | <td> |
| 98 | <form action="/remove-child-group/{{ $parentGroupName }}/{{ .Name }}" method="post" onsubmit="return confirm('Are you sure you want to remove group {{ .Name }} as a child of the group {{ $parentGroupName }}?')"> |
| 99 | <button type="submit" class="button">Remove</button> |
| 100 | </form> |
| 101 | </td> |
| DTabidze | c0b4d8f | 2024-03-22 17:25:10 +0400 | [diff] [blame] | 102 | </tr> |
| 103 | {{- end }} |
| 104 | </table> |
| DTabidze | 0d80259 | 2024-03-19 17:42:45 +0400 | [diff] [blame] | 105 | </body> |
| 106 | </html> |