summaryrefslogtreecommitdiffstats
path: root/templates/user/settings/sshkeys.tmpl
blob: 2d1861210baeea4f66a0669d47559b5a6797becd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="setting-wrapper" class="main-wrapper">
    <div id="user-profile-setting" class="container clear">
        {{template "user/settings/nav" .}}
        <div class="grid-4-5 left">
            <div class="setting-content">
                {{template "ng/base/alert" .}}
                <div id="user-ssh-setting-content">
                    <div id="user-ssh-panel" class="panel panel-radius">
                        <div class="panel-header">
                            <a class="btn btn-small btn-black btn-header btn-radius right" id="ssh-add">{{.i18n.Tr "settings.add_key"}}</a>
                            <strong>{{.i18n.Tr "settings.manage_ssh_keys"}}</strong>
                        </div>
                        <ul class="panel-body setting-list">
                            <li>{{.i18n.Tr "settings.ssh_desc"}}</li>
                            {{range .Keys}}
                            <li class="ssh clear">
                                <span class="active-icon left label label-{{if .HasRecentActivity}}green{{else}}gray{{end}} label-radius"></span>
                                <i class="mega-octicon octicon-key left"></i>
                                <div class="ssh-content left">
                                    <p><strong>{{.Name}}</strong></p>
                                    <p class="print">{{.Fingerprint}}</p>
                                    <p class="activity"><i>{{$.i18n.Tr "settings.add_on"}} {{DateFormat .Created "M d, Y"}} —  <i class="octicon octicon-info"></i>{{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{DateFormat .Updated "M d, Y"}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i></p>
                                </div>
                                <form action="{{AppRootSubUrl}}/user/settings/ssh" method="post">
                                    {{$.CsrfTokenHtml}}
                                    <input name="_method" type="hidden" value="DELETE">
                                    <input name="id" type="hidden" value="{{.Id}}">
                                    <button class="right ssh-delete-btn btn btn-red btn-radius btn-small">{{$.i18n.Tr "settings.delete_key"}}</button>
                                </form>
                            </li>
                            {{end}}
                        </ul>
                    </div>
                    <p>{{.i18n.Tr "settings.ssh_helper" | Str2html}}</p>
                    <br>
                    <form class="panel panel-radius form form-align hide" id="user-ssh-add-form" action="{{AppRootSubUrl}}/user/settings/ssh" method="post">
                        {{.CsrfTokenHtml}}
                        <p class="panel-header"><strong>{{.i18n.Tr "settings.add_new_key"}}</strong></p>
                        <div class="panel-body">
                            <p class="field">
                                <label class="req" for="ssh-title">{{.i18n.Tr "settings.key_name"}}</label>
                                <input class="ipt ipt-radius" id="ssh-title" name="title" type="text" required />
                            </p>
                            <p class="field clear">
                                <label class="left req" for="ssh-key">{{.i18n.Tr "settings.key_content"}}</label>
                                <textarea class="ipt ipt-radius left" name="content" id="ssh-key" required></textarea>
                            </p>
                            <p class="field">
                                <label></label>
                                <button class="btn btn-green btn-radius" id="ssh-add-btn">{{.i18n.Tr "settings.add_key"}}</button>
                            </p>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{{template "ng/base/footer" .}}