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.

76 lines
2.7 KiB

  1. {{template "base/head" .}}
  2. <div class="user settings">
  3. {{template "user/settings/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <h4 class="ui top attached header">
  7. {{.i18n.Tr "settings.manage_access_token"}}
  8. <div class="ui right">
  9. <div class="ui blue tiny show-panel button" data-panel="#add-access-token-panel">{{.i18n.Tr "settings.generate_new_token"}}</div>
  10. </div>
  11. </h4>
  12. <div class="ui attached segment">
  13. <div class="ui key list">
  14. <div class="item">
  15. {{.i18n.Tr "settings.tokens_desc"}}
  16. </div>
  17. {{range .Tokens}}
  18. <div class="item">
  19. <div class="right floated content">
  20. <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
  21. {{$.i18n.Tr "settings.delete_token"}}
  22. </button>
  23. </div>
  24. <i class="big send icon {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.token_state_desc"}}" data-variation="inverted tiny"{{end}}></i>
  25. <div class="content">
  26. <strong>{{.Name}}</strong>
  27. <div class="activity meta">
  28. <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>
  29. </div>
  30. </div>
  31. </div>
  32. {{end}}
  33. </div>
  34. </div>
  35. <br>
  36. <div {{if not .HasError}}class="hide"{{end}} id="add-access-token-panel">
  37. <h4 class="ui top attached header">
  38. {{.i18n.Tr "settings.generate_new_token"}}
  39. </h4>
  40. <div class="ui attached segment">
  41. <form class="ui form" action="{{.Link}}" method="post">
  42. {{.CsrfTokenHtml}}
  43. <p>{{.i18n.Tr "settings.new_token_desc"}}</p>
  44. <div class="field {{if .Err_Name}}error{{end}}">
  45. <label for="name">{{.i18n.Tr "settings.token_name"}}</label>
  46. <input id="name" name="name" value="{{.name}}" autofocus required>
  47. </div>
  48. <button class="ui green button">
  49. {{.i18n.Tr "settings.generate_token"}}
  50. </button>
  51. </form>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="ui small basic delete modal">
  57. <div class="ui icon header">
  58. <i class="trash icon"></i>
  59. {{.i18n.Tr "settings.access_token_deletion"}}
  60. </div>
  61. <div class="content">
  62. <p>{{.i18n.Tr "settings.access_token_deletion_desc"}}</p>
  63. </div>
  64. <div class="actions">
  65. <div class="ui red basic inverted cancel button">
  66. <i class="remove icon"></i>
  67. {{.i18n.Tr "modal.no"}}
  68. </div>
  69. <div class="ui green basic inverted ok button">
  70. <i class="checkmark icon"></i>
  71. {{.i18n.Tr "modal.yes"}}
  72. </div>
  73. </div>
  74. </div>
  75. {{template "base/footer" .}}