blob: 562f27dcea998c929d3af6ff3ca10988368a4104 [file] [log] [blame]
DTabidze4b44ff42024-04-02 03:16:26 +04001{{ define "title" }}
2 User - {{ .CurrentUser }}
3{{ end }}
4{{- define "content" -}}
Davit Tabidze75d57c32024-07-19 19:17:55 +04005 {{ $currentUser := .CurrentUser }}
6 {{ $isLoggedInUser := .LoggedInUserPage}}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +04007 <h1 class="headline">User: {{ .CurrentUser }}</h1>
Davit Tabidze75d57c32024-07-19 19:17:55 +04008 <p>{{ .Email }}</p>
9 <hr class="divider">
10 <h3>SSH Public keys</h3>
11 <div class="ssh-key-grid">
12 {{ if eq (len .SSHPublicKeys) 0 }}
13 <p>No SSH keys configured.</p>
14 {{ else }}
15 {{ range .SSHPublicKeys }}
16 <div class="ssh-key-item">
17 {{ if $isLoggedInUser }}
18 <form action="/user/{{ $currentUser }}/remove-ssh-key" method="post" class="remove-form" data-confirmation-message="Are you sure you want to remove SSH key?">
19 <input type="hidden" name="ssh-key" value="{{ . }}">
20 <button class="remove ssh-remove" type="submit">
21 <div>{{ template "svgIcon" }}</div>
22 </button>
23 </form>
24 {{ end }}
25 <div class="ssh-key">{{ . }}</div>
26 </div>
27 {{ end }}
28 {{ end }}
29 </div>
DTabidze5d735e32024-03-26 16:01:06 +040030 {{ if .LoggedInUserPage }}
Davit Tabidze75d57c32024-07-19 19:17:55 +040031 <hr class="divider">
32 <form action="/user/{{ .CurrentUser }}/ssh-key" method="post">
33 <fieldset class="grid twoone">
34 <input type="text" id="ssh-hey" name="ssh-key" placeholder="Add SSH public key..." required>
35 <button type="submit">Add SSH public key</button>
36 </fieldset>
37 </form>
38 <hr class="divider">
DTabidze0d802592024-03-19 17:42:45 +040039 <form action="/create-group" method="post">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040040 <fieldset class="grid first">
41 <input type="text" id="group-name" name="group-name" placeholder="Group name" required>
42 <input type="text" id="description" name="description" placeholder="Description">
43 <button type="submit">Create Group</button>
44 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040045 </form>
DTabidze5d735e32024-03-26 16:01:06 +040046 {{ end }}
Davit Tabidze75d57c32024-07-19 19:17:55 +040047 <hr class="divider">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040048
49 <h3>Owner of groups</h3>
50 <div class="user-remove">
51 {{- range .OwnerGroups }}
52 <a href="/group/{{ .Name }}" role="button"
53 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
54 {{ .Name }}
55 </a>
56 {{- end }}
57 </div>
58 <hr class="divider">
59
60 <h3>Direct member of groups</h3>
61 <div class="user-remove">
62 {{- range .MembershipGroups }}
63 <a href="/group/{{ .Name }}" role="button"
64 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
65 {{ .Name }}
66 </a>
67 {{- end }}
68 </div>
69 <hr class="divider">
70
71 <h3>Transitive member of groups</h3>
72 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +040073 {{- range .TransitiveGroups -}}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040074 <a href="/group/{{ .Name }}" role="button"
75 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
76 {{ .Name }}
77 </a>
78 {{- end }}
79 </div>
Davit Tabidze75d57c32024-07-19 19:17:55 +040080
81 <dialog id="confirmation" close>
82 <article>
83 <h3>Attention</h3>
84 <p id="confirmation-message">Are you sure?</p>
85 <footer>
86 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
87 <button id="confirm-button">Confirm</button>
88 </footer>
89 </article>
90 </dialog>
DTabidze4b44ff42024-04-02 03:16:26 +040091{{- end }}