blob: c927536d5cb422c60226e00f625eda3180560fa4 [file] [log] [blame]
DTabidze4b44ff42024-04-02 03:16:26 +04001{{ define "title" }}
2 Group - {{ .GroupName }}
3{{ end }}
4{{ define "content" }}
5{{- $parentGroupName := .GroupName }}
DTabidze0d802592024-03-19 17:42:45 +04006 <div>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +04007 <h2 class="headline">Group: {{ .GroupName }}</h2>
DTabidze0d802592024-03-19 17:42:45 +04008 <p class="description">{{ .Description }}</p>
9 </div>
10 <hr class="divider">
DTabidze078385f2024-03-27 14:49:05 +040011 <form action="/group/{{ .GroupName }}/add-user/" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040012 <fieldset class="grid first">
13 <input type="text" id="username" name="username" placeholder="username" required>
14 <select id="status" name="status" required>
15 <option value="Member" selected>Member</option>
16 <option value="Owner">Owner</option>
17 </select>
18 <button type="submit">Add Member</button>
19 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040020 </form>
DTabidze078385f2024-03-27 14:49:05 +040021 <form action="/group/{{ .GroupName }}/add-child-group" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040022 <fieldset class="grid twoone">
23 <select id="child-group" aria-label="Select" name="child-group" required>
24 {{- range .AllGroups }}
25 <option value="{{ .Name }}">{{ .Name }}</option>
26 {{- end }}
27 </select>
28 <button type="submit">Create Child Group</button>
29 </fieldset>
30 </form>
31 <form action="/group/{{ .GroupName }}/add-owner-group" method="post">
32 <fieldset class="grid twoone">
33 <select id="owner-group" aria-label="Select" name="owner-group" required>
34 {{- range .AllGroups }}
35 <option value="{{ .Name }}">{{ .Name }}</option>
36 {{- end }}
37 </select>
38 <button type="submit">Add Owner Group</button>
39 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040040 </form>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +040041 <hr class="divider">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040042 <h3>Owners</h3>
43 <div class="user-remove">
DTabidze0d802592024-03-19 17:42:45 +040044 {{- range .Owners }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040045 <div>
46 <fieldset role="group">
47 <a class="link-button" href="/user/{{ . }}" role="button">{{ . }}</a>
48 <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?">
49 <button class="remove" type="submit" aria-label="Remove owner">
50 {{ template "svgIcon" }}
51 </button>
52 </form>
53 </fieldset>
54 </div>
DTabidze0d802592024-03-19 17:42:45 +040055 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040056 </div>
57
58 <hr class="divider">
59
60 <h3>Members</h3>
61 <div class="user-remove">
DTabidze0d802592024-03-19 17:42:45 +040062 {{- range .Members }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040063 <div>
64 <fieldset role="group">
65 <a class="link-button" href="/user/{{ . }}" role="button">{{ . }}</a>
66 <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?">
67 <button class="remove" type="submit">
68 {{ template "svgIcon" }}
69 </button>
70 </form>
71 </fieldset>
72 </div>
DTabidze0d802592024-03-19 17:42:45 +040073 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040074 </div>
75 <hr class="divider">
76
77 <h3>Transitive Groups</h3>
78 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +040079 {{- range .TransitiveGroups }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040080 <a class="link-button" href="/group/{{ .Name }}" role="button"
81 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
82 {{ .Name }}
83 </a>
DTabidzec0b4d8f2024-03-22 17:25:10 +040084 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040085 </div>
86 <hr class="divider">
87
88 <h3>Child Groups</h3>
89 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +040090 {{- range .ChildGroups }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040091 <div>
92 <fieldset role="group">
93 <a class="link-button" href="/group/{{ .Name }}" role="button"
94 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
95 {{ .Name }}
96 </a>
DTabidze0757f8a2024-03-28 16:49:09 +040097 <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 +040098 <button class="remove" type="submit">
99 {{ template "svgIcon" }}
100 </button>
DTabidze2b224bf2024-03-27 13:25:49 +0400101 </form>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400102 </fieldset>
103 </div>
DTabidzec0b4d8f2024-03-22 17:25:10 +0400104 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400105 </div>
106 <hr class="divider">
107
108 <h3>Owner Groups</h3>
109 <div class="user-remove">
Davit Tabidzec0d2bf52024-04-03 15:39:33 +0400110 {{- range .OwnerGroups }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400111 <a class="link-button" href="/group/{{ .Name }}" role="button"
112 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
113 {{ .Name }}
114 </a>
Davit Tabidzec0d2bf52024-04-03 15:39:33 +0400115 {{- end }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400116 </div>
117
DTabidze0757f8a2024-03-28 16:49:09 +0400118 <dialog id="confirmation" close>
119 <article>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +0400120 <h3>Attention</h3>
DTabidze0757f8a2024-03-28 16:49:09 +0400121 <p id="confirmation-message">Are you sure?</p>
122 <footer>
123 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
124 <button id="confirm-button">Confirm</button>
125 </footer>
126 </article>
127 </dialog>
DTabidze4b44ff42024-04-02 03:16:26 +0400128{{ end }}