blob: c3ff8c7b517a354b196ee3112336affd76d7fe0c [file] [log] [blame]
DTabidze4b44ff42024-04-02 03:16:26 +04001{{ define "title" }}
gio134be722025-07-20 19:01:17 +04002 Group - {{ .Title }}
DTabidze4b44ff42024-04-02 03:16:26 +04003{{ end }}
4{{ define "content" }}
gio134be722025-07-20 19:01:17 +04005{{- $parentGroupId := .GroupId }}
DTabidze0d802592024-03-19 17:42:45 +04006 <div>
gio134be722025-07-20 19:01:17 +04007 <h2 class="headline">Group: {{ .Title }}</h2>
DTabidze0d802592024-03-19 17:42:45 +04008 <p class="description">{{ .Description }}</p>
9 </div>
10 <hr class="divider">
gio134be722025-07-20 19:01:17 +040011 <form action="/group/{{ .GroupId }}/add-user/" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040012 <fieldset class="grid first">
gio134be722025-07-20 19:01:17 +040013 <select id="userId" aria-label="Select" name="userId" required>
14 {{- range .AllUsers }}
15 <option value="{{ .Id }}">{{ .Username }}</option>
16 {{- end }}
17 </select>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040018 <select id="status" name="status" required>
19 <option value="Member" selected>Member</option>
20 <option value="Owner">Owner</option>
21 </select>
22 <button type="submit">Add Member</button>
23 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040024 </form>
gio134be722025-07-20 19:01:17 +040025 <form action="/group/{{ .GroupId }}/add-child-group" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040026 <fieldset class="grid twoone">
gio134be722025-07-20 19:01:17 +040027 <select id="otherId" aria-label="Select" name="otherId" required>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040028 {{- range .AllGroups }}
gio134be722025-07-20 19:01:17 +040029 <option value="{{ .Id }}">{{ .Title }}</option>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040030 {{- end }}
31 </select>
32 <button type="submit">Create Child Group</button>
33 </fieldset>
34 </form>
gio134be722025-07-20 19:01:17 +040035 <form action="/group/{{ .GroupId }}/add-owner-group" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040036 <fieldset class="grid twoone">
gio134be722025-07-20 19:01:17 +040037 <select id="otherId" aria-label="Select" name="otherId" required>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040038 {{- range .AllGroups }}
gio134be722025-07-20 19:01:17 +040039 <option value="{{ .Id }}">{{ .Title }}</option>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040040 {{- end }}
41 </select>
42 <button type="submit">Add Owner Group</button>
43 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040044 </form>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +040045 <hr class="divider">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040046 <h3>Owners</h3>
47 <div class="user-remove">
DTabidze0d802592024-03-19 17:42:45 +040048 {{- range .Owners }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040049 <div>
50 <fieldset role="group">
gio134be722025-07-20 19:01:17 +040051 <a class="link-button" href="/user/{{ .Id }}" role="button">{{ .Username }}</a>
52 <form action="/group/{{ $parentGroupId }}/remove-owner/{{ .Id }}" method="post" class="remove-form" data-confirmation-message="Are you sure you want to revoke user <strong>{{ .Username }}</strong>'s ownership of the <strong>{{ $parentGroupId }}</strong> group?">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040053 <button class="remove" type="submit" aria-label="Remove owner">
54 {{ template "svgIcon" }}
55 </button>
56 </form>
57 </fieldset>
58 </div>
DTabidze0d802592024-03-19 17:42:45 +040059 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040060 </div>
61
62 <hr class="divider">
63
64 <h3>Members</h3>
65 <div class="user-remove">
DTabidze0d802592024-03-19 17:42:45 +040066 {{- range .Members }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040067 <div>
68 <fieldset role="group">
gio134be722025-07-20 19:01:17 +040069 <a class="link-button" href="/user/{{ .Id }}" role="button">{{ .Username }}</a>
70 <form action="/group/{{ $parentGroupId }}/remove-member/{{ .Id }}" method="post" class="remove-form" data-confirmation-message="Are you sure you want to remove user <strong>{{ .Username }}</strong> user from <strong>{{ $parentGroupId }}</strong> group?">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040071 <button class="remove" type="submit">
72 {{ template "svgIcon" }}
73 </button>
74 </form>
75 </fieldset>
76 </div>
DTabidze0d802592024-03-19 17:42:45 +040077 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040078 </div>
79 <hr class="divider">
80
81 <h3>Transitive Groups</h3>
82 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +040083 {{- range .TransitiveGroups }}
gio134be722025-07-20 19:01:17 +040084 <a class="link-button" href="/group/{{ .Id }}" role="button"
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040085 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
gio134be722025-07-20 19:01:17 +040086 {{ .Title }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040087 </a>
DTabidzec0b4d8f2024-03-22 17:25:10 +040088 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040089 </div>
90 <hr class="divider">
91
92 <h3>Child Groups</h3>
93 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +040094 {{- range .ChildGroups }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040095 <div>
96 <fieldset role="group">
gio134be722025-07-20 19:01:17 +040097 <a class="link-button" href="/group/{{ .Id }}" role="button"
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040098 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
gio134be722025-07-20 19:01:17 +040099 {{ .Title }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400100 </a>
gio134be722025-07-20 19:01:17 +0400101 <form action="/group/{{ $parentGroupId }}/remove-child-group/{{ .Id }}" method="post" class="remove-form" data-confirmation-message="Are you sure you want to remove group <strong>{{ .Title }}</strong> as a child of the group <strong>{{ $parentGroupId }}</strong>?">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400102 <button class="remove" type="submit">
103 {{ template "svgIcon" }}
104 </button>
DTabidze2b224bf2024-03-27 13:25:49 +0400105 </form>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400106 </fieldset>
107 </div>
DTabidzec0b4d8f2024-03-22 17:25:10 +0400108 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400109 </div>
110 <hr class="divider">
111
112 <h3>Owner Groups</h3>
113 <div class="user-remove">
Davit Tabidzec0d2bf52024-04-03 15:39:33 +0400114 {{- range .OwnerGroups }}
gio134be722025-07-20 19:01:17 +0400115 <a class="link-button" href="/group/{{ .Id }}" role="button"
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400116 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
gio134be722025-07-20 19:01:17 +0400117 {{ .Title }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400118 </a>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +0400119 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400120 </div>
121
DTabidze0757f8a2024-03-28 16:49:09 +0400122 <dialog id="confirmation" close>
123 <article>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400124 <h3>Attention</h3>
DTabidze0757f8a2024-03-28 16:49:09 +0400125 <p id="confirmation-message">Are you sure?</p>
126 <footer>
127 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
128 <button id="confirm-button">Confirm</button>
129 </footer>
130 </article>
131 </dialog>
DTabidze4b44ff42024-04-02 03:16:26 +0400132{{ end }}