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.

69 lines
2.5 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. <div class="left floated content">
  20. <span class="{{if or .ExpiredUnix.IsZero ($.PageStartTime.Before .ExpiredUnix.AsTime)}}green{{end}}">{{svg "octicon-key" 32}}</span>
  21. </div>
  22. <div class="content">
  23. {{range .Emails}}<strong>{{.Email}} </strong>{{end}}
  24. <div class="print meta">
  25. <b>{{$.i18n.Tr "settings.key_id"}}:</b> {{.KeyID}}
  26. <b>{{$.i18n.Tr "settings.subkeys"}}:</b> {{range .SubsKey}} {{.KeyID}} {{end}}
  27. </div>
  28. <div class="activity meta">
  29. <i>{{$.i18n.Tr "settings.add_on"}} <span>{{.AddedUnix.FormatShort}}</span></i>
  30. -
  31. <i>{{if not .ExpiredUnix.IsZero}}{{$.i18n.Tr "settings.valid_until"}} <span>{{.ExpiredUnix.FormatShort}}</span>{{else}}{{$.i18n.Tr "settings.valid_forever"}}{{end}}</i>
  32. </div>
  33. </div>
  34. </div>
  35. {{end}}
  36. </div>
  37. </div>
  38. <br>
  39. <p>{{.i18n.Tr "settings.gpg_helper" "https://help.github.com/articles/about-gpg/" | Str2html}}</p>
  40. <div {{if not .HasGPGError}}class="hide"{{end}} id="add-gpg-key-panel">
  41. <h4 class="ui top attached header">
  42. {{.i18n.Tr "settings.add_new_gpg_key"}}
  43. </h4>
  44. <div class="ui attached segment">
  45. <form class="ui form" action="{{.Link}}" method="post">
  46. {{.CsrfTokenHtml}}
  47. <input type="hidden" name="title" value="none">
  48. <div class="field {{if .Err_Content}}error{{end}}">
  49. <label for="content">{{.i18n.Tr "settings.key_content"}}</label>
  50. <textarea id="gpg-key-content" name="content" required>{{.content}}</textarea>
  51. </div>
  52. <input name="type" type="hidden" value="gpg">
  53. <button class="ui green button">
  54. {{.i18n.Tr "settings.add_key"}}
  55. </button>
  56. </form>
  57. </div>
  58. </div>
  59. <div class="ui small basic delete modal" id="delete-gpg">
  60. <div class="ui icon header">
  61. <i class="trash icon"></i>
  62. {{.i18n.Tr "settings.gpg_key_deletion"}}
  63. </div>
  64. <div class="content">
  65. <p>{{.i18n.Tr "settings.gpg_key_deletion_desc"}}</p>
  66. </div>
  67. {{template "base/delete_modal_actions" .}}
  68. </div>