mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 17:20:53 +02:00
Merge branch 'origin/main' into session-management
Conflict resolutions: - models/migrations/v1_26/v328.go: kept origin/main's TokenPermissions migration; moved AddUserSessionTable to v1_27/v332.go (1.26.0 closed at migration 330; 1.27 starts at 331). - models/migrations/migrations.go: registered session migration as 332 using v1_27.AddUserSessionTable. - tests/integration/api_admin_test.go: adopted new DecodeJSON return style; cron count is 30 (added cleanup_user_sessions task). Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
1841 files changed
+83555
-29241
No files matched your search
@@ -10,20 +10,23 @@
|
||||
<div class="inline field tw-text-center required">
|
||||
<div id="captcha" data-captcha-type="g-recaptcha" class="g-recaptcha-style" data-sitekey="{{.RecaptchaSitekey}}"></div>
|
||||
</div>
|
||||
<script defer src='{{.RecaptchaAPIScriptURL}}'></script>
|
||||
<script nonce="{{ctx.CspScriptNonce}}" defer src='{{.RecaptchaAPIScriptURL}}'></script>
|
||||
{{else if eq .CaptchaType "hcaptcha"}}
|
||||
<div class="inline field tw-text-center required">
|
||||
<div id="captcha" data-captcha-type="h-captcha" class="h-captcha-style" data-sitekey="{{.HcaptchaSitekey}}"></div>
|
||||
</div>
|
||||
<script defer src='https://hcaptcha.com/1/api.js'></script>
|
||||
<script nonce="{{ctx.CspScriptNonce}}" defer src='https://hcaptcha.com/1/api.js'></script>
|
||||
{{else if eq .CaptchaType "mcaptcha"}}
|
||||
<div class="inline field tw-text-center">
|
||||
<div class="m-captcha-style" id="mcaptcha__widget-container"></div>
|
||||
<div id="captcha" data-captcha-type="m-captcha" data-sitekey="{{.McaptchaSitekey}}" data-instance-url="{{.McaptchaURL}}"></div>
|
||||
<label id="mcaptcha__token-label" hidden data-mcaptcha_url="{{.McaptchaURL}}/widget?sitekey={{.McaptchaSitekey}}">
|
||||
<input id="mcaptcha__token" name="mcaptcha__token">{{/* the id and name are hard-coded in the library, cant't be changed */}}
|
||||
</label>
|
||||
<div id="captcha" data-captcha-type="m-captcha"></div>
|
||||
</div>
|
||||
{{else if eq .CaptchaType "cfturnstile"}}
|
||||
<div class="inline field tw-text-center">
|
||||
<div id="captcha" data-captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
|
||||
</div>
|
||||
<script defer src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
|
||||
<script nonce="{{ctx.CspScriptNonce}}" defer src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
|
||||
{{end}}{{end}}
|
||||
@@ -0,0 +1,17 @@
|
||||
<div id="external-login-navigator" class="tw-py-1 tw-flex tw-flex-col tw-gap-3">
|
||||
{{range $provider := .OAuth2Providers}}
|
||||
<a class="ui button external-login-link tw-gap-3" data-require-appurl-check="true" rel="nofollow" href="{{AppSubUrl}}/user/oauth2/{{$provider.DisplayName | PathEscape}}">
|
||||
{{$provider.IconHTML 24}} {{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableOpenIDSignIn}}
|
||||
<a class="ui button external-login-link tw-gap-3" data-require-appurl-check="true" rel="nofollow" href="{{AppSubUrl}}/user/login/openid">
|
||||
{{svg "fontawesome-openid" 24}} {{ctx.Locale.Tr "sign_in_with_provider" "OpenID"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableSSPI}}
|
||||
<a class="ui button external-login-link tw-gap-3" rel="nofollow" href="{{AppSubUrl}}/user/login?auth_with_sspi=1">
|
||||
{{svg "fontawesome-windows" 24}} Windows SSPI
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -1,16 +1,14 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content user link-account">
|
||||
<overflow-menu class="ui secondary pointing tabular top attached borderless menu secondary-nav">
|
||||
<div class="overflow-menu-items tw-justify-center">
|
||||
<div class="overflow-menu-items tw-justify-center" data-global-init="initTabSwitcher">
|
||||
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
|
||||
{{if not .AllowOnlyInternalRegistration}}
|
||||
<a class="item {{if not .user_exists}}active{{end}}"
|
||||
data-tab="auth-link-signup-tab">
|
||||
<a class="item {{if not .user_exists}}active{{end}}" data-tab="auth-link-signup-tab">
|
||||
{{ctx.Locale.Tr "auth.oauth_signup_tab"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="item {{if .user_exists}}active{{end}}"
|
||||
data-tab="auth-link-signin-tab">
|
||||
<a class="item {{if .user_exists}}active{{end}}" data-tab="auth-link-signin-tab">
|
||||
{{ctx.Locale.Tr "auth.oauth_signin_tab"}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<div id="oauth2-login-navigator" class="tw-py-1">
|
||||
<div class="tw-flex tw-flex-col tw-justify-center">
|
||||
<div id="oauth2-login-navigator-inner" class="tw-flex tw-flex-col tw-flex-wrap tw-items-center tw-gap-2">
|
||||
{{range $provider := .OAuth2Providers}}
|
||||
<a class="{{$provider.Name}} ui button tw-flex tw-items-center tw-justify-center tw-py-2 tw-w-full oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$provider.DisplayName}}">
|
||||
{{$provider.IconHTML 28}}
|
||||
{{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableOpenIDSignIn}}
|
||||
<a class="openid ui button tw-flex tw-items-center tw-justify-center tw-py-2 tw-w-full" href="{{AppSubUrl}}/user/login/openid">
|
||||
{{svg "fontawesome-openid" 28 "tw-mr-2"}}
|
||||
{{ctx.Locale.Tr "sign_in_with_provider" "OpenID"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableSSPI}}
|
||||
<a class="ui button tw-flex tw-items-center tw-justify-center tw-py-2 tw-w-full" rel="nofollow" href="{{AppSubUrl}}/user/login?auth_with_sspi=1">
|
||||
{{svg "fontawesome-windows"}}
|
||||
SSPI
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,14 +46,13 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{{end}}{{/*if .EnablePasswordSignInForm*/}}
|
||||
{{/* "oauth_container" contains not only "oauth2" methods, but also "OIDC" and "SSPI" methods */}}
|
||||
{{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn .EnableSSPI}}
|
||||
{{if and $showOAuth2Methods .EnablePasswordSignInForm}}
|
||||
{{end}}{{/*end if .EnablePasswordSignInForm*/}}
|
||||
{{$showExternalAuthMethods := or .OAuth2Providers .EnableOpenIDSignIn .EnableSSPI}}
|
||||
{{if and $showExternalAuthMethods .EnablePasswordSignInForm}}
|
||||
<div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
|
||||
{{end}}
|
||||
{{if $showOAuth2Methods}}
|
||||
{{template "user/auth/oauth_container" .}}
|
||||
{{if $showExternalAuthMethods}}
|
||||
{{template "user/auth/external_auth_methods" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,12 +49,10 @@
|
||||
</button>
|
||||
</div>
|
||||
{{end}}
|
||||
{{/* "oauth_container" contains not only "oauth2" methods, but also "OIDC" and "SSPI" methods */}}
|
||||
{{/* TODO: it seems that "EnableSSPI" is only set in "sign-in" handlers, but it should use the same logic to control its display */}}
|
||||
{{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn .EnableSSPI}}
|
||||
{{if $showOAuth2Methods}}
|
||||
{{$showExternalAuthMethods := or .OAuth2Providers .EnableOpenIDSignIn .EnableSSPI}}
|
||||
{{if $showExternalAuthMethods}}
|
||||
<div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
|
||||
{{template "user/auth/oauth_container" .}}
|
||||
{{template "user/auth/external_auth_methods" .}}
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div id="activity-feed" class="flex-list">
|
||||
<div id="activity-feed" class="flex-divided-list items-with-main" data-ref-issue-container>
|
||||
{{range .Feeds}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{ctx.AvatarUtils.AvatarByAction .}}
|
||||
</div>
|
||||
<div class="flex-item-main tw-gap-2">
|
||||
<div class="item-main tw-gap-2">
|
||||
<div>
|
||||
{{if gt .ActUser.ID 0}}
|
||||
<a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetActDisplayNameTitle ctx}}">{{.GetActDisplayName ctx}}</a>
|
||||
@@ -88,13 +88,13 @@
|
||||
{{$repoLink := (.GetRepoLink ctx)}}
|
||||
{{$repo := .Repo}}
|
||||
<div class="tw-flex tw-flex-col tw-gap-1">
|
||||
{{range $push.Commits}}
|
||||
{{range $pushCommit := $push.Commits}}
|
||||
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
|
||||
<div class="flex-text-block">
|
||||
<img loading="lazy" alt class="ui avatar" src="{{$push.AvatarLink ctx .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
|
||||
<a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
|
||||
<span class="tw-inline-block tw-truncate">
|
||||
{{ctx.RenderUtils.RenderCommitMessage .Message $repo}}
|
||||
{{ctx.RenderUtils.RenderCommitMessage $pushCommit.Message $repo}}
|
||||
</span>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -107,21 +107,21 @@
|
||||
{{else if .GetOpType.InActions "create_pull_request"}}
|
||||
<span class="tw-inline-block tw-truncate issue title">{{index .GetIssueInfos 1 | ctx.RenderUtils.RenderIssueSimpleTitle}}</span>
|
||||
{{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}}
|
||||
<a href="{{.GetCommentLink ctx}}" class="tw-inline-block tw-truncate issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
|
||||
<a href="{{.GetCommentLink ctx}}" class="tw-inline-block tw-truncate tw-self-start issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
|
||||
{{$comment := index .GetIssueInfos 1}}
|
||||
{{if $comment}}
|
||||
<div class="render-content markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
|
||||
<div class="render-content markup truncated-markup">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
|
||||
{{end}}
|
||||
{{else if .GetOpType.InActions "merge_pull_request"}}
|
||||
<div class="flex-item-body tw-text-text">{{index .GetIssueInfos 1 | ctx.RenderUtils.RenderIssueSimpleTitle}}</div>
|
||||
<div class="item-body tw-text-text">{{index .GetIssueInfos 1 | ctx.RenderUtils.RenderIssueSimpleTitle}}</div>
|
||||
{{else if .GetOpType.InActions "close_issue" "reopen_issue" "close_pull_request" "reopen_pull_request"}}
|
||||
<span class="tw-inline-block tw-truncate issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}}</span>
|
||||
{{else if .GetOpType.InActions "pull_review_dismissed"}}
|
||||
<div class="flex-item-body tw-text-text">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div>
|
||||
<div class="flex-item-body tw-text-text">{{index .GetIssueInfos 2 | ctx.RenderUtils.RenderEmoji}}</div>
|
||||
<div class="item-body tw-text-text">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div>
|
||||
<div class="item-body tw-text-text">{{index .GetIssueInfos 2 | ctx.RenderUtils.RenderEmoji}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "tw-text-text-light tw-mr-1"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script type="module">
|
||||
<script nonce="{{ctx.CspScriptNonce}}" type="module">
|
||||
const data = {
|
||||
...window.config.pageData.dashboardRepoList, // it only contains searchLimit and uid
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{{if .EnableHeatmap}}
|
||||
{{/*HINT: USER-ACTIVITY-PUSH-COMMITS: it only uses the doer's action time, it doesn't use git commit's time */}}
|
||||
<div class="activity-heatmap-container">
|
||||
<div id="user-heatmap" class="is-loading"
|
||||
data-heatmap-url="{{.HeatmapURL}}"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{$statusUnread := 1}}{{$statusRead := 2}}{{$statusPinned := 3}}
|
||||
{{$notificationUnreadCount := call .PageGlobalData.GetNotificationUnreadCount}}
|
||||
{{$pageTypeIsRead := eq $.PageType "read"}}
|
||||
<div class="flex-text-block tw-justify-between tw-mb-[--page-spacing]">
|
||||
<div class="flex-left-right tw-mb-[--page-spacing]">
|
||||
<div class="small-menu-items ui compact tiny menu">
|
||||
<a class="{{if not $pageTypeIsRead}}active{{end}} item" href="{{AppSubUrl}}/notifications?type=unread">
|
||||
{{ctx.Locale.Tr "notification.unread"}}
|
||||
@@ -53,8 +53,8 @@
|
||||
{{DateUtils.TimeSince $one.UpdatedUnix}}
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="notifications-buttons" action="{{AppSubUrl}}/notifications/status?type={{$.PageType}}&page={{$.Page.Paginater.Current}}&perPage={{$.Page.Paginater.PagingNum}}" method="post"
|
||||
hx-boost="true" hx-target="#notification_div" hx-swap="outerHTML"
|
||||
<form class="notifications-buttons form-fetch-action" action="{{AppSubUrl}}/notifications/status?type={{$.PageType}}&page={{$.Page.Paginater.Current}}&perPage={{$.Page.Paginater.PagingNum}}" method="post"
|
||||
data-fetch-sync="$body #notification_div"
|
||||
>
|
||||
<input type="hidden" name="notification_id" value="{{$one.ID}}">
|
||||
{{if ne $one.Status $statusPinned}}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<div class="ui top attached segment">
|
||||
{{if eq .Status 1}}
|
||||
<div class="tw-flex tw-justify-between">
|
||||
<div class="flex-left-right">
|
||||
<div class="tw-flex">
|
||||
<div class="small-menu-items ui compact tiny menu">
|
||||
<a class="{{if eq .State "all"}}active {{end}}item" href="?sort={{$.SortType}}&state=all&issueType={{$.IssueType}}&labels={{$.Labels}}">
|
||||
@@ -27,8 +27,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw-flex tw-justify-between">
|
||||
<div class="ui secondary filter menu labels">
|
||||
<div class="ui secondary menu tw-m-0">
|
||||
<!-- Type -->
|
||||
<div class="ui dropdown type jump item">
|
||||
<span class="text">
|
||||
@@ -60,7 +59,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{if not .Issues}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings account")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings account")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.password"}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings actions")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings actions")}}
|
||||
<div class="user-setting-content">
|
||||
{{if eq .PageType "secrets"}}
|
||||
{{template "shared/secrets/add_list" .}}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{{template "user/settings/layout_head" (dict)}}
|
||||
{{template "shared/actions/owner_general_settings" .}}
|
||||
{{template "user/settings/layout_footer" .}}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings")}}
|
||||
<div class="user-setting-content">
|
||||
|
||||
<!-- Theme -->
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings applications")}}
|
||||
{{template "user/settings/layout_head" (dict "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">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "settings.tokens_desc"}}
|
||||
</div>
|
||||
{{range .Tokens}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
<span class="{{if .HasRecentActivity}}tw-text-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">
|
||||
<div class="item-main">
|
||||
<details>
|
||||
<summary><span class="flex-item-title">{{.Name}}</span></summary>
|
||||
<summary><span class="item-title">{{.Name}}</span></summary>
|
||||
<p class="tw-my-1">
|
||||
{{ctx.Locale.Tr "settings.repo_and_org_access"}}:
|
||||
{{if .DisplayPublicOnly}}
|
||||
@@ -35,11 +35,11 @@
|
||||
{{end}}
|
||||
</ul>
|
||||
</details>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="tw-text-green"{{end}}>{{DateUtils.AbsoluteShort .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="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"}}
|
||||
{{ctx.Locale.Tr "settings.delete_token"}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings applications")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings applications")}}
|
||||
<div class="user-setting-content">
|
||||
|
||||
{{template "user/settings/applications_oauth2_edit_form" .}}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "settings.oauth2_application_create_description"}}
|
||||
</div>
|
||||
{{range .Applications}}
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-apps" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{.Name}}</div>
|
||||
<div class="item-body">
|
||||
{{ctx.Locale.Tr "settings.oauth2_client_id"}}
|
||||
<span class="ui label">{{.ClientID}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{$isBuiltin := and $.BuiltinApplications (index $.BuiltinApplications .ClientID)}}
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
{{if $isBuiltin}}
|
||||
<span class="ui basic label" data-tooltip-content="{{ctx.Locale.Tr "settings.oauth2_application_locked"}}">{{ctx.Locale.Tr "locked"}}</span>
|
||||
{{else}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings blocked_users")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings blocked_users")}}
|
||||
<div class="user-setting-content">
|
||||
{{template "shared/user/blocked_users" .}}
|
||||
</div>
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
{{ctx.Locale.Tr "settings.authorized_oauth2_applications"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "settings.authorized_oauth2_applications_description"}}
|
||||
</div>
|
||||
{{range .Grants}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-key" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Application.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{.Application.Name}}</div>
|
||||
<div class="item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="revoke-gitea-oauth2-grant"
|
||||
data-url="{{AppSubUrl}}/user/settings/applications/oauth2/{{.ApplicationID}}/revoke/{{.ID}}">
|
||||
{{ctx.Locale.Tr "settings.revoke_key"}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings new webhook")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings new webhook")}}
|
||||
<div class="user-setting-content">
|
||||
{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
|
||||
{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}}
|
||||
{{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
|
||||
{{template "webhook/new" (dict "CustomHeaderTitle" $CustomHeaderTitle)}}
|
||||
</div>
|
||||
{{template "user/settings/layout_footer" .}}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings webhooks")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings webhooks")}}
|
||||
<div class="user-setting-content">
|
||||
{{template "repo/settings/webhook/base_list" .}}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings sshkeys")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings sshkeys")}}
|
||||
<div class="user-setting-content">
|
||||
{{if not ($.UserDisabledFeatures.Contains "manage_ssh_keys")}}
|
||||
{{template "user/settings/keys_ssh" .}}
|
||||
|
||||
@@ -38,36 +38,36 @@
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
<p>
|
||||
{{ctx.Locale.Tr "settings.gpg_desc"}}<br>
|
||||
{{ctx.Locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification"}}
|
||||
</p>
|
||||
</div>
|
||||
{{range .GPGKeys}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
<span class="{{if or .ExpiredUnix.IsZero ($.PageStartTime.Before .ExpiredUnix.AsTime)}}tw-text-green{{end}}">{{svg "octicon-key" 32}}</span>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="item-main">
|
||||
{{if .Verified}}
|
||||
<span class="flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.gpg_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{ctx.Locale.Tr "settings.gpg_key_verified"}}</strong></span>
|
||||
{{end}}
|
||||
{{if .Emails}}
|
||||
<span class="flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.gpg_key_matched_identities_long"}}">{{svg "octicon-mail"}} {{ctx.Locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}<strong>{{.Email}} </strong>{{end}}</span>
|
||||
{{end}}
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
<b>{{ctx.Locale.Tr "settings.key_id"}}:</b> {{.PaddedKeyID}}
|
||||
<b>{{ctx.Locale.Tr "settings.subkeys"}}:</b> {{range .SubsKey}} {{.PaddedKeyID}} {{end}}
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .AddedUnix)}}</i>
|
||||
-
|
||||
<i>{{if not .ExpiredUnix.IsZero}}{{ctx.Locale.Tr "settings.valid_until_date" (DateUtils.AbsoluteShort .ExpiredUnix)}}{{else}}{{ctx.Locale.Tr "settings.valid_forever"}}{{end}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-gpg" data-url="{{$.Link}}/delete?type=gpg" data-id="{{.ID}}">
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
|
||||
@@ -10,22 +10,22 @@
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "settings.principal_desc"}}
|
||||
</div>
|
||||
{{range .Principals}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
<span class="{{if .HasRecentActivity}}tw-text-green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{.Name}}</div>
|
||||
<div class="item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info" 16}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateUtils.AbsoluteShort .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}">
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
|
||||
@@ -26,36 +26,36 @@
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="keys-ssh" class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div id="keys-ssh" class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
<p>
|
||||
{{ctx.Locale.Tr "settings.ssh_desc"}}<br>
|
||||
{{ctx.Locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh"}}
|
||||
</p>
|
||||
</div>
|
||||
{{if .DisableSSH}}
|
||||
<div class="flex-item">
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "settings.ssh_signonly"}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{range $index, $key := .Keys}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
<span class="{{if .HasRecentActivity}}tw-text-green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="item-main">
|
||||
{{if .Verified}}
|
||||
<div class="flex-item-title flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}}{{ctx.Locale.Tr "settings.ssh_key_verified"}}</div>
|
||||
<div class="item-title flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}}{{ctx.Locale.Tr "settings.ssh_key_verified"}}</div>
|
||||
{{end}}
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-title">{{.Name}}</div>
|
||||
<div class="item-body">
|
||||
{{.Fingerprint}}
|
||||
</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="tw-text-green"{{end}}>{{DateUtils.AbsoluteShort .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button delete-button{{if index $.ExternalKeys $index}} disabled{{end}}" data-modal-id="delete-ssh" data-url="{{$.Link}}/delete?type=ssh" data-id="{{.ID}}"{{if index $.ExternalKeys $index}} title="{{ctx.Locale.Tr "settings.ssh_externally_managed"}}"{{end}}>
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{template "base/head" .ctxData}}
|
||||
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
|
||||
{{template "base/head" ctx.RootData}}
|
||||
<div role="main" aria-label="{{ctx.RootData.Title}}" class="page-content {{.pageClass}}">
|
||||
<div class="ui container flex-container">
|
||||
{{template "user/settings/navbar" .ctxData}}
|
||||
{{template "user/settings/navbar" ctx.RootData}}
|
||||
<div class="flex-container-main">
|
||||
{{template "base/alert" .ctxData}}
|
||||
{{template "base/alert" ctx.RootData}}
|
||||
{{/* block: user-setting-content */}}
|
||||
|
||||
{{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}}
|
||||
|
||||
@@ -34,9 +34,12 @@
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableActions}}
|
||||
<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
|
||||
<details class="item toggleable-item" {{if or .PageIsUserSettingsActionsGeneral .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
|
||||
<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
|
||||
<div class="menu">
|
||||
<a class="{{if .PageIsUserSettingsActionsGeneral}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/general">
|
||||
{{ctx.Locale.Tr "actions.general"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/runners">
|
||||
{{ctx.Locale.Tr "actions.runners"}}
|
||||
</a>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "notifications"}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings organization")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings organization")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.orgs"}}
|
||||
@@ -10,19 +10,19 @@
|
||||
</h4>
|
||||
<div class="ui attached segment orgs">
|
||||
{{if .Orgs}}
|
||||
<div class="flex-list">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range .Orgs}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{template "shared/user/name" .}}</div>
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{template "shared/user/name" .}}</div>
|
||||
<div class="flex-text-body">
|
||||
{{.Description}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<form>
|
||||
<button class="ui red button delete-button" data-modal-id="leave-organization"
|
||||
data-url="{{.OrganisationLink}}/members/action/leave" data-datauid="{{$.SignedUser.ID}}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings packages")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings packages")}}
|
||||
<div class="user-setting-content">
|
||||
{{template "package/shared/cleanup_rules/list" .}}
|
||||
{{template "package/shared/cargo" .}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings packages")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings packages")}}
|
||||
<div class="user-setting-content">
|
||||
{{template "package/shared/cleanup_rules/edit" .}}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user packages admin")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user packages admin")}}
|
||||
<div class="user-setting-content">
|
||||
{{template "package/shared/cleanup_rules/preview" .}}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings profile")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings profile")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.public_profile"}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings repos")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings repos")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.repos"}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings runners")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings runners")}}
|
||||
<div class="user-setting-content">
|
||||
{{template "shared/actions/runner_edit" .}}
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="menu">
|
||||
{{range $key := .OrderedOAuth2Names}}
|
||||
{{$provider := index $.OAuth2Providers $key}}
|
||||
<a class="item" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
|
||||
<a class="item" href="{{AppSubUrl}}/user/oauth2/{{$key | PathEscape}}">
|
||||
{{$provider.IconHTML 20}}
|
||||
{{$provider.DisplayName}}
|
||||
</a>
|
||||
@@ -21,25 +21,25 @@
|
||||
</h4>
|
||||
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "settings.manage_account_links_desc"}}
|
||||
</div>
|
||||
{{range $loginSource, $provider := .AccountLinks}}
|
||||
<div class="flex-item">
|
||||
<div class="item">
|
||||
{{$providerData := index $.OAuth2Providers $loginSource.Name}}
|
||||
<div class="flex-item-leading">
|
||||
<div class="item-leading">
|
||||
{{$providerData.IconHTML 20}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<span class="flex-item-title" data-tooltip-content="{{$provider}}">
|
||||
<div class="item-main">
|
||||
<span class="item-title" data-tooltip-content="{{$provider}}">
|
||||
{{$loginSource.Name}}
|
||||
</span>
|
||||
{{if $loginSource.IsActive}}
|
||||
<span class="flex-text-body tw-text-primary">{{ctx.Locale.Tr "repo.settings.active"}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
{{ctx.Locale.Tr "settings.manage_openid"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "settings.openid_desc"}}
|
||||
</div>
|
||||
{{range .OpenIDs}}
|
||||
<div class="flex-item tw-items-center">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item tw-items-center">
|
||||
<div class="item-leading">
|
||||
{{svg "fontawesome-openid" 20}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.URI}}</div>
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{.URI}}</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<form action="{{AppSubUrl}}/user/settings/security/openid/toggle_visibility" method="post">
|
||||
<input name="id" type="hidden" value="{{.ID}}">
|
||||
{{if .Show}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings security")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings security")}}
|
||||
{{if not ($.UserDisabledFeatures.Contains "manage_mfa" "manage_credentials")}}
|
||||
<div class="user-setting-content">
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings twofa")}}
|
||||
{{template "user/settings/layout_head" (dict "pageClass" "user settings twofa")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.twofa_enroll"}}
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
<p>{{ctx.Locale.Tr "settings.webauthn_desc" "https://w3c.github.io/webauthn/#webauthn-authenticator"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.webauthn_key_loss_warning"}} {{ctx.Locale.Tr "settings.webauthn_alternative_tip"}}</p>
|
||||
{{template "user/auth/webauthn_error" .}}
|
||||
<div class="flex-list">
|
||||
<div class="flex-divided-list items-with-main">
|
||||
{{range .WebAuthnCredentials}}
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-leading">
|
||||
<div class="item">
|
||||
<div class="item-leading">
|
||||
{{svg "octicon-key" 32}}
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">{{.Name}}</div>
|
||||
<div class="flex-item-body">
|
||||
<div class="item-main">
|
||||
<div class="item-title">{{.Name}}</div>
|
||||
<div class="item-body">
|
||||
<i>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<div class="item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-registration" data-url="{{$.Link}}/webauthn/delete" data-id="{{.ID}}">
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user