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.

67 lines
2.8 KiB

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