blob: 4576a920bbf9ffbf600b9a9766fced6bb3e24414 [file] [log] [blame]
Davit Tabidze5f1a2c62024-07-17 17:57:27 +04001{{ define "svgIcon" }}
2<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3 <g fill="none" fill-rule="evenodd">
4 <path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z" />
5 <path fill="currentColor" d="m12 13.414l5.657 5.657a1 1 0 0 0 1.414-1.414L13.414 12l5.657-5.657a1 1 0 0 0-1.414-1.414L12 10.586L6.343 4.929A1 1 0 0 0 4.93 6.343L10.586 12l-5.657 5.657a1 1 0 1 0 1.414 1.414z" />
6 </g>
7</svg>
8{{ end }}
9
DTabidze4b44ff42024-04-02 03:16:26 +040010{{ define "title" }}
11 Group - {{ .GroupName }}
12{{ end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040013
DTabidze4b44ff42024-04-02 03:16:26 +040014{{ define "content" }}
15{{- $parentGroupName := .GroupName }}
DTabidze0d802592024-03-19 17:42:45 +040016 <div>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040017 <h2 class="headline">Group: {{ .GroupName }}</h2>
DTabidze0d802592024-03-19 17:42:45 +040018 <p class="description">{{ .Description }}</p>
19 </div>
20 <hr class="divider">
DTabidze078385f2024-03-27 14:49:05 +040021 <form action="/group/{{ .GroupName }}/add-user/" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040022 <fieldset class="grid first">
23 <input type="text" id="username" name="username" placeholder="username" required>
24 <select id="status" name="status" required>
25 <option value="Member" selected>Member</option>
26 <option value="Owner">Owner</option>
27 </select>
28 <button type="submit">Add Member</button>
29 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040030 </form>
DTabidze078385f2024-03-27 14:49:05 +040031 <form action="/group/{{ .GroupName }}/add-child-group" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040032 <fieldset class="grid twoone">
33 <select id="child-group" aria-label="Select" name="child-group" required>
34 {{- range .AllGroups }}
35 <option value="{{ .Name }}">{{ .Name }}</option>
36 {{- end }}
37 </select>
38 <button type="submit">Create Child Group</button>
39 </fieldset>
40 </form>
41 <form action="/group/{{ .GroupName }}/add-owner-group" method="post">
42 <fieldset class="grid twoone">
43 <select id="owner-group" aria-label="Select" name="owner-group" required>
44 {{- range .AllGroups }}
45 <option value="{{ .Name }}">{{ .Name }}</option>
46 {{- end }}
47 </select>
48 <button type="submit">Add Owner Group</button>
49 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040050 </form>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +040051 <hr class="divider">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040052 <h3>Owners</h3>
53 <div class="user-remove">
DTabidze0d802592024-03-19 17:42:45 +040054 {{- range .Owners }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040055 <div>
56 <fieldset role="group">
57 <a class="link-button" href="/user/{{ . }}" role="button">{{ . }}</a>
58 <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?">
59 <button class="remove" type="submit" aria-label="Remove owner">
60 {{ template "svgIcon" }}
61 </button>
62 </form>
63 </fieldset>
64 </div>
DTabidze0d802592024-03-19 17:42:45 +040065 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040066 </div>
67
68 <hr class="divider">
69
70 <h3>Members</h3>
71 <div class="user-remove">
DTabidze0d802592024-03-19 17:42:45 +040072 {{- range .Members }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040073 <div>
74 <fieldset role="group">
75 <a class="link-button" href="/user/{{ . }}" role="button">{{ . }}</a>
76 <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?">
77 <button class="remove" type="submit">
78 {{ template "svgIcon" }}
79 </button>
80 </form>
81 </fieldset>
82 </div>
DTabidze0d802592024-03-19 17:42:45 +040083 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040084 </div>
85 <hr class="divider">
86
87 <h3>Transitive Groups</h3>
88 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +040089 {{- range .TransitiveGroups }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040090 <a class="link-button" href="/group/{{ .Name }}" role="button"
91 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
92 {{ .Name }}
93 </a>
DTabidzec0b4d8f2024-03-22 17:25:10 +040094 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040095 </div>
96 <hr class="divider">
97
98 <h3>Child Groups</h3>
99 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +0400100 {{- range .ChildGroups }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400101 <div>
102 <fieldset role="group">
103 <a class="link-button" href="/group/{{ .Name }}" role="button"
104 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
105 {{ .Name }}
106 </a>
DTabidze0757f8a2024-03-28 16:49:09 +0400107 <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>?">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400108 <button class="remove" type="submit">
109 {{ template "svgIcon" }}
110 </button>
DTabidze2b224bf2024-03-27 13:25:49 +0400111 </form>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400112 </fieldset>
113 </div>
DTabidzec0b4d8f2024-03-22 17:25:10 +0400114 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400115 </div>
116 <hr class="divider">
117
118 <h3>Owner Groups</h3>
119 <div class="user-remove">
Davit Tabidzec0d2bf52024-04-03 15:39:33 +0400120 {{- range .OwnerGroups }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400121 <a class="link-button" href="/group/{{ .Name }}" role="button"
122 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
123 {{ .Name }}
124 </a>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +0400125 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400126 </div>
127
DTabidze0757f8a2024-03-28 16:49:09 +0400128 <dialog id="confirmation" close>
129 <article>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400130 <h3>Attention</h3>
DTabidze0757f8a2024-03-28 16:49:09 +0400131 <p id="confirmation-message">Are you sure?</p>
132 <footer>
133 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
134 <button id="confirm-button">Confirm</button>
135 </footer>
136 </article>
137 </dialog>
DTabidze4b44ff42024-04-02 03:16:26 +0400138{{ end }}