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.

91 lines
3.3 KiB

  1. {{template "base/head" .}}
  2. <div class="repository settings">
  3. {{template "repo/header" .}}
  4. {{template "repo/settings/navbar" .}}
  5. <div class="ui container">
  6. {{template "base/alert" .}}
  7. <h4 class="ui top attached header">
  8. {{.i18n.Tr "repo.settings.deploy_keys"}}
  9. <div class="ui right">
  10. {{if not .DisableSSH}}
  11. <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div>
  12. {{else}}
  13. <div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
  14. {{end}}
  15. </div>
  16. </h4>
  17. <div class="ui attached segment">
  18. {{if .Deploykeys}}
  19. <div class="ui key list">
  20. {{range .Deploykeys}}
  21. <div class="item">
  22. <div class="right floated content">
  23. <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
  24. {{$.i18n.Tr "settings.delete_key"}}
  25. </button>
  26. </div>
  27. <i class="mega-octicon octicon-key {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}></i>
  28. <div class="content">
  29. <strong>{{.Name}}</strong>
  30. <div class="print meta">
  31. {{.Fingerprint}}
  32. </div>
  33. <div class="activity meta">
  34. <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>
  35. </div>
  36. </div>
  37. </div>
  38. {{end}}
  39. </div>
  40. {{else}}
  41. {{.i18n.Tr "repo.settings.no_deploy_keys"}}
  42. {{end}}
  43. </div>
  44. <br>
  45. <div {{if not .HasError}}class="hide"{{end}} id="add-deploy-key-panel">
  46. <h4 class="ui top attached header">
  47. {{.i18n.Tr "repo.settings.add_deploy_key"}}
  48. </h4>
  49. <div class="ui attached segment">
  50. <form class="ui form" action="{{.Link}}" method="post">
  51. {{.CsrfTokenHtml}}
  52. <div class="field">
  53. {{.i18n.Tr "repo.settings.deploy_key_desc"}}
  54. </div>
  55. <div class="field {{if .Err_Title}}error{{end}}">
  56. <label for="title">{{.i18n.Tr "repo.settings.title"}}</label>
  57. <input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
  58. </div>
  59. <div class="field {{if .Err_Content}}error{{end}}">
  60. <label for="content">{{.i18n.Tr "repo.settings.deploy_key_content"}}</label>
  61. <textarea id="ssh-key-content" name="content" required>{{.content}}</textarea>
  62. </div>
  63. <button class="ui green button">
  64. {{.i18n.Tr "repo.settings.add_deploy_key"}}
  65. </button>
  66. </form>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="ui small basic delete modal">
  72. <div class="ui icon header">
  73. <i class="trash icon"></i>
  74. {{.i18n.Tr "repo.settings.deploy_key_deletion"}}
  75. </div>
  76. <div class="content">
  77. <p>{{.i18n.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
  78. </div>
  79. <div class="actions">
  80. <div class="ui red basic inverted cancel button">
  81. <i class="remove icon"></i>
  82. {{.i18n.Tr "modal.no"}}
  83. </div>
  84. <div class="ui green basic inverted ok button">
  85. <i class="checkmark icon"></i>
  86. {{.i18n.Tr "modal.yes"}}
  87. </div>
  88. </div>
  89. </div>
  90. {{template "base/footer" .}}