mirror of
https://github.com/go-gitea/gitea
synced 2024-11-28 19:33:29 +01:00
6c86034e0f
Backport #30707 by @silverwind Fixes https://github.com/go-gitea/gitea/issues/30673, all 23 issues. Notes: - Tab bar menus had to change to pills because of unsolvable issue with the border-radius as tab bar renders a overlapping border onto the box below. And I think pills look better. - Added padding to code editor empty preview message - Hide monaco's built-in blue focus border, we don't need it and it never showed before either. - Label add menu is simplified, removing the nested segment. <img width="1322" alt="Screenshot 2024-04-25 at 22 26 19" src="https://github.com/go-gitea/gitea/assets/115237/7e394e0c-b7ad-417d-8e9f-12f1dea93ed1"> <img width="1326" alt="Screenshot 2024-04-25 at 22 28 00" src="https://github.com/go-gitea/gitea/assets/115237/66c8499f-aa9f-4d95-8cca-ef13dfa82c65"> <img width="997" alt="Screenshot 2024-04-25 at 22 36 53" src="https://github.com/go-gitea/gitea/assets/115237/07896102-c71d-4246-8173-c2bc2e1d3cae"> <img width="832" alt="Screenshot 2024-04-25 at 22 56 09" src="https://github.com/go-gitea/gitea/assets/115237/d83afc96-08ca-4adc-baf4-3d02804be57c"> <img width="361" alt="Screenshot 2024-04-25 at 22 57 12" src="https://github.com/go-gitea/gitea/assets/115237/c7371a68-00b5-47d8-84d0-ddc5268b2b2c"> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
115 lines
4.8 KiB
Handlebars
115 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">
|
|
{{ctx.Locale.Tr "settings.manage_access_token"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<div class="flex-list">
|
|
<div class="flex-item">
|
|
{{ctx.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="{{ctx.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="tw-my-1">
|
|
{{ctx.Locale.Tr "settings.repo_and_org_access"}}:
|
|
{{if .DisplayPublicOnly}}
|
|
{{ctx.Locale.Tr "settings.permissions_public_only"}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "settings.permissions_access_all"}}
|
|
{{end}}
|
|
</p>
|
|
<p class="tw-my-1">{{ctx.Locale.Tr "settings.permissions_list"}}</p>
|
|
<ul class="tw-my-1">
|
|
{{range .Scope.StringSlice}}
|
|
{{if (ne . $.AccessTokenScopePublicOnly)}}
|
|
<li>{{.}}</li>
|
|
{{end}}
|
|
{{end}}
|
|
</ul>
|
|
</details>
|
|
<div class="flex-item-body">
|
|
<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{ctx.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 "tw-mr-1"}}
|
|
{{ctx.Locale.Tr "settings.delete_token"}}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="ui bottom attached segment">
|
|
<h5 class="ui top header">
|
|
{{ctx.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">{{ctx.Locale.Tr "settings.token_name"}}</label>
|
|
<input id="name" name="name" value="{{.name}}" autofocus required maxlength="255">
|
|
</div>
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "settings.repo_and_org_access"}}</label>
|
|
<label class="tw-cursor-pointer">
|
|
<input class="enable-system tw-mt-1 tw-mr-1" type="radio" name="scope" value="{{$.AccessTokenScopePublicOnly}}">
|
|
{{ctx.Locale.Tr "settings.permissions_public_only"}}
|
|
</label>
|
|
<label class="tw-cursor-pointer">
|
|
<input class="enable-system tw-mt-1 tw-mr-1" type="radio" name="scope" value="" checked>
|
|
{{ctx.Locale.Tr "settings.permissions_access_all"}}
|
|
</label>
|
|
</div>
|
|
<details class="ui optional field">
|
|
<summary class="tw-pb-4 tw-pl-1">
|
|
{{ctx.Locale.Tr "settings.select_permissions"}}
|
|
</summary>
|
|
<p class="activity meta">
|
|
<i>{{ctx.Locale.Tr "settings.access_token_desc" (`href="/api/swagger" target="_blank"`|SafeHTML) (`href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`|SafeHTML)}}</i>
|
|
</p>
|
|
<div class="scoped-access-token-mount">
|
|
<scoped-access-token-selector
|
|
:is-admin="{{if .IsAdmin}}true{{else}}false{{end}}"
|
|
no-access-label="{{ctx.Locale.Tr "settings.permission_no_access"}}"
|
|
read-label="{{ctx.Locale.Tr "settings.permission_read"}}"
|
|
write-label="{{ctx.Locale.Tr "settings.permission_write"}}"
|
|
></scoped-access-token-selector>
|
|
</div>
|
|
</details>
|
|
<button id="scoped-access-submit" class="ui primary button">
|
|
{{ctx.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 tw-hidden">
|
|
{{ctx.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"}}
|
|
{{ctx.Locale.Tr "settings.access_token_deletion"}}
|
|
</div>
|
|
<div class="content">
|
|
<p>{{ctx.Locale.Tr "settings.access_token_deletion_desc"}}</p>
|
|
</div>
|
|
{{template "base/modal_actions_confirm"}}
|
|
</div>
|
|
|
|
{{template "user/settings/layout_footer" .}}
|