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.

87 lines
3.1 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. <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div>
  11. </div>
  12. </h4>
  13. <div class="ui attached segment">
  14. {{if .Deploykeys}}
  15. <div class="ui key list">
  16. {{range .Deploykeys}}
  17. <div class="item">
  18. <div class="right floated content">
  19. <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" 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"{{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>{{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>
  31. </div>
  32. </div>
  33. </div>
  34. {{end}}
  35. </div>
  36. {{else}}
  37. {{.i18n.Tr "repo.settings.no_deploy_keys"}}
  38. {{end}}
  39. </div>
  40. <br>
  41. <div {{if not .HasError}}class="hide"{{end}} id="add-deploy-key-panel">
  42. <h4 class="ui top attached header">
  43. {{.i18n.Tr "repo.settings.add_deploy_key"}}
  44. </h4>
  45. <div class="ui attached segment">
  46. <form class="ui form" action="{{.Link}}" method="post">
  47. {{.CsrfTokenHtml}}
  48. <div class="field">
  49. {{.i18n.Tr "repo.settings.deploy_key_desc"}}
  50. </div>
  51. <div class="field {{if .Err_Title}}error{{end}}">
  52. <label for="title">{{.i18n.Tr "repo.settings.title"}}</label>
  53. <input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
  54. </div>
  55. <div class="field {{if .Err_Content}}error{{end}}">
  56. <label for="content">{{.i18n.Tr "repo.settings.deploy_key_content"}}</label>
  57. <textarea id="ssh-key-content" name="content" required>{{.content}}</textarea>
  58. </div>
  59. <button class="ui green button">
  60. {{.i18n.Tr "repo.settings.add_deploy_key"}}
  61. </button>
  62. </form>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="ui small basic delete modal">
  68. <div class="ui icon header">
  69. <i class="trash icon"></i>
  70. {{.i18n.Tr "repo.settings.deploy_key_deletion"}}
  71. </div>
  72. <div class="content">
  73. <p>{{.i18n.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
  74. </div>
  75. <div class="actions">
  76. <div class="ui red basic inverted cancel button">
  77. <i class="remove icon"></i>
  78. {{.i18n.Tr "modal.no"}}
  79. </div>
  80. <div class="ui green basic inverted ok button">
  81. <i class="checkmark icon"></i>
  82. {{.i18n.Tr "modal.yes"}}
  83. </div>
  84. </div>
  85. </div>
  86. {{template "base/footer" .}}