blob: eda7eb51b2df58676c6c23273b01ba4580242871 [file] [log] [blame]
DTabidze4b44ff42024-04-02 03:16:26 +04001{{ define "title" }}
gio134be722025-07-20 19:01:17 +04002 User - {{ .User.Username }}
DTabidze4b44ff42024-04-02 03:16:26 +04003{{ end }}
4{{- define "content" -}}
gio134be722025-07-20 19:01:17 +04005 {{ $currentUserId := .User.Id }}
Davit Tabidze75d57c32024-07-19 19:17:55 +04006 {{ $isLoggedInUser := .LoggedInUserPage}}
gio134be722025-07-20 19:01:17 +04007 <h1 class="headline">User: {{ .User.Username }}</h1>
8 <p>{{ .User.Email }}</p>
Davit Tabidze75d57c32024-07-19 19:17:55 +04009 <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 }}
gio134be722025-07-20 19:01:17 +040018 <form action="/user/{{ $currentUserId }}/remove-ssh-key" method="post" class="remove-form" data-confirmation-message="Are you sure you want to remove SSH key?">
Davit Tabidze75d57c32024-07-19 19:17:55 +040019 <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">
gio134be722025-07-20 19:01:17 +040032 <form action="/user/{{ .User.Id }}/ssh-key" method="post">
Davit Tabidze75d57c32024-07-19 19:17:55 +040033 <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">
gio134be722025-07-20 19:01:17 +040041 <input type="text" id="id" name="id" placeholder="Id" required>
42 <input type="text" id="title" name="title" placeholder="Title" required>
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040043 <input type="text" id="description" name="description" placeholder="Description">
44 <button type="submit">Create Group</button>
45 </fieldset>
DTabidze0d802592024-03-19 17:42:45 +040046 </form>
DTabidze5d735e32024-03-26 16:01:06 +040047 {{ end }}
Davit Tabidze75d57c32024-07-19 19:17:55 +040048 <hr class="divider">
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040049
50 <h3>Owner of groups</h3>
51 <div class="user-remove">
52 {{- range .OwnerGroups }}
gio134be722025-07-20 19:01:17 +040053 <a href="/group/{{ .Id }}" role="button"
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040054 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
gio134be722025-07-20 19:01:17 +040055 {{ .Title }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040056 </a>
57 {{- end }}
58 </div>
59 <hr class="divider">
60
61 <h3>Direct member of groups</h3>
62 <div class="user-remove">
63 {{- range .MembershipGroups }}
gio134be722025-07-20 19:01:17 +040064 <a href="/group/{{ .Id }}" role="button"
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040065 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
gio134be722025-07-20 19:01:17 +040066 {{ .Title }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040067 </a>
68 {{- end }}
69 </div>
70 <hr class="divider">
71
72 <h3>Transitive member of groups</h3>
73 <div class="user-remove">
DTabidzec0b4d8f2024-03-22 17:25:10 +040074 {{- range .TransitiveGroups -}}
gio134be722025-07-20 19:01:17 +040075 <a href="/group/{{ .Id }}" role="button"
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040076 {{ if ne .Description "" }} data-tooltip="{{ .Description }}" data-placement="bottom" {{ end }}>
gio134be722025-07-20 19:01:17 +040077 {{ .Title }}
Davit Tabidze5f1a2c62024-07-17 17:57:27 +040078 </a>
79 {{- end }}
80 </div>
Davit Tabidze75d57c32024-07-19 19:17:55 +040081
82 <dialog id="confirmation" close>
83 <article>
84 <h3>Attention</h3>
85 <p id="confirmation-message">Are you sure?</p>
86 <footer>
87 <button id="cancel-button" class="secondary cancel-button">Cancel</button>
88 <button id="confirm-button">Confirm</button>
89 </footer>
90 </article>
91 </dialog>
DTabidze4b44ff42024-04-02 03:16:26 +040092{{- end }}