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.

77 lines
2.6 KiB

  1. {{template "base/head" .}}
  2. <div class="user settings applications">
  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" id="delete-token" 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. <div class="ui attached bottom segment">
  33. <h5 class="ui top header">
  34. {{.i18n.Tr "settings.generate_new_token"}}
  35. </h5>
  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. {{if .EnableOAuth2}}
  49. {{template "user/settings/grants_oauth2" .}}
  50. {{template "user/settings/applications_oauth2" .}}
  51. {{end}}
  52. </div>
  53. </div>
  54. <div class="ui small basic delete modal" id="delete-token">
  55. <div class="ui icon header">
  56. <i class="trash icon"></i>
  57. {{.i18n.Tr "settings.access_token_deletion"}}
  58. </div>
  59. <div class="content">
  60. <p>{{.i18n.Tr "settings.access_token_deletion_desc"}}</p>
  61. </div>
  62. <div class="actions">
  63. <div class="ui red basic inverted cancel button">
  64. <i class="remove icon"></i>
  65. {{.i18n.Tr "modal.no"}}
  66. </div>
  67. <div class="ui green basic inverted ok button">
  68. <i class="checkmark icon"></i>
  69. {{.i18n.Tr "modal.yes"}}
  70. </div>
  71. </div>
  72. </div>
  73. {{template "base/footer" .}}