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.6 KiB

  1. <h4 class="ui top attached header">
  2. {{.i18n.Tr "settings.manage_gpg_keys"}}
  3. <div class="ui right">
  4. <div class="ui blue tiny show-panel button" data-panel="#add-gpg-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.gpg_desc"}}
  11. </div>
  12. {{range .GPGKeys}}
  13. <div class="item">
  14. <div class="right floated content">
  15. <button class="ui red tiny button delete-button" id="delete-gpg" data-url="{{$.Link}}/delete?type=gpg" data-id="{{.ID}}">
  16. {{$.i18n.Tr "settings.delete_key"}}
  17. </button>
  18. </div>
  19. <i class="mega-octicon octicon-key {{if or .Expired.IsZero (.Expired.After $.PageStartTime)}}green{{end}}"></i>
  20. <div class="content">
  21. {{range .Emails}}<strong>{{.Email}} </strong>{{end}}
  22. <div class="print meta">
  23. <b>{{$.i18n.Tr "settings.key_id"}}:</b> {{.KeyID}}
  24. <b>{{$.i18n.Tr "settings.subkeys"}}:</b> {{range .SubsKey}} {{.KeyID}} {{end}}
  25. </div>
  26. <div class="activity meta">
  27. <i>{{$.i18n.Tr "settings.add_on"}} <span>{{DateFmtShort .Added}}</span></i>
  28. -
  29. <i>{{$.i18n.Tr "settings.valid_until"}} <span>{{if not .Expired.IsZero }}{{DateFmtShort .Expired}}{{else}}{{$.i18n.Tr "settings.never"}}{{end}}</span></i>
  30. </div>
  31. </div>
  32. </div>
  33. {{end}}
  34. </div>
  35. </div>
  36. <br>
  37. <p>{{.i18n.Tr "settings.gpg_helper" "https://help.github.com/articles/about-gpg/" | Str2html}}</p>
  38. <div {{if not .HasGPGError}}class="hide"{{end}} id="add-gpg-key-panel">
  39. <h4 class="ui top attached header">
  40. {{.i18n.Tr "settings.add_new_gpg_key"}}
  41. </h4>
  42. <div class="ui attached segment">
  43. <form class="ui form" action="{{.Link}}" method="post">
  44. {{.CsrfTokenHtml}}
  45. <input type="hidden" name="title" value="none">
  46. <div class="field {{if .Err_Content}}error{{end}}">
  47. <label for="content">{{.i18n.Tr "settings.key_content"}}</label>
  48. <textarea id="gpg-key-content" name="content" required>{{.content}}</textarea>
  49. </div>
  50. <input name="type" type="hidden" value="gpg">
  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-gpg">
  58. <div class="ui icon header">
  59. <i class="trash icon"></i>
  60. {{.i18n.Tr "settings.gpg_key_deletion"}}
  61. </div>
  62. <div class="content">
  63. <p>{{.i18n.Tr "settings.gpg_key_deletion_desc"}}</p>
  64. </div>
  65. {{template "base/delete_modal_actions" .}}
  66. </div>