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.

71 lines
3.0 KiB

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