8099238618
I think it's better if the primary actions have primary color instead of green which fits better into the overall single-color UI design. This PR currently replaces every green button with primary: <img width="141" alt="Screenshot 2023-09-16 at 14 07 59" src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe"> <img width="161" alt="Screenshot 2023-09-16 at 14 07 51" src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1"> Modal actions now use uncolored/primary instead of previous green/red colors. I also removed the box-shadow on all basic buttons: <img width="259" alt="Screenshot 2023-09-16 at 14 16 39" src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490"> <img width="261" alt="Screenshot 2023-09-16 at 14 17 42" src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88"> The change currently includes the "Merge PR" button, for which we might want to make an exception to match the icon color there: <img width="442" alt="Screenshot 2023-09-16 at 14 33 53" src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">
116 lines
4.8 KiB
Handlebars
116 lines
4.8 KiB
Handlebars
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings applications")}}
|
|
<div class="user-setting-content">
|
|
<h4 class="ui top attached header">
|
|
{{.locale.Tr "settings.manage_access_token"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<div class="flex-list">
|
|
<div class="flex-item">
|
|
{{.locale.Tr "settings.tokens_desc"}}
|
|
</div>
|
|
{{range .Tokens}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-leading">
|
|
<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.token_state_desc"}}"{{end}}>
|
|
{{svg "fontawesome-send" 32}}
|
|
</span>
|
|
</div>
|
|
<div class="flex-item-main">
|
|
<details>
|
|
<summary><span class="flex-item-title">{{.Name}}</span></summary>
|
|
<p class="gt-my-2">
|
|
{{$.locale.Tr "settings.repo_and_org_access"}}:
|
|
{{if .DisplayPublicOnly}}
|
|
{{$.locale.Tr "settings.permissions_public_only"}}
|
|
{{else}}
|
|
{{$.locale.Tr "settings.permissions_access_all"}}
|
|
{{end}}
|
|
</p>
|
|
<p class="gt-my-2">{{$.locale.Tr "settings.permissions_list"}}</p>
|
|
<ul class="gt-my-2">
|
|
{{range .Scope.StringSlice}}
|
|
{{if (ne . $.AccessTokenScopePublicOnly)}}
|
|
<li>{{.}}</li>
|
|
{{end}}
|
|
{{end}}
|
|
</ul>
|
|
</details>
|
|
<div class="flex-item-body">
|
|
<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
|
|
</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui red tiny button delete-button" data-modal-id="delete-token" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
|
|
{{svg "octicon-trash" 16 "gt-mr-2"}}
|
|
{{$.locale.Tr "settings.delete_token"}}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="ui attached bottom segment">
|
|
<h5 class="ui top header">
|
|
{{.locale.Tr "settings.generate_new_token"}}
|
|
</h5>
|
|
<form id="scoped-access-form" class="ui form ignore-dirty" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<div class="field {{if .Err_Name}}error{{end}}">
|
|
<label for="name">{{.locale.Tr "settings.token_name"}}</label>
|
|
<input id="name" name="name" value="{{.name}}" autofocus required maxlength="255">
|
|
</div>
|
|
<div class="field">
|
|
<label>{{.locale.Tr "settings.repo_and_org_access"}}</label>
|
|
<label class="gt-cursor-pointer">
|
|
<input class="enable-system gt-mt-2 gt-mr-2" type="radio" name="scope" value="{{$.AccessTokenScopePublicOnly}}">
|
|
{{.locale.Tr "settings.permissions_public_only"}}
|
|
</label>
|
|
<label class="gt-cursor-pointer">
|
|
<input class="enable-system gt-mt-2 gt-mr-2" type="radio" name="scope" value="" checked>
|
|
{{.locale.Tr "settings.permissions_access_all"}}
|
|
</label>
|
|
</div>
|
|
<details class="ui optional field">
|
|
<summary class="gt-pb-4 gt-pl-2">
|
|
{{.locale.Tr "settings.select_permissions"}}
|
|
</summary>
|
|
<p class="activity meta">
|
|
<i>{{$.locale.Tr "settings.access_token_desc" (printf `href="/api/swagger" target="_blank"`) (printf `href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`) | Str2html}}</i>
|
|
</p>
|
|
<div class="scoped-access-token-mount">
|
|
<scoped-access-token-selector
|
|
:is-admin="{{if .IsAdmin}}true{{else}}false{{end}}"
|
|
no-access-label="{{.locale.Tr "settings.permission_no_access"}}"
|
|
read-label="{{.locale.Tr "settings.permission_read"}}"
|
|
write-label="{{.locale.Tr "settings.permission_write"}}"
|
|
></scoped-access-token-selector>
|
|
</div>
|
|
</details>
|
|
<button id="scoped-access-submit" class="ui primary button">
|
|
{{.locale.Tr "settings.generate_token"}}
|
|
</button>
|
|
</form>{{/* Fomantic ".ui.form .warning.message" is hidden by default, so put the warning message out of the form*/}}
|
|
<div id="scoped-access-warning" class="ui warning message center gt-hidden">
|
|
{{.locale.Tr "settings.at_least_one_permission"}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if .EnableOAuth2}}
|
|
{{template "user/settings/grants_oauth2" .}}
|
|
{{template "user/settings/applications_oauth2" .}}
|
|
{{end}}
|
|
</div>
|
|
|
|
<div class="ui g-modal-confirm delete modal" id="delete-token">
|
|
<div class="header">
|
|
{{svg "octicon-trash"}}
|
|
{{.locale.Tr "settings.access_token_deletion"}}
|
|
</div>
|
|
<div class="content">
|
|
<p>{{.locale.Tr "settings.access_token_deletion_desc"}}</p>
|
|
</div>
|
|
{{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonColors" "yellow")}}
|
|
</div>
|
|
|
|
{{template "user/settings/layout_footer" .}}
|