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.

74 lines
2.8 KiB

  1. {{template "base/head" .}}
  2. <div class="user settings sshkeys">
  3. {{template "user/settings/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <h4 class="ui top attached header">
  7. {{.i18n.Tr "settings.manage_ssh_keys"}}
  8. <div class="ui right">
  9. <div class="ui blue tiny show-panel button" data-panel="#add-ssh-key-panel">{{.i18n.Tr "settings.add_key"}}</div>
  10. </div>
  11. </h4>
  12. <div class="ui attached segment">
  13. <div class="ui key list">
  14. <div class="item">
  15. {{.i18n.Tr "settings.ssh_desc"}}
  16. </div>
  17. {{range .Keys}}
  18. <div class="item">
  19. <div class="right floated content">
  20. <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
  21. {{$.i18n.Tr "settings.delete_key"}}
  22. </button>
  23. </div>
  24. <i class="mega-octicon octicon-key {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted tiny"{{end}}></i>
  25. <div class="content">
  26. <strong>{{.Name}}</strong>
  27. <div class="print meta">
  28. {{.Fingerprint}}
  29. </div>
  30. <div class="activity meta">
  31. <i>{{$.i18n.Tr "settings.add_on"}} <span>{{DateFmtShort .Created}}</span> — <i class="octicon octicon-info"></i> {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateFmtShort .Updated}}</span>{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i>
  32. </div>
  33. </div>
  34. </div>
  35. {{end}}
  36. </div>
  37. </div>
  38. <br>
  39. <p>{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2html}}</p>
  40. <div {{if not .HasError}}class="hide"{{end}} id="add-ssh-key-panel">
  41. <h4 class="ui top attached header">
  42. {{.i18n.Tr "settings.add_new_key"}}
  43. </h4>
  44. <div class="ui attached segment">
  45. <form class="ui form" action="{{.Link}}" method="post">
  46. {{.CsrfTokenHtml}}
  47. <div class="field {{if .Err_Title}}error{{end}}">
  48. <label for="title">{{.i18n.Tr "settings.key_name"}}</label>
  49. <input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
  50. </div>
  51. <div class="field {{if .Err_Content}}error{{end}}">
  52. <label for="content">{{.i18n.Tr "settings.key_content"}}</label>
  53. <textarea id="ssh-key-content" name="content" required>{{.content}}</textarea>
  54. </div>
  55. <button class="ui green button">
  56. {{.i18n.Tr "settings.add_key"}}
  57. </button>
  58. </form>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="ui small basic delete modal">
  64. <div class="ui icon header">
  65. <i class="trash icon"></i>
  66. {{.i18n.Tr "settings.ssh_key_deletion"}}
  67. </div>
  68. <div class="content">
  69. <p>{{.i18n.Tr "settings.ssh_key_deletion_desc"}}</p>
  70. </div>
  71. {{template "base/delete_modal_actions" .}}
  72. </div>
  73. {{template "base/footer" .}}