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.

70 lines
2.5 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. </h4>
  9. <div class="ui attached segment">
  10. <div class="ui key list">
  11. <div class="item">
  12. {{.i18n.Tr "settings.tokens_desc"}}
  13. </div>
  14. {{range .Tokens}}
  15. <div class="item">
  16. <div class="right floated content">
  17. <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
  18. {{$.i18n.Tr "settings.delete_token"}}
  19. </button>
  20. </div>
  21. <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>
  22. <div class="content">
  23. <strong>{{.Name}}</strong>
  24. <div class="activity meta">
  25. <i>{{$.i18n.Tr "settings.add_on"}} <span>{{.CreatedUnix.FormatShort}}</span> — <i class="octicon octicon-info"></i> {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{.UpdatedUnix.FormatShort}}</span>{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i>
  26. </div>
  27. </div>
  28. </div>
  29. {{end}}
  30. </div>
  31. </div>
  32. <h4 class="ui top attached header">
  33. {{.i18n.Tr "settings.generate_new_token"}}
  34. </h4>
  35. <div class="ui attached segment">
  36. <p>{{.i18n.Tr "settings.new_token_desc"}}</p>
  37. <form class="ui form ignore-dirty" action="{{.Link}}" method="post">
  38. {{.CsrfTokenHtml}}
  39. <div class="field {{if .Err_Name}}error{{end}}">
  40. <label for="name">{{.i18n.Tr "settings.token_name"}}</label>
  41. <input id="name" name="name" value="{{.name}}" autofocus required>
  42. </div>
  43. <button class="ui green button">
  44. {{.i18n.Tr "settings.generate_token"}}
  45. </button>
  46. </form>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="ui small basic delete modal">
  51. <div class="ui icon header">
  52. <i class="trash icon"></i>
  53. {{.i18n.Tr "settings.access_token_deletion"}}
  54. </div>
  55. <div class="content">
  56. <p>{{.i18n.Tr "settings.access_token_deletion_desc"}}</p>
  57. </div>
  58. <div class="actions">
  59. <div class="ui red basic inverted cancel button">
  60. <i class="remove icon"></i>
  61. {{.i18n.Tr "modal.no"}}
  62. </div>
  63. <div class="ui green basic inverted ok button">
  64. <i class="checkmark icon"></i>
  65. {{.i18n.Tr "modal.yes"}}
  66. </div>
  67. </div>
  68. </div>
  69. {{template "base/footer" .}}