You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
4.1 KiB

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