aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/auth/edit.tmpl69
-rw-r--r--templates/admin/auth/source/oauth.tmpl16
-rw-r--r--templates/admin/config.tmpl6
-rw-r--r--templates/admin/hooks.tmpl3
-rw-r--r--templates/admin/packages/list.tmpl19
-rw-r--r--templates/admin/repo/list.tmpl23
-rw-r--r--templates/admin/user/edit.tmpl6
-rw-r--r--templates/admin/user/list.tmpl2
-rw-r--r--templates/admin/user/view.tmpl17
-rw-r--r--templates/base/alert.tmpl5
-rw-r--r--templates/base/footer.tmpl8
-rw-r--r--templates/base/head_navbar.tmpl60
-rw-r--r--templates/base/head_navbar_icons.tmpl25
-rw-r--r--templates/base/head_script.tmpl2
-rw-r--r--templates/devtest/badge-actions-svg.tmpl25
-rw-r--r--templates/devtest/badge-commit-sign.tmpl (renamed from templates/devtest/commit-sign-badge.tmpl)0
-rw-r--r--templates/devtest/devtest-header.tmpl1
-rw-r--r--templates/devtest/flex-list.tmpl2
-rw-r--r--templates/devtest/fomantic-dropdown.tmpl4
-rw-r--r--templates/devtest/fomantic-modal.tmpl16
-rw-r--r--templates/devtest/gitea-ui.tmpl32
-rw-r--r--templates/devtest/mail-preview.tmpl27
-rw-r--r--templates/devtest/markup-render.tmpl71
-rw-r--r--templates/explore/repos.tmpl4
-rw-r--r--templates/home.tmpl12
-rw-r--r--templates/install.tmpl1
-rw-r--r--templates/mail/auth/activate.devtest.yml3
-rw-r--r--templates/mail/notify/workflow_run.devtest.yml18
-rw-r--r--templates/mail/notify/workflow_run.tmpl33
-rw-r--r--templates/org/create.tmpl8
-rw-r--r--templates/org/header.tmpl2
-rw-r--r--templates/org/home.tmpl4
-rw-r--r--templates/org/member/members.tmpl4
-rw-r--r--templates/org/menu.tmpl2
-rw-r--r--templates/org/projects/new.tmpl23
-rw-r--r--templates/org/projects/view.tmpl4
-rw-r--r--templates/org/settings/delete.tmpl35
-rw-r--r--templates/org/settings/hooks.tmpl2
-rw-r--r--templates/org/settings/navbar.tmpl3
-rw-r--r--templates/org/settings/options.tmpl178
-rw-r--r--templates/org/settings/options_dangerzone.tmpl93
-rw-r--r--templates/org/team/members.tmpl2
-rw-r--r--templates/org/team/new.tmpl2
-rw-r--r--templates/org/team/sidebar.tmpl6
-rw-r--r--templates/org/team/teams.tmpl4
-rw-r--r--templates/package/content/container.tmpl44
-rw-r--r--templates/package/content/pypi.tmpl2
-rw-r--r--templates/package/shared/view.tmpl107
-rw-r--r--templates/package/view.tmpl122
-rw-r--r--templates/post-install.tmpl4
-rw-r--r--templates/projects/list.tmpl19
-rw-r--r--templates/projects/new.tmpl2
-rw-r--r--templates/projects/view.tmpl62
-rw-r--r--templates/repo/actions/runs_list.tmpl45
-rw-r--r--templates/repo/actions/status.tmpl2
-rw-r--r--templates/repo/actions/view_component.tmpl3
-rw-r--r--templates/repo/actions/workflow_dispatch.tmpl2
-rw-r--r--templates/repo/actions/workflow_dispatch_inputs.tmpl3
-rw-r--r--templates/repo/blame.tmpl4
-rw-r--r--templates/repo/branch/list.tmpl26
-rw-r--r--templates/repo/branch_dropdown.tmpl16
-rw-r--r--templates/repo/clone_panel.tmpl4
-rw-r--r--templates/repo/code/recently_pushed_new_branches.tmpl18
-rw-r--r--templates/repo/commit_load_branches_and_tags.tmpl7
-rw-r--r--templates/repo/commit_page.tmpl10
-rw-r--r--templates/repo/commit_status.tmpl3
-rw-r--r--templates/repo/commit_statuses.tmpl4
-rw-r--r--templates/repo/commits_list.tmpl12
-rw-r--r--templates/repo/commits_list_small.tmpl6
-rw-r--r--templates/repo/create.tmpl30
-rw-r--r--templates/repo/diff/box.tmpl13
-rw-r--r--templates/repo/diff/comment_form.tmpl2
-rw-r--r--templates/repo/diff/comments.tmpl18
-rw-r--r--templates/repo/diff/compare.tmpl10
-rw-r--r--templates/repo/diff/conversation.tmpl34
-rw-r--r--templates/repo/diff/image_diff.tmpl12
-rw-r--r--templates/repo/editor/cherry_pick.tmpl11
-rw-r--r--templates/repo/editor/commit_form.tmpl25
-rw-r--r--templates/repo/editor/common_breadcrumb.tmpl16
-rw-r--r--templates/repo/editor/common_top.tmpl6
-rw-r--r--templates/repo/editor/delete.tmpl4
-rw-r--r--templates/repo/editor/edit.tmpl73
-rw-r--r--templates/repo/editor/fork.tmpl18
-rw-r--r--templates/repo/editor/patch.tmpl7
-rw-r--r--templates/repo/editor/upload.tmpl20
-rw-r--r--templates/repo/empty.tmpl2
-rw-r--r--templates/repo/file_info.tmpl2
-rw-r--r--templates/repo/forks.tmpl14
-rw-r--r--templates/repo/graph.tmpl43
-rw-r--r--templates/repo/graph/commits.tmpl15
-rw-r--r--templates/repo/graph/div.tmpl10
-rw-r--r--templates/repo/header.tmpl25
-rw-r--r--templates/repo/home.tmpl2
-rw-r--r--templates/repo/home_sidebar_bottom.tmpl6
-rw-r--r--templates/repo/home_sidebar_top.tmpl2
-rw-r--r--templates/repo/icon.tmpl2
-rw-r--r--templates/repo/issue/branch_selector_field.tmpl2
-rw-r--r--templates/repo/issue/card.tmpl19
-rw-r--r--templates/repo/issue/filter_item_label.tmpl2
-rw-r--r--templates/repo/issue/filter_list.tmpl12
-rw-r--r--templates/repo/issue/label_precolors.tmpl43
-rw-r--r--templates/repo/issue/labels/label_edit_modal.tmpl15
-rw-r--r--templates/repo/issue/labels/label_list.tmpl7
-rw-r--r--templates/repo/issue/list.tmpl7
-rw-r--r--templates/repo/issue/milestone_issues.tmpl12
-rw-r--r--templates/repo/issue/milestone_new.tmpl2
-rw-r--r--templates/repo/issue/milestones.tmpl14
-rw-r--r--templates/repo/issue/new_form.tmpl6
-rw-r--r--templates/repo/issue/search.tmpl1
-rw-r--r--templates/repo/issue/sidebar/assignee_list.tmpl8
-rw-r--r--templates/repo/issue/sidebar/issue_management.tmpl34
-rw-r--r--templates/repo/issue/sidebar/label_list.tmpl8
-rw-r--r--templates/repo/issue/sidebar/milestone_list.tmpl6
-rw-r--r--templates/repo/issue/sidebar/project_list.tmpl6
-rw-r--r--templates/repo/issue/sidebar/reviewer_list.tmpl6
-rw-r--r--templates/repo/issue/sidebar/stopwatch_timetracker.tmpl76
-rw-r--r--templates/repo/issue/sidebar/wip_switch.tmpl2
-rw-r--r--templates/repo/issue/view_content.tmpl14
-rw-r--r--templates/repo/issue/view_content/attachments.tmpl2
-rw-r--r--templates/repo/issue/view_content/comments.tmpl115
-rw-r--r--templates/repo/issue/view_content/conversation.tmpl18
-rw-r--r--templates/repo/issue/view_content/pull_merge_box.tmpl (renamed from templates/repo/issue/view_content/pull.tmpl)23
-rw-r--r--templates/repo/issue/view_content/pull_merge_instruction.tmpl6
-rw-r--r--templates/repo/issue/view_content/reference_issue_dialog.tmpl4
-rw-r--r--templates/repo/issue/view_content/update_branch_by_merge.tmpl8
-rw-r--r--templates/repo/issue/view_title.tmpl4
-rw-r--r--templates/repo/latest_commit.tmpl4
-rw-r--r--templates/repo/migrate/codebase.tmpl14
-rw-r--r--templates/repo/migrate/codecommit.tmpl14
-rw-r--r--templates/repo/migrate/git.tmpl14
-rw-r--r--templates/repo/migrate/gitbucket.tmpl14
-rw-r--r--templates/repo/migrate/gitea.tmpl14
-rw-r--r--templates/repo/migrate/github.tmpl14
-rw-r--r--templates/repo/migrate/gitlab.tmpl14
-rw-r--r--templates/repo/migrate/gogs.tmpl14
-rw-r--r--templates/repo/migrate/migrate.tmpl2
-rw-r--r--templates/repo/migrate/migrating.tmpl4
-rw-r--r--templates/repo/migrate/onedev.tmpl14
-rw-r--r--templates/repo/navbar.tmpl23
-rw-r--r--templates/repo/projects/view.tmpl9
-rw-r--r--templates/repo/pulls/fork.tmpl22
-rw-r--r--templates/repo/pulse.tmpl4
-rw-r--r--templates/repo/release/list.tmpl38
-rw-r--r--templates/repo/release/new.tmpl16
-rw-r--r--templates/repo/release_tag_header.tmpl2
-rw-r--r--templates/repo/settings/branches.tmpl15
-rw-r--r--templates/repo/settings/collaboration.tmpl43
-rw-r--r--templates/repo/settings/deploy_keys.tmpl13
-rw-r--r--templates/repo/settings/githooks.tmpl16
-rw-r--r--templates/repo/settings/lfs_file.tmpl4
-rw-r--r--templates/repo/settings/navbar.tmpl5
-rw-r--r--templates/repo/settings/options.tmpl34
-rw-r--r--templates/repo/settings/protected_branch.tmpl10
-rw-r--r--templates/repo/settings/public_access.tmpl54
-rw-r--r--templates/repo/settings/webhook/base.tmpl2
-rw-r--r--templates/repo/settings/webhook/base_list.tmpl17
-rw-r--r--templates/repo/settings/webhook/delete_modal.tmpl10
-rw-r--r--templates/repo/settings/webhook/dingtalk.tmpl3
-rw-r--r--templates/repo/settings/webhook/discord.tmpl3
-rw-r--r--templates/repo/settings/webhook/feishu.tmpl8
-rw-r--r--templates/repo/settings/webhook/gitea.tmpl11
-rw-r--r--templates/repo/settings/webhook/gogs.tmpl11
-rw-r--r--templates/repo/settings/webhook/history.tmpl2
-rw-r--r--templates/repo/settings/webhook/list.tmpl4
-rw-r--r--templates/repo/settings/webhook/matrix.tmpl2
-rw-r--r--templates/repo/settings/webhook/msteams.tmpl3
-rw-r--r--templates/repo/settings/webhook/packagist.tmpl3
-rw-r--r--templates/repo/settings/webhook/settings.tmpl92
-rw-r--r--templates/repo/settings/webhook/slack.tmpl3
-rw-r--r--templates/repo/settings/webhook/telegram.tmpl3
-rw-r--r--templates/repo/settings/webhook/wechatwork.tmpl3
-rw-r--r--templates/repo/star_unstar.tmpl4
-rw-r--r--templates/repo/tag/list.tmpl85
-rw-r--r--templates/repo/tag/name.tmpl2
-rw-r--r--templates/repo/unicode_escape_prompt.tmpl10
-rw-r--r--templates/repo/view.tmpl4
-rw-r--r--templates/repo/view_content.tmpl8
-rw-r--r--templates/repo/view_file.tmpl92
-rw-r--r--templates/repo/view_list.tmpl12
-rw-r--r--templates/repo/watch_unwatch.tmpl4
-rw-r--r--templates/repo/wiki/new.tmpl4
-rw-r--r--templates/repo/wiki/revision.tmpl12
-rw-r--r--templates/repo/wiki/start.tmpl2
-rw-r--r--templates/repo/wiki/view.tmpl35
-rw-r--r--templates/shared/actions/runner_badge.tmpl25
-rw-r--r--templates/shared/actions/runner_badge_flat-square.tmpl15
-rw-r--r--templates/shared/actions/runner_badge_flat.tmpl27
-rw-r--r--templates/shared/actions/runner_list.tmpl20
-rw-r--r--templates/shared/avatar_upload_crop.tmpl2
-rw-r--r--templates/shared/issuelist.tmpl15
-rw-r--r--templates/shared/repo/list.tmpl (renamed from templates/explore/repo_list.tmpl)12
-rw-r--r--templates/shared/repo/search.tmpl (renamed from templates/shared/repo_search.tmpl)2
-rw-r--r--templates/shared/secrets/add_list.tmpl26
-rw-r--r--templates/shared/user/avatarlink.tmpl2
-rw-r--r--templates/shared/user/profile_big_avatar.tmpl2
-rw-r--r--templates/shared/webhook/icon.tmpl16
-rw-r--r--templates/status/404.tmpl1
-rw-r--r--templates/status/500.tmpl2
-rw-r--r--templates/status/503.tmpl12
-rw-r--r--templates/swagger/ui.tmpl2
-rw-r--r--templates/swagger/v1_input.json4
-rw-r--r--templates/swagger/v1_json.tmpl2423
-rw-r--r--templates/user/auth/oidc_wellknown.tmpl14
-rw-r--r--templates/user/auth/signup_inner.tmpl3
-rw-r--r--templates/user/dashboard/feeds.tmpl4
-rw-r--r--templates/user/dashboard/milestones.tmpl2
-rw-r--r--templates/user/dashboard/navbar.tmpl22
-rw-r--r--templates/user/notification/notification_div.tmpl176
-rw-r--r--templates/user/notification/notification_subscriptions.tmpl4
-rw-r--r--templates/user/profile.tmpl8
-rw-r--r--templates/user/settings/account.tmpl25
-rw-r--r--templates/user/settings/applications.tmpl2
-rw-r--r--templates/user/settings/hooks.tmpl2
-rw-r--r--templates/user/settings/navbar.tmpl7
-rw-r--r--templates/user/settings/notifications.tmpl65
-rw-r--r--templates/user/settings/organization.tmpl2
-rw-r--r--templates/user/settings/profile.tmpl2
217 files changed, 4398 insertions, 1759 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index 660f0d0881..7b96b4e94f 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -15,7 +15,14 @@
</div>
<div class="required inline field {{if .Err_Name}}error{{end}}">
<label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label>
- <input id="auth_name" name="name" value="{{.Source.Name}}" autofocus required>
+ <input id="auth_name" name="name" value="{{.Source.Name}}" required>
+ </div>
+ <div class="inline field">
+ <div class="ui checkbox">
+ <label ><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+ <input name="two_factor_policy" type="checkbox" value="skip" {{if eq .Source.TwoFactorPolicy "skip"}}checked{{end}}>
+ <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+ </div>
</div>
<!-- LDAP and DLDAP -->
@@ -159,13 +166,6 @@
</div>
</div>
{{end}}
- <div class="optional field">
- <div class="ui checkbox">
- <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
- <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
- <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
- </div>
- </div>
<div class="inline field">
<div class="ui checkbox">
<label for="allow_deactivate_all"><strong>{{ctx.Locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label>
@@ -227,13 +227,6 @@
<input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}">
<p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p>
</div>
- <div class="optional field">
- <div class="ui checkbox">
- <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
- <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
- <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
- </div>
- </div>
{{end}}
<!-- PAM -->
@@ -247,13 +240,6 @@
<label for="pam_email_domain">{{ctx.Locale.Tr "admin.auths.pam_email_domain"}}</label>
<input id="pam_email_domain" name="pam_email_domain" value="{{$cfg.EmailDomain}}">
</div>
- <div class="optional field">
- <div class="ui checkbox">
- <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
- <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
- <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
- </div>
- </div>
{{end}}
<!-- OAuth2 -->
@@ -288,13 +274,6 @@
<label for="open_id_connect_auto_discovery_url">{{ctx.Locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}">
</div>
- <div class="optional field">
- <div class="ui checkbox">
- <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
- <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
- <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
- </div>
- </div>
<div class="oauth2_use_custom_url inline field">
<div class="ui checkbox">
<label><strong>{{ctx.Locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
@@ -322,20 +301,31 @@
<input id="oauth2_tenant" name="oauth2_tenant" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.Tenant}}{{end}}">
</div>
- {{range .OAuth2Providers}}{{if .CustomURLSettings}}
+ {{range .OAuth2Providers}}
+ <input id="{{.Name}}_SupportSSHPublicKey" value="{{.SupportSSHPublicKey}}" type="hidden">
+ {{if .CustomURLSettings}}
<input id="{{.Name}}_customURLSettings" type="hidden" data-required="{{.CustomURLSettings.Required}}" data-available="true">
<input id="{{.Name}}_token_url" value="{{.CustomURLSettings.TokenURL.Value}}" data-available="{{.CustomURLSettings.TokenURL.Available}}" data-required="{{.CustomURLSettings.TokenURL.Required}}" type="hidden">
<input id="{{.Name}}_auth_url" value="{{.CustomURLSettings.AuthURL.Value}}" data-available="{{.CustomURLSettings.AuthURL.Available}}" data-required="{{.CustomURLSettings.AuthURL.Required}}" type="hidden">
<input id="{{.Name}}_profile_url" value="{{.CustomURLSettings.ProfileURL.Value}}" data-available="{{.CustomURLSettings.ProfileURL.Available}}" data-required="{{.CustomURLSettings.ProfileURL.Required}}" type="hidden">
<input id="{{.Name}}_email_url" value="{{.CustomURLSettings.EmailURL.Value}}" data-available="{{.CustomURLSettings.EmailURL.Available}}" data-required="{{.CustomURLSettings.EmailURL.Required}}" type="hidden">
<input id="{{.Name}}_tenant" value="{{.CustomURLSettings.Tenant.Value}}" data-available="{{.CustomURLSettings.Tenant.Available}}" data-required="{{.CustomURLSettings.Tenant.Required}}" type="hidden">
- {{end}}{{end}}
+ {{end}}
+ {{end}}
<div class="field">
<label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label>
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{StringUtils.Join $cfg.Scopes ","}}{{end}}">
</div>
<div class="field">
+ <label>{{ctx.Locale.Tr "admin.auths.oauth2_full_name_claim_name"}}</label>
+ <input name="oauth2_full_name_claim_name" value="{{$cfg.FullNameClaimName}}" placeholder="name">
+ </div>
+ <div class="field oauth2_ssh_public_key_claim_name">
+ <label>{{ctx.Locale.Tr "admin.auths.oauth2_ssh_public_key_claim_name"}}</label>
+ <input name="oauth2_ssh_public_key_claim_name" value="{{$cfg.SSHPublicKeyClaimName}}" placeholder="sshpubkey">
+ </div>
+ <div class="field">
<label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
<input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{$cfg.RequiredClaimName}}">
<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
@@ -429,7 +419,10 @@
<div class="field">
<button class="ui primary button">{{ctx.Locale.Tr "admin.auths.update"}}</button>
- <button class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{ctx.Locale.Tr "admin.auths.delete"}}</button>
+ <button class="ui red button link-action" data-url="{{$.Link}}/delete?id={{.Source.ID}}"
+ data-modal-confirm-header="{{ctx.Locale.Tr "admin.auths.delete_auth_title"}}"
+ data-modal-confirm-content="{{ctx.Locale.Tr "admin.auths.delete_auth_desc"}}"
+ >{{ctx.Locale.Tr "admin.auths.delete"}}</button>
</div>
</form>
</div>
@@ -445,16 +438,4 @@
<p class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
</div>
</div>
-
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "admin.auths.delete_auth_title"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "admin.auths.delete_auth_desc"}}</p>
- </div>
- {{template "base/modal_actions_confirm" .}}
-</div>
-
{{template "admin/layout_footer" .}}
diff --git a/templates/admin/auth/source/oauth.tmpl b/templates/admin/auth/source/oauth.tmpl
index f02c5bdf30..69590635e4 100644
--- a/templates/admin/auth/source/oauth.tmpl
+++ b/templates/admin/auth/source/oauth.tmpl
@@ -63,19 +63,31 @@
<input id="oauth2_tenant" name="oauth2_tenant" value="{{.oauth2_tenant}}">
</div>
- {{range .OAuth2Providers}}{{if .CustomURLSettings}}
+ {{range .OAuth2Providers}}
+ <input id="{{.Name}}_SupportSSHPublicKey" value="{{.SupportSSHPublicKey}}" type="hidden">
+ {{if .CustomURLSettings}}
<input id="{{.Name}}_customURLSettings" type="hidden" data-required="{{.CustomURLSettings.Required}}" data-available="true">
<input id="{{.Name}}_token_url" value="{{.CustomURLSettings.TokenURL.Value}}" data-available="{{.CustomURLSettings.TokenURL.Available}}" data-required="{{.CustomURLSettings.TokenURL.Required}}" type="hidden">
<input id="{{.Name}}_auth_url" value="{{.CustomURLSettings.AuthURL.Value}}" data-available="{{.CustomURLSettings.AuthURL.Available}}" data-required="{{.CustomURLSettings.AuthURL.Required}}" type="hidden">
<input id="{{.Name}}_profile_url" value="{{.CustomURLSettings.ProfileURL.Value}}" data-available="{{.CustomURLSettings.ProfileURL.Available}}" data-required="{{.CustomURLSettings.ProfileURL.Required}}" type="hidden">
<input id="{{.Name}}_email_url" value="{{.CustomURLSettings.EmailURL.Value}}" data-available="{{.CustomURLSettings.EmailURL.Available}}" data-required="{{.CustomURLSettings.EmailURL.Required}}" type="hidden">
<input id="{{.Name}}_tenant" value="{{.CustomURLSettings.Tenant.Value}}" data-available="{{.CustomURLSettings.Tenant.Available}}" data-required="{{.CustomURLSettings.Tenant.Required}}" type="hidden">
- {{end}}{{end}}
+ {{end}}
+ {{end}}
<div class="field">
<label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label>
<input id="oauth2_scopes" name="oauth2_scopes" value="{{.oauth2_scopes}}">
</div>
+
+ <div class="field">
+ <label>{{ctx.Locale.Tr "admin.auths.oauth2_full_name_claim_name"}}</label>
+ <input name="oauth2_full_name_claim_name" value="{{.oauth2_full_name_claim_name}}" placeholder="name">
+ </div>
+ <div class="field oauth2_ssh_public_key_claim_name">
+ <label>{{ctx.Locale.Tr "admin.auths.oauth2_ssh_public_key_claim_name"}}</label>
+ <input name="oauth2_ssh_public_key_claim_name" value="{{.oauth2_ssh_public_key_claim_name}}" placeholder="sshpubkey">
+ </div>
<div class="field">
<label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
<input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{.oauth2_required_claim_name}}">
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 29a5e1b473..806347c720 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -69,10 +69,6 @@
{{if not .SSH.StartBuiltinServer}}
<dt>{{ctx.Locale.Tr "admin.config.ssh_root_path"}}</dt>
<dd>{{.SSH.RootPath}}</dd>
- <dt>{{ctx.Locale.Tr "admin.config.ssh_key_test_path"}}</dt>
- <dd>{{.SSH.KeyTestPath}}</dd>
- <dt>{{ctx.Locale.Tr "admin.config.ssh_keygen_path"}}</dt>
- <dd>{{.SSH.KeygenPath}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.ssh_minimum_key_size_check"}}</dt>
<dd>{{svg (Iif .SSH.MinimumKeySizeCheck "octicon-check" "octicon-x")}}</dd>
{{if .SSH.MinimumKeySizeCheck}}
@@ -148,7 +144,7 @@
<dt>{{ctx.Locale.Tr "admin.config.enable_openid_signin"}}</dt>
<dd>{{svg (Iif .Service.EnableOpenIDSignIn "octicon-check" "octicon-x")}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.require_sign_in_view"}}</dt>
- <dd>{{svg (Iif .Service.RequireSignInView "octicon-check" "octicon-x")}}</dd>
+ <dd>{{svg (Iif .Service.RequireSignInViewStrict "octicon-check" "octicon-x")}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.mail_notify"}}</dt>
<dd>{{svg (Iif .Service.EnableNotifyMail "octicon-check" "octicon-x")}}</dd>
<dt>{{ctx.Locale.Tr "admin.config.enable_captcha"}}</dt>
diff --git a/templates/admin/hooks.tmpl b/templates/admin/hooks.tmpl
index c77d27dbd0..d5fdef6850 100644
--- a/templates/admin/hooks.tmpl
+++ b/templates/admin/hooks.tmpl
@@ -1,9 +1,6 @@
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin hooks")}}
<div class="admin-setting-content">
-
{{template "repo/settings/webhook/base_list" .SystemWebhooks}}
{{template "repo/settings/webhook/base_list" .DefaultWebhooks}}
-
- {{template "repo/settings/webhook/delete_modal" .}}
</div>
{{template "admin/layout_footer" .}}
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl
index 0c6889b599..4817f2681b 100644
--- a/templates/admin/packages/list.tmpl
+++ b/templates/admin/packages/list.tmpl
@@ -72,7 +72,12 @@
</td>
<td>{{FileSize .CalculateBlobSize}}</td>
<td>{{DateUtils.AbsoluteShort .Version.CreatedUnix}}</td>
- <td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.Version.ID}}" data-name="{{.Package.Name}}" data-data-version="{{.Version.Version}}">{{svg "octicon-trash"}}</a></td>
+ <td>
+ <a class="text red show-modal" href data-modal="#admin-package-delete-modal"
+ data-modal-form.action="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}&id={{.Version.ID}}"
+ data-modal-package-name="{{.Package.Name}}" data-modal-package-version="{{.Version.Version}}"
+ >{{svg "octicon-trash"}}</a>
+ </td>
</tr>
{{else}}
<tr><td class="tw-text-center" colspan="10">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
@@ -84,15 +89,13 @@
{{template "base/paginate" .}}
</div>
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "packages.settings.delete"}}
- </div>
+<form class="ui small modal form-fetch-action" method="post" id="admin-package-delete-modal">
+ {{.CsrfTokenHtml}}
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "packages.settings.delete"}}</div>
<div class="content">
- {{ctx.Locale.Tr "packages.settings.delete.notice" (`<span class="name"></span>`|SafeHTML) (`<span class="dataVersion"></span>`|SafeHTML)}}
+ {{ctx.Locale.Tr "packages.settings.delete.notice" (HTMLFormat `<span class="%s"></span>` "package-name") (HTMLFormat `<span class="%s"></span>` "package-version")}}
</div>
{{template "base/modal_actions_confirm" .}}
-</div>
+</form>
{{template "admin/layout_footer" .}}
diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl
index 762013af47..767d00fa74 100644
--- a/templates/admin/repo/list.tmpl
+++ b/templates/admin/repo/list.tmpl
@@ -7,10 +7,10 @@
</div>
</h4>
<div class="ui attached segment">
- {{template "shared/repo_search" .}}
+ {{template "shared/repo/search" .}}
</div>
<div class="ui attached table segment">
- <table class="ui very basic striped table unstackable">
+ <table class="ui very basic striped table selectable unstackable">
<thead>
<tr>
<th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th>
@@ -84,7 +84,12 @@
<td>{{FileSize .LFSSize}}</td>
<td>{{DateUtils.AbsoluteShort .UpdatedUnix}}</td>
<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td>
- <td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.ID}}" data-name="{{.Name}}">{{svg "octicon-trash"}}</a></td>
+ <td>
+ <a class="text red show-modal" href data-modal="#admin-repo-delete-modal"
+ data-modal-form.action="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}&id={{.ID}}"
+ data-modal-repo-name="{{.Name}}"
+ >{{svg "octicon-trash"}}</a>
+ </td>
</tr>
{{else}}
<tr><td class="tw-text-center" colspan="12">{{ctx.Locale.Tr "no_results_found"}}</td></tr>
@@ -96,17 +101,15 @@
{{template "base/paginate" .}}
</div>
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.settings.delete"}}
- </div>
+<form class="ui small modal form-fetch-action" id="admin-repo-delete-modal" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.settings.delete"}}</div>
<div class="content">
<p>{{ctx.Locale.Tr "repo.settings.delete_desc"}}</p>
- {{ctx.Locale.Tr "repo.settings.delete_notices_2" (`<span class="name"></span>`|SafeHTML)}}<br>
+ {{ctx.Locale.Tr "repo.settings.delete_notices_2" (HTMLFormat `<span class="%s"></span>` "repo-name")}}<br>
{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}<br>
</div>
{{template "base/modal_actions_confirm" .}}
-</div>
+</form>
{{template "admin/layout_footer" .}}
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index c04d332660..879b5cb550 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -9,7 +9,7 @@
{{.CsrfTokenHtml}}
<div class="field {{if .Err_UserName}}error{{end}}">
<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
- <input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}} maxlength="40">
+ <input id="user_name" name="user_name" value="{{.User.Name}}" {{if not .User.IsLocal}}disabled{{end}} maxlength="40">
</div>
<!-- Types and name -->
<div class="inline required field {{if .Err_LoginType}}error{{end}}">
@@ -55,7 +55,7 @@
<div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}tw-hidden{{end}}">
<label for="login_name">{{ctx.Locale.Tr "admin.users.auth_login_name"}}</label>
- <input id="login_name" name="login_name" value="{{.User.LoginName}}" autofocus>
+ <input id="login_name" name="login_name" value="{{.User.LoginName}}">
</div>
<div class="field {{if .Err_FullName}}error{{end}}">
<label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label>
@@ -63,7 +63,7 @@
</div>
<div class="required field {{if .Err_Email}}error{{end}}">
<label for="email">{{ctx.Locale.Tr "email"}}</label>
- <input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required>
+ <input id="email" name="email" type="email" value="{{.User.Email}}" required>
</div>
<div class="local field {{if .Err_Password}}error{{end}} {{if not (or (.User.IsLocal) (.User.IsOAuth2))}}tw-hidden{{end}}">
<label for="password">{{ctx.Locale.Tr "password"}}</label>
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl
index eb3f6cd720..49f62dda74 100644
--- a/templates/admin/user/list.tmpl
+++ b/templates/admin/user/list.tmpl
@@ -56,7 +56,7 @@
</form>
</div>
<div class="ui attached table segment">
- <table class="ui very basic striped table unstackable">
+ <table class="ui very basic striped selectable table unstackable">
<thead>
<tr>
<th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" .SortType false}}</th>
diff --git a/templates/admin/user/view.tmpl b/templates/admin/user/view.tmpl
index 21943a8382..67f9148e64 100644
--- a/templates/admin/user/view.tmpl
+++ b/templates/admin/user/view.tmpl
@@ -15,10 +15,7 @@
</div>
<div class="tw-flex-1">
<h4 class="ui top attached header">
- {{ctx.Locale.Tr "admin.emails"}}
- <div class="ui right">
- {{.EmailsTotal}}
- </div>
+ {{ctx.Locale.Tr "admin.emails"}} ({{ctx.Locale.Tr "admin.total" .EmailsTotal}})
</h4>
<div class="ui attached segment">
{{template "admin/user/view_emails" .}}
@@ -26,19 +23,13 @@
</div>
</div>
<h4 class="ui top attached header">
- {{ctx.Locale.Tr "admin.repositories"}}
- <div class="ui right">
- {{.ReposTotal}}
- </div>
+ {{ctx.Locale.Tr "admin.repositories"}} ({{ctx.Locale.Tr "admin.total" .ReposTotal}})
</h4>
<div class="ui attached segment">
- {{template "explore/repo_list" .}}
+ {{template "shared/repo/list" .}}
</div>
<h4 class="ui top attached header">
- {{ctx.Locale.Tr "settings.organization"}}
- <div class="ui right">
- {{.OrgsTotal}}
- </div>
+ {{ctx.Locale.Tr "settings.organization"}} ({{ctx.Locale.Tr "admin.total" .OrgsTotal}})
</h4>
<div class="ui attached segment">
{{template "explore/user_list" .}}
diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl
index 3f6d77a645..5ebe191771 100644
--- a/templates/base/alert.tmpl
+++ b/templates/base/alert.tmpl
@@ -18,3 +18,8 @@
<p>{{.Flash.WarningMsg | SanitizeHTML}}</p>
</div>
{{- end -}}
+{{- if .ShowTwoFactorRequiredMessage -}}
+<div class="ui negative message flash-message flash-error">
+ <p><a href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{ctx.Locale.Tr "auth.twofa_required"}}</a></p>
+</div>
+{{- end -}}
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl
index fed426a469..3af66e7369 100644
--- a/templates/base/footer.tmpl
+++ b/templates/base/footer.tmpl
@@ -5,16 +5,10 @@
<div>
{{end}}
- {{template "custom/body_inner_post" .}}
-
+ {{template "custom/body_inner_post" .}}
</div>
-
{{template "custom/body_outer_post" .}}
-
{{template "base/footer_content" .}}
-
- <script src="{{AssetUrlPrefix}}/js/index.js?v={{AssetVersion}}" onerror="alert('Failed to load asset files from ' + this.src + '. Please make sure the asset files can be accessed.')"></script>
-
{{template "custom/footer" .}}
</body>
</html>
diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl
index eab6c00840..b721779c95 100644
--- a/templates/base/head_navbar.tmpl
+++ b/templates/base/head_navbar.tmpl
@@ -1,8 +1,3 @@
-{{$notificationUnreadCount := 0}}
-{{if and .IsSigned .NotificationUnreadCount}}
- {{$notificationUnreadCount = call .NotificationUnreadCount}}
-{{end}}
-
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
<div class="navbar-left">
<!-- the logo -->
@@ -12,22 +7,7 @@
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
<div class="ui secondary menu navbar-mobile-right only-mobile">
- {{if and .IsSigned EnableTimetracking .ActiveStopwatch}}
- <a id="mobile-stopwatch-icon" class="active-stopwatch item" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{.ActiveStopwatch.Seconds}}">
- <div class="tw-relative">
- {{svg "octicon-stopwatch"}}
- <span class="header-stopwatch-dot"></span>
- </div>
- </a>
- {{end}}
- {{if .IsSigned}}
- <a id="mobile-notifications-icon" class="item" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
- <div class="tw-relative">
- {{svg "octicon-bell"}}
- <span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
- </div>
- </a>
- {{end}}
+ {{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
</div>
@@ -82,22 +62,7 @@
</div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu -->
{{else if .IsSigned}}
- {{if and EnableTimetracking .ActiveStopwatch}}
- <a class="item not-mobile active-stopwatch" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{.ActiveStopwatch.Seconds}}">
- <div class="tw-relative">
- {{svg "octicon-stopwatch"}}
- <span class="header-stopwatch-dot"></span>
- </div>
- </a>
- {{end}}
-
- <a class="item not-mobile" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
- <div class="tw-relative">
- {{svg "octicon-bell"}}
- <span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
- </div>
- </a>
-
+ {{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
<span class="text">
{{svg "octicon-plus"}}
@@ -127,8 +92,6 @@
<span class="only-mobile">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span>
- {{/* do not localize it, here it needs the fixed length (width) to make UI comfortable */}}
- {{if .IsAdmin}}<span class="navbar-profile-admin">admin</span>{{end}}
<div class="menu user-menu">
<div class="header">
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
@@ -157,14 +120,6 @@
{{svg "octicon-question"}}
{{ctx.Locale.Tr "help"}}
</a>
- {{if .IsAdmin}}
- <div class="divider"></div>
- <a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
- {{svg "octicon-server"}}
- {{ctx.Locale.Tr "admin_panel"}}
- </a>
- {{end}}
-
<div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
{{svg "octicon-sign-out"}}
@@ -186,15 +141,16 @@
{{end}}
</div><!-- end full right menu -->
- {{if and .IsSigned EnableTimetracking .ActiveStopwatch}}
+ {{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
+ {{if $activeStopwatch}}
<div class="active-stopwatch-popup tippy-target">
<div class="tw-flex tw-items-center tw-gap-2 tw-p-3">
- <a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{.ActiveStopwatch.IssueLink}}">
+ <a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{$activeStopwatch.IssueLink}}">
{{svg "octicon-issue-opened" 16}}
- <span class="stopwatch-issue">{{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}</span>
+ <span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
</a>
<div class="tw-flex tw-gap-1">
- <form class="stopwatch-commit form-fetch-action" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/toggle">
+ <form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
{{.CsrfTokenHtml}}
<button
type="submit"
@@ -202,7 +158,7 @@
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
>{{svg "octicon-square-fill"}}</button>
</form>
- <form class="stopwatch-cancel form-fetch-action" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
+ <form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
{{.CsrfTokenHtml}}
<button
type="submit"
diff --git a/templates/base/head_navbar_icons.tmpl b/templates/base/head_navbar_icons.tmpl
new file mode 100644
index 0000000000..e3bdd27992
--- /dev/null
+++ b/templates/base/head_navbar_icons.tmpl
@@ -0,0 +1,25 @@
+{{- $itemExtraClass := .ItemExtraClass -}}
+{{- $data := .PageGlobalData -}}
+{{if and $data $data.IsSigned}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
+ {{- $activeStopwatch := call $data.GetActiveStopwatch -}}
+ {{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
+ {{if $activeStopwatch}}
+ <a class="item active-stopwatch {{$itemExtraClass}}" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
+ <div class="tw-relative">
+ {{svg "octicon-stopwatch"}}
+ <span class="header-stopwatch-dot"></span>
+ </div>
+ </a>
+ {{end}}
+ <a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}">
+ <div class="tw-relative">
+ {{svg "octicon-bell"}}
+ <span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
+ </div>
+ </a>
+ {{if $data.IsSiteAdmin}}
+ <a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/-/admin" data-tooltip-content="{{ctx.Locale.Tr "admin_panel"}}">
+ {{svg "octicon-server"}}
+ </a>
+ {{end}}
+{{end}}
diff --git a/templates/base/head_script.tmpl b/templates/base/head_script.tmpl
index 7c931e7404..f6648b59d8 100644
--- a/templates/base/head_script.tmpl
+++ b/templates/base/head_script.tmpl
@@ -46,4 +46,4 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly.
{{/* in case some pages don't render the pageData, we make sure it is an object to prevent null access */}}
window.config.pageData = window.config.pageData || {};
</script>
-<script src="{{AssetUrlPrefix}}/js/webcomponents.js?v={{AssetVersion}}"></script>
+<script src="{{AssetUrlPrefix}}/js/index.js?v={{AssetVersion}}" onerror="alert('Failed to load asset files from ' + this.src + '. Please make sure the asset files can be accessed.')"></script>
diff --git a/templates/devtest/badge-actions-svg.tmpl b/templates/devtest/badge-actions-svg.tmpl
new file mode 100644
index 0000000000..5be4fb3131
--- /dev/null
+++ b/templates/devtest/badge-actions-svg.tmpl
@@ -0,0 +1,25 @@
+{{template "devtest/devtest-header"}}
+<div class="page-content devtest ui container">
+ <div>
+ <h1>Actions SVG</h1>
+ <form class="tw-my-3">
+ <div class="tw-mb-2">
+ {{range $fontName := .BadgeFontFamilyNames}}
+ <label><input name="font" type="radio" value="{{$fontName}}" {{Iif (eq $.SelectedFontFamilyName $fontName) "checked"}}>{{$fontName}}</label>
+ {{end}}
+ </div>
+ <div class="tw-mb-2">
+ {{range $style := .BadgeStyles}}
+ <label><input name="style" type="radio" value="{{$style}}" {{Iif (eq $.SelectedStyle $style) "checked"}}>{{$style}}</label>
+ {{end}}
+ </div>
+ <button>submit</button>
+ </form>
+ <div class="flex-text-block tw-flex-wrap">
+ {{range $badgeSVG := .BadgeSVGs}}
+ <div>{{$badgeSVG}}</div>
+ {{end}}
+ </div>
+ </div>
+</div>
+{{template "devtest/devtest-footer"}}
diff --git a/templates/devtest/commit-sign-badge.tmpl b/templates/devtest/badge-commit-sign.tmpl
index a6677c4495..a6677c4495 100644
--- a/templates/devtest/commit-sign-badge.tmpl
+++ b/templates/devtest/badge-commit-sign.tmpl
diff --git a/templates/devtest/devtest-header.tmpl b/templates/devtest/devtest-header.tmpl
index ee08545640..0775dccc2d 100644
--- a/templates/devtest/devtest-header.tmpl
+++ b/templates/devtest/devtest-header.tmpl
@@ -1,2 +1,3 @@
{{template "base/head" ctx.RootData}}
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/devtest.css?v={{AssetVersion}}">
+{{template "base/alert" .}}
diff --git a/templates/devtest/flex-list.tmpl b/templates/devtest/flex-list.tmpl
index 11d71d56a9..0db84b0c59 100644
--- a/templates/devtest/flex-list.tmpl
+++ b/templates/devtest/flex-list.tmpl
@@ -68,7 +68,7 @@
<a class="text primary" href="{{$.Link}}">
gitea-org / gitea
</a>
- <span data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
+ <span class="flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
</div>
<div class="flex-item-trailing">
<a class="muted" href="{{$.Link}}">
diff --git a/templates/devtest/fomantic-dropdown.tmpl b/templates/devtest/fomantic-dropdown.tmpl
index d41a161e86..a10dc890ce 100644
--- a/templates/devtest/fomantic-dropdown.tmpl
+++ b/templates/devtest/fomantic-dropdown.tmpl
@@ -75,12 +75,12 @@
<h2>Selection</h2>
<div>
{{/* the "selection" class is optional, it will be added by JS automatically */}}
- <select class="ui dropdown selection ellipsis-items-nowrap">
+ <select class="ui dropdown selection ellipsis-text-items">
<option>a</option>
<option>abcdefuvwxyz</option>
<option>loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong</option>
</select>
- <select class="ui dropdown ellipsis-items-nowrap tw-max-w-[8em]">
+ <select class="ui dropdown ellipsis-text-items tw-max-w-[8em]">
<option>loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong</option>
<option>abcdefuvwxyz</option>
<option>a</option>
diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl
index 838c6893a4..8e769790b2 100644
--- a/templates/devtest/fomantic-modal.tmpl
+++ b/templates/devtest/fomantic-modal.tmpl
@@ -2,13 +2,15 @@
<div class="page-content devtest ui container">
{{template "base/alert" .}}
<div class="modal-buttons flex-text-block tw-flex-wrap"></div>
- <script type="module">
- for (const el of $('.ui.modal:not([data-skip-button])')) {
- const $btn = $('<button class="ui button">').text(`${el.id}`).on('click', () => {
- $(el).modal({onApprove() {alert('confirmed')}}).modal('show');
- });
- $('.modal-buttons').append($btn);
- }
+ <script>
+ document.addEventListener('gitea:index-ready', () => {
+ for (const el of $('.ui.modal:not([data-skip-button])')) {
+ const $btn = $('<button class="ui button">').text(`${el.id}`).on('click', () => {
+ $(el).modal({onApprove() {alert('confirmed')}}).modal('show');
+ });
+ $('.modal-buttons').append($btn);
+ }
+ });
</script>
<div id="test-modal-form-1" class="ui mini modal">
diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl
index 5b40268761..cb5aad7b0c 100644
--- a/templates/devtest/gitea-ui.tmpl
+++ b/templates/devtest/gitea-ui.tmpl
@@ -9,16 +9,16 @@
<a class="silenced" href="#">silenced</a>
</div>
<h1>Button</h1>
- <div>
- Style:
- <label><input type="checkbox" name="button-style-compact" value="compact">compact</label>
- <label><input type="radio" name="button-style-size" value="">(normal)</label>
- <label><input type="radio" name="button-style-size" value="tiny">tiny</label>
- <label><input type="radio" name="button-style-size" value="mini">mini</label>
+ ".ui.button" styles:
+ <div class="flex-text-block tw-gap-4">
+ <label class="gt-checkbox"><input type="radio" name="button-style-size" value="">(normal)</label>
+ <label class="gt-checkbox"><input type="radio" name="button-style-size" value="small">small</label>
+ <label class="gt-checkbox"><input type="radio" name="button-style-size" value="tiny">tiny</label>
+ <label class="gt-checkbox"><input type="radio" name="button-style-size" value="mini">mini</label>
</div>
- <div>
- State:
- <label><input type="checkbox" name="button-state-disabled" value="disabled">disabled</label>
+ <div class="flex-text-block tw-gap-4">
+ <label class="gt-checkbox"><input type="checkbox" name="button-style-compact" value="compact">compact</label>
+ <label class="gt-checkbox"><input type="checkbox" name="button-state-disabled" value="disabled">disabled</label>
</div>
<div id="devtest-button-samples">
<ul class="button-sample-groups">
@@ -45,14 +45,16 @@
</div>
</li>
</ul>
- <script type="module">
- const $buttons = $('#devtest-button-samples').find('button.ui');
+ <script>
+ document.addEventListener('gitea:index-ready', () => {
+ const $buttons = $('#devtest-button-samples').find('button.ui');
- const $buttonStyles = $('input[name*="button-style"]');
- $buttonStyles.on('click', () => $buttonStyles.map((_ ,el) => $buttons.toggleClass(el.value, el.checked)));
+ const $buttonStyles = $('input[name*="button-style"]');
+ $buttonStyles.on('click', () => $buttonStyles.map((_, el) => $buttons.toggleClass(el.value, el.checked)));
- const $buttonStates = $('input[name*="button-state"]');
- $buttonStates.on('click', () => $buttonStates.map((_ ,el) => $buttons.prop(el.value, el.checked)));
+ const $buttonStates = $('input[name*="button-state"]');
+ $buttonStates.on('click', () => $buttonStates.map((_, el) => $buttons.prop(el.value, el.checked)));
+ });
</script>
</div>
</div>
diff --git a/templates/devtest/mail-preview.tmpl b/templates/devtest/mail-preview.tmpl
new file mode 100644
index 0000000000..9a3d792904
--- /dev/null
+++ b/templates/devtest/mail-preview.tmpl
@@ -0,0 +1,27 @@
+{{template "devtest/devtest-header"}}
+<div class="page-content devtest ui container">
+ <div class="flex-text-block tw-flex-wrap">
+ {{range $templateName := .MailTemplateNames}}
+ <a class="ui button" href="?tmpl={{$templateName}}">{{$templateName}}</a>
+ {{else}}
+ <p>Mailer service is not enabled or no template is found</p>
+ {{end}}
+ </div>
+
+ {{if .RenderMailTemplateName}}
+ <div class="tw-my-2">
+ <div>Preview of: {{.RenderMailTemplateName}}</div>
+ <div>Subject: {{.RenderMailSubject}}</div>
+ <iframe src="{{AppSubUrl}}/devtest/mail-preview/{{.RenderMailTemplateName}}" class="mail-preview-body"></iframe>
+ <style>
+ .mail-preview-body {
+ border: 1px solid #ccc;
+ width: 100%;
+ height: 400px;
+ overflow: auto;
+ }
+ </style>
+ </div>
+ {{end}}
+</div>
+{{template "devtest/devtest-footer"}}
diff --git a/templates/devtest/markup-render.tmpl b/templates/devtest/markup-render.tmpl
new file mode 100644
index 0000000000..69d29d7829
--- /dev/null
+++ b/templates/devtest/markup-render.tmpl
@@ -0,0 +1,71 @@
+{{template "devtest/devtest-header"}}
+<div class="page-content devtest ui container">
+ {{$longCode := "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}}
+ <div class="tw-flex">
+ <div class="tw-w-[50%] tw-p-4">
+ <div class="markup render-content">
+ Inline <code>code</code> content
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="markup render-content">
+ <p>content before</p>
+ <pre><code>Very long line with no code block or container: {{$longCode}}</code></pre>
+ <p>content after</p>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="markup render-content">
+ <p>content before</p>
+ <div class="code-block-container code-overflow-wrap">
+ <pre class="code-block"><code>Very long line with wrap: {{$longCode}}</code></pre>
+ </div>
+ <p>content after</p>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="markup render-content">
+ <p>content before</p>
+ <div class="code-block-container code-overflow-scroll">
+ <pre class="code-block"><code>Short line in scroll container</code></pre>
+ </div>
+ <div class="code-block-container code-overflow-scroll">
+ <pre class="code-block"><code>Very long line with scroll: {{$longCode}}</code></pre>
+ </div>
+ <p>content after</p>
+ </div>
+ </div>
+
+ <div class="tw-w-[50%] tw-p-4">
+ <div class="markup render-content">
+ <p>content before</p>
+ <div class="code-block-container">
+ <pre class="code-block"><code class="language-math">
+ \lim\limits_{n\rightarrow\infty}{\left(1+\frac{1}{n}\right)^n}
+ </code></pre>
+ </div>
+ <p>content after</p>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="markup render-content">
+ <p>content before</p>
+ <div class="code-block-container">
+ <pre class="code-block"><code class="language-mermaid is-loading">
+ graph LR
+ A[Square Rect] -- Link text --> B((Circle))
+ A --> C(Round Rect)
+ B --> D{Rhombus}
+ C --> D
+ </code></pre>
+ </div>
+ <p>content after</p>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "devtest/devtest-footer"}}
diff --git a/templates/explore/repos.tmpl b/templates/explore/repos.tmpl
index 53742bf0d9..68da398306 100644
--- a/templates/explore/repos.tmpl
+++ b/templates/explore/repos.tmpl
@@ -2,8 +2,8 @@
<div role="main" aria-label="{{.Title}}" class="page-content explore repositories">
{{template "explore/navbar" .}}
<div class="ui container">
- {{template "shared/repo_search" .}}
- {{template "explore/repo_list" .}}
+ {{template "shared/repo/search" .}}
+ {{template "shared/repo/list" .}}
{{template "base/paginate" .}}
</div>
</div>
diff --git a/templates/home.tmpl b/templates/home.tmpl
index 116dc487dc..cc9da82605 100644
--- a/templates/home.tmpl
+++ b/templates/home.tmpl
@@ -4,10 +4,10 @@
<div class="center">
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
<div class="hero">
- <h1 class="ui icon header title">
+ <h1 class="ui icon header title tw-text-balance">
{{AppName}}
</h1>
- <h2>{{ctx.Locale.Tr "startpage.app_desc"}}</h2>
+ <h2 class="tw-text-balance">{{ctx.Locale.Tr "startpage.app_desc"}}</h2>
</div>
</div>
</div>
@@ -16,7 +16,7 @@
<h1 class="hero ui icon header">
{{svg "octicon-flame"}} {{ctx.Locale.Tr "startpage.install"}}
</h1>
- <p class="large">
+ <p class="large tw-text-balance">
{{ctx.Locale.Tr "startpage.install_desc" "https://docs.gitea.com/installation/install-from-binary" "https://github.com/go-gitea/gitea/tree/master/docker" "https://docs.gitea.com/installation/install-from-package"}}
</p>
</div>
@@ -24,7 +24,7 @@
<h1 class="hero ui icon header">
{{svg "octicon-device-desktop"}} {{ctx.Locale.Tr "startpage.platform"}}
</h1>
- <p class="large">
+ <p class="large tw-text-balance">
{{ctx.Locale.Tr "startpage.platform_desc" "https://go.dev/"}}
</p>
</div>
@@ -34,7 +34,7 @@
<h1 class="hero ui icon header">
{{svg "octicon-rocket"}} {{ctx.Locale.Tr "startpage.lightweight"}}
</h1>
- <p class="large">
+ <p class="large tw-text-balance">
{{ctx.Locale.Tr "startpage.lightweight_desc"}}
</p>
</div>
@@ -42,7 +42,7 @@
<h1 class="hero ui icon header">
{{svg "octicon-code"}} {{ctx.Locale.Tr "startpage.license"}}
</h1>
- <p class="large">
+ <p class="large tw-text-balance">
{{ctx.Locale.Tr "startpage.license_desc" "https://code.gitea.io/gitea" "code.gitea.io/gitea" "https://github.com/go-gitea/gitea"}}
</p>
</div>
diff --git a/templates/install.tmpl b/templates/install.tmpl
index 058822a6f6..0aec52f27b 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -351,5 +351,4 @@
</div>
</div>
</div>
-<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/loading.png">
{{template "base/footer" .}}
diff --git a/templates/mail/auth/activate.devtest.yml b/templates/mail/auth/activate.devtest.yml
new file mode 100644
index 0000000000..f5519a6f6c
--- /dev/null
+++ b/templates/mail/auth/activate.devtest.yml
@@ -0,0 +1,3 @@
+DisplayName: User Display Name
+Code: The-Activation-Code
+ActiveCodeLives: 24h
diff --git a/templates/mail/notify/workflow_run.devtest.yml b/templates/mail/notify/workflow_run.devtest.yml
new file mode 100644
index 0000000000..1e285be328
--- /dev/null
+++ b/templates/mail/notify/workflow_run.devtest.yml
@@ -0,0 +1,18 @@
+RunStatusText: run status text ....
+
+Repo:
+ FullName: RepoName
+
+Run:
+ WorkflowID: WorkflowID
+ HTMLURL: http://localhost/run/1
+
+Jobs:
+ - Name: Job-Name-1
+ Status: success
+ Attempt: 1
+ HTMLURL: http://localhost/job/1
+ - Name: Job-Name-2
+ Status: failed
+ Attempt: 2
+ HTMLURL: http://localhost/job/2
diff --git a/templates/mail/notify/workflow_run.tmpl b/templates/mail/notify/workflow_run.tmpl
new file mode 100644
index 0000000000..f6dd8ad510
--- /dev/null
+++ b/templates/mail/notify/workflow_run.tmpl
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no">
+ <title>{{.Subject}}</title>
+</head>
+<body style="background-color: #f5f7fa; margin: 20px;">
+
+ <h2 style="color: #2c3e50; margin-bottom: 20px;">
+ {{.Repo.FullName}} {{.Run.WorkflowID}}: {{.RunStatusText}}
+ </h2>
+
+ <ul style="list-style: none; padding: 0; margin: 0 0 30px 0;">
+ {{range $job := .Jobs}}
+ <li style="background-color: #ffffff; border: 1px solid #ddd; border-radius: 6px; padding: 12px 16px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); transition: box-shadow 0.2s ease;">
+ <a href="{{$job.HTMLURL}}" style="color: #0073e6; text-decoration: none; font-weight: bold;">
+ {{$job.Status}}: {{$job.Name}}{{if gt $job.Attempt 1}}, Attempt #{{$job.Attempt}}{{end}}
+ </a>
+ </li>
+ {{end}}
+ </ul>
+
+ <br/>
+
+ <div style="text-align: center; margin-top: 30px;">
+ <a href="{{.Run.HTMLURL}}" style="display: inline-block; background-color: #28a745; color: #ffffff !important; text-decoration: none; padding: 10px 20px; border-radius: 5px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: background-color 0.3s ease;">
+ {{.locale.Tr "mail.view_it_on" AppName}}
+ </a>
+ </div>
+
+</body>
+</html>
diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl
index 7934d5b722..2d6dca5440 100644
--- a/templates/org/create.tmpl
+++ b/templates/org/create.tmpl
@@ -18,15 +18,15 @@
<label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label>
<div class="inline-right">
<div class="ui radio checkbox">
- <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}>
+ <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if .visibility.IsPublic}}checked{{end}}>
<label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
</div>
<div class="ui radio checkbox">
- <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if .DefaultOrgVisibilityMode.IsLimited}}checked{{end}}>
+ <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if .visibility.IsLimited}}checked{{end}}>
<label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label>
</div>
<div class="ui radio checkbox">
- <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if .DefaultOrgVisibilityMode.IsPrivate}}checked{{end}}>
+ <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if .visibility.IsPrivate}}checked{{end}}>
<label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label>
</div>
</div>
@@ -35,7 +35,7 @@
<div class="inline field" id="permission_box">
<label>{{ctx.Locale.Tr "org.settings.permission"}}</label>
<div class="ui checkbox">
- <input type="checkbox" name="repo_admin_change_team_access" checked>
+ <input type="checkbox" name="repo_admin_change_team_access" {{if .repo_admin_change_team_access}}checked{{end}}>
<label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
</div>
</div>
diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl
index 80519361fd..90798b5d7c 100644
--- a/templates/org/header.tmpl
+++ b/templates/org/header.tmpl
@@ -18,7 +18,7 @@
{{end}}
</span>
</div>
- {{if .RenderedDescription}}<div class="render-content markup tw-break-anywhere">{{.RenderedDescription}}</div>{{end}}
+ {{if .RenderedDescription}}<div class="render-content markup">{{.RenderedDescription}}</div>{{end}}
<div class="text light meta tw-mt-1">
{{if .Org.Location}}<div class="flex-text-block">{{svg "octicon-location"}} <span>{{.Org.Location}}</span></div>{{end}}
{{if .Org.Website}}<div class="flex-text-block">{{svg "octicon-link"}} <a class="muted" target="_blank" rel="noopener noreferrer me" href="{{.Org.Website}}">{{.Org.Website}}</a></div>{{end}}
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index cffdfabfaa..3cde3554c9 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -8,8 +8,8 @@
{{if .ProfileReadmeContent}}
<div id="readme_profile" class="render-content markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
{{end}}
- {{template "shared/repo_search" .}}
- {{template "explore/repo_list" .}}
+ {{template "shared/repo/search" .}}
+ {{template "shared/repo/list" .}}
{{template "base/paginate" .}}
</div>
diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl
index 4388dc9520..2d0f4bc423 100644
--- a/templates/org/member/members.tmpl
+++ b/templates/org/member/members.tmpl
@@ -73,7 +73,7 @@
{{ctx.Locale.Tr "org.members.leave"}}
</div>
<div class="content">
- <p>{{ctx.Locale.Tr "org.members.leave.detail" (`<span class="dataOrganizationName"></span>`|SafeHTML)}}</p>
+ <p>{{ctx.Locale.Tr "org.members.leave.detail" (HTMLFormat `<span class="%s"></span>` "dataOrganizationName")}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
@@ -82,7 +82,7 @@
{{ctx.Locale.Tr "org.members.remove"}}
</div>
<div class="content">
- <p>{{ctx.Locale.Tr "org.members.remove.detail" (`<span class="name"></span>`|SafeHTML) (`<span class="dataOrganizationName"></span>`|SafeHTML)}}</p>
+ <p>{{ctx.Locale.Tr "org.members.remove.detail" (HTMLFormat `<span class="%s"></span>` "name") (HTMLFormat `<span class="%s"></span>` "dataOrganizationName")}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/org/menu.tmpl b/templates/org/menu.tmpl
index 2d3af2d559..d876dabb44 100644
--- a/templates/org/menu.tmpl
+++ b/templates/org/menu.tmpl
@@ -44,7 +44,7 @@
{{end}}
</a>
{{end}}
- {{if .IsOrganizationOwner}}
+ {{if and EnableTimetracking .IsOrganizationOwner}}
<a class="{{if $.PageIsOrgTimes}}active{{end}} item" href="{{$.OrgLink}}/worktime">
{{svg "octicon-clock"}} {{ctx.Locale.Tr "org.worktime"}}
</a>
diff --git a/templates/org/projects/new.tmpl b/templates/org/projects/new.tmpl
index fc52130f68..c021c5a0fe 100644
--- a/templates/org/projects/new.tmpl
+++ b/templates/org/projects/new.tmpl
@@ -1,9 +1,24 @@
{{template "base/head" .}}
-<div role="main" aria-label="{{.Title}}" class="page-content organization projects edit-project new">
- {{template "shared/user/org_profile_avatar" .}}
+{{if .ContextUser.IsOrganization}}
+<div role="main" aria-label="{{.Title}}" class="page-content organization projects">
+ {{template "org/header" .}}
<div class="ui container">
- {{template "user/overview/header" .}}
- {{template "projects/new" .}}
+ {{template "projects/new" .}}
</div>
</div>
+{{else}}
+<div role="main" aria-label="{{.Title}}" class="page-content user profile">
+ <div class="ui container">
+ <div class="ui stackable grid">
+ <div class="ui four wide column">
+ {{template "shared/user/profile_big_avatar" .}}
+ </div>
+ <div class="ui twelve wide column tw-mb-4">
+ {{template "user/overview/header" .}}
+ {{template "projects/new" .}}
+ </div>
+ </div>
+ </div>
+</div>
+{{end}}
{{template "base/footer" .}}
diff --git a/templates/org/projects/view.tmpl b/templates/org/projects/view.tmpl
index bd74114fe2..1bfbc8d8b4 100644
--- a/templates/org/projects/view.tmpl
+++ b/templates/org/projects/view.tmpl
@@ -8,8 +8,6 @@
{{template "user/overview/header" .}}
</div>
{{end}}
- <div class="ui container fluid padded">
- {{template "projects/view" .}}
- </div>
+ {{template "projects/view" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl
deleted file mode 100644
index e1ef471e34..0000000000
--- a/templates/org/settings/delete.tmpl
+++ /dev/null
@@ -1,35 +0,0 @@
-{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings delete")}}
-
- <div class="org-setting-content">
- <h4 class="ui top attached error header">
- {{ctx.Locale.Tr "org.settings.delete_account"}}
- </h4>
- <div class="ui attached error segment">
- <div class="ui red message">
- <p class="text left">{{svg "octicon-alert"}} {{ctx.Locale.Tr "org.settings.delete_prompt"}}</p>
- </div>
- <form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}" method="post">
- {{.CsrfTokenHtml}}
- <div class="inline required field {{if .Err_OrgName}}error{{end}}">
- <label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}</label>
- <input id="org_name" name="org_name" value="" autocomplete="off" autofocus required>
- </div>
- <button class="ui red button delete-button" data-type="form" data-form="#delete-form">
- {{ctx.Locale.Tr "org.settings.confirm_delete_account"}}
- </button>
- </form>
- </div>
- </div>
-
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "org.settings.delete_org_title"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "org.settings.delete_org_desc"}}</p>
- </div>
- {{template "base/modal_actions_confirm" .}}
-</div>
-
-{{template "org/settings/layout_footer" .}}
diff --git a/templates/org/settings/hooks.tmpl b/templates/org/settings/hooks.tmpl
index 9f307968f8..b05e22fe20 100644
--- a/templates/org/settings/hooks.tmpl
+++ b/templates/org/settings/hooks.tmpl
@@ -1,5 +1,5 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings webhooks")}}
<div class="org-setting-content">
- {{template "repo/settings/webhook/list" .}}
+ {{template "repo/settings/webhook/base_list" .}}
</div>
{{template "org/settings/layout_footer" .}}
diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl
index ce792f667c..58475de7e7 100644
--- a/templates/org/settings/navbar.tmpl
+++ b/templates/org/settings/navbar.tmpl
@@ -41,8 +41,5 @@
</div>
</details>
{{end}}
- <a class="{{if .PageIsSettingsDelete}}active {{end}}item" href="{{.OrgLink}}/settings/delete">
- {{ctx.Locale.Tr "org.settings.delete"}}
- </a>
</div>
</div>
diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl
index 76315f3eac..d94bb4c62b 100644
--- a/templates/org/settings/options.tmpl
+++ b/templates/org/settings/options.tmpl
@@ -1,101 +1,97 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}}
- <div class="org-setting-content">
- <h4 class="ui top attached header">
- {{ctx.Locale.Tr "org.settings.options"}}
- </h4>
- <div class="ui attached segment">
- <form class="ui form" action="{{.Link}}" method="post">
- {{.CsrfTokenHtml}}
- <div class="required field {{if .Err_Name}}error{{end}}">
- <label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}
- <span class="text red tw-hidden" id="org-name-change-prompt">
- <br>{{ctx.Locale.Tr "org.settings.change_orgname_prompt"}}<br>{{ctx.Locale.Tr "org.settings.change_orgname_redirect_prompt"}}
- </span>
- </label>
- <input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required maxlength="40">
- </div>
- <div class="field {{if .Err_FullName}}error{{end}}">
- <label for="full_name">{{ctx.Locale.Tr "org.org_full_name_holder"}}</label>
- <input id="full_name" name="full_name" value="{{.Org.FullName}}" maxlength="100">
- </div>
- <div class="field {{if .Err_Email}}error{{end}}">
- <label for="email">{{ctx.Locale.Tr "org.settings.email"}}</label>
- <input id="email" name="email" type="email" value="{{.Org.Email}}" maxlength="255">
- </div>
- <div class="field {{if .Err_Description}}error{{end}}">
- {{/* it is rendered as markdown, but the length is limited, so at the moment we do not use the markdown editor here */}}
- <label for="description">{{ctx.Locale.Tr "org.org_desc"}}</label>
- <textarea id="description" name="description" rows="2" maxlength="255">{{.Org.Description}}</textarea>
- </div>
- <div class="field {{if .Err_Website}}error{{end}}">
- <label for="website">{{ctx.Locale.Tr "org.settings.website"}}</label>
- <input id="website" name="website" type="url" value="{{.Org.Website}}" maxlength="255">
- </div>
- <div class="field">
- <label for="location">{{ctx.Locale.Tr "org.settings.location"}}</label>
- <input id="location" name="location" value="{{.Org.Location}}" maxlength="50">
- </div>
- <div class="divider"></div>
- <div class="field" id="visibility_box">
- <label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label>
- <div class="field">
- <div class="ui radio checkbox">
- <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}>
- <label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
- </div>
- </div>
- <div class="field">
- <div class="ui radio checkbox">
- <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}>
- <label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label>
- </div>
- </div>
- <div class="field">
- <div class="ui radio checkbox">
- <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}>
- <label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label>
- </div>
- </div>
- </div>
+<div class="ui segments org-setting-content">
+ <h4 class="ui top attached header">
+ {{ctx.Locale.Tr "org.settings.options"}}
+ </h4>
+ <div class="ui attached segment">
+ <form class="ui form" action="{{.Link}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field {{if .Err_FullName}}error{{end}}">
+ <label for="full_name">{{ctx.Locale.Tr "org.org_full_name_holder"}}</label>
+ <input id="full_name" name="full_name" value="{{.Org.FullName}}" maxlength="100">
+ </div>
+ <div class="field {{if .Err_Email}}error{{end}}">
+ <label for="email">{{ctx.Locale.Tr "org.settings.email"}}</label>
+ <input id="email" name="email" type="email" value="{{.Org.Email}}" maxlength="255">
+ </div>
+ <div class="field {{if .Err_Description}}error{{end}}">
+ {{/* it is rendered as markdown, but the length is limited, so at the moment we do not use the markdown editor here */}}
+ <label for="description">{{ctx.Locale.Tr "org.org_desc"}}</label>
+ <textarea id="description" name="description" rows="2" maxlength="255">{{.Org.Description}}</textarea>
+ </div>
+ <div class="field {{if .Err_Website}}error{{end}}">
+ <label for="website">{{ctx.Locale.Tr "org.settings.website"}}</label>
+ <input id="website" name="website" type="url" value="{{.Org.Website}}" maxlength="255">
+ </div>
+ <div class="field">
+ <label for="location">{{ctx.Locale.Tr "org.settings.location"}}</label>
+ <input id="location" name="location" value="{{.Org.Location}}" maxlength="50">
+ </div>
+
+ <div class="divider"></div>
+ <div class="field" id="visibility_box">
+ <label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label>
+ <div class="field">
+ <div class="ui radio checkbox">
+ <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}>
+ <label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
+ </div>
+ </div>
+ <div class="field">
+ <div class="ui radio checkbox">
+ <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}>
+ <label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label>
+ </div>
+ </div>
+ <div class="field">
+ <div class="ui radio checkbox">
+ <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}>
+ <label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label>
+ </div>
+ </div>
+ </div>
- <div class="field" id="permission_box">
- <label>{{ctx.Locale.Tr "org.settings.permission"}}</label>
- <div class="field">
- <div class="ui checkbox">
- <input type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}>
- <label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
- </div>
- </div>
- </div>
+ <div class="field" id="permission_box">
+ <label>{{ctx.Locale.Tr "org.settings.permission"}}</label>
+ <div class="field">
+ <div class="ui checkbox">
+ <input type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}>
+ <label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
+ </div>
+ </div>
+ </div>
- {{if .SignedUser.IsAdmin}}
- <div class="divider"></div>
+ {{if .SignedUser.IsAdmin}}
+ <div class="divider"></div>
- <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
- <label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label>
- <input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.Org.MaxRepoCreation}}">
- <p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p>
- </div>
- {{end}}
+ <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
+ <label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label>
+ <input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.Org.MaxRepoCreation}}">
+ <p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p>
+ </div>
+ {{end}}
- <div class="field">
- <button class="ui primary button">{{ctx.Locale.Tr "org.settings.update_settings"}}</button>
- </div>
- </form>
+ <div class="field">
+ <button class="ui primary button">{{ctx.Locale.Tr "org.settings.update_settings"}}</button>
+ </div>
+ </form>
- <div class="divider"></div>
+ <div class="divider"></div>
- <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
- {{.CsrfTokenHtml}}
- <div class="inline field">
- {{template "shared/avatar_upload_crop" dict "LabelText" (ctx.Locale.Tr "settings.choose_new_avatar")}}
- </div>
- <div class="field">
- <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
- <button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
- </div>
- </form>
- </div>
+ <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
+ {{.CsrfTokenHtml}}
+ <div class="inline field">
+ {{template "shared/avatar_upload_crop" dict "LabelText" (ctx.Locale.Tr "settings.choose_new_avatar")}}
+ </div>
+ <div class="field">
+ <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
+ <button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
</div>
+ </form>
+ </div>
+</div>
+
+{{template "org/settings/options_dangerzone" .}}
+
{{template "org/settings/layout_footer" .}}
diff --git a/templates/org/settings/options_dangerzone.tmpl b/templates/org/settings/options_dangerzone.tmpl
new file mode 100644
index 0000000000..01cf3fd405
--- /dev/null
+++ b/templates/org/settings/options_dangerzone.tmpl
@@ -0,0 +1,93 @@
+<h4 class="ui top attached error header">
+ {{ctx.Locale.Tr "repo.settings.danger_zone"}}
+</h4>
+<div class="ui attached error danger segment">
+ <div class="flex-list">
+ <div class="flex-item tw-items-center">
+ <div class="flex-item-main">
+ <div class="flex-item-title">{{ctx.Locale.Tr "org.settings.rename"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "org.settings.rename_desc"}}</div>
+ </div>
+ <div class="flex-item-trailing">
+ <button class="ui basic red show-modal button" data-modal="#rename-org-modal">{{ctx.Locale.Tr "org.settings.rename"}}</button>
+ </div>
+ </div>
+
+ <div class="flex-item">
+ <div class="flex-item-main">
+ <div class="flex-item-title">{{ctx.Locale.Tr "org.settings.delete_account"}}</div>
+ <div class="flex-item-body">{{ctx.Locale.Tr "org.settings.delete_prompt"}}</div>
+ </div>
+ <div class="flex-item-trailing">
+ <button class="ui basic red show-modal button" data-modal="#delete-org-modal">{{ctx.Locale.Tr "org.settings.delete_account"}}</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="ui small modal" id="rename-org-modal">
+ <div class="header">
+ {{ctx.Locale.Tr "org.settings.rename"}}
+ </div>
+ <div class="content">
+ <ul class="ui warning message">
+ <li>{{ctx.Locale.Tr "org.settings.rename_notices_1"}}</li>
+ <li>{{ctx.Locale.Tr "org.settings.rename_notices_2"}}</li>
+ </ul>
+ <form class="ui form form-fetch-action" action="{{.Link}}/rename" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field">
+ <label>
+ {{ctx.Locale.Tr "org.settings.name_confirm"}}
+ <span class="text red">{{.Org.Name}}</span>
+ </label>
+ </div>
+ <div class="required field">
+ <label for="org_name_to_rename">{{ctx.Locale.Tr "org.org_name_holder"}}</label>
+ <input id="org_name_to_rename" name="org_name" required>
+ </div>
+
+ <div class="required field">
+ <label>{{ctx.Locale.Tr "org.settings.rename_new_org_name"}}</label>
+ <input name="new_org_name" required>
+ </div>
+
+ <div class="actions">
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "org.settings.rename"}}</button>
+ </div>
+ </form>
+ </div>
+</div>
+
+<div class="ui small modal" id="delete-org-modal">
+ <div class="header">
+ {{ctx.Locale.Tr "org.settings.delete_account"}}
+ </div>
+ <div class="content">
+ <ul class="ui warning message">
+ <li>{{ctx.Locale.Tr "org.settings.delete_notices_1"}}</li>
+ <li>{{ctx.Locale.Tr "org.settings.delete_notices_2" .Org.Name}}</li>
+ <li>{{ctx.Locale.Tr "org.settings.delete_notices_3" .Org.Name}}</li>
+ <li>{{ctx.Locale.Tr "org.settings.delete_notices_4" .Org.Name}}</li>
+ </ul>
+ <form class="ui form form-fetch-action" action="{{.Link}}/delete" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field">
+ <label>
+ {{ctx.Locale.Tr "org.settings.name_confirm"}}
+ <span class="text red">{{.Org.Name}}</span>
+ </label>
+ </div>
+ <div class="required field">
+ <label>{{ctx.Locale.Tr "org.org_name_holder"}}</label>
+ <input name="org_name" required>
+ </div>
+
+ <div class="actions">
+ <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+ <button class="ui red button">{{ctx.Locale.Tr "org.settings.delete_account"}}</button>
+ </div>
+ </form>
+ </div>
+</div>
diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl
index 5433f01530..4bc063f90c 100644
--- a/templates/org/team/members.tmpl
+++ b/templates/org/team/members.tmpl
@@ -81,7 +81,7 @@
{{ctx.Locale.Tr "org.members.remove"}}
</div>
<div class="content">
- <p>{{ctx.Locale.Tr "org.members.remove.detail" (`<span class="name"></span>`|SafeHTML) (`<span class="dataTeamName"></span>`|SafeHTML)}}</p>
+ <p>{{ctx.Locale.Tr "org.members.remove.detail" (HTMLFormat `<span class="%s"></span>` "name") (HTMLFormat `<span class="%s"></span>` "dataTeamName")}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
index b67c18dd7d..67529ddfba 100644
--- a/templates/org/team/new.tmpl
+++ b/templates/org/team/new.tmpl
@@ -56,7 +56,7 @@
<br>
<div class="field">
<div class="ui radio checkbox">
- <input type="radio" name="permission" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.AccessMode 1) (eq .Team.AccessMode 2)}}checked{{end}}>
+ <input type="radio" name="permission" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.AccessMode 0) (eq .Team.AccessMode 1) (eq .Team.AccessMode 2)}}checked{{end}}>
<label>{{ctx.Locale.Tr "org.teams.general_access"}}</label>
<span class="help">{{ctx.Locale.Tr "org.teams.general_access_helper"}}</span>
</div>
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl
index c4acd8da24..6dd5cb3eeb 100644
--- a/templates/org/team/sidebar.tmpl
+++ b/templates/org/team/sidebar.tmpl
@@ -42,10 +42,12 @@
<li>{{ctx.Locale.Tr "org.teams.can_create_org_repo"}}</li>
{{end}}
</ul>
- {{if (eq .Team.AccessMode 2)}}
+ {{/* the AccessMode should be either none or admin/owner, the real permissions are provided by each team unit */}}
+ {{if false}}{{/*(eq .Team.AccessMode 2)*/}}
<h3>{{ctx.Locale.Tr "org.settings.permission"}}</h3>
{{ctx.Locale.Tr "org.teams.write_permission_desc"}}
{{else if (eq .Team.AccessMode 3)}}
+ {{/* FIXME: here might not right, see "FIXME: TEAM-UNIT-PERMISSION", new units might not have correct admin permission*/}}
<h3>{{ctx.Locale.Tr "org.settings.permission"}}</h3>
{{ctx.Locale.Tr "org.teams.admin_permission_desc"}}
{{else}}
@@ -88,7 +90,7 @@
{{ctx.Locale.Tr "org.teams.leave"}}
</div>
<div class="content">
- <p>{{ctx.Locale.Tr "org.teams.leave.detail" (`<span class="name"></span>`|SafeHTML)}}</p>
+ <p>{{ctx.Locale.Tr "org.teams.leave.detail" (HTMLFormat `<span class="%s"></span>` "name")}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl
index 4e3e388cb6..cdd2789128 100644
--- a/templates/org/team/teams.tmpl
+++ b/templates/org/team/teams.tmpl
@@ -4,7 +4,7 @@
<div class="ui container">
{{template "base/alert" .}}
{{if .IsOrganizationOwner}}
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
<a class="ui primary button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus"}} {{ctx.Locale.Tr "org.create_new_team"}}</a>
</div>
<div class="divider"></div>
@@ -49,7 +49,7 @@
{{ctx.Locale.Tr "org.teams.leave"}}
</div>
<div class="content">
- <p>{{ctx.Locale.Tr "org.teams.leave.detail" (`<span class="name"></span>`|SafeHTML)}}</p>
+ <p>{{ctx.Locale.Tr "org.teams.leave.detail" (HTMLFormat `<span class="%s"></span>` "name")}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl
index 7d89f8c6e2..1a1335aaa6 100644
--- a/templates/package/content/container.tmpl
+++ b/templates/package/content/container.tmpl
@@ -16,7 +16,17 @@
</div>
<div class="field">
<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.container.digest"}}</label>
- <div class="markup"><pre class="code-block"><code>{{range .PackageDescriptor.Files}}{{if eq .File.LowerName "manifest.json"}}{{.Properties.GetByName "container.digest"}}{{end}}{{end}}</code></pre></div>
+ <div class="markup">
+ <div class="code-block-container code-overflow-scroll">
+ <pre class="code-block"><code>
+ {{- range .PackageDescriptor.Files -}}
+ {{- if eq .File.LowerName "manifest.json" -}}
+ {{- .Properties.GetByName "container.digest" -}}{{"\n"}}
+ {{- end -}}
+ {{- end -}}
+ </code></pre>
+ </div>
+ </div>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "packages.registry.documentation" "Container" "https://docs.gitea.com/usage/packages/container/"}}</label>
@@ -39,7 +49,11 @@
{{/* "unknown/unknown" is attestation-manifest, so we should skip it */}}
{{if ne .Platform "unknown/unknown"}}
<tr>
- <td><a class="tw-font-mono" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}</a></td>
+ <td>
+ <a class="tw-font-mono" href="{{$.PackageDescriptor.PackageWebLink}}/{{$.PackageDescriptor.Version.LowerVersion}}/{{PathEscape .Digest}}">
+ {{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}
+ </a>
+ </td>
<td>{{.Platform}}</td>
<td>{{FileSize .Size}}</td>
</tr>
@@ -55,12 +69,24 @@
{{.PackageDescriptor.Metadata.Description}}
</div>
{{end}}
- {{if .PackageDescriptor.Metadata.ImageLayers}}
- <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.layers"}}</h4>
+
+ {{/* a container manifest may contain sub manifests, so here we try to display some information of the sub manifest,
+ not perfect, just better than before */}}
+ {{$imageMetadata := .ContainerImageMetadata}}
+ {{if $imageMetadata.ImageLayers}}
+ <h4 class="ui top attached header flex-text-block">
+ {{ctx.Locale.Tr "packages.container.layers"}}
+ {{/* only show the platform if the image metadata is not the package's, which means that it is a sub manifest */}}
+ {{if ne .ContainerImageMetadata .PackageDescriptor.Metadata}}
+ <span class="tw-text-sm flex-text-inline" title="{{ctx.Locale.Tr "packages.container.details.platform"}}">
+ ({{svg "octicon-cpu" 12}} {{.ContainerImageMetadata.Platform}})
+ </span>
+ {{end}}
+ </h4>
<div class="ui attached segment tw-break-anywhere">
- <table class="ui very basic compact table">
+ <table class="ui very basic compact table tw-font-mono">
<tbody>
- {{range .PackageDescriptor.Metadata.ImageLayers}}
+ {{range $imageMetadata.ImageLayers}}
<tr>
<td>{{.}}</td>
</tr>
@@ -69,10 +95,10 @@
</table>
</div>
{{end}}
- {{if .PackageDescriptor.Metadata.Labels}}
+ {{if $imageMetadata.Labels}}
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.labels"}}</h4>
<div class="ui attached segment">
- <table class="ui very basic compact table">
+ <table class="ui very basic compact table tw-font-mono">
<thead>
<tr>
<th>{{ctx.Locale.Tr "packages.container.labels.key"}}</th>
@@ -80,7 +106,7 @@
</tr>
</thead>
<tbody>
- {{range $key, $value := .PackageDescriptor.Metadata.Labels}}
+ {{range $key, $value := $imageMetadata.Labels}}
<tr>
<td class="tw-align-top">{{$key}}</td>
<td class="tw-break-anywhere">{{$value}}</td>
diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl
index 2a22a6ed71..2625c160fe 100644
--- a/templates/package/content/pypi.tmpl
+++ b/templates/package/content/pypi.tmpl
@@ -4,7 +4,7 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.pypi.install"}}</label>
- <div class="markup"><pre class="code-block"><code>pip install --index-url <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple/"></origin-url> {{.PackageDescriptor.Package.Name}}</code></pre></div>
+ <div class="markup"><pre class="code-block"><code>pip install --index-url <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple/"></origin-url> --extra-index-url https://pypi.org/ {{.PackageDescriptor.Package.Name}}</code></pre></div>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "packages.registry.documentation" "PyPI" "https://docs.gitea.com/usage/packages/pypi/"}}</label>
diff --git a/templates/package/shared/view.tmpl b/templates/package/shared/view.tmpl
new file mode 100644
index 0000000000..52673accf9
--- /dev/null
+++ b/templates/package/shared/view.tmpl
@@ -0,0 +1,107 @@
+<div class="issue-title-header">
+ {{$packageVersionLink := print $.PackageDescriptor.PackageWebLink "/" (PathEscape .PackageDescriptor.Version.LowerVersion)}}
+ <h1>{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</h1>
+ <div>
+ {{$timeStr := DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}
+ {{if .HasRepositoryAccess}}
+ {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}}
+ {{else}}
+ {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName}}
+ {{end}}
+ </div>
+</div>
+<div class="packages-content">
+ <div class="packages-content-left">
+ {{template "package/content/alpine" .}}
+ {{template "package/content/arch" .}}
+ {{template "package/content/cargo" .}}
+ {{template "package/content/chef" .}}
+ {{template "package/content/composer" .}}
+ {{template "package/content/conan" .}}
+ {{template "package/content/conda" .}}
+ {{template "package/content/container" .}}
+ {{template "package/content/cran" .}}
+ {{template "package/content/debian" .}}
+ {{template "package/content/generic" .}}
+ {{template "package/content/go" .}}
+ {{template "package/content/helm" .}}
+ {{template "package/content/maven" .}}
+ {{template "package/content/npm" .}}
+ {{template "package/content/nuget" .}}
+ {{template "package/content/pub" .}}
+ {{template "package/content/pypi" .}}
+ {{template "package/content/rpm" .}}
+ {{template "package/content/rubygems" .}}
+ {{template "package/content/swift" .}}
+ {{template "package/content/vagrant" .}}
+ </div>
+ <div class="ui segment packages-content-right">
+ <strong>{{ctx.Locale.Tr "packages.details"}}</strong>
+ <div class="ui relaxed list flex-items-block">
+ <div class="item">{{svg .PackageDescriptor.Package.Type.SVGName}} {{.PackageDescriptor.Package.Type.Name}}</div>
+ {{if .HasRepositoryAccess}}
+ <div class="item">{{svg "octicon-repo"}} <a href="{{.PackageDescriptor.Repository.Link}}">{{.PackageDescriptor.Repository.FullName}}</a></div>
+ {{end}}
+ <div class="item">{{svg "octicon-calendar"}} {{DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}</div>
+ <div class="item">{{svg "octicon-download"}} {{.PackageDescriptor.Version.DownloadCount}}</div>
+ {{template "package/metadata/alpine" .}}
+ {{template "package/metadata/arch" .}}
+ {{template "package/metadata/cargo" .}}
+ {{template "package/metadata/chef" .}}
+ {{template "package/metadata/composer" .}}
+ {{template "package/metadata/conan" .}}
+ {{template "package/metadata/conda" .}}
+ {{template "package/metadata/container" .}}
+ {{template "package/metadata/cran" .}}
+ {{template "package/metadata/debian" .}}
+ {{template "package/metadata/generic" .}}
+ {{template "package/metadata/helm" .}}
+ {{template "package/metadata/maven" .}}
+ {{template "package/metadata/npm" .}}
+ {{template "package/metadata/nuget" .}}
+ {{template "package/metadata/pub" .}}
+ {{template "package/metadata/pypi" .}}
+ {{template "package/metadata/rpm" .}}
+ {{template "package/metadata/rubygems" .}}
+ {{template "package/metadata/swift" .}}
+ {{template "package/metadata/vagrant" .}}
+ {{if not (and (eq .PackageDescriptor.Package.Type "container") .PackageDescriptor.Metadata.Manifests)}}
+ <div class="item">{{svg "octicon-database"}} {{FileSize .PackageDescriptor.CalculateBlobSize}}</div>
+ {{end}}
+ </div>
+ {{if not (eq .PackageDescriptor.Package.Type "container")}}
+ <div class="divider"></div>
+ <strong>{{ctx.Locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong>
+ <div class="ui relaxed list">
+ {{range .PackageDescriptor.Files}}
+ <div class="item">
+ <a href="{{$packageVersionLink}}/files/{{.File.ID}}">{{.File.Name}}</a>
+ <span class="text small tw-whitespace-nowrap">{{FileSize .Blob.Size}}</span>
+ </div>
+ {{end}}
+ </div>
+ {{end}}
+ <div class="divider"></div>
+ <strong>{{ctx.Locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong>
+ <a class="tw-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{ctx.Locale.Tr "packages.versions.view_all"}}</a>
+ <div class="ui relaxed list">
+ {{range .LatestVersions}}
+ <div class="item tw-flex">
+ <a class="tw-flex-1 gt-ellipsis" title="{{.Version}}" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a>
+ <span class="text small">{{DateUtils.AbsoluteShort .CreatedUnix}}</span>
+ </div>
+ {{end}}
+ </div>
+ {{if or .CanWritePackages .HasRepositoryAccess}}
+ <div class="divider"></div>
+ <div class="ui relaxed list flex-items-block">
+ {{if .HasRepositoryAccess}}
+ <div class="item">{{svg "octicon-issue-opened"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{ctx.Locale.Tr "repo.issues"}}</a></div>
+ {{end}}
+ {{if .CanWritePackages}}
+ <div class="item">{{svg "octicon-tools"}} <a href="{{$packageVersionLink}}/settings">{{ctx.Locale.Tr "repo.settings"}}</a></div>
+ {{end}}
+ </div>
+ {{end}}
+ </div>
+</div>
diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl
index 9e92207466..9067f44296 100644
--- a/templates/package/view.tmpl
+++ b/templates/package/view.tmpl
@@ -1,114 +1,24 @@
{{template "base/head" .}}
-<div role="main" aria-label="{{.Title}}" class="page-content repository packages">
- {{template "shared/user/org_profile_avatar" .}}
+{{if .ContextUser.IsOrganization}}
+<div role="main" aria-label="{{.Title}}" class="page-content organization packages">
+ {{template "org/header" .}}
<div class="ui container">
- {{template "user/overview/header" .}}
- <div class="issue-title-header">
- <h1>{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</h1>
- <div>
- {{$timeStr := DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}
- {{if .HasRepositoryAccess}}
- {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}}
- {{else}}
- {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName}}
- {{end}}
- </div>
- </div>
- <div class="issue-content">
- <div class="issue-content-left">
- {{template "package/content/alpine" .}}
- {{template "package/content/arch" .}}
- {{template "package/content/cargo" .}}
- {{template "package/content/chef" .}}
- {{template "package/content/composer" .}}
- {{template "package/content/conan" .}}
- {{template "package/content/conda" .}}
- {{template "package/content/container" .}}
- {{template "package/content/cran" .}}
- {{template "package/content/debian" .}}
- {{template "package/content/generic" .}}
- {{template "package/content/go" .}}
- {{template "package/content/helm" .}}
- {{template "package/content/maven" .}}
- {{template "package/content/npm" .}}
- {{template "package/content/nuget" .}}
- {{template "package/content/pub" .}}
- {{template "package/content/pypi" .}}
- {{template "package/content/rpm" .}}
- {{template "package/content/rubygems" .}}
- {{template "package/content/swift" .}}
- {{template "package/content/vagrant" .}}
+ {{template "package/shared/view" .}}
+ </div>
+</div>
+{{else}}
+<div role="main" aria-label="{{.Title}}" class="page-content user profile packages">
+ <div class="ui container">
+ <div class="ui stackable grid">
+ <div class="ui four wide column">
+ {{template "shared/user/profile_big_avatar" .}}
</div>
- <div class="issue-content-right ui segment">
- <strong>{{ctx.Locale.Tr "packages.details"}}</strong>
- <div class="ui relaxed list flex-items-block">
- <div class="item">{{svg .PackageDescriptor.Package.Type.SVGName}} {{.PackageDescriptor.Package.Type.Name}}</div>
- {{if .HasRepositoryAccess}}
- <div class="item">{{svg "octicon-repo"}} <a href="{{.PackageDescriptor.Repository.Link}}">{{.PackageDescriptor.Repository.FullName}}</a></div>
- {{end}}
- <div class="item">{{svg "octicon-calendar"}} {{DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}</div>
- <div class="item">{{svg "octicon-download"}} {{.PackageDescriptor.Version.DownloadCount}}</div>
- {{template "package/metadata/alpine" .}}
- {{template "package/metadata/arch" .}}
- {{template "package/metadata/cargo" .}}
- {{template "package/metadata/chef" .}}
- {{template "package/metadata/composer" .}}
- {{template "package/metadata/conan" .}}
- {{template "package/metadata/conda" .}}
- {{template "package/metadata/container" .}}
- {{template "package/metadata/cran" .}}
- {{template "package/metadata/debian" .}}
- {{template "package/metadata/generic" .}}
- {{template "package/metadata/helm" .}}
- {{template "package/metadata/maven" .}}
- {{template "package/metadata/npm" .}}
- {{template "package/metadata/nuget" .}}
- {{template "package/metadata/pub" .}}
- {{template "package/metadata/pypi" .}}
- {{template "package/metadata/rpm" .}}
- {{template "package/metadata/rubygems" .}}
- {{template "package/metadata/swift" .}}
- {{template "package/metadata/vagrant" .}}
- {{if not (and (eq .PackageDescriptor.Package.Type "container") .PackageDescriptor.Metadata.Manifests)}}
- <div class="item">{{svg "octicon-database"}} {{FileSize .PackageDescriptor.CalculateBlobSize}}</div>
- {{end}}
- </div>
- {{if not (eq .PackageDescriptor.Package.Type "container")}}
- <div class="divider"></div>
- <strong>{{ctx.Locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong>
- <div class="ui relaxed list">
- {{range .PackageDescriptor.Files}}
- <div class="item">
- <a href="{{$.Link}}/files/{{.File.ID}}">{{.File.Name}}</a>
- <span class="text small file-size">{{FileSize .Blob.Size}}</span>
- </div>
- {{end}}
- </div>
- {{end}}
- <div class="divider"></div>
- <strong>{{ctx.Locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong>
- <a class="tw-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{ctx.Locale.Tr "packages.versions.view_all"}}</a>
- <div class="ui relaxed list">
- {{range .LatestVersions}}
- <div class="item tw-flex">
- <a class="tw-flex-1 gt-ellipsis" title="{{.Version}}" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a>
- <span class="text small">{{DateUtils.AbsoluteShort .CreatedUnix}}</span>
- </div>
- {{end}}
- </div>
- {{if or .CanWritePackages .HasRepositoryAccess}}
- <div class="divider"></div>
- <div class="ui relaxed list flex-items-block">
- {{if .HasRepositoryAccess}}
- <div class="item">{{svg "octicon-issue-opened"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{ctx.Locale.Tr "repo.issues"}}</a></div>
- {{end}}
- {{if .CanWritePackages}}
- <div class="item">{{svg "octicon-tools"}} <a href="{{.Link}}/settings">{{ctx.Locale.Tr "repo.settings"}}</a></div>
- {{end}}
- </div>
- {{end}}
+ <div class="ui twelve wide column tw-mb-4">
+ {{template "user/overview/header" .}}
+ {{template "package/shared/view" .}}
</div>
</div>
</div>
</div>
+{{end}}
{{template "base/footer" .}}
diff --git a/templates/post-install.tmpl b/templates/post-install.tmpl
index fa10827295..9baac4f84c 100644
--- a/templates/post-install.tmpl
+++ b/templates/post-install.tmpl
@@ -2,9 +2,9 @@
<div role="main" aria-label="{{.Title}}" class="page-content install post-install tw-h-full">
<div class="home tw-text-center tw-h-full tw-flex tw-flex-col tw-justify-center"><!-- the "home" class makes the links green -->
<!-- the "cup" has a handler, so move it a little leftward to make it visually in the center -->
- <div class="tw-ml-[-30px]"><img width="160" src="{{AssetUrlPrefix}}/img/loading.png" alt="" aria-hidden="true"></div>
+ <div class="tw-ml-[-30px]"><img width="160" src="{{AssetUrlPrefix}}/img/loading.png" alt aria-hidden="true"></div>
<div class="tw-my-[2em] tw-text-[18px]">
- <a id="goto-user-login" href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "install.installing_desc"}}</a>
+ <a id="goto-after-install" href="{{AppSubUrl}}{{Iif .IsAccountCreated "/user/login" "/user/sign_up"}}">{{ctx.Locale.Tr "install.installing_desc"}}</a>
</div>
</div>
</div>
diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl
index 48083811e7..e769543f6a 100644
--- a/templates/projects/list.tmpl
+++ b/templates/projects/list.tmpl
@@ -1,5 +1,5 @@
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
- <div class="tw-flex tw-justify-between tw-mb-4">
+ <div class="flex-text-block tw-justify-between tw-mb-4">
<div class="small-menu-items ui compact tiny menu list-header-toggle">
<a class="item{{if not .IsShowClosed}} active{{end}}" href="?state=open&q={{$.Keyword}}">
{{svg "octicon-project-symlink" 16 "tw-mr-2"}}
@@ -10,9 +10,7 @@
{{ctx.Locale.PrettyNumber .ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
</a>
</div>
- <div class="tw-text-right">
- <a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.projects.new"}}</a>
- </div>
+ <a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.projects.new"}}</a>
</div>
{{end}}
@@ -69,7 +67,7 @@
{{else}}
<a class="link-action flex-text-inline" href data-url="{{.Link ctx}}/close">{{svg "octicon-skip" 14}}{{ctx.Locale.Tr "repo.projects.close"}}</a>
{{end}}
- <a class="delete-button flex-text-inline" href="#" data-url="{{.Link ctx}}/delete">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
+ <a class="link-action flex-text-inline text red" href data-modal-confirm="#repo-project-delete-modal" data-url="{{.Link ctx}}/delete">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
</div>
{{end}}
</div>
@@ -83,14 +81,9 @@
</div>
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.projects.deletion"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.projects.deletion_desc"}}</p>
- </div>
+<div class="ui small modal" id="repo-project-delete-modal">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.projects.deletion"}}</div>
+ <div class="content"><p>{{ctx.Locale.Tr "repo.projects.deletion_desc"}}</p></div>
{{template "base/modal_actions_confirm" .}}
</div>
{{end}}
diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl
index a936079c46..f2630be09b 100644
--- a/templates/projects/new.tmpl
+++ b/templates/projects/new.tmpl
@@ -64,7 +64,7 @@
</div>
</div>
<div class="divider"></div>
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
<a class="ui cancel button" href="{{$.CancelLink}}">
{{ctx.Locale.Tr "repo.milestones.cancel"}}
</a>
diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl
index f4478d544a..692808a32d 100644
--- a/templates/projects/view.tmpl
+++ b/templates/projects/view.tmpl
@@ -1,27 +1,32 @@
{{$canWriteProject := and .CanWriteProjects (or (not .Repository) (not .Repository.IsArchived))}}
-<div class="ui container tw-max-w-full">
- <div class="tw-flex tw-justify-between tw-items-center tw-mb-4 tw-gap-3">
- <h2 class="tw-mb-0 tw-flex-1 tw-break-anywhere">{{.Project.Title}}</h2>
- <div class="project-toolbar-right">
- <div class="ui secondary filter menu labels">
- {{$queryLink := QueryBuild "?" "labels" .SelectLabels "assignee" $.AssigneeID "archived_labels" (Iif $.ShowArchivedLabels "true")}}
-
- {{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLink "SupportArchivedLabel" true}}
-
- {{template "repo/issue/filter_item_user_assign" dict
- "QueryParamKey" "assignee"
- "QueryLink" $queryLink
- "UserSearchList" $.Assignees
- "SelectedUserId" $.AssigneeID
- "TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
- "TextFilterMatchNone" (ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee")
- "TextFilterMatchAny" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee")
- }}
- </div>
- </div>
+<div class="ui container fluid padded projects-view">
+ <div class="ui container flex-text-block project-header">
+ <h2>{{.Project.Title}}</h2>
+ <div class="tw-flex-1"></div>
+ <div class="ui secondary menu tw-m-0">
+ {{$queryLink := QueryBuild "?" "labels" .SelectLabels "assignee" $.AssigneeID "archived_labels" (Iif $.ShowArchivedLabels "true")}}
+ {{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLink "SupportArchivedLabel" true}}
+ {{template "repo/issue/filter_item_user_assign" dict
+ "QueryParamKey" "assignee"
+ "QueryLink" $queryLink
+ "UserSearchList" $.Assignees
+ "SelectedUserId" $.AssigneeID
+ "TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
+ "TextFilterMatchNone" (ctx.Locale.Tr "repo.issues.filter_assignee_no_assignee")
+ "TextFilterMatchAny" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee")
+ }}
+ </div>
{{if $canWriteProject}}
<div class="ui compact mini menu">
+ <a class="item screen-full">
+ {{svg "octicon-screen-full"}}
+ {{ctx.Locale.Tr "projects.enter_fullscreen"}}
+ </a>
+ <a class="item screen-normal tw-hidden">
+ {{svg "octicon-screen-normal"}}
+ {{ctx.Locale.Tr "projects.exit_fullscreen"}}
+ </a>
<a class="item" href="{{.Link}}/edit?redirect=project">
{{svg "octicon-pencil"}}
{{ctx.Locale.Tr "repo.issues.label_edit"}}
@@ -59,13 +64,12 @@
{{end}}
</div>
- <div class="content">{{$.Project.RenderedContent}}</div>
-
- <div class="divider"></div>
-</div>
+ <div class="ui container project-description">
+ {{$.Project.RenderedContent}}
+ <div class="divider"></div>
+ </div>
-<div id="project-board" data-project-borad-writable="{{$canWriteProject}}">
- <div class="board {{if $canWriteProject}}sortable{{end}}" {{if $canWriteProject}}data-url="{{$.Link}}/move"{{end}}>
+ <div id="project-board" class="board {{if $canWriteProject}}sortable{{end}}" data-project-borad-writable="{{$canWriteProject}}" {{if $canWriteProject}}data-url="{{$.Link}}/move"{{end}}>
{{range .Columns}}
<div class="project-column" {{if .Color}}style="background: {{.Color}} !important; color: {{ContrastColor .Color}} !important"{{end}} data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}">
<div class="project-column-header{{if $canWriteProject}} tw-cursor-grab{{end}}">
@@ -126,12 +130,12 @@
<input class="project-column-id" type="hidden" name="id">
<div class="required field">
<label class="project-column-title-label" for="project-column-title-input">title</label>
- <input id="project-column-title-input" name="title" value="{{.Title}}" required>
+ <input id="project-column-title-input" name="title" required>
</div>
<div class="field">
<label class="project-column-color-label" for="project-column-color-input">color</label>
- <div class="js-color-picker-input column">
- <input maxlength="7" placeholder="#c320f6" id="project-column-color-input" name="color" value="{{.Color}}">
+ <div class="color-picker-combo" data-global-init="initColorPicker">
+ <input maxlength="7" placeholder="#c320f6" id="project-column-color-input" name="color">
{{template "repo/issue/label_precolors"}}
</div>
</div>
diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl
index fa1adb3e3b..23df61a43c 100644
--- a/templates/repo/actions/runs_list.tmpl
+++ b/templates/repo/actions/runs_list.tmpl
@@ -5,36 +5,55 @@
<h2>{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{ctx.Locale.Tr "actions.runs.no_runs"}}{{end}}</h2>
</div>
{{end}}
- {{range .Runs}}
+ {{range $run := .Runs}}
<div class="flex-item tw-items-center">
<div class="flex-item-leading">
- {{template "repo/actions/status" (dict "status" .Status.String)}}
+ {{template "repo/actions/status" (dict "status" $run.Status.String)}}
</div>
<div class="flex-item-main">
- <a class="flex-item-title" title="{{.Title}}" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
- {{if .Title}}{{.Title}}{{else}}{{ctx.Locale.Tr "actions.runs.empty_commit_message"}}{{end}}
+ <a class="flex-item-title" title="{{$run.Title}}" href="{{$run.Link}}">
+ {{or $run.Title (ctx.Locale.Tr "actions.runs.empty_commit_message")}}
</a>
<div class="flex-item-body">
- <span><b>{{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}}</b>:</span>
- {{- if .ScheduleID -}}
+ <span><b>{{if not $.CurWorkflow}}{{$run.WorkflowID}} {{end}}#{{$run.Index}}</b>:</span>
+ {{- if $run.ScheduleID -}}
{{ctx.Locale.Tr "actions.runs.scheduled"}}
{{- else -}}
{{ctx.Locale.Tr "actions.runs.commit"}}
- <a href="{{$.RepoLink}}/commit/{{.CommitSHA}}">{{ShortSha .CommitSHA}}</a>
+ <a href="{{$.RepoLink}}/commit/{{$run.CommitSHA}}">{{ShortSha $run.CommitSHA}}</a>
{{ctx.Locale.Tr "actions.runs.pushed_by"}}
- <a href="{{.TriggerUser.HomeLink}}">{{.TriggerUser.GetDisplayName}}</a>
+ <a href="{{$run.TriggerUser.HomeLink}}">{{$run.TriggerUser.GetDisplayName}}</a>
{{- end -}}
</div>
</div>
<div class="flex-item-trailing">
- {{if .IsRefDeleted}}
- <span class="ui label run-list-ref gt-ellipsis tw-line-through" data-tooltip-content="{{.PrettyRef}}">{{.PrettyRef}}</span>
+ {{if $run.IsRefDeleted}}
+ <span class="ui label run-list-ref gt-ellipsis tw-line-through" data-tooltip-content="{{$run.PrettyRef}}">{{$run.PrettyRef}}</span>
{{else}}
- <a class="ui label run-list-ref gt-ellipsis" href="{{.RefLink}}" data-tooltip-content="{{.PrettyRef}}">{{.PrettyRef}}</a>
+ <a class="ui label run-list-ref gt-ellipsis" href="{{$run.RefLink}}" data-tooltip-content="{{$run.PrettyRef}}">{{$run.PrettyRef}}</a>
{{end}}
<div class="run-list-item-right">
- <div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince .Updated}}</div>
- <div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div>
+ <div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince $run.Updated}}</div>
+ <div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{$run.Duration}}</div>
+ </div>
+ <div class="ui dropdown jump tw-p-2">
+ {{svg "octicon-kebab-horizontal"}}
+ <div class="menu flex-items-menu">
+ <a class="item" href="{{$run.Link}}/workflow">{{svg "octicon-play"}}{{ctx.Locale.Tr "actions.runs.view_workflow_file"}}</a>
+ {{if and $.CanWriteRepoUnitActions (not $run.Status.IsDone)}}
+ <a class="item link-action" data-url="{{$run.Link}}/cancel">
+ {{svg "octicon-x"}}{{ctx.Locale.Tr "actions.runs.cancel"}}
+ </a>
+ {{end}}
+ {{if and $.CanWriteRepoUnitActions $run.Status.IsDone}}
+ <a class="item link-action"
+ data-url="{{$run.Link}}/delete"
+ data-modal-confirm="{{ctx.Locale.Tr "actions.runs.delete.description"}}"
+ >
+ {{svg "octicon-trash"}}{{ctx.Locale.Tr "actions.runs.delete"}}
+ </a>
+ {{end}}
+ </div>
</div>
</div>
</div>
diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl
index 64c2543302..f2020bc160 100644
--- a/templates/repo/actions/status.tmpl
+++ b/templates/repo/actions/status.tmpl
@@ -16,7 +16,7 @@
{{else if eq .status "blocked"}}
{{svg "octicon-blocked" $size (printf "text yellow %s" $className)}}
{{else if eq .status "running"}}
- {{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}}
+ {{svg "octicon-meter" $size (printf "text yellow circular-spin %s" $className)}}
{{else}}{{/*failure, unknown*/}}
{{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}}
{{end}}
diff --git a/templates/repo/actions/view_component.tmpl b/templates/repo/actions/view_component.tmpl
index 8d1de41f70..4e338ffcfc 100644
--- a/templates/repo/actions/view_component.tmpl
+++ b/templates/repo/actions/view_component.tmpl
@@ -4,7 +4,7 @@
data-actions-url="{{.ActionsURL}}"
data-locale-approve="{{ctx.Locale.Tr "repo.diff.review.approve"}}"
- data-locale-cancel="{{ctx.Locale.Tr "cancel"}}"
+ data-locale-cancel="{{ctx.Locale.Tr "actions.runs.cancel"}}"
data-locale-rerun="{{ctx.Locale.Tr "rerun"}}"
data-locale-rerun-all="{{ctx.Locale.Tr "rerun_all"}}"
data-locale-runs-scheduled="{{ctx.Locale.Tr "actions.runs.scheduled"}}"
@@ -19,6 +19,7 @@
data-locale-status-skipped="{{ctx.Locale.Tr "actions.status.skipped"}}"
data-locale-status-blocked="{{ctx.Locale.Tr "actions.status.blocked"}}"
data-locale-artifacts-title="{{ctx.Locale.Tr "artifacts"}}"
+ data-locale-artifact-expired="{{ctx.Locale.Tr "expired"}}"
data-locale-confirm-delete-artifact="{{ctx.Locale.Tr "confirm_delete_artifact"}}"
data-locale-show-timestamps="{{ctx.Locale.Tr "show_timestamps"}}"
data-locale-show-log-seconds="{{ctx.Locale.Tr "show_log_seconds"}}"
diff --git a/templates/repo/actions/workflow_dispatch.tmpl b/templates/repo/actions/workflow_dispatch.tmpl
index 55fe122419..540bbe9162 100644
--- a/templates/repo/actions/workflow_dispatch.tmpl
+++ b/templates/repo/actions/workflow_dispatch.tmpl
@@ -10,7 +10,7 @@
<span class="ui inline required field">
<label>{{ctx.Locale.Tr "actions.workflow.from_ref"}}:</label>
</span>
- <div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-items-nowrap">
+ <div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-text-items">
<input type="hidden" name="ref" hx-sync="this:replace" hx-target="#runWorkflowDispatchModalInputs" hx-swap="innerHTML" hx-get="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}" hx-trigger="change" value="refs/heads/{{index .Branches 0}}">
{{svg "octicon-git-branch" 14}}
<div class="default text">{{index .Branches 0}}</div>
diff --git a/templates/repo/actions/workflow_dispatch_inputs.tmpl b/templates/repo/actions/workflow_dispatch_inputs.tmpl
index 8b8292af1d..37538a318f 100644
--- a/templates/repo/actions/workflow_dispatch_inputs.tmpl
+++ b/templates/repo/actions/workflow_dispatch_inputs.tmpl
@@ -33,7 +33,8 @@
</div>
{{end}}
<div class="ui field">
- <button class="ui tiny primary button" type="submit">{{ctx.Locale.Tr "actions.workflow.run"}}</button>
+ {{/* use autofocus here to prevent the "branch selection" dropdown from getting focus, otherwise it will auto popup */}}
+ <button class="ui tiny primary button" autofocus type="submit">{{ctx.Locale.Tr "actions.workflow.run"}}</button>
</div>
{{end}}
{{range .workflows}}
diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl
index 05f79612bd..c4d9f0741f 100644
--- a/templates/repo/blame.tmpl
+++ b/templates/repo/blame.tmpl
@@ -10,7 +10,7 @@
</div>
{{end}}
{{end}}
-<div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
+<div class="{{TabSizeClass .Editorconfig .FileTreePath}} non-diff-file-content">
<h4 class="file-header ui top attached header tw-flex tw-items-center tw-justify-between tw-flex-wrap">
<div class="file-header-left tw-flex tw-items-center tw-py-2 tw-pr-4">
{{template "repo/file_info" .}}
@@ -82,6 +82,8 @@
</table>
{{end}}{{/* end if .IsFileTooLarge */}}
<div class="code-line-menu tippy-target">
+ {{/*FIXME: the "HasSourceRenderedToggle" is never set on blame page, it should mean "whether the file is renderable".
+ If the file is renderable, then it must has the "display=source" parameter to make sure the file view page shows the source code, then line number works. */}}
{{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
<a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
{{end}}
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl
index f4f3c2e5c5..9e86641c6f 100644
--- a/templates/repo/branch/list.tmpl
+++ b/templates/repo/branch/list.tmpl
@@ -20,14 +20,14 @@
<tr>
<td>
<div class="flex-text-block">
- <a class="gt-ellipsis" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a>
+ <a class="gt-ellipsis branch-name" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a>
{{if .DefaultBranchBranch.IsProtected}}
<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span>
{{end}}
<button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button>
{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
</div>
- <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DefaultBranchBranch.DBBranch.CommitMessage (.Repository.ComposeMetas ctx)}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p>
+ <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DefaultBranchBranch.DBBranch.CommitMessage .Repository}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p>
</td>
{{/* FIXME: here and below, the tw-overflow-visible is not quite right but it is still needed the moment: to show the important buttons when the width is narrow */}}
<td class="tw-text-right tw-overflow-visible">
@@ -90,25 +90,31 @@
<td class="eight wide">
{{if .DBBranch.IsDeleted}}
<div class="flex-text-block">
- <span class="gt-ellipsis">{{.DBBranch.Name}}</span>
+ <span class="gt-ellipsis branch-name">{{.DBBranch.Name}}</span>
<button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button>
</div>
<p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{DateUtils.TimeSince .DBBranch.DeletedUnix}}</p>
{{else}}
<div class="flex-text-block">
- <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a>
+ <a class="gt-ellipsis branch-name" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a>
{{if .IsProtected}}
<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span>
{{end}}
<button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button>
{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
</div>
- <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DBBranch.CommitMessage ($.Repository.ComposeMetas ctx)}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DBBranch.CommitTime}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p>
+ <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DBBranch.CommitMessage $.Repository}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DBBranch.CommitTime}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p>
{{end}}
</td>
<td class="two wide ui">
- {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
- <div class="commit-divergence">
+ {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
+ {{$tooltipDivergence := ""}}
+ {{if or .CommitsBehind .CommitsAhead}}
+ {{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_divergence_from" .CommitsBehind .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}}
+ {{else}}
+ {{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_no_divergence" $.DefaultBranchBranch.DBBranch.Name}}
+ {{end}}
+ <div class="commit-divergence" data-tooltip-content="{{$tooltipDivergence}}">
<div class="bar-group">
<div class="count count-behind">{{.CommitsBehind}}</div>
{{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}}
@@ -119,7 +125,7 @@
<div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
</div>
</div>
- {{end}}
+ {{end}}
</td>
<td class="two wide tw-text-right">
{{if not .LatestPullRequest}}
@@ -128,13 +134,13 @@
{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}}
</span>
{{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
- <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}">
+ <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}?expand=1">
<button id="new-pull-request" class="ui compact basic button tw-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button>
</a>
{{end}}
{{else if and .LatestPullRequest.HasMerged .MergeMovedOn}}
{{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
- <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}">
+ <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}?expand=1">
<button id="new-pull-request" class="ui compact basic button tw-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button>
</a>
{{end}}
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl
index f679b8744b..36dc047c23 100644
--- a/templates/repo/branch_dropdown.tmpl
+++ b/templates/repo/branch_dropdown.tmpl
@@ -46,17 +46,21 @@ Search "repo/branch_dropdown" in the template directory to find all occurrences.
data-enable-feed="{{ctx.RootData.EnableFeed}}"
>
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}}
- <div class="ui dropdown custom branch-selector-dropdown ellipsis-items-nowrap">
- <div class="ui button branch-dropdown-button">
+ <div class="ui dropdown custom branch-selector-dropdown ellipsis-text-items">
+ <div class="ui compact button branch-dropdown-button">
<span class="flex-text-block gt-ellipsis">
- {{if not .DropdownFixedText}}
- {{if .ShowTabTags}}
+ {{if .DropdownFixedText}}
+ {{.DropdownFixedText}}
+ {{else}}
+ {{if eq .CurrentRefType "tag"}}
{{svg "octicon-tag"}}
- {{else if .ShowTabBranches}}
+ {{else if eq .CurrentRefType "branch"}}
{{svg "octicon-git-branch"}}
+ {{else}}
+ {{svg "octicon-git-commit"}}
{{end}}
+ <strong class="tw-inline-block gt-ellipsis">{{.CurrentRefShortName}}</strong>
{{end}}
- <strong class="tw-ml-2 tw-inline-block gt-ellipsis">{{Iif .DropdownFixedText .SelectedRefShortName}}</strong>
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
diff --git a/templates/repo/clone_panel.tmpl b/templates/repo/clone_panel.tmpl
index 2ed8f52fbe..e23bc8a19a 100644
--- a/templates/repo/clone_panel.tmpl
+++ b/templates/repo/clone_panel.tmpl
@@ -1,6 +1,6 @@
-<button class="ui primary button js-btn-clone-panel">
+<button class="ui compact primary button js-btn-clone-panel">
{{svg "octicon-code" 16}}
- <span>Code</span>
+ <span>{{ctx.Locale.Tr "repo.code"}}</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</button>
<div class="clone-panel-popup tippy-target">
diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl
index f0edf6065b..8569bd6c13 100644
--- a/templates/repo/code/recently_pushed_new_branches.tmpl
+++ b/templates/repo/code/recently_pushed_new_branches.tmpl
@@ -1,12 +1,18 @@
-{{range .RecentlyPushedNewBranches}}
- <div class="ui positive message tw-flex tw-items-center tw-gap-2">
- <div class="tw-flex-1 tw-break-anywhere">
- {{$timeSince := DateUtils.TimeSince .CommitTime}}
- {{$branchLink := HTMLFormat `<a href="%s">%s</a>` .BranchLink .BranchDisplayName}}
+{{/* Template Attributes:
+* RecentBranchesPromptData
+*/}}
+{{$data := .RecentBranchesPromptData}}
+{{if $data}}
+ {{range $recentBranch := $data.RecentlyPushedNewBranches}}
+ <div class="ui positive message flex-text-block">
+ <div class="tw-flex-1">
+ {{$timeSince := DateUtils.TimeSince $recentBranch.CommitTime}}
+ {{$branchLink := HTMLFormat `<a href="%s">%s</a>` $recentBranch.BranchLink .BranchDisplayName}}
{{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" $branchLink $timeSince}}
</div>
- <a role="button" class="ui compact green button tw-m-0" href="{{.BranchCompareURL}}">
+ <a role="button" class="ui compact green button" href="{{QueryBuild $recentBranch.BranchCompareURL "expand" 1}}">
{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
</a>
</div>
+ {{end}}
{{end}}
diff --git a/templates/repo/commit_load_branches_and_tags.tmpl b/templates/repo/commit_load_branches_and_tags.tmpl
index ffa0e530e8..ecb210c575 100644
--- a/templates/repo/commit_load_branches_and_tags.tmpl
+++ b/templates/repo/commit_load_branches_and_tags.tmpl
@@ -1,5 +1,12 @@
{{if not .PageIsWiki}}
<div class="branch-and-tag-area" data-text-default-branch-tooltip="{{ctx.Locale.Tr "repo.commit.contained_in_default_branch"}}">
+ {{if .MergedPRIssueNumber}}
+ {{$prLink := HTMLFormat `<a href="%s/pulls/%d">#%d</a>` $.RepoLink $.MergedPRIssueNumber $.MergedPRIssueNumber}}
+ <div>
+ <div class="divider"></div>
+ <div>{{ctx.Locale.Tr "repo.commit.merged_in_pr" $prLink}}</div>
+ </div>
+ {{end}}
<button class="ui button ellipsis-button load-branches-and-tags tw-mt-2" aria-expanded="false"
data-fetch-url="{{.RepoLink}}/commit/{{.CommitID}}/load-branches-and-tags"
data-tooltip-content="{{ctx.Locale.Tr "repo.commit.load_referencing_branches_and_tags"}}"
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl
index ff3dccd534..68ccf9d275 100644
--- a/templates/repo/commit_page.tmpl
+++ b/templates/repo/commit_page.tmpl
@@ -5,7 +5,7 @@
<div class="ui container fluid padded">
<div class="ui top attached header clearing segment tw-relative commit-header">
<div class="tw-flex tw-mb-4 tw-gap-1">
- <h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary" title="{{.Commit.Summary}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.Message ($.Repository.ComposeMetas ctx)}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses}}</h3>
+ <h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary" title="{{.Commit.Summary}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.Message $.Repository}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "AdditionalClasses" "tw-inline"}}</h3>
{{if not $.PageIsWiki}}
<div class="commit-header-buttons">
<a class="ui primary tiny button" href="{{.SourcePath}}">
@@ -75,7 +75,7 @@
{{.CsrfTokenHtml}}
<div class="field">
<label>
- {{ctx.Locale.Tr "repo.branch.new_branch_from" (`<span class="text" id="modal-create-branch-from-span"></span>`|SafeHTML)}}
+ {{ctx.Locale.Tr "repo.branch.new_branch_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-branch-from-span")}}
</label>
</div>
<div class="required field">
@@ -100,7 +100,7 @@
<input type="hidden" name="create_tag" value="true">
<div class="field">
<label>
- {{ctx.Locale.Tr "repo.tag.create_tag_from" (`<span class="text" id="modal-create-tag-from-span"></span>`|SafeHTML)}}
+ {{ctx.Locale.Tr "repo.tag.create_tag_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-tag-from-span")}}
</label>
</div>
<div class="required field">
@@ -122,7 +122,7 @@
{{end}}
</div>
{{if IsMultilineCommitMessage .Commit.Message}}
- <pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.Message ($.Repository.ComposeMetas ctx)}}</pre>
+ <pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.Message $.Repository}}</pre>
{{end}}
{{template "repo/commit_load_branches_and_tags" .}}
</div>
@@ -147,7 +147,7 @@
<div class="flex-text-inline">
{{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}}
<span class="text grey">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span>
- {{if ne .Verification.CommittingUser.ID 0}}
+ {{if and .Verification.CommittingUser .Verification.CommittingUser.ID}}
{{ctx.AvatarUtils.Avatar .Verification.CommittingUser 20}}
<a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a>
{{else}}
diff --git a/templates/repo/commit_status.tmpl b/templates/repo/commit_status.tmpl
index eb700ab2bb..7184f5f8eb 100644
--- a/templates/repo/commit_status.tmpl
+++ b/templates/repo/commit_status.tmpl
@@ -14,3 +14,6 @@
{{if eq .State "warning"}}
{{svg "gitea-exclamation" 18 "commit-status icon text yellow"}}
{{end}}
+{{if eq .State "skipped"}}
+ {{svg "octicon-skip" 18 "commit-status icon text grey"}}
+{{end}}
diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl
index a6f75584a3..1bbfb33105 100644
--- a/templates/repo/commit_statuses.tmpl
+++ b/templates/repo/commit_statuses.tmpl
@@ -1,10 +1,10 @@
{{if .Statuses}}
{{if and (eq (len .Statuses) 1) .Status.TargetURL}}
- <a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-tippy="commit-statuses" href="{{.Status.TargetURL}}">
+ <a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" href="{{.Status.TargetURL}}">
{{template "repo/commit_status" .Status}}
</a>
{{else}}
- <span class="flex-text-inline {{.AdditionalClasses}}" data-tippy="commit-statuses" tabindex="0">
+ <span class="flex-text-inline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" tabindex="0">
{{template "repo/commit_status" .Status}}
</span>
{{end}}
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl
index e1bd6b73ae..959f2a9398 100644
--- a/templates/repo/commits_list.tmpl
+++ b/templates/repo/commits_list.tmpl
@@ -44,7 +44,7 @@
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | ctx.RenderUtils.RenderEmoji}}</span>
{{else}}
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
- <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink ($.Repository.ComposeMetas ctx)}}</span>
+ <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.Repository}}</span>
{{end}}
</span>
{{if IsMultilineCommitMessage .Message}}
@@ -52,11 +52,11 @@
{{end}}
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
{{if IsMultilineCommitMessage .Message}}
- <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message ($.Repository.ComposeMetas ctx)}}</pre>
+ <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message $.Repository}}</pre>
{{end}}
{{if $.CommitsTagsMap}}
{{range (index $.CommitsTagsMap .ID.String)}}
- {{- template "repo/tag/name" dict "RepoLink" $.Repository.Link "TagName" .TagName "IsRelease" (not .IsTag) -}}
+ {{- template "repo/tag/name" dict "AdditionalClasses" "tw-py-0" "RepoLink" $.Repository.Link "TagName" .TagName "IsRelease" (not .IsTag) -}}
{{end}}
{{end}}
</td>
@@ -70,15 +70,15 @@
{{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}}
{{if not $.PageIsWiki}}
{{/* view single file diff */}}
- {{if $.FileName}}
+ {{if $.FileTreePath}}
<a class="btn interact-bg tw-p-2 view-single-diff" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_file_diff"}}"
- href="{{$commitRepoLink}}/commit/{{.ID.String}}?files={{$.FileName}}"
+ href="{{$commitRepoLink}}/commit/{{.ID.String}}?files={{$.FileTreePath}}"
>{{svg "octicon-file-diff"}}</a>
{{end}}
{{/* view at history point */}}
{{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
- {{if $.FileName}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileName)}}{{end}}
+ {{if $.FileTreePath}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileTreePath)}}{{end}}
<a class="btn interact-bg tw-p-2 view-commit-path" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a>
{{end}}
</td>
diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl
index 2acf7c58b8..0470d1e9f5 100644
--- a/templates/repo/commits_list_small.tmpl
+++ b/templates/repo/commits_list_small.tmpl
@@ -15,21 +15,21 @@
{{$commitLink:= printf "%s/%s" $commitBaseLink (PathEscape .ID.String)}}
<span class="tw-flex-1 tw-font-mono gt-ellipsis" title="{{.Summary}}">
- {{- ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
+ {{- ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.comment.Issue.PullRequest.BaseRepo -}}
</span>
{{if IsMultilineCommitMessage .Message}}
<button class="ui button ellipsis-button show-panel toggle" data-panel="[data-singular-commit-body-for='{{$tag}}']">...</button>
{{end}}
- <span class="tw-flex tw-items-center tw-gap-2">
+ <span class="flex-text-block">
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}
</span>
</div>
{{if IsMultilineCommitMessage .Message}}
<pre class="commit-body tw-ml-[33px] tw-hidden" data-singular-commit-body-for="{{$tag}}">
- {{- ctx.RenderUtils.RenderCommitBody .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
+ {{- ctx.RenderUtils.RenderCommitBody .Message $.comment.Issue.PullRequest.BaseRepo -}}
</pre>
{{end}}
{{end}}
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index ad308c857c..ada7e0c092 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -7,32 +7,28 @@
<div class="ui attached segment">
{{template "base/alert" .}}
{{template "repo/create_helper" .}}
-
- {{if not .CanCreateRepo}}
- <div class="ui negative message">
- <p>{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p>
- </div>
- {{end}}
<form class="ui form left-right-form new-repo-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
+ <div id="create-repo-error-message" class="ui negative message tw-text-center tw-hidden"></div>
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
- <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
- {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
- </span>
+ <div class="ui selection dropdown ellipsis-text-items" id="repo_owner_dropdown">
+ <input type="hidden" name="uid" value="{{.ContextUser.ID}}">
+ <span class="text"></span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
+ <div class="item" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"
+ {{if not .CanCreateRepoInDoer}}
+ data-create-repo-disallowed-prompt="{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimitOfDoer}}"
+ {{end}}
+ >
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
@@ -212,7 +208,7 @@
<br>
<div class="inline field">
<label></label>
- <button class="ui primary button{{if not .CanCreateRepo}} disabled{{end}}">
+ <button class="ui primary button">
{{ctx.Locale.Tr "repo.create_repo"}}
</button>
</div>
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl
index 19f2efecb7..e4d1efac57 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -35,9 +35,9 @@
{{template "repo/diff/whitespace_dropdown" .}}
{{template "repo/diff/options_dropdown" .}}
{{if .PageIsPullFiles}}
- <div id="diff-commit-select" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-filter_changes_by_commit="{{ctx.Locale.Tr "repo.pulls.filter_changes_by_commit"}}">
+ <div id="diff-commit-select" data-merge-base="{{.MergeBase}}" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-filter_changes_by_commit="{{ctx.Locale.Tr "repo.pulls.filter_changes_by_commit"}}">
{{/* the following will be replaced by vue component, but this avoids any loading artifacts till the vue component is initialized */}}
- <div class="ui jump dropdown basic button custom">
+ <div class="ui jump dropdown tiny basic button custom">
{{svg "octicon-git-commit"}}
</div>
</div>
@@ -60,6 +60,7 @@
{{end}}
<div id="diff-container">
{{if $showFileTree}}
+ {{$.FileIconPoolHTML}}
<div id="diff-file-tree" class="tw-hidden not-mobile"></div>
<script>
if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('tw-hidden');
@@ -100,8 +101,8 @@
{{end}}
</div>
<span class="file tw-flex tw-items-center tw-font-mono tw-flex-1"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}</a>
- {{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}}
<button class="btn interact-fg tw-p-2" data-clipboard-text="{{$file.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_path"}}">{{svg "octicon-copy" 14}}</button>
+ {{if .IsLFSFile}}<span class="ui label">LFS</span>{{end}}
{{if $file.IsGenerated}}
<span class="ui label">{{ctx.Locale.Tr "repo.diff.generated"}}</span>
{{end}}
@@ -147,7 +148,7 @@
<a class="item" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
{{else}}
<a class="item" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
- {{if and $.Repository.CanEnableEditor $.CanEditFile (not $file.IsLFSFile) (not $file.IsBin)}}
+ {{if and $.Repository.CanEnableEditor $.CanEditFile}}
<a class="item" rel="nofollow" href="{{$.HeadRepoLink}}/_edit/{{PathEscapeSegments $.HeadBranchName}}/{{PathEscapeSegments $file.Name}}?return_uri={{print $.BackToLink "#diff-" $file.NameHash | QueryEscape}}">{{ctx.Locale.Tr "repo.editor.edit_this_file"}}</a>
{{end}}
{{end}}
@@ -223,6 +224,7 @@
{{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}}
<template id="issue-comment-editor-template">
<form class="ui form comment">
+ <div class="field">
{{template "shared/combomarkdowneditor" (dict
"CustomInit" true
"MarkdownPreviewInRepo" $.Repository
@@ -230,12 +232,13 @@
"TextareaName" "content"
"DropzoneParentContainer" ".ui.form"
)}}
+ </div>
{{if .IsAttachmentEnabled}}
<div class="field">
{{template "repo/upload" .}}
</div>
{{end}}
- <div class="tw-text-right edit buttons">
+ <div class="field flex-text-block tw-justify-end">
<button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
</div>
diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl
index 964dc2adc7..58b675467c 100644
--- a/templates/repo/diff/comment_form.tmpl
+++ b/templates/repo/diff/comment_form.tmpl
@@ -27,7 +27,7 @@
{{end}}
<div class="field footer">
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
{{if $.reply}}
<button class="ui submit primary tiny button btn-reply" type="submit">{{ctx.Locale.Tr "repo.diff.comment.reply"}}</button>
<input type="hidden" name="reply" value="{{$.reply}}">
diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl
index 2e8261e479..22829fbf8a 100644
--- a/templates/repo/diff/comments.tmpl
+++ b/templates/repo/diff/comments.tmpl
@@ -2,14 +2,16 @@
{{$createdStr:= DateUtils.TimeSince .CreatedUnix}}
<div class="comment" id="{{.HashTag}}">
- {{if .OriginalAuthor}}
- <span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
- {{else}}
- {{template "shared/user/avatarlink" dict "user" .Poster}}
- {{end}}
+ <div class="tw-mt-2 tw-mr-4">
+ {{if .OriginalAuthor}}
+ <span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
+ {{else}}
+ {{template "shared/user/avatarlink" dict "user" .Poster}}
+ {{end}}
+ </div>
<div class="content comment-container">
- <div class="comment-header">
- <div class="comment-header-left tw-flex tw-items-center">
+ <div class="comment-header avatar-content-left-arrow">
+ <div class="comment-header-left">
{{if .OriginalAuthor}}
<span class="text black tw-font-semibold tw-mr-1">
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
@@ -30,7 +32,7 @@
</span>
{{end}}
</div>
- <div class="comment-header-right actions tw-flex tw-items-center">
+ <div class="comment-header-right">
{{if .Invalidated}}
{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}}
<a href="{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl
index 9a7a04a328..4e8ad1326c 100644
--- a/templates/repo/diff/compare.tmpl
+++ b/templates/repo/diff/compare.tmpl
@@ -32,7 +32,7 @@
<a class="tw-mr-2" href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
<div class="ui dropdown jump select-branch">
<div class="ui basic small button">
- <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span>
+ <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: <strong>{{$BaseCompareName}}:{{$.BaseBranch}}</strong></span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
<div class="menu">
@@ -103,7 +103,7 @@
<div class="ui dropdown jump select-branch">
<div class="ui basic small button">
- <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span>
+ <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: <strong>{{$HeadCompareName}}:{{$.HeadBranch}}</strong></span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
<div class="menu">
@@ -189,7 +189,7 @@
<div class="ui segment flex-text-block tw-gap-4">
{{template "shared/issueicon" .}}
<div class="issue-title tw-break-anywhere">
- {{ctx.RenderUtils.RenderIssueTitle .PullRequest.Issue.Title ($.Repository.ComposeMetas ctx)}}
+ {{ctx.RenderUtils.RenderIssueTitle .PullRequest.Issue.Title $.Repository}}
<span class="index">#{{.PullRequest.Issue.Index}}</span>
</div>
<a href="{{$.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui compact button primary">
@@ -205,10 +205,10 @@
{{end}}
</div>
{{else if $allowCreatePR}}
- <div class="ui info message pullrequest-form-toggle {{if .Flash}}tw-hidden{{end}}">
+ <div class="ui info message pullrequest-form-toggle {{if .ExpandNewPrForm}}tw-hidden{{end}}">
<button class="ui button primary show-panel toggle" data-panel=".pullrequest-form-toggle, .pullrequest-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button>
</div>
- <div class="pullrequest-form {{if not .Flash}}tw-hidden{{end}}">
+ <div class="pullrequest-form {{if not .ExpandNewPrForm}}tw-hidden{{end}}">
{{template "repo/issue/new_form" .}}
</div>
{{end}}
diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl
index 08f60644b3..eb2abfa7e9 100644
--- a/templates/repo/diff/conversation.tmpl
+++ b/templates/repo/diff/conversation.tmpl
@@ -8,9 +8,9 @@
{{$referenceUrl := printf "%s#%s" $.Issue.Link $comment.HashTag}}
<div class="conversation-holder" data-path="{{$comment.TreePath}}" data-side="{{if lt $comment.Line 0}}left{{else}}right{{end}}" data-idx="{{$comment.UnsignedLine}}">
{{if $resolved}}
- <div class="ui attached header resolved-placeholder tw-flex tw-items-center tw-justify-between">
- <div class="ui grey text tw-flex tw-items-center tw-flex-wrap tw-gap-1">
- {{svg "octicon-check" 16 "icon tw-mr-1"}}
+ <div class="resolved-placeholder">
+ <div class="flex-text-block tw-flex-wrap grey text">
+ {{svg "octicon-check"}}
<b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}}
{{if $invalid}}
<!--
@@ -22,35 +22,33 @@
</a>
{{end}}
</div>
- <div class="tw-flex tw-items-center tw-gap-2">
- <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button show-outdated tw-flex tw-items-center">
- {{svg "octicon-unfold" 16 "tw-mr-2"}}
- {{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
+ <div class="flex-text-block">
+ <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny show-outdated">
+ {{svg "octicon-unfold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
</button>
- <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button hide-outdated tw-flex tw-items-center tw-hidden">
- {{svg "octicon-fold" 16 "tw-mr-2"}}
- {{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
+ <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny hide-outdated tw-hidden">
+ {{svg "octicon-fold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
</button>
</div>
</div>
{{end}}
<div id="code-comments-{{$comment.ID}}" class="field comment-code-cloud {{if $resolved}}tw-hidden{{end}}">
<div class="comment-list">
- <ui class="ui comments">
+ <div class="ui comments">
{{template "repo/diff/comments" dict "root" $ "comments" .comments}}
- </ui>
+ </div>
</div>
- <div class="tw-flex tw-justify-end tw-items-center tw-gap-2 tw-mt-2 tw-flex-wrap">
+ <div class="flex-text-block tw-mt-2 tw-flex-wrap tw-justify-end">
<div class="ui buttons">
<button class="ui icon tiny basic button previous-conversation">
- {{svg "octicon-arrow-up" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.previous"}}
+ {{svg "octicon-arrow-up" 12}} {{ctx.Locale.Tr "repo.issues.previous"}}
</button>
<button class="ui icon tiny basic button next-conversation">
- {{svg "octicon-arrow-down" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.next"}}
+ {{svg "octicon-arrow-down" 12}} {{ctx.Locale.Tr "repo.issues.next"}}
</button>
</div>
{{if and $.CanMarkConversation $hasReview (not $isReviewPending)}}
- <button class="ui icon tiny basic button resolve-conversation tw-mr-0" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
+ <button class="ui icon tiny basic button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
{{if $resolved}}
{{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}}
{{else}}
@@ -59,8 +57,8 @@
</button>
{{end}}
{{if and $.SignedUserID (not $.Repository.IsArchived)}}
- <button class="comment-form-reply ui primary tiny labeled icon button tw-mr-0">
- {{svg "octicon-reply" 16 "reply icon tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}}
+ <button class="comment-form-reply ui primary icon tiny button">
+ {{svg "octicon-reply" 12}}{{ctx.Locale.Tr "repo.diff.comment.reply"}}
</button>
{{end}}
</div>
diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl
index bbd8d4a2ec..7557129c64 100644
--- a/templates/repo/diff/image_diff.tmpl
+++ b/templates/repo/diff/image_diff.tmpl
@@ -22,7 +22,7 @@
{{if .blobBase}}
<span class="side">
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_before"}}</p>
- <span class="before-container"><img class="image-before"></span>
+ <span class="before-container"><img alt class="image-before"></span>
<p>
<span class="bounds-info-before">
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
@@ -37,7 +37,7 @@
{{if .blobHead}}
<span class="side">
<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_after"}}</p>
- <span class="after-container"><img class="image-after"></span>
+ <span class="after-container"><img alt class="image-after"></span>
<p>
<span class="bounds-info-after">
{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
@@ -55,9 +55,9 @@
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.NameHash}}">
<div class="diff-swipe">
<div class="swipe-frame">
- <span class="before-container"><img class="image-before"></span>
+ <span class="before-container"><img alt class="image-before"></span>
<span class="swipe-container">
- <span class="after-container"><img class="image-after"></span>
+ <span class="after-container"><img alt class="image-after"></span>
</span>
<span class="swipe-bar">
<span class="handle top-handle"></span>
@@ -70,8 +70,8 @@
<div class="diff-overlay">
<input type="range" min="0" max="100" value="50">
<div class="overlay-frame">
- <span class="before-container"><img class="image-before"></span>
- <span class="after-container"><img class="image-after"></span>
+ <span class="before-container"><img alt class="image-before"></span>
+ <span class="after-container"><img alt class="image-after"></span>
</div>
</div>
</div>
diff --git a/templates/repo/editor/cherry_pick.tmpl b/templates/repo/editor/cherry_pick.tmpl
index f9c9eef5aa..7981fd0761 100644
--- a/templates/repo/editor/cherry_pick.tmpl
+++ b/templates/repo/editor/cherry_pick.tmpl
@@ -3,15 +3,14 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
- <form class="ui edit form" method="post" action="{{.RepoLink}}/_cherrypick/{{.SHA}}/{{.BranchName | PathEscapeSegments}}">
+ <form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
{{.CsrfTokenHtml}}
- <input type="hidden" name="last_commit" value="{{.last_commit}}">
- <input type="hidden" name="page_has_posted" value="true">
+ {{template "repo/editor/common_top" .}}
<input type="hidden" name="revert" value="{{if eq .CherryPickType "revert"}}true{{else}}false{{end}}">
<div class="repo-editor-header">
- <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
- {{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
- {{$shalink := HTMLFormat `<a class="ui primary sha label" href="%s">%s</a>` $shaurl (ShortSha .SHA)}}
+ <div class="breadcrumb">
+ {{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .FromCommitID)}}
+ {{$shalink := HTMLFormat `<a class="ui primary sha label" href="%s">%s</a>` $shaurl (ShortSha .FromCommitID)}}
{{if eq .CherryPickType "revert"}}
{{ctx.Locale.Tr "repo.editor.revert" $shalink}}
{{else}}
diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl
index 8f46c47b96..3e4482f9e2 100644
--- a/templates/repo/editor/commit_form.tmpl
+++ b/templates/repo/editor/commit_form.tmpl
@@ -1,11 +1,11 @@
<div class="commit-form-wrapper">
{{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}}
- <div class="commit-form">
- <h3>{{- if .CanCommitToBranch.WillSign}}
- <span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>
+ <div class="commit-form avatar-content-left-arrow">
+ <h3>{{- if .CommitFormOptions.WillSign}}
+ <span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CommitFormOptions.SigningKey}}">{{svg "octicon-lock" 24}}</span>
{{ctx.Locale.Tr "repo.editor.commit_signed_changes"}}
{{- else}}
- <span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
+ <span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CommitFormOptions.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
{{- end}}</h3>
<div class="field">
@@ -22,17 +22,17 @@
</div>
<div class="quick-pull-choice js-quick-pull-choice">
<div class="field">
- <div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}">
+ <div class="ui radio checkbox {{if not .CommitFormOptions.CanCommitToBranch}}disabled{{end}}">
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
<label>
{{svg "octicon-git-commit"}}
{{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}}
- {{if not .CanCommitToBranch.CanCommitToBranch}}
+ {{if not .CommitFormOptions.CanCommitToBranch}}
<div class="ui visible small warning message">
{{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}}
<ul>
- {{if not .CanCommitToBranch.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
- {{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
+ {{if not .CommitFormOptions.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
+ {{if and .CommitFormOptions.RequireSigned (not .CommitFormOptions.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
</ul>
</div>
{{end}}
@@ -42,14 +42,14 @@
{{if and (not .Repository.IsEmpty) (not .IsEditingFileOnly)}}
<div class="field">
<div class="ui radio checkbox">
- {{if .CanCreatePullRequest}}
+ {{if .CommitFormOptions.CanCreatePullRequest}}
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
{{else}}
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
{{end}}
<label>
{{svg "octicon-git-pull-request"}}
- {{if .CanCreatePullRequest}}
+ {{if .CommitFormOptions.CanCreatePullRequest}}
{{ctx.Locale.Tr "repo.editor.create_new_branch"}}
{{else}}
{{ctx.Locale.Tr "repo.editor.create_new_branch_np"}}
@@ -58,7 +58,7 @@
</div>
</div>
<div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}tw-hidden{{end}}">
- <div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
+ <div class="new-branch-name-input field">
{{svg "octicon-git-branch"}}
<input type="text" name="new_branch_name" maxlength="100" value="{{.new_branch_name}}" class="input-contrast tw-mr-1 js-quick-pull-new-branch-name" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}">
<span class="text-muted js-quick-pull-normalization-info"></span>
@@ -67,7 +67,7 @@
{{end}}
</div>
{{if and .CommitCandidateEmails (gt (len .CommitCandidateEmails) 1)}}
- <div class="field {{if .Err_CommitEmail}}error{{end}}">
+ <div class="field">
<label>{{ctx.Locale.Tr "repo.editor.commit_email"}}</label>
<select class="ui selection dropdown" name="commit_email">
{{- range $email := .CommitCandidateEmails -}}
@@ -77,6 +77,7 @@
</div>
{{end}}
</div>
+ <input type="hidden" name="last_commit" value="{{.last_commit}}">
<button id="commit-button" type="submit" class="ui primary button">
{{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}}
</button>
diff --git a/templates/repo/editor/common_breadcrumb.tmpl b/templates/repo/editor/common_breadcrumb.tmpl
new file mode 100644
index 0000000000..8cfbe09d3e
--- /dev/null
+++ b/templates/repo/editor/common_breadcrumb.tmpl
@@ -0,0 +1,16 @@
+<div class="breadcrumb">
+ <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
+ {{$n := len .TreeNames}}
+ {{$l := Eval $n "-" 1}}
+ {{range $i, $v := .TreeNames}}
+ <div class="breadcrumb-divider">/</div>
+ {{if eq $i $l}}
+ <input id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr (Iif $.PageIsUpload "repo.editor.add_subdir" "repo.editor.name_your_file")}}" data-editorconfig="{{$.EditorconfigJson}}" {{Iif $.PageIsUpload "" "required"}} autofocus>
+ <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
+ {{else}}
+ <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
+ {{end}}
+ {{end}}
+ <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{or .ReturnURI (print $.BranchLink "/" (PathEscapeSegments .TreePath))}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
+ <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}">
+</div>
diff --git a/templates/repo/editor/common_top.tmpl b/templates/repo/editor/common_top.tmpl
new file mode 100644
index 0000000000..23280ed565
--- /dev/null
+++ b/templates/repo/editor/common_top.tmpl
@@ -0,0 +1,6 @@
+{{if .CommitFormOptions.WillSubmitToFork}}
+<div class="ui blue message">
+ {{$repoLinkHTML := HTMLFormat `<a href="%s">%s</a>` .CommitFormOptions.TargetRepo.Link .CommitFormOptions.TargetRepo.FullName}}
+ {{ctx.Locale.Tr "repo.editor.fork_edit_description" $repoLinkHTML}}
+</div>
+{{end}}
diff --git a/templates/repo/editor/delete.tmpl b/templates/repo/editor/delete.tmpl
index 2c0c2fc792..bf6143f1cb 100644
--- a/templates/repo/editor/delete.tmpl
+++ b/templates/repo/editor/delete.tmpl
@@ -3,9 +3,9 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
- <form class="ui form" method="post">
+ <form class="ui form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
{{.CsrfTokenHtml}}
- <input type="hidden" name="last_commit" value="{{.last_commit}}">
+ {{template "repo/editor/common_top" .}}
{{template "repo/editor/commit_form" .}}
</form>
</div>
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl
index ae8a60c20c..0911d02e1f 100644
--- a/templates/repo/editor/edit.tmpl
+++ b/templates/repo/editor/edit.tmpl
@@ -3,56 +3,49 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
- <form class="ui edit form" method="post"
+ <form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}"
data-text-empty-confirm-header="{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}"
data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}"
>
{{.CsrfTokenHtml}}
- <input type="hidden" name="last_commit" value="{{.last_commit}}">
- <input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
+ {{template "repo/editor/common_top" .}}
<div class="repo-editor-header">
- <div class="ui breadcrumb field{{if .Err_TreePath}} error{{end}}">
- <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
- {{$n := len .TreeNames}}
- {{$l := Eval $n "-" 1}}
- {{range $i, $v := .TreeNames}}
- <div class="breadcrumb-divider">/</div>
- {{if eq $i $l}}
- <input id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.EditorconfigJson}}" required autofocus>
- <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
- {{else}}
- <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
- {{end}}
- {{end}}
- <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
- <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
- </div>
+ {{template "repo/editor/common_breadcrumb" .}}
</div>
- <div class="field">
- <div class="ui top attached header">
- <div class="ui compact small menu small-menu-items repo-editor-menu">
- <a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
- <a class="item" data-tab="preview" data-preview-url="{{.Repository.Link}}/markup" data-preview-context-ref="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
- {{if not .IsNewFile}}
- <a class="item" data-tab="diff" hx-params="context,content" hx-vals='{"context":"{{.BranchLink}}"}' hx-include="#edit_area" hx-swap="innerHTML" hx-target=".tab[data-tab='diff']" hx-indicator=".tab[data-tab='diff']" hx-post="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a>
- {{end}}
- </div>
- </div>
- <div class="ui bottom attached segment tw-p-0">
- <div class="ui active tab tw-rounded-b" data-tab="write">
- <textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
- data-previewable-extensions="{{.PreviewableExtensions}}"
- data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea>
- <div class="editor-loading is-loading"></div>
+ {{if not .NotEditableReason}}
+ <div class="field">
+ <div class="ui top attached header">
+ <div class="ui compact small menu small-menu-items repo-editor-menu">
+ <a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
+ <a class="item" data-tab="preview" data-preview-url="{{.Repository.Link}}/markup" data-preview-context-ref="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
+ {{if not .IsNewFile}}
+ <a class="item" data-tab="diff" hx-params="context,content" hx-vals='{"context":"{{.BranchLink}}"}' hx-include="#edit_area" hx-swap="innerHTML" hx-target=".tab[data-tab='diff']" hx-indicator=".tab[data-tab='diff']" hx-post="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a>
+ {{end}}
+ </div>
</div>
- <div class="ui tab tw-px-4 tw-py-3" data-tab="preview">
- {{ctx.Locale.Tr "loading"}}
+ <div class="ui bottom attached segment tw-p-0">
+ <div class="ui active tab tw-rounded-b" data-tab="write">
+ <textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
+ data-previewable-extensions="{{.PreviewableExtensions}}"
+ data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea>
+ <div class="editor-loading is-loading"></div>
+ </div>
+ <div class="ui tab tw-px-4 tw-py-3" data-tab="preview">
+ {{ctx.Locale.Tr "loading"}}
+ </div>
+ <div class="ui tab" data-tab="diff">
+ <div class="tw-p-16"></div>
+ </div>
</div>
- <div class="ui tab" data-tab="diff">
- <div class="tw-p-16"></div>
+ </div>
+ {{else}}
+ <div class="field">
+ <div class="ui segment tw-text-center">
+ <h4 class="tw-font-semibold tw-mb-2">{{.NotEditableReason}}</h4>
+ <p>{{ctx.Locale.Tr "repo.editor.file_not_editable_hint"}}</p>
</div>
</div>
- </div>
+ {{end}}
{{template "repo/editor/commit_form" .}}
</form>
</div>
diff --git a/templates/repo/editor/fork.tmpl b/templates/repo/editor/fork.tmpl
new file mode 100644
index 0000000000..e28b2ba7a2
--- /dev/null
+++ b/templates/repo/editor/fork.tmpl
@@ -0,0 +1,18 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content repository">
+ {{template "repo/header" .}}
+ <div class="ui container">
+ {{template "base/alert" .}}
+ <form class="ui form form-fetch-action" method="post" action="{{.RepoLink}}/_fork/{{.BranchName | PathEscapeSegments}}">
+ {{.CsrfTokenHtml}}
+ <div class="tw-text-center">
+ <div class="tw-my-[40px]">
+ <h3>{{ctx.Locale.Tr "repo.editor.fork_create"}}</h3>
+ <p>{{ctx.Locale.Tr "repo.editor.fork_create_description"}}</p>
+ </div>
+ <button class="ui primary button">{{ctx.Locale.Tr "repo.fork_repo"}}</button>
+ </div>
+ </form>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl
index 33a7c2a89d..fa00edd92e 100644
--- a/templates/repo/editor/patch.tmpl
+++ b/templates/repo/editor/patch.tmpl
@@ -3,15 +3,14 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
- <form class="ui edit form" method="post" action="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}"
+ <form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}"
data-text-empty-confirm-header="{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}"
data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}"
>
{{.CsrfTokenHtml}}
- <input type="hidden" name="last_commit" value="{{.last_commit}}">
- <input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
+ {{template "repo/editor/common_top" .}}
<div class="repo-editor-header">
- <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
+ <div class="breadcrumb">
{{ctx.Locale.Tr "repo.editor.patching"}}
<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
<div class="breadcrumb-divider">:</div>
diff --git a/templates/repo/editor/upload.tmpl b/templates/repo/editor/upload.tmpl
index 5725020406..3e36c77b3b 100644
--- a/templates/repo/editor/upload.tmpl
+++ b/templates/repo/editor/upload.tmpl
@@ -3,25 +3,11 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
- <form class="ui comment form" method="post">
+ <form class="ui comment form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
{{.CsrfTokenHtml}}
+ {{template "repo/editor/common_top" .}}
<div class="repo-editor-header">
- <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
- <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a>
- {{$n := len .TreeNames}}
- {{$l := Eval $n "-" 1}}
- {{range $i, $v := .TreeNames}}
- <div class="breadcrumb-divider">/</div>
- {{if eq $i $l}}
- <input type="text" id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.add_subdir"}}" autofocus>
- <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
- {{else}}
- <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
- {{end}}
- {{end}}
- <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
- <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
- </div>
+ {{template "repo/editor/common_breadcrumb" .}}
</div>
<div class="field">
{{template "repo/upload" .}}
diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl
index ae3f95045b..32b5c8401b 100644
--- a/templates/repo/empty.tmpl
+++ b/templates/repo/empty.tmpl
@@ -47,7 +47,7 @@
<h3>{{ctx.Locale.Tr "repo.create_new_repo_command"}}</h3>
<div class="markup">
<pre><code>touch README.md
-git init
+git init{{if ne .Repository.ObjectFormatName "sha1"}} --object-format={{.Repository.ObjectFormatName}}{{end}}{{/* for sha256 repo, it needs to set "object-format" explicitly*/}}
{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
git add README.md
git commit -m "first commit"
diff --git a/templates/repo/file_info.tmpl b/templates/repo/file_info.tmpl
index b63af68973..38133bde2b 100644
--- a/templates/repo/file_info.tmpl
+++ b/templates/repo/file_info.tmpl
@@ -11,7 +11,7 @@
{{end}}
{{if ne .FileSize nil}}
<div class="file-info-entry">
- {{FileSize .FileSize}}{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}}
+ {{FileSize .FileSize}}{{if .IsLFSFile}}<span class="ui label">LFS</span>{{end}}
</div>
{{end}}
{{if .LFSLock}}
diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl
index 725b67c651..6e46457893 100644
--- a/templates/repo/forks.tmpl
+++ b/templates/repo/forks.tmpl
@@ -1,20 +1,12 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content repository forks">
{{template "repo/header" .}}
- <div class="ui container">
+ <div class="ui container fork-list">
<h2 class="ui dividing header">
{{ctx.Locale.Tr "repo.forks"}}
</h2>
- <div class="flex-list">
- {{range .Forks}}
- <div class="flex-item tw-border-0 repo-fork-item">
- <span>{{ctx.AvatarUtils.Avatar .Owner}}</span>
- <span><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a></span>
- </div>
- {{end}}
- </div>
+ {{template "shared/repo/list" .}}
+ {{template "base/paginate" .}}
</div>
-
- {{template "base/paginate" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl
index 9eb4bd4ecb..cd115f95dc 100644
--- a/templates/repo/graph.tmpl
+++ b/templates/repo/graph.tmpl
@@ -2,7 +2,7 @@
<div role="main" aria-label="{{.Title}}" class="page-content repository commits">
{{template "repo/header" .}}
<div class="ui container">
- <div id="git-graph-container" class="ui segment{{if eq .Mode "monochrome"}} monochrome{{end}}">
+ <div id="git-graph-container" class="ui segment {{if eq .Mode "monochrome"}}monochrome{{end}}">
<h2 class="ui header dividing">
{{ctx.Locale.Tr "repo.commit_graph"}}
<div class="ui icon buttons tiny color-buttons">
@@ -11,52 +11,45 @@
<div class="default text">{{ctx.Locale.Tr "repo.commit_graph.select"}}</div>
<div class="menu">
<div class="item" data-value="...flow-hide-pr-refs">
- <span class="truncate">
- {{svg "octicon-eye-closed" 16 "tw-mr-1"}}<span title="{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}">{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}</span>
- </span>
+ {{svg "octicon-eye-closed"}}
+ <span class="gt-ellipsis" title="{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}">{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}</span>
</div>
{{range .AllRefs}}
{{$refGroup := .RefGroup}}
{{if eq $refGroup "pull"}}
<div class="item" data-value="{{.Name}}">
- <span class="truncate">
- {{svg "octicon-git-pull-request" 16 "tw-mr-1"}}<span title="{{.ShortName}}">#{{.ShortName}}</span>
- </span>
+ {{svg "octicon-git-pull-request"}}
+ <span class="gt-ellipsis" title="{{.ShortName}}">#{{.ShortName}}</span>
</div>
{{else if eq $refGroup "tags"}}
<div class="item" data-value="{{.Name}}">
- <span class="truncate">
- {{svg "octicon-tag" 16 "tw-mr-1"}}<span title="{{.ShortName}}">{{.ShortName}}</span>
- </span>
+ {{svg "octicon-tag"}}
+ <span class="gt-ellipsis" title="{{.ShortName}}">{{.ShortName}}</span>
</div>
{{else if eq $refGroup "remotes"}}
<div class="item" data-value="{{.Name}}">
- <span class="truncate">
- {{svg "octicon-cross-reference" 16 "tw-mr-1"}}<span title="{{.ShortName}}">{{.ShortName}}</span>
- </span>
+ {{svg "octicon-cross-reference"}}
+ <span class="gt-ellipsis" title="{{.ShortName}}">{{.ShortName}}</span>
</div>
{{else if eq $refGroup "heads"}}
<div class="item" data-value="{{.Name}}">
- <span class="truncate">
- {{svg "octicon-git-branch" 16 "tw-mr-1"}}<span title="{{.ShortName}}">{{.ShortName}}</span>
- </span>
+ {{svg "octicon-git-branch"}}
+ <span class="gt-ellipsis" title="{{.ShortName}}">{{.ShortName}}</span>
</div>
{{end}}
{{end}}
</div>
</div>
- <button id="flow-color-monochrome" class="ui labelled icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}</button>
- <button id="flow-color-colored" class="ui labelled icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.color"}}</button>
+ <button id="flow-color-monochrome" class="ui icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}</button>
+ <button id="flow-color-colored" class="ui icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.color"}}</button>
</div>
</h2>
- <div class="ui dividing"></div>
- <div class="is-loading tw-py-32 tw-hidden" id="loading-indicator"></div>
- {{template "repo/graph/svgcontainer" .}}
- {{template "repo/graph/commits" .}}
+ <div id="git-graph-body">
+ {{template "repo/graph/svgcontainer" .}}
+ {{template "repo/graph/commits" .}}
+ {{template "base/paginate" .}}
+ </div>
</div>
</div>
</div>
-<div id="pagination">
- {{template "base/paginate" .}}
-</div>
{{template "base/footer" .}}
diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl
index 6af0ba1f0f..07ec076697 100644
--- a/templates/repo/graph/commits.tmpl
+++ b/templates/repo/graph/commits.tmpl
@@ -5,10 +5,13 @@
{{if $commit.OnlyRelation}}
<span></span>
{{else}}
- {{template "repo/commit_sign_badge" dict "Commit" $commit.Commit "CommitBaseLink" (print $.RepoLink "/commit") "CommitSignVerification" $commit.Verification}}
+ {{/* every field must be in a span to get correctly styled */}}
+ <span>
+ {{template "repo/commit_sign_badge" dict "Commit" $commit.Commit "CommitBaseLink" (print $.RepoLink "/commit") "CommitSignVerification" $commit.Verification}}
+ </span>
<span class="message tw-inline-block gt-ellipsis">
- <span>{{ctx.RenderUtils.RenderCommitMessage $commit.Subject ($.Repository.ComposeMetas ctx)}}</span>
+ {{ctx.RenderUtils.RenderCommitMessage $commit.Subject $.Repository}}
</span>
<span class="commit-refs flex-text-inline">
@@ -17,18 +20,18 @@
{{if eq $refGroup "pull"}}
{{if or (not $.HidePRRefs) (SliceUtils.Contains $.SelectedBranches .Name)}}
<!-- it's intended to use issues not pulls, if it's a pull you will get redirected -->
- <a class="ui labelled basic tiny button" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
+ <a class="ui basic tiny button" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
{{svg "octicon-git-pull-request"}} #{{.ShortName}}
</a>
{{end}}
{{else if eq $refGroup "tags"}}
- {{- template "repo/tag/name" dict "RepoLink" $.Repository.Link "TagName" .ShortName -}}
+ {{- template "repo/tag/name" dict "AdditionalClasses" "tag-label" "RepoLink" $.Repository.Link "TagName" .ShortName -}}
{{else if eq $refGroup "remotes"}}
- <a class="ui labelled basic tiny button" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}">
+ <a class="ui basic tiny button" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}">
{{svg "octicon-cross-reference"}} {{.ShortName}}
</a>
{{else if eq $refGroup "heads"}}
- <a class="ui labelled basic tiny button" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
+ <a class="ui basic tiny button" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
{{svg "octicon-git-branch"}} {{.ShortName}}
</a>
{{else}}
diff --git a/templates/repo/graph/div.tmpl b/templates/repo/graph/div.tmpl
index c0bd4e269a..12c2869cd8 100644
--- a/templates/repo/graph/div.tmpl
+++ b/templates/repo/graph/div.tmpl
@@ -1,7 +1,3 @@
-<div>
- {{template "repo/graph/svgcontainer" .}}
- {{template "repo/graph/commits" .}}
- <div id="pagination">
- {{template "base/paginate" .}}
- </div>
-</div>
+{{template "repo/graph/svgcontainer" .}}
+{{template "repo/graph/commits" .}}
+{{template "base/paginate" .}}
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 8c2a0da8d0..b61076ff46 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -25,6 +25,9 @@
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.internal"}}">{{svg "octicon-shield-lock" 18}}</div>
{{end}}
{{end}}
+ {{if $.Permission.HasAnyUnitPublicAccess}}
+ <span class="ui basic orange label">{{ctx.Locale.Tr "repo.desc.public_access"}}</span>
+ {{end}}
{{if .IsTemplate}}
<span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.template"}}</span>
<div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div>
@@ -35,20 +38,20 @@
</div>
</div>
{{if not (or .IsBeingCreated .IsBroken)}}
- <div class="repo-buttons">
+ <div class="flex-text-block tw-flex-wrap">
{{if $.RepoTransfer}}
<form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}">
{{$.CsrfTokenHtml}}
- <div data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}">
- <button type="submit" class="ui basic button {{if $.CanUserAcceptOrRejectTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}>
+ <div class="flex-text-inline" data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}">
+ <button type="submit" class="ui compact small basic button {{if $.CanUserAcceptOrRejectTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}>
{{ctx.Locale.Tr "repo.transfer.accept"}}
</button>
</div>
</form>
<form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}">
{{$.CsrfTokenHtml}}
- <div data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}">
- <button type="submit" class="ui basic button {{if $.CanUserAcceptOrRejectTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}>
+ <div class="flex-text-inline" data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}">
+ <button type="submit" class="ui compact small basic button {{if $.CanUserAcceptOrRejectTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}>
{{ctx.Locale.Tr "repo.transfer.reject"}}
</button>
</div>
@@ -208,7 +211,7 @@
</a>
{{end}}
- {{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}}
+ {{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases ctx.Consts.RepoUnitTypeCode) (not .IsEmptyRepo)}}
<a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity">
{{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}}
</a>
@@ -223,11 +226,19 @@
</a>
{{end}}
</div>
- {{else if .Permission.IsAdmin}}
+ {{else}}
<div class="overflow-menu-items">
+ {{if(and .Repository.IsBeingCreated (.Permission.CanRead ctx.Consts.RepoUnitTypeCode))}}
+ <a class="{{if not .PageIsRepoSettings}}active {{end}}item" href="{{.RepoLink}}">
+ {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.migration_status"}}
+ </a>
+ {{end}}
+
+ {{if .Permission.IsAdmin}}
<a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings">
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
</a>
+ {{end}}
</div>
{{end}}
</overflow-menu>
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index f86b90502d..2a6c0d2fe5 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -15,7 +15,7 @@
</div>
{{end}}
- {{template "repo/code/recently_pushed_new_branches" .}}
+ {{template "repo/code/recently_pushed_new_branches" dict "RecentBranchesPromptData" .RecentBranchesPromptData}}
<div class="{{Iif $showSidebar "repo-grid-filelist-sidebar" "repo-grid-filelist-only"}}">
<div class="repo-home-filelist">
diff --git a/templates/repo/home_sidebar_bottom.tmpl b/templates/repo/home_sidebar_bottom.tmpl
index f780dc122d..01e630ccbf 100644
--- a/templates/repo/home_sidebar_bottom.tmpl
+++ b/templates/repo/home_sidebar_bottom.tmpl
@@ -4,14 +4,14 @@
<div class="flex-item">
<div class="flex-item-main">
<div class="flex-item-title">
- <a class="item muted" href="{{.Link}}/releases">
+ <a class="item muted" href="{{.RepoLink}}/releases">
{{ctx.Locale.Tr "repo.releases"}}
<span class="ui small label">{{.NumReleases}}</span>
</a>
</div>
<div class="flex-item">
- <div class="flex-item-icon">
- {{svg "octicon-tag" 16}}
+ <div class="flex-item-leading">
+ <div class="tw-mt-1">{{svg "octicon-tag" 16}}</div>
</div>
<div class="flex-item-main">
<div class="flex-item-header">
diff --git a/templates/repo/home_sidebar_top.tmpl b/templates/repo/home_sidebar_top.tmpl
index 8d3d7c6f86..8c2089c839 100644
--- a/templates/repo/home_sidebar_top.tmpl
+++ b/templates/repo/home_sidebar_top.tmpl
@@ -45,7 +45,7 @@
{{end}}
{{if .ReadmeExist}}
- <a class="flex-text-block muted" href="{{.TreeLink}}/{{.FileName}}">
+ <a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}/{{PathEscapeSegments .FileTreePath}}">
{{svg "octicon-book"}} {{ctx.Locale.Tr "readme"}}
</a>
{{end}}
diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl
index e5e0bd68e7..e4a904c46b 100644
--- a/templates/repo/icon.tmpl
+++ b/templates/repo/icon.tmpl
@@ -1,6 +1,6 @@
{{$avatarLink := (.RelAvatarLink ctx)}}
{{if $avatarLink}}
- <img class="ui avatar tw-align-middle" src="{{$avatarLink}}" width="24" height="24" alt="{{.FullName}}">
+ <img class="ui avatar tw-align-middle" src="{{$avatarLink}}" width="24" height="24" alt aria-hidden="true">
{{else if $.IsMirror}}
{{svg "octicon-mirror" 24}}
{{else if $.IsFork}}
diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl
index 9183b7b46a..c8b67490ac 100644
--- a/templates/repo/issue/branch_selector_field.tmpl
+++ b/templates/repo/issue/branch_selector_field.tmpl
@@ -14,7 +14,7 @@ Still needs to figure out:
*/}}
{{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
<input id="ref_selector" name="ref" type="hidden" value="{{.Reference}}">
-<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-items-nowrap {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}}"
+<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-text-items {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}}"
data-no-results="{{ctx.Locale.Tr "no_results_found"}}"
{{if and .Issue (or .IsIssueWriter .HasIssuesOrPullsWritePermission)}}data-url-update-issueref="{{$.RepoLink}}/issues/{{.Issue.Index}}/ref"{{end}}
>
diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl
index c7bbe91885..6dae49c455 100644
--- a/templates/repo/issue/card.tmpl
+++ b/templates/repo/issue/card.tmpl
@@ -4,7 +4,7 @@
{{if $attachments}}
<div class="card-attachment-images">
{{range $attachments}}
- <img src="{{.DownloadURL}}" alt="{{.Name}}" />
+ <img loading="lazy" src="{{.DownloadURL}}" alt="{{.Name}}" />
{{end}}
</div>
{{end}}
@@ -45,7 +45,7 @@
{{if $.Page.LinkedPRs}}
{{range index $.Page.LinkedPRs .ID}}
<div class="meta tw-my-1">
- <a href="{{$.Issue.Repo.Link}}/pulls/{{.Index}}">
+ <a href="{{.Repo.Link}}/pulls/{{.Index}}">
<span class="tw-m-0 text {{if .PullRequest.HasMerged}}purple{{else if .IsClosed}}red{{else}}green{{end}}">{{svg "octicon-git-merge" 16 "tw-mr-1 tw-align-middle"}}</span>
<span class="tw-align-middle">{{.Title}} <span class="text light grey">#{{.Index}}</span></span>
</a>
@@ -63,16 +63,21 @@
{{if or .Labels .Assignees}}
<div class="issue-card-bottom">
- <div class="labels-list">
- {{range .Labels}}
- <a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{ctx.RenderUtils.RenderLabel .}}</a>
+ {{/* the labels container must always be present, to help the assignees list right-aligned */}}
+ <div class="issue-card-bottom-part labels-list">
+ {{range $label := .Labels}}
+ {{$link := print $.Issue.Repo.Link "/issues"}}
+ {{$link = QueryBuild $link "labels" $label.ID}}
+ {{ctx.RenderUtils.RenderLabelWithLink $label $link}}
{{end}}
</div>
- <div class="issue-card-assignees">
+ {{if .Assignees}}
+ <div class="issue-card-bottom-part tw-justify-end">
{{range .Assignees}}
- <a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28}}</a>
+ <a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 24}}</a>
{{end}}
</div>
+ {{end}}
</div>
{{end}}
{{end}}
diff --git a/templates/repo/issue/filter_item_label.tmpl b/templates/repo/issue/filter_item_label.tmpl
index 0883d93804..04c3605a6a 100644
--- a/templates/repo/issue/filter_item_label.tmpl
+++ b/templates/repo/issue/filter_item_label.tmpl
@@ -22,7 +22,7 @@
<span class="label-filter-exclude-info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude"}}</span>
<div class="divider"></div>
<a class="item label-filter-query-default" href="{{QueryBuild $queryLink "labels" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a>
- <a class="item label-filter-query-not-set" href="{{QueryBuild $queryLink "labels" 0}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
+ <a class="item label-filter-query-not-set" href="{{QueryBuild $queryLink "labels" "0"}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
{{/* The logic here is not the same as the label selector in the issue sidebar.
The one in the issue sidebar renders "repo labels | divider | org labels".
Maybe the logic should be updated to be consistent.*/}}
diff --git a/templates/repo/issue/filter_list.tmpl b/templates/repo/issue/filter_list.tmpl
index 58ca4a7c00..bfdf94513e 100644
--- a/templates/repo/issue/filter_list.tmpl
+++ b/templates/repo/issue/filter_list.tmpl
@@ -15,7 +15,7 @@
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}">
</div>
<div class="divider"></div>
- <a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" 0}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a>
+ <a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a>
<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="{{QueryBuild $queryLink "milestone" -1}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a>
{{if .OpenMilestones}}
<div class="divider"></div>
@@ -94,7 +94,7 @@
"UserSearchList" $.Assignees
"SelectedUserId" $.AssigneeID
"TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
- "TextFilterMatchNone" (ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee")
+ "TextFilterMatchNone" (ctx.Locale.Tr "repo.issues.filter_assignee_no_assignee")
"TextFilterMatchAny" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee")
}}
@@ -106,7 +106,7 @@
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
- <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "all"}}">{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}</a>
+ <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "all"}}">{{if .PageIsPullList}}{{ctx.Locale.Tr "repo.issues.filter_type.all_pull_requests"}}{{else}}{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}{{end}}</a>
<a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "assigned"}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
<a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "created_by"}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a>
{{if .PageIsPullList}}
@@ -133,5 +133,11 @@
<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "leastcomment"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "nearduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "farduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
+ <div class="divider"></div>
+ <div class="header">{{ctx.Locale.Tr "repo.issues.filter_label"}}</div>
+ {{range $scope := .ExclusiveLabelScopes}}
+ {{$sortType := (printf "scope-%s" $scope)}}
+ <a class="{{if eq $.SortType $sortType}}active {{end}}item" href="{{QueryBuild $queryLink "sort" $sortType}}">{{$scope}}</a>
+ {{end}}
</div>
</div>
diff --git a/templates/repo/issue/label_precolors.tmpl b/templates/repo/issue/label_precolors.tmpl
index 80007662c0..7be3f40350 100644
--- a/templates/repo/issue/label_precolors.tmpl
+++ b/templates/repo/issue/label_precolors.tmpl
@@ -1,22 +1,27 @@
<div class="precolors">
- <div class="tw-flex">
- <a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a>
- <a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a>
- <a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a>
- <a class="color" style="background-color:#009800" data-color-hex="#009800"></a>
- <a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a>
- <a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a>
- <a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a>
- <a class="color" style="background-color:#5319e7" data-color-hex="#5319e7"></a>
- </div>
- <div class="tw-flex">
- <a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a>
- <a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a>
- <a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a>
- <a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a>
- <a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a>
- <a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a>
- <a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a>
- <a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a>
+ <button type="button" class="ui button generate-random-color">
+ {{svg "octicon-sync"}}
+ </button>
+ <div>
+ <div class="tw-flex">
+ <a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a>
+ <a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a>
+ <a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a>
+ <a class="color" style="background-color:#009800" data-color-hex="#009800"></a>
+ <a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a>
+ <a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a>
+ <a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a>
+ <a class="color" style="background-color:#5319e7" data-color-hex="#5319e7"></a>
+ </div>
+ <div class="tw-flex">
+ <a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a>
+ <a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a>
+ <a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a>
+ <a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a>
+ <a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a>
+ <a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a>
+ <a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a>
+ <a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a>
+ </div>
</div>
</div>
diff --git a/templates/repo/issue/labels/label_edit_modal.tmpl b/templates/repo/issue/labels/label_edit_modal.tmpl
index 527b7ff900..ec57de2f3f 100644
--- a/templates/repo/issue/labels/label_edit_modal.tmpl
+++ b/templates/repo/issue/labels/label_edit_modal.tmpl
@@ -5,7 +5,7 @@
>
<div class="header"></div>
<div class="content">
- <form class="ui form ignore-dirty" method="post">
+ <form class="ui form ignore-dirty form-fetch-action" method="post">
{{.CsrfTokenHtml}}
<input name="id" type="hidden">
<div class="required field">
@@ -24,7 +24,13 @@
<div class="desc tw-ml-1 tw-mt-2 tw-hidden label-exclusive-warning">
{{svg "octicon-alert"}} {{ctx.Locale.Tr "repo.issues.label_exclusive_warning"}}
</div>
- <br>
+ <div class="field label-exclusive-order-input-field tw-mt-2">
+ <label class="flex-text-block">
+ {{ctx.Locale.Tr "repo.issues.label_exclusive_order"}}
+ <span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.label_exclusive_order_tooltip"}}">{{svg "octicon-info"}}</span>
+ </label>
+ <input class="label-exclusive-order-input" name="exclusive_order" type="number" maxlength="4">
+ </div>
</div>
<div class="field label-is-archived-input-field">
<div class="ui checkbox">
@@ -43,8 +49,9 @@
</div>
<div class="field">
<label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label>
- <div class="column js-color-picker-input">
- <input name="color" value="#70c24a"placeholder="#c320f6" required maxlength="7">
+ <div class="color-picker-combo" data-global-init="initColorPicker">
+ <!-- the "#" is optional because backend NormalizeColor is able to handle it, API also accepts both formats, and it is easier for users to directly copy-paste a hex value -->
+ <input name="color" value="#70c24a" placeholder="#c320f6" required pattern="^#?([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$" maxlength="7">
{{template "repo/issue/label_precolors"}}
</div>
</div>
diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl
index cdbcc456f0..c8a6b46cc4 100644
--- a/templates/repo/issue/labels/label_list.tmpl
+++ b/templates/repo/issue/labels/label_list.tmpl
@@ -26,7 +26,7 @@
<div class="divider"></div>
{{end}}
- <ul class="issue-label-list">
+ <ul class="issue-label-list muted-links">
{{$canEditLabel := and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
{{$canEditLabel = or $canEditLabel $.PageIsOrgSettingsLabels}}
{{range .Labels}}
@@ -42,21 +42,20 @@
<a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
{{end}}
</div>
- <div class="label-operation tw-flex">
+ <div class="label-operation">
{{template "repo/issue/labels/label_archived" .}}
- <div class="tw-flex tw-ml-auto">
{{if $canEditLabel}}
<a class="edit-label-button" href="#"
data-label-id="{{.ID}}" data-label-name="{{.Name}}" data-label-color="{{.Color}}"
data-label-exclusive="{{.Exclusive}}" data-label-is-archived="{{gt .ArchivedUnix 0}}"
data-label-num-issues="{{.NumIssues}}" data-label-description="{{.Description}}"
+ data-label-exclusive-order="{{.ExclusiveOrder}}"
>{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
<a class="link-action" href="#" data-url="{{$.Link}}/delete?id={{.ID}}"
data-modal-confirm-header="{{ctx.Locale.Tr "repo.issues.label_deletion"}}"
data-modal-confirm-content="{{ctx.Locale.Tr "repo.issues.label_deletion_desc"}}"
>{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
{{end}}
- </div>
</div>
</li>
{{end}}
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 53d0eca171..1fe220e1b8 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -4,6 +4,8 @@
<div class="ui container">
{{template "base/alert" .}}
+ {{template "repo/code/recently_pushed_new_branches" dict "RecentBranchesPromptData" .RecentBranchesPromptData}}
+
{{if .PinnedIssues}}
<div id="issue-pins" {{if .IsRepoAdmin}}data-is-repo-admin{{end}}>
{{range .PinnedIssues}}
@@ -14,9 +16,10 @@
</div>
{{end}}
- <div class="list-header">
- {{template "repo/issue/navbar" .}}
+ <div class="list-header flex-text-block">
{{template "repo/issue/search" .}}
+ <a class="ui small button" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a>
+ <a class="ui small button" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a>
{{if not .Repository.IsArchived}}
{{if .PageIsIssueList}}
<a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl
index 85068102e6..591820080f 100644
--- a/templates/repo/issue/milestone_issues.tmpl
+++ b/templates/repo/issue/milestone_issues.tmpl
@@ -3,10 +3,10 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
- <div class="tw-flex">
- <h1 class="tw-mb-2">{{.Milestone.Name}}</h1>
+ <div class="flex-text-block tw-flex-wrap tw-mb-2">
+ <h1 class="tw-flex-1 tw-m-0">{{.Milestone.Name}}</h1>
{{if not .Repository.IsArchived}}
- <div class="tw-text-right tw-flex-1">
+ <div>
{{if or .CanWriteIssues .CanWritePulls}}
{{if .Milestone.IsClosed}}
<a class="ui primary basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{ctx.Locale.Tr "repo.milestones.open"}}
@@ -28,8 +28,8 @@
{{end}}
<div class="tw-flex tw-flex-col tw-gap-2">
<progress class="milestone-progress-big" value="{{.Milestone.Completeness}}" max="100"></progress>
- <div class="tw-flex tw-gap-4">
- <div classs="tw-flex tw-items-center">
+ <div class="flex-text-block tw-gap-4">
+ <div class="flex-text-inline">
{{$closedDate:= DateUtils.TimeSince .Milestone.ClosedDateUnix}}
{{if .IsClosed}}
{{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}}
@@ -46,7 +46,7 @@
{{end}}
{{end}}
</div>
- <div class="tw-mr-2">{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness}}</div>
+ <div>{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness}}</div>
{{if .TotalTrackedTime}}
<div data-tooltip-content='{{ctx.Locale.Tr "tracked_time_summary"}}'>
{{svg "octicon-clock"}}
diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl
index 4809149a21..9bcced6f54 100644
--- a/templates/repo/issue/milestone_new.tmpl
+++ b/templates/repo/issue/milestone_new.tmpl
@@ -44,7 +44,7 @@
"TextareaPlaceholder" (ctx.Locale.Tr "repo.milestones.desc")
)}}
</div>
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
{{if .PageIsEditMilestone}}
<a class="ui primary basic button" href="{{.RepoLink}}/milestones">
{{ctx.Locale.Tr "repo.milestones.cancel"}}
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl
index 5701c1faa6..8805c709a0 100644
--- a/templates/repo/issue/milestones.tmpl
+++ b/templates/repo/issue/milestones.tmpl
@@ -76,7 +76,7 @@
{{else}}
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{ctx.Locale.Tr "repo.milestones.close"}}</a>
{{end}}
- <a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
+ <a class="link-action flex-text-inline text red" href data-modal-confirm="#repo-milestone-delete-modal" data-url="{{$.RepoLink}}/milestones/delete?id={{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
</div>
{{end}}
</div>
@@ -92,15 +92,11 @@
</div>
{{if or .CanWriteIssues .CanWritePulls}}
- <div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.milestones.deletion"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.milestones.deletion_desc"}}</p>
- </div>
+ <div class="ui small modal" id="repo-milestone-delete-modal">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.milestones.deletion"}}</div>
+ <div class="content"><p>{{ctx.Locale.Tr "repo.milestones.deletion_desc"}}</p></div>
{{template "base/modal_actions_confirm" .}}
</div>
{{end}}
+
{{template "base/footer" .}}
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl
index 73cf8c6324..b63cbcfc0d 100644
--- a/templates/repo/issue/new_form.tmpl
+++ b/templates/repo/issue/new_form.tmpl
@@ -4,8 +4,8 @@
<div class="issue-content-left">
<div class="ui comments">
<div class="comment">
- {{ctx.AvatarUtils.Avatar .SignedUser 40}}
- <div class="ui segment content tw-my-0">
+ <div class=" tw-mr-4 not-mobile">{{ctx.AvatarUtils.Avatar .SignedUser 40}}</div>
+ <div class="ui segment content tw-my-0 avatar-content-left-arrow">
<div class="field">
<input name="title" data-global-init="initInputAutoFocusEnd" id="issue_title" required maxlength="255" autocomplete="off"
placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}"
@@ -33,7 +33,7 @@
{{else}}
{{template "repo/issue/comment_tab" .}}
{{end}}
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
<button class="ui primary button">
{{if .PageIsComparePull}}
{{ctx.Locale.Tr "repo.pulls.create"}}
diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl
index 07732ab5e7..de6c194ee8 100644
--- a/templates/repo/issue/search.tmpl
+++ b/templates/repo/issue/search.tmpl
@@ -8,6 +8,7 @@
<input type="hidden" name="project" value="{{$.ProjectID}}">
<input type="hidden" name="assignee" value="{{$.AssigneeID}}">
<input type="hidden" name="poster" value="{{$.PosterUsername}}">
+ <input type="hidden" name="sort" value="{{$.SortType}}">
{{end}}
{{template "shared/search/input" dict "Value" .Keyword}}
{{if .PageIsIssueList}}
diff --git a/templates/repo/issue/sidebar/assignee_list.tmpl b/templates/repo/issue/sidebar/assignee_list.tmpl
index 19927cbd41..1d2279a45d 100644
--- a/templates/repo/issue/sidebar/assignee_list.tmpl
+++ b/templates/repo/issue/sidebar/assignee_list.tmpl
@@ -6,8 +6,8 @@
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/assignee?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
>
<input class="combo-value" name="assignee_ids" type="hidden" value="{{$data.SelectedAssigneeIDs}}">
- <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
- <a class="text muted">
+ <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <a class="fixed-text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
<div class="menu">
@@ -16,7 +16,7 @@
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
</div>
<div class="scrolling menu flex-items-block">
- <div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
+ <div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
<div class="divider"></div>
{{range $data.CandidateAssignees}}
<a class="item" href="#" data-value="{{.ID}}">
@@ -27,7 +27,7 @@
</div>
</div>
</div>
- <div class="ui list muted-links flex-items-block tw-flex tw-flex-col tw-gap-2">
+ <div class="ui relaxed list muted-links flex-items-block">
<span class="item empty-list {{if $issueAssignees}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}</span>
{{range $issueAssignees}}
<a class="item" href="{{$pageMeta.RepoLink}}/{{if $pageMeta.IsPullRequest}}pulls{{else}}issues{{end}}?assignee={{.ID}}">
diff --git a/templates/repo/issue/sidebar/issue_management.tmpl b/templates/repo/issue/sidebar/issue_management.tmpl
index b4922ed04b..8876a5054e 100644
--- a/templates/repo/issue/sidebar/issue_management.tmpl
+++ b/templates/repo/issue/sidebar/issue_management.tmpl
@@ -1,6 +1,7 @@
{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
<div class="divider"></div>
+ {{/* Pin issue */}}
{{if or .PinEnabled .Issue.IsPinned}}
<form class="tw-mt-1 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.max_pinned"}}"{{end}}>
{{$.CsrfTokenHtml}}
@@ -16,16 +17,15 @@
</form>
{{end}}
- <button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock">
+ {{/* Lock/unlock conversation */}}
+ <button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock-conversation">
{{if .Issue.IsLocked}}
- {{svg "octicon-key"}}
- {{ctx.Locale.Tr "repo.issues.unlock"}}
+ {{svg "octicon-key"}} {{ctx.Locale.Tr "repo.issues.unlock"}}
{{else}}
- {{svg "octicon-lock"}}
- {{ctx.Locale.Tr "repo.issues.lock"}}
+ {{svg "octicon-lock"}} {{ctx.Locale.Tr "repo.issues.lock"}}
{{end}}
</button>
- <div class="ui tiny modal" id="lock">
+ <div class="ui tiny modal" id="lock-conversation">
<div class="header">
{{if .Issue.IsLocked}}
{{ctx.Locale.Tr "repo.issues.unlock.title"}}
@@ -45,29 +45,20 @@
{{end}}
</div>
- <form class="ui form form-fetch-action" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
- method="post">
+ <form class="ui form form-fetch-action" method="post" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}">
{{.CsrfTokenHtml}}
{{if not .Issue.IsLocked}}
<div class="field">
- <strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong>
+ <strong>{{ctx.Locale.Tr "repo.issues.lock.reason"}}</strong>
</div>
<div class="field">
<div class="ui fluid dropdown selection">
-
- <select name="reason">
- <option value=""> </option>
- {{range .LockReasons}}
- <option value="{{.}}">{{.}}</option>
- {{end}}
- </select>
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
-
- <div class="default text"> </div>
-
+ <input type="hidden" name="reason">
+ <div class="text"></div> {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
+ <div class="item" data-value=""></div>
{{range .LockReasons}}
<div class="item" data-value="{{.}}">{{.}}</div>
{{end}}
@@ -78,7 +69,8 @@
<div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
- <button class="ui red button">
+ {{/* explicitly focus the submit button, to avoid Fomantic modal focuses and popups the dropdown */}}
+ <button class="ui red button" autofocus>
{{if .Issue.IsLocked}}
{{ctx.Locale.Tr "repo.issues.unlock_confirm"}}
{{else}}
diff --git a/templates/repo/issue/sidebar/label_list.tmpl b/templates/repo/issue/sidebar/label_list.tmpl
index 7d4ad264c2..15c8760d1a 100644
--- a/templates/repo/issue/sidebar/label_list.tmpl
+++ b/templates/repo/issue/sidebar/label_list.tmpl
@@ -4,8 +4,8 @@
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/labels?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
>
<input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}">
- <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
- <a class="text muted">
+ <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <a class="fixed-text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
<div class="menu">
@@ -17,7 +17,7 @@
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
</div>
<div class="scrolling menu">
- <a class="item clear-selection" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
+ <a class="item clear-selection" data-text="" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
<div class="divider"></div>
{{$previousExclusiveScope := "_no_scope"}}
{{range $data.RepoLabels}}
@@ -43,7 +43,7 @@
</div>
</div>
- <div class="ui list labels-list tw-my-2 tw-flex tw-gap-2">
+ <div class="ui list labels-list">
<span class="item empty-list {{if $data.SelectedLabelIDs}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span>
{{range $data.AllLabels}}
{{if .IsChecked}}
diff --git a/templates/repo/issue/sidebar/milestone_list.tmpl b/templates/repo/issue/sidebar/milestone_list.tmpl
index 4ca0d1bd3a..5bc961ed3c 100644
--- a/templates/repo/issue/sidebar/milestone_list.tmpl
+++ b/templates/repo/issue/sidebar/milestone_list.tmpl
@@ -6,8 +6,8 @@
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/milestone?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
>
<input class="combo-value" name="milestone_id" type="hidden" value="{{$data.SelectedMilestoneID}}">
- <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
- <a class="text muted">
+ <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <a class="fixed-text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
<div class="menu">
@@ -19,7 +19,7 @@
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
</div>
<div class="scrolling menu">
- <div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
+ <div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
<div class="divider"></div>
{{if $data.OpenMilestones}}
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
diff --git a/templates/repo/issue/sidebar/project_list.tmpl b/templates/repo/issue/sidebar/project_list.tmpl
index 0d8a88e8fa..a212261a22 100644
--- a/templates/repo/issue/sidebar/project_list.tmpl
+++ b/templates/repo/issue/sidebar/project_list.tmpl
@@ -6,8 +6,8 @@
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/projects?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
>
<input class="combo-value" name="project_id" type="hidden" value="{{$data.SelectedProjectID}}">
- <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
- <a class="text muted">
+ <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <a class="fixed-text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
<div class="menu">
@@ -18,7 +18,7 @@
</div>
{{end}}
<div class="scrolling menu">
- <div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
+ <div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
<div class="divider"></div>
{{if $data.OpenProjects}}
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div>
diff --git a/templates/repo/issue/sidebar/reviewer_list.tmpl b/templates/repo/issue/sidebar/reviewer_list.tmpl
index 82e3c0c86a..2b5ca80fe7 100644
--- a/templates/repo/issue/sidebar/reviewer_list.tmpl
+++ b/templates/repo/issue/sidebar/reviewer_list.tmpl
@@ -6,8 +6,8 @@
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/request_review?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
>
<input type="hidden" class="combo-value" name="reviewer_ids">{{/* match CreateIssueForm */}}
- <div class="ui dropdown text-flex-grow {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
- <a class="text muted">
+ <div class="ui dropdown full-width {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
+ <a class="fixed-text muted">
<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}}
</a>
<div class="menu flex-items-menu">
@@ -43,7 +43,7 @@
</div>
</div>
- <div class="ui relaxed list flex-items-block tw-my-4">
+ <div class="ui relaxed list flex-items-block">
<span class="item empty-list {{if or $data.OriginalReviews $data.CurrentPullReviewers}}tw-hidden{{end}}">
{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}
</span>
diff --git a/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl b/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl
index a72749a9f3..6168b06e17 100644
--- a/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl
+++ b/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl
@@ -2,34 +2,28 @@
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
<div class="divider"></div>
<div>
- <div class="ui dropdown text-flex-grow jump">
- <a class="text muted">
- <div>
- <strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong> {{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}}
- </div>
- {{svg "octicon-gear"}}
- </a>
- <div class="menu">
- <a class="item issue-set-time-estimate show-modal" data-modal="#issue-time-set-estimate-modal">
- {{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.time_estimate_set"}}
- </a>
- <div class="divider"></div>
- {{if $.IsStopwatchRunning}}
- <a class="item issue-stop-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/toggle">
- {{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_stop"}}
- </a>
- <a class="item issue-cancel-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/cancel">
- {{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_discard"}}
- </a>
- {{else}}
- <a class="item issue-start-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/toggle">
- {{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_start"}}
- </a>
- <a class="item issue-add-time show-modal" data-modal="#issue-time-manually-add-modal">
- {{svg "octicon-plus"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_manually_add"}}
- </a>
- {{end}}
- </div>
+ <div class="flex-text-block">
+ <strong class="tw-flex-1">{{ctx.Locale.Tr "repo.issues.tracker"}}</strong>
+ <button class="btn interact-fg show-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.time_estimate_set"}}" data-modal="#issue-time-set-estimate-modal">
+ {{svg "octicon-pencil"}}
+ </button>
+ </div>
+ <div class="ui buttons tw-mt-2 tw-w-full">
+ {{if $.IsStopwatchRunning}}
+ <button class="ui button tw-flex-1 issue-stop-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/stop">
+ {{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_stop"}}
+ </button>
+ <button class="ui icon button issue-cancel-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/cancel" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.timetracker_timer_discard"}}">
+ {{svg "octicon-trash"}}
+ </button>
+ {{else}}
+ <button class="ui button tw-flex-1 issue-start-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/start">
+ {{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_start"}}
+ </button>
+ <button class="ui icon button issue-add-time show-modal" data-modal="#issue-time-manually-add-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.timetracker_timer_manually_add"}}">
+ {{svg "octicon-plus"}}
+ </button>
+ {{end}}
</div>
{{if and (not $.IsStopwatchRunning) .HasUserStopwatch}}
@@ -73,23 +67,19 @@
</div>
{{end}}
{{if .WorkingUsers}}
- <div class="ui comments tw-mt-2">
+ <div class="tw-mt-2">
{{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Hour)}}
- <div>
- {{range $user, $trackedtime := .WorkingUsers}}
- <div class="comment tw-mt-2">
- <a class="avatar">
- {{ctx.AvatarUtils.Avatar $user}}
- </a>
- <div class="content">
- {{template "shared/user/authorlink" $user}}
- <div class="text">
- {{$trackedtime|Sec2Hour}}
- </div>
- </div>
+ </div>
+ <div class="ui list flex-items-block">
+ {{range $user, $trackedtime := .WorkingUsers}}
+ <div class="item tw-gap-3">
+ {{template "shared/user/avatarlink" dict "user" $user}}
+ <div>
+ {{template "shared/user/authorlink" $user}}
+ <div class="text">{{$trackedtime|Sec2Hour}}</div>
</div>
- {{end}}
- </div>
+ </div>
+ {{end}}
</div>
{{end}}
{{end}}
diff --git a/templates/repo/issue/sidebar/wip_switch.tmpl b/templates/repo/issue/sidebar/wip_switch.tmpl
index b007399deb..8c40908f62 100644
--- a/templates/repo/issue/sidebar/wip_switch.tmpl
+++ b/templates/repo/issue/sidebar/wip_switch.tmpl
@@ -1,5 +1,5 @@
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
- <a class="toggle-wip tw-block tw-mt-2" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
+ <a data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
</a>
{{end}}
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index 1a7c0716bc..a51a7f4fb1 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -13,8 +13,8 @@
</a>
{{end}}
<div class="content comment-container">
- <div class="comment-header" role="heading" aria-level="3">
- <div class="comment-header-left tw-flex tw-items-center">
+ <div class="comment-header avatar-content-left-arrow" role="heading" aria-level="3">
+ <div class="comment-header-left">
{{if .Issue.OriginalAuthor}}
<span class="text black tw-font-semibold">
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
@@ -36,7 +36,7 @@
</span>
{{end}}
</div>
- <div class="comment-header-right actions tw-flex tw-items-center">
+ <div class="comment-header-right">
{{template "repo/issue/view_content/show_role" dict "ShowRole" .Issue.ShowRole "IgnorePoster" true}}
{{if not $.Repository.IsArchived}}
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}
@@ -68,7 +68,7 @@
{{template "repo/issue/view_content/comments" .}}
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
- {{template "repo/issue/view_content/pull".}}
+ {{template "repo/issue/view_content/pull_merge_box".}}
{{end}}
{{if .IsSigned}}
@@ -78,12 +78,12 @@
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
</a>
<div class="content">
- <div class="ui segment">
+ <div class="ui segment avatar-content-left-arrow">
<form class="ui form form-fetch-action" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
{{template "repo/issue/comment_tab" .}}
{{.CsrfTokenHtml}}
<div class="field footer">
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
{{if .Issue.IsClosed}}
<button id="status-button" class="ui primary basic button" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">
@@ -157,7 +157,7 @@
{{end}}
<div class="field">
- <div class="tw-text-right edit">
+ <div class="flex-text-block tw-justify-end">
<button type="button" class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
<button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
</div>
diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl
index 2155f78656..e865050559 100644
--- a/templates/repo/issue/view_content/attachments.tmpl
+++ b/templates/repo/issue/view_content/attachments.tmpl
@@ -31,7 +31,7 @@
{{if FilenameIsImage .Name}}
{{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}}
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
- <img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
+ <img loading="lazy" alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
</a>
{{end}}
{{end}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index f2f3d1c9cc..089cdf2ccd 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -26,14 +26,14 @@
</a>
{{end}}
<div class="content comment-container">
- <div class="comment-header" role="heading" aria-level="3">
- <div class="comment-header-left tw-flex tw-items-center">
+ <div class="comment-header avatar-content-left-arrow" role="heading" aria-level="3">
+ <div class="comment-header-left">
{{if .OriginalAuthor}}
<span class="text black tw-font-semibold tw-mr-1">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{.OriginalAuthor}}
</span>
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} {{if $.Repository.OriginalURL}}
</span>
<span class="text migrate">
@@ -45,13 +45,13 @@
{{ctx.AvatarUtils.Avatar .Poster 24}}
</a>
{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
</span>
{{end}}
</div>
- <div class="comment-header-right actions tw-flex tw-items-center">
+ <div class="comment-header-right">
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
{{if not $.Repository.IsArchived}}
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
@@ -85,7 +85,7 @@
{{if not .OriginalAuthor}}
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{if .Issue.IsPull}}
{{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr}}
@@ -100,7 +100,7 @@
{{if not .OriginalAuthor}}
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{if .Issue.IsPull}}
{{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr}}
@@ -115,7 +115,7 @@
{{if not .OriginalAuthor}}
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
{{if eq $.Issue.PullRequest.Status 3}}
@@ -143,35 +143,36 @@
<span class="badge">{{svg "octicon-bookmark"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{if eq .RefAction 3}}<del>{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr $refTr .EventTag $createdStr (.RefCommentLink ctx) $refFrom}}
</span>
{{if eq .RefAction 3}}</del>{{end}}
<div class="detail flex-text-block">
- <span class="text grey muted-links"><a href="{{.RefIssueLink ctx}}"><b>{{.RefIssueTitle ctx}}</b> {{.RefIssueIdent ctx}}</a></span>
+ <span class="comment-text-line"><a href="{{.RefIssueLink ctx}}"><b>{{.RefIssueTitle ctx}}</b> {{.RefIssueIdent ctx}}</a></span>
</div>
</div>
{{else if eq .Type 4}}
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-bookmark"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr}}
</span>
<div class="detail flex-text-block">
{{svg "octicon-git-commit"}}
- <span class="text grey muted-links">{{.Content | SanitizeHTML}}</span>
+ {{/* the content is a link like <a href="{RepoLink}/commit/{CommitID}">message title</a> (from CreateRefComment) */}}
+ <span class="comment-text-line">{{.Content | SanitizeHTML}}</span>
</div>
</div>
{{else if eq .Type 7}}
{{if or .AddedLabels .RemovedLabels}}
- <div class="timeline-item event" id="{{.HashTag}}">
+ <div class="timeline-item event with-labels-list-inline" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-tag"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{if and .AddedLabels (not .RemovedLabels)}}
{{ctx.Locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (ctx.RenderUtils.RenderLabels .AddedLabels $.RepoLink .Issue) $createdStr}}
@@ -187,7 +188,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-milestone"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" .OldMilestone.Name .Milestone.Name $createdStr}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" .OldMilestone.Name $createdStr}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" .Milestone.Name $createdStr}}{{end}}
</span>
@@ -197,7 +198,7 @@
<span class="badge">{{svg "octicon-person"}}</span>
{{if .RemovedAssignee}}
{{template "shared/user/avatarlink" dict "user" .Assignee}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Assignee}}
{{if eq .Poster.ID .Assignee.ID}}
{{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr}}
@@ -207,7 +208,7 @@
</span>
{{else}}
{{template "shared/user/avatarlink" dict "user" .Assignee}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Assignee}}
{{if eq .Poster.ID .AssigneeID}}
{{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr}}
@@ -221,7 +222,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-pencil"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.change_title_at" (.OldTitle|ctx.RenderUtils.RenderEmoji) (.NewTitle|ctx.RenderUtils.RenderEmoji) $createdStr}}
</span>
@@ -230,7 +231,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-branch"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$oldRef := HTMLFormat `<span class="tw-line-through">%s</span>` .OldRef}}
{{ctx.Locale.Tr "repo.issues.delete_branch_at" $oldRef $createdStr}}
@@ -240,7 +241,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.start_tracking_history" $createdStr}}
</span>
@@ -249,7 +250,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$timeStr := .RenderedContent}} {{/* compatibility with time comments made before v1.21 */}}
{{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}}
@@ -261,7 +262,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$timeStr := .RenderedContent}} {{/* compatibility with time comments made before v1.21 */}}
{{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}}
@@ -273,7 +274,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.cancel_tracking_history" $createdStr}}
</span>
@@ -282,7 +283,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$dueDate := DateUtils.AbsoluteLong (.Content|DateUtils.ParseLegacy)}}
{{ctx.Locale.Tr "repo.issues.due_date_added" $dueDate $createdStr}}
@@ -292,7 +293,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$parsedDeadline := StringUtils.Split .Content "|"}}
{{if eq (len $parsedDeadline) 2}}
@@ -306,7 +307,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$dueDate := DateUtils.AbsoluteLong (.Content|DateUtils.ParseLegacy)}}
{{ctx.Locale.Tr "repo.issues.due_date_remove" $dueDate $createdStr}}
@@ -316,14 +317,14 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-package-dependents"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.dependency.added_dependency" $createdStr}}
</span>
{{if .DependentIssue}}
<div class="detail flex-text-block">
{{svg "octicon-plus"}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
<a href="{{.DependentIssue.Link}}">
{{if eq .DependentIssue.RepoID .Issue.RepoID}}
#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
@@ -339,14 +340,14 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-package-dependents"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.dependency.removed_dependency" $createdStr}}
</span>
{{if .DependentIssue}}
<div class="detail flex-text-block">
{{svg "octicon-trash"}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
<a href="{{.DependentIssue.Link}}">
{{if eq .DependentIssue.RepoID .Issue.RepoID}}
#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
@@ -374,7 +375,7 @@
<span class="badge tw-text-white{{if eq $reviewType 1}}{{if .Review.Official}} tw-bg-green {{else}} tw-bg-grey{{end}}{{else if eq $reviewType 3}} tw-bg-red{{end}}">
{{if .Review}}{{svg (printf "octicon-%s" .Review.Type.Icon)}}{{end}}
</span>
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{if eq $reviewType 1}}
{{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}}
@@ -393,20 +394,20 @@
{{if or .Content .Attachments}}
<div class="timeline-item comment">
<div class="content comment-container">
- <div class="comment-header">
- <div class="comment-header-left tw-flex tw-items-center">
+ <div class="comment-header avatar-content-left-arrow">
+ <div class="comment-header-left">
{{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{ctx.AvatarUtils.Avatar .Poster 24}}
</a>
{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{if .OriginalAuthor}}
<span class="text black tw-font-semibold">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{.OriginalAuthor}}
</span>
- <span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span>
+ <span class="comment-text-line"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}}</span>
{{else}}
{{template "shared/user/authorlink" .Poster}}
@@ -415,7 +416,7 @@
{{ctx.Locale.Tr "repo.issues.review.left_comment"}}
</span>
</div>
- <div class="comment-header-right actions tw-flex tw-items-center">
+ <div class="comment-header-right">
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
{{if not $.Repository.IsArchived}}
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
@@ -460,12 +461,12 @@
<span class="badge">{{svg "octicon-lock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{if .Content}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.lock_with_reason" .Content $createdStr}}
</span>
{{else}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.lock_no_reason" $createdStr}}
</span>
@@ -475,7 +476,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-key"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.unlock_comment" $createdStr}}
</span>
@@ -486,7 +487,7 @@
{{if not .OriginalAuthor}}
{{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}}
</span>
@@ -495,7 +496,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.del_time_history" $createdStr}}
@@ -504,9 +505,9 @@
{{svg "octicon-clock"}}
{{if .RenderedContent}}
{{/* compatibility with time comments made before v1.21 */}}
- <span class="text grey muted-links">{{.RenderedContent}}</span>
+ <span class="comment-text-line">{{.RenderedContent}}</span>
{{else}}
- <span class="text grey muted-links">- {{.Content|Sec2Hour}}</span>
+ <span class="comment-text-line">- {{.Content|Sec2Hour}}</span>
{{end}}
</div>
</div>
@@ -514,7 +515,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-eye"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{if (gt .AssigneeID 0)}}
{{if .RemovedAssignee}}
@@ -547,7 +548,7 @@
{{end}}
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-repo-push"}}</span>
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{if .IsForcePush}}
{{ctx.Locale.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr}}
@@ -556,9 +557,7 @@
{{end}}
</span>
{{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}}
- <span class="tw-float-right comparebox">
- <a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{ctx.Locale.Tr "repo.issues.force_push_compare"}}</a>
- </span>
+ <a class="ui label comment-text-label tw-float-right" href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow">{{ctx.Locale.Tr "repo.issues.force_push_compare"}}</a>
{{end}}
</div>
{{if not .IsForcePush}}
@@ -568,7 +567,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-project"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$oldProjectDisplayHtml := "Unknown Project"}}
{{if .OldProject}}
@@ -600,7 +599,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-project"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$newProjectDisplay := .CommentMetaData.ProjectTitle}}
{{if .Project}}
@@ -615,10 +614,10 @@
<div class="timeline-item-group">
<div class="timeline-item event" id="{{.HashTag}}">
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
- <img src="{{.Poster.AvatarLink ctx}}" width="40" height="40">
+ {{ctx.AvatarUtils.Avatar .Poster 40}}
</a>
<span class="badge grey">{{svg "octicon-x" 16}}</span>
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$reviewerName := ""}}
{{if .Review}}
@@ -634,13 +633,13 @@
{{if .Content}}
<div class="timeline-item comment">
<div class="content comment-container">
- <div class="comment-header arrow-top">
+ <div class="comment-header avatar-content-left-arrow arrow-top">
{{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{ctx.AvatarUtils.Avatar .Poster 24}}
</a>
{{end}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{ctx.Locale.Tr "action.review_dismissed_reason"}}
</span>
</div>
@@ -661,7 +660,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-branch"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{if and .OldRef .NewRef}}
{{ctx.Locale.Tr "repo.issues.change_ref_at" .OldRef .NewRef $createdStr}}
@@ -675,7 +674,7 @@
{{else if or (eq .Type 34) (eq .Type 35)}}
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-merge" 16}}</span>
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
{{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr}}
{{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr}}{{end}}
@@ -685,7 +684,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-pin" 16}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{if eq .Type 36}}{{ctx.Locale.Tr "repo.issues.pin_comment" $createdStr}}
{{else}}{{ctx.Locale.Tr "repo.issues.unpin_comment" $createdStr}}{{end}}
@@ -695,7 +694,7 @@
<div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "user" .Poster}}
- <span class="text grey muted-links">
+ <span class="comment-text-line">
{{template "shared/user/authorlink" .Poster}}
{{$timeStr := .Content|TimeEstimateString}}
{{if $timeStr}}
diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl
index 32e9811335..189b9d6259 100644
--- a/templates/repo/issue/view_content/conversation.tmpl
+++ b/templates/repo/issue/view_content/conversation.tmpl
@@ -15,9 +15,9 @@
</span>
{{end}}
</div>
- <div>
+ <div class="tw-flex tw-items-center">
{{if or $invalid $resolved}}
- <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if not $resolved}}tw-hidden {{end}}ui compact labeled button show-outdated tw-flex tw-items-center">
+ <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if not $resolved}}tw-hidden{{end}} btn tiny show-outdated">
{{svg "octicon-unfold" 16 "tw-mr-2"}}
{{if $resolved}}
{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
@@ -25,7 +25,7 @@
{{ctx.Locale.Tr "repo.issues.review.show_outdated"}}
{{end}}
</button>
- <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if $resolved}}tw-hidden {{end}}ui compact labeled button hide-outdated tw-flex tw-items-center">
+ <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if $resolved}}tw-hidden {{end}} btn tiny hide-outdated">
{{svg "octicon-fold" 16 "tw-mr-2"}}
{{if $resolved}}
{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
@@ -58,7 +58,7 @@
<div class="comment code-comment" id="{{.HashTag}}">
<div class="content comment-container">
<div class="comment-header">
- <div class="comment-header-left tw-flex tw-items-center">
+ <div class="comment-header-left">
{{if not .OriginalAuthor}}
<a class="avatar">
{{ctx.AvatarUtils.Avatar .Poster 20}}
@@ -79,7 +79,7 @@
{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdSubStr}}
</span>
</div>
- <div class="comment-header-right actions tw-flex tw-items-center">
+ <div class="comment-header-right">
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
{{if not $.Repository.IsArchived}}
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
@@ -109,7 +109,7 @@
</div>
{{end}}
</div>
- <div class="code-comment-buttons tw-flex tw-items-center tw-flex-wrap tw-mt-2 tw-mb-1 tw-mx-2">
+ <div class="flex-text-block tw-flex-wrap tw-my-2">
<div class="tw-flex-1">
{{if $resolved}}
<div class="ui grey text">
@@ -118,7 +118,7 @@
</div>
{{end}}
</div>
- <div class="code-comment-buttons-buttons">
+ <div class="flex-text-block">
{{if and $.CanMarkConversation $hasReview (not $isReviewPending)}}
<button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
{{if $resolved}}
@@ -129,8 +129,8 @@
</button>
{{end}}
{{if and $.SignedUserID (not $.Repository.IsArchived)}}
- <button class="comment-form-reply ui primary tiny labeled icon button tw-ml-1 tw-mr-0">
- {{svg "octicon-reply" 16 "reply icon tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}}
+ <button class="comment-form-reply ui primary icon tiny button">
+ {{svg "octicon-reply" 12}}{{ctx.Locale.Tr "repo.diff.comment.reply"}}
</button>
{{end}}
</div>
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull_merge_box.tmpl
index 064b62e128..113bfb732e 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_box.tmpl
@@ -1,7 +1,13 @@
{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}}
{{/* Then the merge box will not be displayed because this page already contains enough information */}}
{{else}}
-<div class="timeline-item comment merge box">
+<div class="timeline-item comment pull-merge-box"
+ data-global-init="initRepoPullMergeBox"
+ {{if .PullMergeBoxReloadingInterval}}
+ data-pull-merge-box-reloading-interval="{{.PullMergeBoxReloadingInterval}}"
+ data-pull-link="{{.Issue.Link}}"
+ {{end}}
+>
<div class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
{{- else if .Issue.IsClosed}}grey
{{- else if .IsPullWorkInProgress}}grey
@@ -32,7 +38,7 @@
</div>
{{end}}
{{$showGeneralMergeForm := false}}
- <div class="ui attached segment merge-section {{if not $.LatestCommitStatus}}no-header{{end}} flex-items-block">
+ <div class="ui attached segment merge-section {{if not $.LatestCommitStatus}}avatar-content-left-arrow{{end}} flex-items-block">
{{if .Issue.PullRequest.HasMerged}}
{{if .IsPullBranchDeletable}}
<div class="item item-section text tw-flex-1">
@@ -89,7 +95,7 @@
{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
</div>
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
- <button class="ui compact button toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
+ <button class="ui compact button" data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
{{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
</button>
{{end}}
@@ -97,7 +103,7 @@
{{template "repo/issue/view_content/update_branch_by_merge" $}}
{{else if .Issue.PullRequest.IsChecking}}
<div class="item">
- {{svg "octicon-sync"}}
+ {{svg "octicon-sync" 16 "circular-spin"}}
{{ctx.Locale.Tr "repo.pulls.is_checking"}}
</div>
{{else if .Issue.PullRequest.IsAncestor}}
@@ -191,10 +197,11 @@
</div>
{{end}}
{{end}}
+
{{template "repo/issue/view_content/update_branch_by_merge" $}}
+
{{if .Issue.PullRequest.IsEmpty}}
<div class="divider"></div>
-
<div class="item">
{{svg "octicon-alert"}}
{{ctx.Locale.Tr "repo.pulls.is_empty"}}
@@ -216,7 +223,7 @@
const defaultMergeMessage = {{.DefaultMergeBody}};
const defaultSquashMergeMessage = {{.DefaultSquashMergeBody}};
const mergeForm = {
- 'baseLink': {{.Link}},
+ 'baseLink': {{.Issue.Link}},
'textCancel': {{ctx.Locale.Tr "cancel"}},
'textDeleteBranch': {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}},
'textAutoMergeButtonWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
@@ -318,7 +325,7 @@
{{if .IsBlockedByApprovals}}
<div class="item text red">
{{svg "octicon-x"}}
- {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
+ {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
</div>
{{else if .IsBlockedByRejection}}
<div class="item text red">
@@ -377,7 +384,7 @@
*/}}
{{if and $.StillCanManualMerge (not $showGeneralMergeForm)}}
<div class="divider"></div>
- <form class="ui form form-fetch-action" action="{{.Link}}/merge" method="post">{{/* another similar form is in PullRequestMergeForm.vue*/}}
+ <form class="ui form form-fetch-action" action="{{.Issue.Link}}/merge" method="post">{{/* another similar form is in PullRequestMergeForm.vue*/}}
{{.CsrfTokenHtml}}
<div class="field">
<input type="text" name="merge_commit_id" placeholder="{{ctx.Locale.Tr "repo.pulls.merge_commit_id"}}">
diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
index a1cff41a3a..9dbcbeee21 100644
--- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
@@ -7,11 +7,11 @@
{{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}
{{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}}
{{end}}
- <div class="ui secondary segment">
+ <div class="ui secondary segment tw-font-mono">
{{if eq .PullRequest.Flow 0}}
<div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}<origin-url data-url="{{.PullRequest.HeadRepo.Link}}"></origin-url>{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div>
{{else}}
- <div>git fetch -u origin {{.PullRequest.GetGitRefName}}:{{$localBranch}}</div>
+ <div>git fetch -u origin {{.PullRequest.GetGitHeadRefName}}:{{$localBranch}}</div>
{{end}}
<div>git checkout {{$localBranch}}</div>
</div>
@@ -23,7 +23,7 @@
<div>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}</div>
{{end}}
</div>
- <div class="ui secondary segment">
+ <div class="ui secondary segment tw-font-mono">
<div data-pull-merge-style="merge">
<div>git checkout {{.PullRequest.BaseBranch}}</div>
<div>git merge --no-ff {{$localBranch}}</div>
diff --git a/templates/repo/issue/view_content/reference_issue_dialog.tmpl b/templates/repo/issue/view_content/reference_issue_dialog.tmpl
index f6ffeef26d..0b28bdc811 100644
--- a/templates/repo/issue/view_content/reference_issue_dialog.tmpl
+++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl
@@ -7,7 +7,7 @@
{{.CsrfTokenHtml}}
<div class="field">
<label><strong>{{ctx.Locale.Tr "repository"}}</strong></label>
- <div class="ui search selection dropdown issue_reference_repository_search ellipsis-items-nowrap">
+ <div class="ui search selection dropdown issue_reference_repository_search ellipsis-text-items">
<div class="default text gt-ellipsis">{{.Repository.FullName}}</div>
<div class="menu"></div>
</div>
@@ -20,7 +20,7 @@
<label><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></label>
<textarea name="content"></textarea>
</div>
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button>
</div>
</form>
diff --git a/templates/repo/issue/view_content/update_branch_by_merge.tmpl b/templates/repo/issue/view_content/update_branch_by_merge.tmpl
index e0ed262f17..5d959bf0b3 100644
--- a/templates/repo/issue/view_content/update_branch_by_merge.tmpl
+++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl
@@ -9,7 +9,7 @@
{{if and $.UpdateAllowed $.UpdateByRebaseAllowed}}
<div class="tw-inline-block">
<div id="update-pr-branch-with-base" class="ui buttons">
- <button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}">
+ <button class="ui button" data-do="{{$.Issue.Link}}/update" data-redirect="{{$.Issue.Link}}">
<span class="button-text">
{{ctx.Locale.Tr "repo.pulls.update_branch"}}
</span>
@@ -17,15 +17,15 @@
<div class="ui dropdown icon button">
{{svg "octicon-triangle-down"}}
<div class="menu">
- <a class="item active selected" data-do="{{$.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a>
- <a class="item" data-do="{{$.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a>
+ <a class="item active selected" data-do="{{$.Issue.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a>
+ <a class="item" data-do="{{$.Issue.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a>
</div>
</div>
</div>
</div>
{{end}}
{{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}}
- <form action="{{$.Link}}/update" method="post" class="ui update-branch-form">
+ <form action="{{$.Issue.Link}}/update" method="post" class="ui update-branch-form">
{{$.CsrfTokenHtml}}
<button class="ui compact button">
<span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span>
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl
index dcc1f48c2c..103fa5de53 100644
--- a/templates/repo/issue/view_title.tmpl
+++ b/templates/repo/issue/view_title.tmpl
@@ -12,8 +12,8 @@
<div class="issue-title-header">
{{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
<div class="issue-title" id="issue-title-display">
- <h1 class="tw-break-anywhere">
- {{ctx.RenderUtils.RenderIssueTitle .Issue.Title ($.Repository.ComposeMetas ctx)}}
+ <h1>
+ {{ctx.RenderUtils.RenderIssueTitle .Issue.Title $.Repository}}
<span class="index">#{{.Issue.Index}}</span>
</h1>
<div class="issue-title-buttons">
diff --git a/templates/repo/latest_commit.tmpl b/templates/repo/latest_commit.tmpl
index 0341d60eb2..cff338949f 100644
--- a/templates/repo/latest_commit.tmpl
+++ b/templates/repo/latest_commit.tmpl
@@ -21,10 +21,10 @@
{{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses}}
{{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}}
- <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .LatestCommit.Message $commitLink ($.Repository.ComposeMetas ctx)}}</span>
+ <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .LatestCommit.Message $commitLink $.Repository}}</span>
{{if IsMultilineCommitMessage .LatestCommit.Message}}
<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>
- <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .LatestCommit.Message ($.Repository.ComposeMetas ctx)}}</pre>
+ <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .LatestCommit.Message $.Repository}}</pre>
{{end}}
</span>
{{end}}
diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl
index d4ca269f02..f4de8ff236 100644
--- a/templates/repo/migrate/codebase.tmpl
+++ b/templates/repo/migrate/codebase.tmpl
@@ -60,22 +60,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/codecommit.tmpl b/templates/repo/migrate/codecommit.tmpl
index 53ca7dda3d..275a2aef09 100644
--- a/templates/repo/migrate/codecommit.tmpl
+++ b/templates/repo/migrate/codecommit.tmpl
@@ -61,22 +61,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl
index 3f447f76eb..41139d4fd6 100644
--- a/templates/repo/migrate/git.tmpl
+++ b/templates/repo/migrate/git.tmpl
@@ -34,22 +34,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar .}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl
index 559988951b..c89aa6c744 100644
--- a/templates/repo/migrate/gitbucket.tmpl
+++ b/templates/repo/migrate/gitbucket.tmpl
@@ -76,22 +76,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl
index 3d692129d5..55cf61a77f 100644
--- a/templates/repo/migrate/gitea.tmpl
+++ b/templates/repo/migrate/gitea.tmpl
@@ -72,22 +72,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar .}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl
index 850a2b3c71..86b585b861 100644
--- a/templates/repo/migrate/github.tmpl
+++ b/templates/repo/migrate/github.tmpl
@@ -74,22 +74,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl
index 9bafa122f1..edd69f0027 100644
--- a/templates/repo/migrate/gitlab.tmpl
+++ b/templates/repo/migrate/gitlab.tmpl
@@ -71,22 +71,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl
index 0495ce67fb..9149c43239 100644
--- a/templates/repo/migrate/gogs.tmpl
+++ b/templates/repo/migrate/gogs.tmpl
@@ -74,22 +74,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar .}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl
index c5c697edff..79ac5cc8a1 100644
--- a/templates/repo/migrate/migrate.tmpl
+++ b/templates/repo/migrate/migrate.tmpl
@@ -19,7 +19,7 @@
<div class="header tw-text-center">
{{.Title}}
</div>
- <div class="description tw-text-center">
+ <div class="description tw-text-center tw-text-balance">
{{ctx.Locale.Tr (printf "repo.migrate.%s.description" .Name)}}
</div>
</div>
diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl
index 8b83816b9b..e73e3a9790 100644
--- a/templates/repo/migrate/migrating.tmpl
+++ b/templates/repo/migrate/migrating.tmpl
@@ -9,12 +9,12 @@
<div class="ui stackable middle very relaxed page grid">
<div id="repo_migrating" class="sixteen wide tw-text-center centered column" data-migrating-repo-link="{{.Link}}">
<div>
- <img src="{{AssetUrlPrefix}}/img/loading.png">
+ <img alt src="{{AssetUrlPrefix}}/img/loading.png">
</div>
</div>
<div id="repo_migrating_failed_image" class="sixteen wide tw-text-center centered column tw-hidden">
<div>
- <img src="{{AssetUrlPrefix}}/img/failed.png">
+ <img alt src="{{AssetUrlPrefix}}/img/failed.png">
</div>
</div>
</div>
diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl
index 55945154ef..a25ccf9438 100644
--- a/templates/repo/migrate/onedev.tmpl
+++ b/templates/repo/migrate/onedev.tmpl
@@ -61,22 +61,22 @@
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}">
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
+ <div class="item" data-value="{{.SignedUser.ID}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
diff --git a/templates/repo/navbar.tmpl b/templates/repo/navbar.tmpl
index b2471dc17e..e004c5254b 100644
--- a/templates/repo/navbar.tmpl
+++ b/templates/repo/navbar.tmpl
@@ -1,14 +1,19 @@
+{{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
+
<div class="ui fluid vertical menu">
+ {{/* the default activity page "pulse" could work with any permission: code, issue, pr, release*/}}
<a class="{{if .PageIsPulse}}active {{end}}item" href="{{.RepoLink}}/activity">
{{ctx.Locale.Tr "repo.activity.navbar.pulse"}}
</a>
- <a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors">
- {{ctx.Locale.Tr "repo.activity.navbar.contributors"}}
- </a>
- <a class="{{if .PageIsCodeFrequency}}active{{end}} item" href="{{.RepoLink}}/activity/code-frequency">
- {{ctx.Locale.Tr "repo.activity.navbar.code_frequency"}}
- </a>
- <a class="{{if .PageIsRecentCommits}}active{{end}} item" href="{{.RepoLink}}/activity/recent-commits">
- {{ctx.Locale.Tr "repo.activity.navbar.recent_commits"}}
- </a>
+ {{if $canReadCode}}
+ <a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors">
+ {{ctx.Locale.Tr "repo.activity.navbar.contributors"}}
+ </a>
+ <a class="{{if .PageIsCodeFrequency}}active{{end}} item" href="{{.RepoLink}}/activity/code-frequency">
+ {{ctx.Locale.Tr "repo.activity.navbar.code_frequency"}}
+ </a>
+ <a class="{{if .PageIsRecentCommits}}active{{end}} item" href="{{.RepoLink}}/activity/recent-commits">
+ {{ctx.Locale.Tr "repo.activity.navbar.recent_commits"}}
+ </a>
+ {{end}}
</div>
diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl
index 05ad7264bf..1acaaf8b4b 100644
--- a/templates/repo/projects/view.tmpl
+++ b/templates/repo/projects/view.tmpl
@@ -2,14 +2,13 @@
<div role="main" aria-label="{{.Title}}" class="page-content repository projects view-project">
{{template "repo/header" .}}
<div class="ui container padded">
- <div class="tw-flex tw-justify-between tw-items-center tw-mb-4">
- {{template "repo/issue/navbar" .}}
+ <div class="flex-text-block tw-justify-end tw-mb-4">
+ <a class="ui small button" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a>
+ <a class="ui small button" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a>
<a class="ui small primary button" href="{{.RepoLink}}/issues/new/choose?project={{.Project.ID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
</div>
</div>
- <div class="ui container fluid padded">
- {{template "projects/view" .}}
- </div>
+ {{template "projects/view" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl
index 879e5328f2..0d775ed6a0 100644
--- a/templates/repo/pulls/fork.tmpl
+++ b/templates/repo/pulls/fork.tmpl
@@ -6,28 +6,28 @@
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
- <form class="ui form left-right-form" action="{{.Link}}" method="post">
+ <form class="ui form form-fetch-action left-right-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="inline required field {{if .Err_Owner}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
- <div class="ui selection owner dropdown">
+ <div class="ui selection owner dropdown ellipsis-text-items">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
- <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
+ <span class="text" title="{{.ContextUser.Name}}">
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ {{.ContextUser.ShortName 40}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
{{if .CanForkToUser}}
- <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
+ <div class="item" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ {{.SignedUser.ShortName 40}}
</div>
{{end}}
{{range .Orgs}}
- <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
+ <div class="item" data-value="{{.ID}}" title="{{.Name}}">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ {{.ShortName 40}}
</div>
{{end}}
</div>
@@ -52,10 +52,10 @@
</div>
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.fork_branch"}}</label>
- <div class="ui selection dropdown ellipsis-items-nowrap">
+ <div class="ui selection dropdown ellipsis-text-items">
<input type="hidden" id="fork_single_branch" name="fork_single_branch" value="" required>
<div class="text" title="{{ctx.Locale.Tr "repo.all_branches"}}">
- <span class="truncated-item-name">{{ctx.Locale.Tr "repo.all_branches"}}</span>
+ {{ctx.Locale.Tr "repo.all_branches"}}
</div>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
@@ -75,7 +75,7 @@
<div class="inline field">
<label></label>
- <button class="ui primary button{{if not .CanForkRepo}} disabled{{end}}">
+ <button class="ui primary button{{if not .CanForkRepoInNewOwner}} disabled{{end}}">
{{ctx.Locale.Tr "repo.fork_repo"}}
</button>
</div>
diff --git a/templates/repo/pulse.tmpl b/templates/repo/pulse.tmpl
index 12fbb85410..cbafee9ba9 100644
--- a/templates/repo/pulse.tmpl
+++ b/templates/repo/pulse.tmpl
@@ -1,12 +1,12 @@
<h2 class="ui header activity-header">
<span>{{DateUtils.AbsoluteLong .DateFrom}} - {{DateUtils.AbsoluteLong .DateUntil}}</span>
<!-- Period -->
- <div class="ui floating dropdown jump filter">
+ <div class="ui floating dropdown jump">
<div class="ui basic compact button">
{{ctx.Locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
- <div class="menu">
+ <div class="left menu">
<a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{ctx.Locale.Tr "repo.activity.period.daily"}}</a>
<a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{ctx.Locale.Tr "repo.activity.period.halfweekly"}}</a>
<a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{ctx.Locale.Tr "repo.activity.period.weekly"}}</a>
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index 432c3309ce..882ffe40b7 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -50,7 +50,11 @@
{{svg (MigrationIcon $release.Repo.GetOriginalURLHostname) 20 "tw-mr-1"}}{{$release.OriginalAuthor}}
{{else if $release.Publisher}}
{{ctx.AvatarUtils.Avatar $release.Publisher 20 "tw-mr-1"}}
- <a href="{{$release.Publisher.HomeLink}}">{{$release.Publisher.GetDisplayName}}</a>
+ {{if gt $release.PublisherID 0}}
+ <a href="{{$release.Publisher.HomeLink}}">{{$release.Publisher.GetDisplayName}}</a>
+ {{else}}
+ {{$release.Publisher.GetDisplayName}}
+ {{end}}
{{else}}
Ghost
{{end}}
@@ -61,7 +65,7 @@
{{if $release.CreatedUnix}}
<span class="time">{{DateUtils.TimeSince $release.CreatedUnix}}</span>
{{end}}
- {{if and (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
+ {{if and (gt $release.NumCommits 0) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{$release.TagName | PathEscapeSegments}}...{{$release.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}}</span>
{{end}}
</p>
@@ -73,25 +77,31 @@
<summary>
{{ctx.Locale.Tr "repo.release.downloads"}}
</summary>
- <ul class="list">
+ <ul class="ui divided list attachment-list">
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
- <li>
- <a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
+ <li class="item">
+ <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
+ <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
+ </a>
</li>
- <li>
- <a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
+ <li class="item">
+ <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
+ <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
+ </a>
</li>
{{end}}
- {{range $release.Attachments}}
- <li>
- <a target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
- <strong>{{svg "octicon-package" 16 "download-icon"}}{{.Name}}</strong>
+ {{range $att := $release.Attachments}}
+ <li class="item">
+ <a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}">
+ <strong class="flex-text-inline">{{svg "octicon-package" 16 "download-icon"}}<span class="gt-ellipsis">{{$att.Name}}</span></strong>
</a>
- <div>
- <span class="text grey">{{.Size | FileSize}}</span>
- <span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
+ <div class="attachment-right-info flex-text-inline">
+ <span class="tw-pl-5">{{$att.Size | FileSize}}</span>
+ <span class="flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber $att.DownloadCount)}}">
{{svg "octicon-info"}}
</span>
+ <div class="tw-flex-1"></div>
+ {{DateUtils.TimeSince $att.CreatedUnix}}
</div>
</li>
{{end}}
diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl
index 8b6aa252af..109a18fa0e 100644
--- a/templates/repo/release/new.tmpl
+++ b/templates/repo/release/new.tmpl
@@ -100,12 +100,12 @@
</div>
<span class="help">{{ctx.Locale.Tr "repo.release.prerelease_helper"}}</span>
<div class="divider tw-mt-0"></div>
- <div class="tw-flex tw-justify-end">
+ <div class="flex-text-block tw-justify-end">
{{if .PageIsEditRelease}}
<a class="ui small button" href="{{.RepoLink}}/releases">
{{ctx.Locale.Tr "repo.release.cancel"}}
</a>
- <a class="ui small red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}">
+ <a class="ui small red button link-action" data-modal-confirm="#repo-release-delete-modal" data-url="{{$.RepoLink}}/releases/delete?id={{.ID}}">
{{ctx.Locale.Tr "repo.release.delete_release"}}
</a>
{{if .IsDraft}}
@@ -129,15 +129,11 @@
</div>
{{if .PageIsEditRelease}}
- <div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.release.deletion"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.release.deletion_desc"}}</p>
- </div>
+ <div class="ui small modal" id="repo-release-delete-modal">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.release.deletion"}}</div>
+ <div class="content"><p>{{ctx.Locale.Tr "repo.release.deletion_desc"}}</p></div>
{{template "base/modal_actions_confirm" .}}
</div>
{{end}}
+
{{template "base/footer" .}}
diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl
index fb17cf44c4..12acf4bfeb 100644
--- a/templates/repo/release_tag_header.tmpl
+++ b/templates/repo/release_tag_header.tmpl
@@ -2,7 +2,7 @@
{{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
{{if $canReadReleases}}
- <div class="tw-flex">
+ <div class="flex-text-block">
<div class="tw-flex-1 tw-flex tw-items-center">
<h2 class="ui compact small menu small-menu-items">
<a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl
index ef4732540b..e8e7a3f1c2 100644
--- a/templates/repo/settings/branches.tmpl
+++ b/templates/repo/settings/branches.tmpl
@@ -49,8 +49,8 @@
</div>
</div>
<div class="flex-item-trailing">
- <a class="rm ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{ctx.Locale.Tr "repo.settings.edit_protected_branch"}}</a>
- <button class="ui red tiny button delete-button" data-url="{{$.Repository.Link}}/settings/branches/{{.ID}}/delete" data-id="{{.ID}}">
+ <a class="ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{ctx.Locale.Tr "repo.settings.edit_protected_branch"}}</a>
+ <button class="ui red tiny button link-action" data-modal-confirm="#repo-branch-protection-delete-modal" data-url="{{$.Repository.Link}}/settings/branches/{{.ID}}/delete?id={{.ID}}">
{{ctx.Locale.Tr "repo.settings.protected_branch.delete_rule"}}
</button>
</div>
@@ -65,14 +65,9 @@
{{end}}
</div>
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.settings.protected_branch_deletion"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p>
- </div>
+<div class="ui small modal" id="repo-branch-protection-delete-modal">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.settings.protected_branch_deletion"}}</div>
+ <div class="content"><p>{{ctx.Locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p></div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl
index 4461398258..62903e1cfb 100644
--- a/templates/repo/settings/collaboration.tmpl
+++ b/templates/repo/settings/collaboration.tmpl
@@ -29,7 +29,7 @@
</div>
</div>
</div>
- <button class="ui red tiny button inline delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
+ <button class="ui red tiny button link-action" data-modal-confirm="#repo-collaborator-delete-modal" data-url="{{$.Link}}/delete?id={{.ID}}">
{{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
</button>
</div>
@@ -63,19 +63,39 @@
{{.Name}}
</a>
<div class="flex-item-body flex-text-block">
+ {{/*FIXME: TEAM-UNIT-PERMISSION this display is not right, search the fixme keyword to see more details */}}
{{svg "octicon-shield-lock"}}
- {{if eq .AccessMode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{ctx.Locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}}
+ {{if eq .AccessMode 0}}
+ {{ctx.Locale.Tr "repo.settings.collaboration.per_unit"}}
+ {{else if eq .AccessMode 1}}
+ {{ctx.Locale.Tr "repo.settings.collaboration.read"}}
+ {{else if eq .AccessMode 2}}
+ {{ctx.Locale.Tr "repo.settings.collaboration.write"}}
+ {{else if eq .AccessMode 3}}
+ {{ctx.Locale.Tr "repo.settings.collaboration.admin"}}
+ {{else if eq .AccessMode 4}}
+ {{ctx.Locale.Tr "repo.settings.collaboration.owner"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}
+ {{end}}
</div>
- {{if or (eq .AccessMode 1) (eq .AccessMode 2)}}
+ {{if or (eq .AccessMode 0) (eq .AccessMode 1) (eq .AccessMode 2)}}
{{$first := true}}
<div class="flex-item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}">
- Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled ctx $unit.Type) ($team.UnitEnabled ctx $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{ctx.Locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
+ Units:
+ {{range $u, $unit := $.Units}}
+ {{- if and ($.Repo.UnitEnabled ctx $unit.Type) ($team.UnitEnabled ctx $unit.Type) -}}
+ {{- Iif $first "" ", "}}{{ctx.Locale.Tr $unit.NameKey -}}
+ {{- $first = false -}}
+ {{- end -}}
+ {{end}}
+ {{if $first}}None{{end}}
</div>
{{end}}
</div>
{{if $allowedToChangeTeams}}
<div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
- <button class="ui red tiny button inline delete-button {{if .IncludesAllRepositories}}disabled{{end}}" data-url="{{$.Link}}/team/delete" data-id="{{.ID}}">
+ <button class="ui red tiny button link-action {{if .IncludesAllRepositories}}disabled{{end}}" data-modal-confirm="#repo-collaborator-delete-modal" data-url="{{$.Link}}/team/delete?id={{.ID}}">
{{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
</button>
</div>
@@ -90,7 +110,7 @@
<form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
{{.CsrfTokenHtml}}
<div id="search-team-box" class="ui search input tw-align-middle" data-org-name="{{.OrgName}}">
- <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" autofocus required>
+ <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" required>
</div>
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button>
</form>
@@ -103,14 +123,9 @@
{{end}}
</div>
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.settings.collaborator_deletion"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.settings.collaborator_deletion_desc"}}</p>
- </div>
+<div class="ui small modal" id="repo-collaborator-delete-modal">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.settings.collaborator_deletion"}}</div>
+ <div class="content"><p>{{ctx.Locale.Tr "repo.settings.collaborator_deletion_desc"}}</p></div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl
index 5eb2a47e5a..b82d584b22 100644
--- a/templates/repo/settings/deploy_keys.tmpl
+++ b/templates/repo/settings/deploy_keys.tmpl
@@ -59,7 +59,7 @@
</div>
</div>
<div class="flex-item-trailing">
- <button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
+ <button class="ui red tiny button link-action" data-modal-confirm="#repo-deploy-key-delete-modal" data-url="{{$.Link}}/delete?id={{.ID}}">
{{ctx.Locale.Tr "settings.delete_key"}}
</button>
</div>
@@ -72,14 +72,9 @@
</div>
</div>
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.settings.deploy_key_deletion"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
- </div>
+<div class="ui small modal" id="repo-deploy-key-delete-modal">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.settings.deploy_key_deletion"}}</div>
+ <div class="content"><p>{{ctx.Locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p></div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl
index 1a603f9fe8..9b17af1406 100644
--- a/templates/repo/settings/githooks.tmpl
+++ b/templates/repo/settings/githooks.tmpl
@@ -4,18 +4,14 @@
{{ctx.Locale.Tr "repo.settings.githooks"}}
</h4>
<div class="ui attached segment">
- <div class="ui list">
+ <div class="ui list flex-items-block">
+ <div class="item"><span>{{ctx.Locale.Tr "repo.settings.githooks_desc"}}</span></div>
+ {{range .Hooks}}
<div class="item">
- {{ctx.Locale.Tr "repo.settings.githooks_desc"}}
+ <span class="text {{if .IsActive}}green{{else}}grey{{end}}">{{svg "octicon-dot-fill" 22}}</span>
+ <span class="gt-ellipsis tw-flex-1">{{.Name}}</span>
+ <a class="muted tw-p-2" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}">{{svg "octicon-pencil"}}</a>
</div>
- {{range .Hooks}}
- <div class="item truncated-item-container">
- <span class="text {{if .IsActive}}green{{else}}grey{{end}} tw-mr-2">{{svg "octicon-dot-fill" 22}}</span>
- <span class="text truncate tw-flex-1 tw-mr-2">{{.Name}}</span>
- <a class="muted tw-float-right tw-p-2" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}">
- {{svg "octicon-pencil"}}
- </a>
- </div>
{{end}}
</div>
</div>
diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl
index 9f72d764ae..cd1b168401 100644
--- a/templates/repo/settings/lfs_file.tmpl
+++ b/templates/repo/settings/lfs_file.tmpl
@@ -21,7 +21,7 @@
{{else if not .IsTextFile}}
<div class="view-raw">
{{if .IsImageFile}}
- <img src="{{$.RawFileLink}}">
+ <img loading="lazy" alt="{{$.RawFileLink}}" src="{{$.RawFileLink}}">
{{else if .IsVideoFile}}
<video controls src="{{$.RawFileLink}}">
<strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>
@@ -30,8 +30,6 @@
<audio controls src="{{$.RawFileLink}}">
<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
- {{else if .IsPDFFile}}
- <div class="pdf-content is-loading" data-global-init="initPdfViewer" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "diff.view_file"}}"></div>
{{else}}
<a href="{{$.RawFileLink}}" rel="nofollow" class="tw-p-4">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
{{end}}
diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl
index 3e127ccbb3..3dd86d1f6a 100644
--- a/templates/repo/settings/navbar.tmpl
+++ b/templates/repo/settings/navbar.tmpl
@@ -4,6 +4,11 @@
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">
{{ctx.Locale.Tr "repo.settings.options"}}
</a>
+ {{if or .Repository.IsPrivate .Permission.HasAnyUnitPublicAccess}}
+ <a class="{{if .PageIsSettingsPublicAccess}}active {{end}}item" href="{{.RepoLink}}/settings/public_access">
+ {{ctx.Locale.Tr "repo.settings.public_access"}}
+ </a>
+ {{end}}
<a class="{{if .PageIsSettingsCollaboration}}active {{end}}item" href="{{.RepoLink}}/settings/collaboration">
{{ctx.Locale.Tr "repo.settings.collaboration"}}
</a>
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index aade734a1d..fc42056e0a 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -10,7 +10,7 @@
<input type="hidden" name="action" value="update">
<div class="required field {{if .Err_RepoName}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.repo_name"}}</label>
- <input name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
+ <input name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" required>
</div>
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.repo_size"}}</label>
@@ -310,15 +310,6 @@
<input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}>
<label>{{ctx.Locale.Tr "repo.code.desc"}}</label>
</div>
- <div class="inline field tw-pl-4">
- {{$unitCode := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeCode}}
- <label>{{ctx.Locale.Tr "repo.settings.default_permission_everyone_access"}}</label>
- <select name="default_code_everyone_access" class="ui selection dropdown">
- {{/* everyone access mode is different from others, none means it is unset and won't be applied */}}
- <option value="none" {{Iif (eq $unitCode.EveryoneAccessMode 0) "selected"}}>{{ctx.Locale.Tr "settings.permission_not_set"}}</option>
- <option value="read" {{Iif (eq $unitCode.EveryoneAccessMode 1) "selected"}}>{{ctx.Locale.Tr "settings.permission_read"}}</option>
- </select>
- </div>
</div>
{{$isInternalWikiEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeWiki}}
@@ -346,16 +337,6 @@
<label>{{ctx.Locale.Tr "repo.settings.default_wiki_branch_name"}}</label>
<input name="default_wiki_branch" value="{{.Repository.DefaultWikiBranch}}">
</div>
- <div class="inline field">
- {{$unitInternalWiki := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeWiki}}
- <label>{{ctx.Locale.Tr "repo.settings.default_permission_everyone_access"}}</label>
- <select name="default_wiki_everyone_access" class="ui selection dropdown">
- {{/* everyone access mode is different from others, none means it is unset and won't be applied */}}
- <option value="none" {{Iif (eq $unitInternalWiki.EveryoneAccessMode 0) "selected"}}>{{ctx.Locale.Tr "settings.permission_not_set"}}</option>
- <option value="read" {{Iif (eq $unitInternalWiki.EveryoneAccessMode 1) "selected"}}>{{ctx.Locale.Tr "settings.permission_read"}}</option>
- <option value="write" {{Iif (eq $unitInternalWiki.EveryoneAccessMode 2) "selected"}}>{{ctx.Locale.Tr "settings.permission_write"}}</option>
- </select>
- </div>
</div>
<div class="field">
<div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
@@ -391,15 +372,6 @@
</div>
</div>
<div class="field tw-pl-4 {{if (.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
- <div class="inline field">
- {{$unitIssue := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeIssues}}
- <label>{{ctx.Locale.Tr "repo.settings.default_permission_everyone_access"}}</label>
- <select name="default_issues_everyone_access" class="ui selection dropdown">
- {{/* everyone access mode is different from others, none means it is unset and won't be applied */}}
- <option value="none" {{Iif (eq $unitIssue.EveryoneAccessMode 0) "selected"}}>{{ctx.Locale.Tr "settings.permission_not_set"}}</option>
- <option value="read" {{Iif (eq $unitIssue.EveryoneAccessMode 1) "selected"}}>{{ctx.Locale.Tr "settings.permission_read"}}</option>
- </select>
- </div>
{{if .Repository.CanEnableTimetracker}}
<div class="field">
<div class="ui checkbox">
@@ -830,7 +802,7 @@
</div>
</div>
{{end}}
- {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
+ {{if .CanConvertFork}}
<div class="flex-item">
<div class="flex-item-main">
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div>
@@ -944,7 +916,7 @@
</div>
</div>
{{end}}
- {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
+ {{if .CanConvertFork}}
<div class="ui small modal" id="convert-fork-repo-modal">
<div class="header">
{{ctx.Locale.Tr "repo.settings.convert_fork"}}
diff --git a/templates/repo/settings/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl
index 61cc6077a1..3c311c18c3 100644
--- a/templates/repo/settings/protected_branch.tmpl
+++ b/templates/repo/settings/protected_branch.tmpl
@@ -2,13 +2,17 @@
<div class="repo-setting-content">
<form class="ui form" action="{{.Link}}" method="post">
<h4 class="ui top attached header">
- {{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}}
+ {{if .Rule.RuleName}}
+ {{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.settings.branches.add_new_rule"}}
+ {{end}}
</h4>
<div class="ui attached segment branch-protection">
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5>
- <div class="field">
+ <div class="field required">
<label>{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern"}}</label>
- <input name="rule_name" type="text" value="{{.Rule.RuleName}}">
+ <input name="rule_name" type="text" value="{{.Rule.RuleName}}" required>
<input name="rule_id" type="hidden" value="{{.Rule.ID}}">
<p class="help tw-ml-0">{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern_desc" "https://github.com/gobwas/glob"}}</p>
</div>
diff --git a/templates/repo/settings/public_access.tmpl b/templates/repo/settings/public_access.tmpl
new file mode 100644
index 0000000000..c1c198bcce
--- /dev/null
+++ b/templates/repo/settings/public_access.tmpl
@@ -0,0 +1,54 @@
+{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
+<div class="repo-setting-content">
+ <h4 class="ui top attached header">
+ {{ctx.Locale.Tr "repo.settings.public_access"}}
+ </h4>
+ <div class="ui attached segment">
+ <p>
+ {{ctx.Locale.Tr "repo.settings.public_access_desc"}}
+ </p>
+ {{$paNotSet := "not-set"}}
+ {{$paAnonymousRead := "anonymous-read"}}
+ {{$paEveryoneRead := "everyone-read"}}
+ {{$paEveryoneWrite := "everyone-write"}}
+ <form class="ui form" method="post">
+ {{.CsrfTokenHtml}}
+ <table class="ui table unstackable tw-my-2">
+ <thead>
+ <tr>
+ <th>{{ctx.Locale.Tr "units.unit"}}</th>
+ <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_not_set"}}</th>
+ <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_anonymous_read"}}</th>
+ <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_everyone_read"}}</th>
+ <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_everyone_write"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range $ua := .RepoUnitPublicAccesses}}
+ <tr>
+ <td>{{$ua.DisplayName}}</td>
+ <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paNotSet}}" {{Iif (eq $paNotSet $ua.UnitPublicAccess) "checked"}}></label></td>
+ <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paAnonymousRead}}" {{Iif (eq $paAnonymousRead $ua.UnitPublicAccess) "checked"}}></label></td>
+ <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneRead}}" {{Iif (eq $paEveryoneRead $ua.UnitPublicAccess) "checked"}}></label></td>
+ <td class="tw-text-center">
+ {{if SliceUtils.Contains $ua.PublicAccessTypes $paEveryoneWrite}}
+ <label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneWrite}}" {{Iif (eq $paEveryoneWrite $ua.UnitPublicAccess) "checked"}}></label>
+ {{else}}
+ -
+ {{end}}
+ </td>
+ </tr>
+ {{end}}
+ </tbody>
+ </table>
+ <ul class="tw-my-3 tw-pl-5 tw-flex tw-flex-col tw-gap-3">
+ <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.not_set"}}</li>
+ <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.anonymous_read"}}</li>
+ <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_read"}}</li>
+ <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_write"}}</li>
+ </ul>
+ <button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
+ </form>
+ </div>
+</div>
+{{template "repo/settings/layout_footer" .}}
diff --git a/templates/repo/settings/webhook/base.tmpl b/templates/repo/settings/webhook/base.tmpl
index d524722454..39bb7a9fe0 100644
--- a/templates/repo/settings/webhook/base.tmpl
+++ b/templates/repo/settings/webhook/base.tmpl
@@ -1,5 +1,5 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings webhooks")}}
<div class="repo-setting-content">
- {{template "repo/settings/webhook/list" .}}
+ {{template "repo/settings/webhook/base_list" .}}
</div>
{{template "repo/settings/layout_footer" .}}
diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl
index 36e75a7eb5..a808d4122f 100644
--- a/templates/repo/settings/webhook/base_list.tmpl
+++ b/templates/repo/settings/webhook/base_list.tmpl
@@ -8,18 +8,19 @@
</div>
</h4>
<div class="ui attached segment">
- <div class="ui list">
- <div class="item">
- {{.Description}}
- </div>
+ <div class="ui list flex-items-block">
+ <div class="item"><span>{{.Description}}</span></div>
{{range .Webhooks}}
- <div class="item truncated-item-container">
- <span class="text {{if eq .LastStatus 1}}green{{else if eq .LastStatus 2}}red{{else}}grey{{end}} tw-mr-2">{{svg "octicon-dot-fill" 22}}</span>
- <div class="text truncate tw-flex-1 tw-mr-2">
+ <div class="item">
+ <span class="text {{if eq .LastStatus 1}}green{{else if eq .LastStatus 2}}red{{else}}grey{{end}}">{{svg "octicon-dot-fill" 22}}</span>
+ <div class="gt-ellipsis tw-flex-1">
<a title="{{.URL}}" href="{{$.BaseLink}}/{{.ID}}">{{.URL}}</a>
</div>
<a class="muted tw-p-2" href="{{$.BaseLink}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
- <a class="delete-button tw-p-2" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}}</a>
+ <a class="text red tw-p-2 link-action"
+ data-url="{{$.Link}}/delete?id={{.ID}}"
+ data-modal-confirm="{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}"
+ >{{svg "octicon-trash"}}</a>
</div>
{{end}}
</div>
diff --git a/templates/repo/settings/webhook/delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl
deleted file mode 100644
index 9955ed3a2f..0000000000
--- a/templates/repo/settings/webhook/delete_modal.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.settings.webhook_deletion"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}</p>
- </div>
- {{template "base/modal_actions_confirm" .}}
-</div>
diff --git a/templates/repo/settings/webhook/dingtalk.tmpl b/templates/repo/settings/webhook/dingtalk.tmpl
index 0ba99e98ee..dd208cde17 100644
--- a/templates/repo/settings/webhook/dingtalk.tmpl
+++ b/templates/repo/settings/webhook/dingtalk.tmpl
@@ -6,6 +6,7 @@
<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{/* FIXME: support authorization header or not? */}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/discord.tmpl b/templates/repo/settings/webhook/discord.tmpl
index 104346e042..fa66249fa5 100644
--- a/templates/repo/settings/webhook/discord.tmpl
+++ b/templates/repo/settings/webhook/discord.tmpl
@@ -14,6 +14,7 @@
<label for="icon_url">{{ctx.Locale.Tr "repo.settings.discord_icon_url"}}</label>
<input id="icon_url" name="icon_url" value="{{.DiscordHook.IconURL}}" placeholder="https://example.com/assets/img/logo.svg">
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{/* FIXME: support authorization header or not? */}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/feishu.tmpl b/templates/repo/settings/webhook/feishu.tmpl
index d80deab26f..13bd0d92a1 100644
--- a/templates/repo/settings/webhook/feishu.tmpl
+++ b/templates/repo/settings/webhook/feishu.tmpl
@@ -1,12 +1,14 @@
{{if eq .HookType "feishu"}}
- <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (ctx.Locale.Tr "repo.settings.web_hook_name_feishu")}}</p>
- <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (ctx.Locale.Tr "repo.settings.web_hook_name_larksuite")}}</p>
+ <p>
+ {{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (ctx.Locale.Tr "repo.settings.web_hook_name_feishu")}}
+ {{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (ctx.Locale.Tr "repo.settings.web_hook_name_larksuite")}}
+ </p>
<form class="ui form" action="{{.BaseLink}}/feishu/{{or .Webhook.ID "new"}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseRequestSecret" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl
index e6eb61ea92..30f14d609b 100644
--- a/templates/repo/settings/webhook/gitea.tmpl
+++ b/templates/repo/settings/webhook/gitea.tmpl
@@ -31,10 +31,11 @@
</div>
</div>
</div>
- <div class="field {{if .Err_Secret}}error{{end}}">
- <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label>
- <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
- </div>
- {{template "repo/settings/webhook/settings" .}}
+ {{template "repo/settings/webhook/settings" dict
+ "BaseLink" .BaseLink
+ "Webhook" .Webhook
+ "UseAuthorizationHeader" "optional"
+ "UseRequestSecret" "optional"
+ }}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl
index e91a3279e4..c0e054602a 100644
--- a/templates/repo/settings/webhook/gogs.tmpl
+++ b/templates/repo/settings/webhook/gogs.tmpl
@@ -19,10 +19,11 @@
</div>
</div>
</div>
- <div class="field {{if .Err_Secret}}error{{end}}">
- <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label>
- <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
- </div>
- {{template "repo/settings/webhook/settings" .}}
+ {{template "repo/settings/webhook/settings" dict
+ "BaseLink" .BaseLink
+ "Webhook" .Webhook
+ "UseAuthorizationHeader" "optional"
+ "UseRequestSecret" "optional"
+ }}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/history.tmpl b/templates/repo/settings/webhook/history.tmpl
index ea3c037813..953ba69670 100644
--- a/templates/repo/settings/webhook/history.tmpl
+++ b/templates/repo/settings/webhook/history.tmpl
@@ -26,7 +26,7 @@
{{else}}
<span class="text red">{{svg "octicon-alert"}}</span>
{{end}}
- <a class="ui primary sha label toggle button show-panel" data-panel="#info-{{.ID}}">{{.UUID}}</a>
+ <button class="btn interact-bg tw-p-2 toggle show-panel" data-panel="#info-{{.ID}}">{{.UUID}}</button>
</div>
<span class="text grey">
{{DateUtils.TimeSince .Delivered}}
diff --git a/templates/repo/settings/webhook/list.tmpl b/templates/repo/settings/webhook/list.tmpl
deleted file mode 100644
index b24159fccb..0000000000
--- a/templates/repo/settings/webhook/list.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-
-{{template "repo/settings/webhook/base_list" .}}
-
-{{template "repo/settings/webhook/delete_modal" .}}
diff --git a/templates/repo/settings/webhook/matrix.tmpl b/templates/repo/settings/webhook/matrix.tmpl
index 7f1c9f08e6..e0aad2d807 100644
--- a/templates/repo/settings/webhook/matrix.tmpl
+++ b/templates/repo/settings/webhook/matrix.tmpl
@@ -22,6 +22,6 @@
</div>
</div>
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "required"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/msteams.tmpl b/templates/repo/settings/webhook/msteams.tmpl
index 62ea24e763..17718a1064 100644
--- a/templates/repo/settings/webhook/msteams.tmpl
+++ b/templates/repo/settings/webhook/msteams.tmpl
@@ -6,6 +6,7 @@
<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{/* FIXME: support authorization header or not? */}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/packagist.tmpl b/templates/repo/settings/webhook/packagist.tmpl
index 25aba2a435..c813e7c2af 100644
--- a/templates/repo/settings/webhook/packagist.tmpl
+++ b/templates/repo/settings/webhook/packagist.tmpl
@@ -14,6 +14,7 @@
<label for="package_url">{{ctx.Locale.Tr "repo.settings.packagist_package_url"}}</label>
<input id="package_url" name="package_url" value="{{.PackagistHook.PackageURL}}" placeholder="https://packagist.org/packages/laravel/framework" required>
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{/* FIXME: support authorization header or not? */}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/settings.tmpl b/templates/repo/settings/webhook/settings.tmpl
index 16ad263e42..a8ad1d6c9e 100644
--- a/templates/repo/settings/webhook/settings.tmpl
+++ b/templates/repo/settings/webhook/settings.tmpl
@@ -1,4 +1,52 @@
-{{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}}
+{{/* Template attributes:
+- BaseLink: Base URL for the repository settings
+- WebHook: Webhook object containing details about the webhook
+- UseAuthorizationHeader: optional or required
+- UseRequestSecret: optional or required
+*/}}
+{{$isNew := not .Webhook.ID}}
+
+<div class="inline field">
+ <div class="ui checkbox">
+ <input name="active" type="checkbox" {{if or $isNew .Webhook.IsActive}}checked{{end}}>
+ <label>{{ctx.Locale.Tr "repo.settings.active"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.active_helper"}}</span>
+ </div>
+</div>
+
+<!-- Authorization Header -->
+{{if .UseAuthorizationHeader}}
+ {{$attributeValid := or (eq .UseAuthorizationHeader "optional") (eq .UseAuthorizationHeader "required")}}
+ {{if not $attributeValid}}<div class="ui error message">Invalid UseAuthorizationHeader: {{.UseAuthorizationHeader}}}</div>{{end}}
+ {{$required := eq .UseAuthorizationHeader "required"}}
+ <div class="field {{if $required}}required{{end}}">
+ <label>{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label>
+ <input name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}" {{if $required}}required placeholder="Bearer $access_token"{{end}}>
+ {{if not $required}}
+ <span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" (HTMLFormat "<code>%s</code>, <code>%s</code>" "Bearer token123456" "Basic YWxhZGRpbjpvcGVuc2VzYW1l")}}</span>
+ {{end}}
+ </div>
+{{end}}
+
+<!-- Secret -->
+{{if .UseRequestSecret}}
+ {{$attributeValid := or (eq .UseRequestSecret "optional") (eq .UseRequestSecret "required")}}
+ {{if not $attributeValid}}<div class="ui error message">Invalid UseRequestSecret: {{.UseRequestSecret}}}</div>{{end}}
+ {{$required := eq .UseRequestSecret "required"}}
+ <div class="field {{if $required}}required{{end}}">
+ <label>{{ctx.Locale.Tr "repo.settings.secret"}}</label>
+ <input name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off" {{if $required}}required{{end}}>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.webhook_secret_desc"}}</span>
+ </div>
+{{end}}
+
+<!-- Branch filter -->
+<div class="field">
+ <label>{{ctx.Locale.Tr "repo.settings.branch_filter"}}</label>
+ <input name="branch_filter" type="text" value="{{or .Webhook.BranchFilter "*"}}">
+ <span class="help">{{ctx.Locale.Tr "repo.settings.branch_filter_desc" "https://pkg.go.dev/github.com/gobwas/glob#Compile" "github.com/gobwas/glob"}}</span>
+</div>
+
<div class="field">
<h4>{{ctx.Locale.Tr "repo.settings.event_desc"}}</h4>
<div class="grouped event type fields">
@@ -263,6 +311,16 @@
<div class="fourteen wide column">
<label>{{ctx.Locale.Tr "repo.settings.event_header_workflow"}}</label>
</div>
+ <!-- Workflow Run Event -->
+ <div class="seven wide column">
+ <div class="field">
+ <div class="ui checkbox">
+ <input name="workflow_run" type="checkbox" {{if .Webhook.HookEvents.Get "workflow_run"}}checked{{end}}>
+ <label>{{ctx.Locale.Tr "repo.settings.event_workflow_run"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_workflow_run_desc"}}</span>
+ </div>
+ </div>
+ </div>
<!-- Workflow Job Event -->
<div class="seven wide column">
<div class="field">
@@ -276,38 +334,14 @@
</div>
</div>
-<!-- Branch filter -->
-<div class="field">
- <label for="branch_filter">{{ctx.Locale.Tr "repo.settings.branch_filter"}}</label>
- <input id="branch_filter" name="branch_filter" type="text" value="{{or .Webhook.BranchFilter "*"}}">
- <span class="help">{{ctx.Locale.Tr "repo.settings.branch_filter_desc" "https://pkg.go.dev/github.com/gobwas/glob#Compile" "github.com/gobwas/glob"}}</span>
-</div>
-
-<!-- Authorization Header -->
-<div class="field{{if eq .HookType "matrix"}} required{{end}}">
- <label for="authorization_header">{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label>
- <input id="authorization_header" name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}"{{if eq .HookType "matrix"}} placeholder="Bearer $access_token" required{{end}}>
- {{if ne .HookType "matrix"}}{{/* Matrix doesn't make the authorization optional but it is implied by the help string, should be changed.*/}}
- <span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" ("<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | SafeHTML)}}</span>
- {{end}}
-</div>
-
-<div class="divider"></div>
-
-<div class="inline field">
- <div class="ui checkbox">
- <input name="active" type="checkbox" {{if or $isNew .Webhook.IsActive}}checked{{end}}>
- <label>{{ctx.Locale.Tr "repo.settings.active"}}</label>
- <span class="help">{{ctx.Locale.Tr "repo.settings.active_helper"}}</span>
- </div>
-</div>
<div class="field">
{{if $isNew}}
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</button>
{{else}}
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_webhook"}}</button>
- <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a>
+ <a class="ui red button link-action"
+ data-url="{{.BaseLink}}/delete?id={{.Webhook.ID}}"
+ data-modal-confirm="{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}"
+ >{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a>
{{end}}
</div>
-
-{{template "repo/settings/webhook/delete_modal" .}}
diff --git a/templates/repo/settings/webhook/slack.tmpl b/templates/repo/settings/webhook/slack.tmpl
index e7cae92d4b..519d6afa1a 100644
--- a/templates/repo/settings/webhook/slack.tmpl
+++ b/templates/repo/settings/webhook/slack.tmpl
@@ -23,6 +23,7 @@
<label for="color">{{ctx.Locale.Tr "repo.settings.slack_color"}}</label>
<input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="#dd4b39, good, warning, danger">
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{/* FIXME: support authorization header or not? */}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl
index f92c2be0db..5ab89b72cc 100644
--- a/templates/repo/settings/webhook/telegram.tmpl
+++ b/templates/repo/settings/webhook/telegram.tmpl
@@ -14,6 +14,7 @@
<label for="thread_id">{{ctx.Locale.Tr "repo.settings.thread_id"}}</label>
<input id="thread_id" name="thread_id" type="text" value="{{.TelegramHook.ThreadID}}">
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{/* FIXME: support authorization header or not? */}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/settings/webhook/wechatwork.tmpl b/templates/repo/settings/webhook/wechatwork.tmpl
index 78a1617123..cbc29b4610 100644
--- a/templates/repo/settings/webhook/wechatwork.tmpl
+++ b/templates/repo/settings/webhook/wechatwork.tmpl
@@ -6,6 +6,7 @@
<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
</div>
- {{template "repo/settings/webhook/settings" .}}
+ {{/* FIXME: support authorization header or not? */}}
+ {{template "repo/settings/webhook/settings" dict "BaseLink" .BaseLink "Webhook" .Webhook "UseAuthorizationHeader" "optional"}}
</form>
{{end}}
diff --git a/templates/repo/star_unstar.tmpl b/templates/repo/star_unstar.tmpl
index 9234a0d196..dea965ab30 100644
--- a/templates/repo/star_unstar.tmpl
+++ b/templates/repo/star_unstar.tmpl
@@ -1,10 +1,10 @@
-<form hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}unstar{{else}}star{{end}}">
+<form class="flex-text-inline" hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}unstar{{else}}star{{end}}">
<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.star_guest_user"}}"{{end}}>
{{$buttonText := ctx.Locale.Tr "repo.star"}}
{{if $.IsStaringRepo}}{{$buttonText = ctx.Locale.Tr "repo.unstar"}}{{end}}
<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}">
{{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}}
- <span aria-hidden="true">{{$buttonText}}</span>
+ <span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
</button>
<a hx-boost="false" class="ui basic label" href="{{$.RepoLink}}/stars">
{{CountFmt .Repository.NumStars}}
diff --git a/templates/repo/tag/list.tmpl b/templates/repo/tag/list.tmpl
index 9789943b49..8b33b96f86 100644
--- a/templates/repo/tag/list.tmpl
+++ b/templates/repo/tag/list.tmpl
@@ -5,9 +5,7 @@
{{template "base/alert" .}}
{{template "repo/release_tag_header" .}}
<h4 class="ui top attached header">
- <div class="five wide column tw-flex tw-items-center">
- {{.TagCount}} {{ctx.Locale.Tr "repo.release.tags"}}
- </div>
+ {{.TagCount}} {{ctx.Locale.Tr "repo.release.tags"}}
</h4>
{{$canReadReleases := $.Permission.CanRead ctx.Consts.RepoUnitTypeReleases}}
<div class="ui attached segment">
@@ -15,53 +13,49 @@
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.tag_kind") "Tooltip" (ctx.Locale.Tr "search.tag_tooltip")}}
</form>
</div>
- <div class="ui attached table segment">
+ <div class="ui attached segment tw-p-0">
{{if .Releases}}
- <table class="ui very basic striped fixed table single line" id="tags-table">
- <tbody class="tag-list">
- {{range $idx, $release := .Releases}}
- <tr>
- <td class="tag-list-row">
- <h3 class="tag-list-row-title tw-mb-2">
- {{if $canReadReleases}}
- <a class="tag-list-row-link tw-flex tw-items-center" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a>
- {{else}}
- <a class="tag-list-row-link tw-flex tw-items-center" href="{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a>
- {{end}}
- </h3>
- <div class="download tw-flex tw-items-center">
- {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
- {{if .CreatedUnix}}
- <span class="tw-mr-2">{{svg "octicon-clock" 16 "tw-mr-1"}}{{DateUtils.TimeSince .CreatedUnix}}</span>
- {{end}}
+ <div class="ui divided list" id="tags-table">
+ {{range $idx, $release := .Releases}}
+ <div class="item tag-list-row tw-p-4">
+ <h3 class="tag-list-row-title tw-mb-2">
+ {{if $canReadReleases}}
+ <a class="tag-list-row-link" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a>
+ {{else}}
+ <a class="tag-list-row-link" href="{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a>
+ {{end}}
+ </h3>
+ <div class="flex-text-block muted-links tw-gap-4 tw-flex-wrap">
+ {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
+ {{if .CreatedUnix}}
+ <span class="flex-text-inline">{{svg "octicon-clock"}}{{DateUtils.TimeSince .CreatedUnix}}</span>
+ {{end}}
- <a class="tw-mr-2 tw-font-mono muted" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .Sha1}}</a>
+ <a class="flex-text-inline tw-font-mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit"}}{{ShortSha .Sha1}}</a>
- {{if not $.DisableDownloadSourceArchives}}
- <a class="archive-link tw-mr-2 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-1"}}ZIP</a>
- <a class="archive-link tw-mr-2 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-1"}}TAR.GZ</a>
- {{end}}
+ {{if not $.DisableDownloadSourceArchives}}
+ <a class="archive-link flex-text-inline" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}ZIP</a>
+ <a class="archive-link flex-text-inline" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}TAR.GZ</a>
+ {{end}}
- {{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}}
- <a class="tw-mr-2 muted" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.new_release"}}</a>
- {{end}}
+ {{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}}
+ <a class="flex-text-inline" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.release.new_release"}}</a>
+ {{end}}
- {{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}}
- <a class="ui delete-button tw-mr-2 muted" data-url="{{$.RepoLink}}/tags/delete" data-id="{{.ID}}">
- {{svg "octicon-trash" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.delete_tag"}}
- </a>
- {{end}}
+ {{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}}
+ <a class="flex-text-inline link-action" data-url="{{$.RepoLink}}/tags/delete?id={{.ID}}" data-modal-confirm="#confirm-delete-tag-modal">
+ {{svg "octicon-trash"}}{{ctx.Locale.Tr "repo.release.delete_tag"}}
+ </a>
+ {{end}}
- {{if and $canReadReleases (not $release.IsTag)}}
- <a class="tw-mr-2 muted" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.detail"}}</a>
- {{end}}
- {{end}}
- </div>
- </td>
- </tr>
- {{end}}
- </tbody>
- </table>
+ {{if and $canReadReleases (not $release.IsTag)}}
+ <a class="flex-text-inline" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.release.detail"}}</a>
+ {{end}}
+ {{end}}
+ </div>
+ </div>
+ {{end}}
+ </div>
{{else}}
{{if .NumTags}}
<p class="tw-p-4">{{ctx.Locale.Tr "no_results_found"}}</p>
@@ -73,9 +67,8 @@
</div>
{{if $.Permission.CanWrite ctx.Consts.RepoUnitTypeCode}}
-<div class="ui g-modal-confirm delete modal">
+<div id="confirm-delete-tag-modal" class="ui small modal">
<div class="header">
- {{svg "octicon-trash"}}
{{ctx.Locale.Tr "repo.release.delete_tag"}}
</div>
<div class="content">
diff --git a/templates/repo/tag/name.tmpl b/templates/repo/tag/name.tmpl
index c3042014d3..24e7de046d 100644
--- a/templates/repo/tag/name.tmpl
+++ b/templates/repo/tag/name.tmpl
@@ -1,3 +1,3 @@
-<a class="ui label basic tiny button{{if .IsRelease}} primary{{end}}" href="{{.RepoLink}}/src/tag/{{.TagName|PathEscape}}">
+<a class="ui basic label {{if .IsRelease}}primary{{end}} {{.AdditionalClasses}}" href="{{.RepoLink}}/src/tag/{{.TagName|PathEscape}}">
{{svg "octicon-tag"}} {{.TagName}}
</a>
diff --git a/templates/repo/unicode_escape_prompt.tmpl b/templates/repo/unicode_escape_prompt.tmpl
index 8bceafa8bb..f8226ec728 100644
--- a/templates/repo/unicode_escape_prompt.tmpl
+++ b/templates/repo/unicode_escape_prompt.tmpl
@@ -1,22 +1,22 @@
{{if .EscapeStatus}}
{{if .EscapeStatus.HasInvisible}}
- <div class="ui warning message unicode-escape-prompt tw-text-left">
+ <div class="ui warning message unicode-escape-prompt">
<button class="btn close icon hide-panel" data-panel-closest=".message">{{svg "octicon-x" 16 "close inside"}}</button>
<div class="header">
{{ctx.Locale.Tr "repo.invisible_runes_header"}}
</div>
- <p>{{ctx.Locale.Tr "repo.invisible_runes_description"}}</p>
+ <div>{{ctx.Locale.Tr "repo.invisible_runes_description"}}</div>
{{if .EscapeStatus.HasAmbiguous}}
- <p>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</p>
+ <div>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</div>
{{end}}
</div>
{{else if .EscapeStatus.HasAmbiguous}}
- <div class="ui warning message unicode-escape-prompt tw-text-left">
+ <div class="ui warning message unicode-escape-prompt">
<button class="btn close icon hide-panel" data-panel-closest=".message">{{svg "octicon-x" 16 "close inside"}}</button>
<div class="header">
{{ctx.Locale.Tr "repo.ambiguous_runes_header"}}
</div>
- <p>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</p>
+ <div>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</div>
</div>
{{end}}
{{end}}
diff --git a/templates/repo/view.tmpl b/templates/repo/view.tmpl
index c3d562003d..f99fe2f57a 100644
--- a/templates/repo/view.tmpl
+++ b/templates/repo/view.tmpl
@@ -14,10 +14,10 @@
</div>
{{end}}
- {{template "repo/code/recently_pushed_new_branches" .}}
+ {{template "repo/code/recently_pushed_new_branches" dict "RecentBranchesPromptData" .RecentBranchesPromptData}}
<div class="repo-view-container">
- <div class="repo-view-file-tree-container not-mobile {{if not .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}" {{if .IsSigned}}data-user-is-signed-in{{end}}>
+ <div class="tw-flex tw-flex-col repo-view-file-tree-container not-mobile {{if not .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}" {{if .IsSigned}}data-user-is-signed-in{{end}}>
{{template "repo/view_file_tree" .}}
</div>
<div class="repo-view-content">
diff --git a/templates/repo/view_content.tmpl b/templates/repo/view_content.tmpl
index 06e9f8515c..3ba04a9974 100644
--- a/templates/repo/view_content.tmpl
+++ b/templates/repo/view_content.tmpl
@@ -30,7 +30,7 @@
{{end}}
{{$cmpBranch = print $cmpBranch (.BranchName|PathEscapeSegments)}}
{{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}}
- <a id="new-pull-request" role="button" class="ui compact basic button" href="{{$compareLink}}"
+ <a id="new-pull-request" role="button" class="ui compact basic button" href="{{QueryBuild $compareLink "expand" 1}}"
data-tooltip-content="{{if .PullRequestCtx.Allowed}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}">
{{svg "octicon-git-pull-request"}}
</a>
@@ -41,8 +41,8 @@
<a href="{{.Repository.Link}}/find/{{.RefTypeNameSubURL}}" class="ui compact basic button">{{ctx.Locale.Tr "repo.find_file.go_to_file"}}</a>
{{end}}
- {{if and .CanWriteCode .RefFullName.IsBranch (not .Repository.IsMirror) (not .Repository.IsArchived) (not .IsViewFile)}}
- <button class="ui dropdown basic compact jump button"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
+ {{if and .RefFullName.IsBranch (not .IsViewFile)}}
+ <button class="ui dropdown basic compact jump button repo-add-file" {{if not .Repository.CanEnableEditor}}disabled{{end}}>
{{ctx.Locale.Tr "repo.editor.add_file"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
@@ -69,7 +69,7 @@
{{if not $isTreePathRoot}}
{{$treeNameIdxLast := Eval (len .TreeNames) "-" 1}}
- <span class="breadcrumb repo-path tw-ml-1">
+ <span class="breadcrumb">
<a class="section" href="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}" title="{{.Repository.Name}}">{{StringUtils.EllipsisString .Repository.Name 30}}</a>
{{- range $i, $v := .TreeNames -}}
<span class="breadcrumb-divider">/</span>
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 51a8f7d501..1486d7181d 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -1,4 +1,6 @@
-<div {{if .ReadmeInList}}id="readme" {{end}}class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content">
+<div {{if .ReadmeInList}}id="readme"{{end}} class="{{TabSizeClass .Editorconfig .FileTreePath}} non-diff-file-content"
+ data-global-init="initRepoFileView" data-raw-file-link="{{.RawFileLink}}">
+
{{- if .FileError}}
<div class="ui error message">
<div class="text left tw-whitespace-pre">{{.FileError}}</div>
@@ -27,18 +29,19 @@
<div class="file-header-left tw-flex tw-items-center tw-py-2 tw-pr-4">
{{if .ReadmeInList}}
{{svg "octicon-book" 16 "tw-mr-2"}}
- <strong><a class="muted" href="#readme">{{.FileName}}</a></strong>
+ <strong><a class="muted" href="#readme">{{.ReadmeInList}}</a></strong>
{{else}}
{{template "repo/file_info" .}}
{{end}}
</div>
- <div class="file-header-right file-actions tw-flex tw-items-center tw-flex-wrap">
- {{if .HasSourceRenderedToggle}}
- <div class="ui compact icon buttons">
- <a href="?display=source" class="ui mini basic button {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a>
- <a href="{{$.Link}}" class="ui mini basic button {{if .IsDisplayingRendered}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a>
- </div>
- {{end}}
+ <div class="file-header-right file-actions flex-text-block tw-flex-wrap">
+ {{/* this componment is also controlled by frontend plugin renders */}}
+ <div class="ui compact icon buttons file-view-toggle-buttons {{Iif .HasSourceRenderedToggle "" "tw-hidden"}}">
+ {{if .IsRepresentableAsText}}
+ <a href="?display=source" class="ui mini basic button file-view-toggle-source {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a>
+ {{end}}
+ <a href="?display=rendered" class="ui mini basic button file-view-toggle-rendered {{if not .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a>
+ </div>
{{if not .ReadmeInList}}
<div class="ui buttons tw-mr-1">
<a class="ui mini basic button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a>
@@ -55,7 +58,10 @@
{{end}}
</div>
<a download class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}" href="{{$.RawFileLink}}">{{svg "octicon-download"}}</a>
- <a class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}" data-global-click="onCopyContentButtonClick" {{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy"}}</a>
+ <a class="btn-octicon {{if not .CanCopyContent}}disabled{{end}}" data-global-click="onCopyContentButtonClick"
+ {{if not .IsDisplayingSource}}data-raw-file-link="{{$.RawFileLink}}"{{end}}
+ data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}"
+ >{{svg "octicon-copy"}}</a>
{{if .EnableFeed}}
<a class="btn-octicon" href="{{$.RepoLink}}/rss/{{$.RefTypeNameSubURL}}/{{PathEscapeSegments .TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
{{svg "octicon-rss"}}
@@ -78,45 +84,28 @@
<button class="ui mini basic button escape-button tw-mr-1">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
{{end}}
{{if and .ReadmeInList .CanEditReadmeFile}}
- <a class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.edit_this_file"}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}/{{PathEscapeSegments .FileName}}">{{svg "octicon-pencil"}}</a>
+ <a class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.edit_this_file"}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .FileTreePath}}">{{svg "octicon-pencil"}}</a>
{{end}}
</div>
</h4>
+
<div class="ui bottom attached table unstackable segment">
- {{if not (or .IsMarkup .IsRenderedHTML)}}
- {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
+ {{if not .IsMarkup}}
+ {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus}}
{{end}}
- <div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextSource}} code-view{{end}}">
+ <div class="file-view {{if .IsMarkup}}markup {{.MarkupType}}{{else if .IsPlainText}}plain-text{{else if .IsDisplayingSource}}code-view{{end}}">
{{if .IsFileTooLarge}}
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
{{else if not .FileSize}}
{{template "shared/fileisempty"}}
{{else if .IsMarkup}}
- {{if .FileContent}}{{.FileContent}}{{end}}
+ {{.FileContent}}
{{else if .IsPlainText}}
<pre>{{if .FileContent}}{{.FileContent}}{{end}}</pre>
- {{else if not .IsTextSource}}
- <div class="view-raw">
- {{if .IsImageFile}}
- <img src="{{$.RawFileLink}}">
- {{else if .IsVideoFile}}
- <video controls src="{{$.RawFileLink}}">
- <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>
- </video>
- {{else if .IsAudioFile}}
- <audio controls src="{{$.RawFileLink}}">
- <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
- </audio>
- {{else if .IsPDFFile}}
- <div class="pdf-content is-loading" data-global-init="initPdfViewer" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "repo.diff.view_file"}}"></div>
- {{else}}
- <a href="{{$.RawFileLink}}" rel="nofollow" class="tw-p-4">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
- {{end}}
- </div>
- {{else if .FileSize}}
+ {{else if .FileContent}}
<table>
<tbody>
- {{range $idx, $code := .FileContent}}
+ {{range $idx, $code := .FileContent}}
{{$line := Eval $idx "+" 1}}
<tr>
<td id="L{{$line}}" class="lines-num"><span id="L{{$line}}" data-line-number="{{$line}}"></span></td>
@@ -125,17 +114,38 @@
{{end}}
<td rel="L{{$line}}" class="lines-code chroma"><code class="code-inner">{{$code}}</code></td>
</tr>
- {{end}}
+ {{end}}
</tbody>
</table>
- <div class="code-line-menu tippy-target">
- {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
- <a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
+ {{else}}
+ <div class="view-raw">
+ {{if .IsImageFile}}
+ <img alt="{{$.RawFileLink}}" src="{{$.RawFileLink}}">
+ {{else if .IsVideoFile}}
+ <video controls src="{{$.RawFileLink}}">
+ <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>
+ </video>
+ {{else if .IsAudioFile}}
+ <audio controls src="{{$.RawFileLink}}">
+ <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
+ </audio>
+ {{else}}
+ <div class="file-view-render-container">
+ <div class="file-view-raw-prompt tw-p-4">
+ <a href="{{$.RawFileLink}}" rel="nofollow">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
+ </div>
+ </div>
{{end}}
- <a class="item view_git_blame" role="menuitem" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a>
- <a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a>
</div>
{{end}}
</div>
+
+ <div class="code-line-menu tippy-target">
+ {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}}
+ <a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
+ {{end}}
+ <a class="item view_git_blame" role="menuitem" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a>
+ <a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a>
+ </div>
</div>
</div>
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
index 4745110dd2..145494aa1a 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -4,9 +4,10 @@
{{template "repo/latest_commit" .}}
<div>{{if and .LatestCommit .LatestCommit.Committer}}{{DateUtils.TimeSince .LatestCommit.Committer.When}}{{end}}</div>
</div>
+ {{$.FileIconPoolHTML}}
{{if .HasParentPath}}
<a class="repo-file-line parent-link silenced" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">
- {{svg "octicon-file-directory-fill"}} ..
+ {{index $.FileIcons ".."}} ..
</a>
{{end}}
{{range $item := .Files}}
@@ -15,9 +16,9 @@
{{$commit := $item.Commit}}
{{$submoduleFile := $item.SubmoduleFile}}
<div class="repo-file-cell name muted-links {{if not $commit}}notready{{end}}">
- {{ctx.RenderUtils.RenderFileIcon $entry}}
+ {{index $.FileIcons $entry.Name}}
{{if $entry.IsSubModule}}
- {{$submoduleLink := $submoduleFile.SubmoduleWebLink ctx}}
+ {{$submoduleLink := $submoduleFile.SubmoduleWebLinkTree ctx}}
{{if $submoduleLink}}
<a class="entry-name" href="{{$submoduleLink.RepoWebLink}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
@ <a class="text primary" href="{{$submoduleLink.CommitWebLink}}">{{ShortSha $submoduleFile.RefID}}</a>
@@ -40,13 +41,16 @@
</a>
{{else}}
<a class="entry-name" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
+ {{if $entry.IsLink}}
+ <a class="entry-symbol-link flex-text-inline" data-tooltip-content title="{{ctx.Locale.Tr "repo.find_file.follow_symlink"}}" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}?follow_symlink=1">{{svg "octicon-link" 12}}</a>
+ {{end}}
{{end}}
{{end}}
</div>
<div class="repo-file-cell message loading-icon-2px">
{{if $commit}}
{{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}}
- {{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.Message $commitLink ($.Repository.ComposeMetas ctx)}}
+ {{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.Message $commitLink $.Repository}}
{{else}}
… {{/* will be loaded again by LastCommitLoaderURL */}}
{{end}}
diff --git a/templates/repo/watch_unwatch.tmpl b/templates/repo/watch_unwatch.tmpl
index 465cd91c2b..6f2e5b7a19 100644
--- a/templates/repo/watch_unwatch.tmpl
+++ b/templates/repo/watch_unwatch.tmpl
@@ -1,10 +1,10 @@
-<form hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}">
+<form class="flex-text-inline" hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}">
<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}>
{{$buttonText := ctx.Locale.Tr "repo.watch"}}
{{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}}
<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}">
{{svg "octicon-eye"}}
- <span aria-hidden="true">{{$buttonText}}</span>
+ <span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
</button>
<a hx-boost="false" class="ui basic label" href="{{.RepoLink}}/watchers">
{{CountFmt .Repository.NumWatches}}
diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl
index 9b5e7b907d..12f0983904 100644
--- a/templates/repo/wiki/new.tmpl
+++ b/templates/repo/wiki/new.tmpl
@@ -18,7 +18,7 @@
{{ctx.Locale.Tr "repo.wiki.page_name_desc"}}
</div>
- {{$content := .content}}
+ {{$content := .WikiEditContent}}
{{if not .PageIsWikiEdit}}
{{$content = ctx.Locale.Tr "repo.wiki.welcome"}}
{{end}}
@@ -35,7 +35,7 @@
<input name="message" aria-label="{{ctx.Locale.Tr "repo.wiki.default_commit_message"}}" placeholder="{{ctx.Locale.Tr "repo.wiki.default_commit_message"}}">
</div>
<div class="divider"></div>
- <div class="tw-text-right">
+ <div class="flex-text-block tw-justify-end">
<a class="ui basic cancel button" href="{{.Link}}">{{ctx.Locale.Tr "cancel"}}</a>
<button class="ui primary button">{{ctx.Locale.Tr "repo.wiki.save_page"}}</button>
</div>
diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl
index 80179ce46b..108e378937 100644
--- a/templates/repo/wiki/revision.tmpl
+++ b/templates/repo/wiki/revision.tmpl
@@ -3,18 +3,18 @@
{{template "repo/header" .}}
{{$title := .title}}
<div class="ui container">
- <div class="ui stackable grid">
- <div class="ui eight wide column">
- <div class="ui header">
- <a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a>
+ <div class="ui dividing header flex-text-block tw-flex-wrap tw-justify-between">
+ <div class="flex-text-block">
+ <a class="ui basic button tw-px-3" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}">{{svg "octicon-home"}}</a>
+ <div class="tw-flex-1 gt-ellipsis">
{{$title}}
- <div class="ui sub header tw-break-anywhere">
+ <div class="ui sub header gt-ellipsis">
{{$timeSince := DateUtils.TimeSince .Author.When}}
{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}}
</div>
</div>
</div>
- <div class="ui eight wide column tw-text-right">
+ <div class="flex-text-block">
{{template "repo/clone_panel" .}}
</div>
</div>
diff --git a/templates/repo/wiki/start.tmpl b/templates/repo/wiki/start.tmpl
index 1b3c3d538a..e622db5eb5 100644
--- a/templates/repo/wiki/start.tmpl
+++ b/templates/repo/wiki/start.tmpl
@@ -7,7 +7,7 @@
<h2>{{ctx.Locale.Tr "repo.wiki.welcome"}}</h2>
<p>{{ctx.Locale.Tr "repo.wiki.welcome_desc"}}</p>
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
- <a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a>
+ <a class="ui primary button tw-mr-0" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a>
{{end}}
</div>
</div>
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
index efb614280a..4c7ef364d2 100644
--- a/templates/repo/wiki/view.tmpl
+++ b/templates/repo/wiki/view.tmpl
@@ -33,7 +33,7 @@
<div class="ui dividing header">
<div class="flex-text-block tw-flex-wrap tw-justify-end">
<div class="flex-text-block tw-flex-1 tw-min-w-[300px]">
- <a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" ><span>{{.CommitCount}}</span> {{svg "octicon-history"}}</a>
+ <a class="ui basic button tw-px-3 tw-gap-3" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" >{{if .CommitCount}}<span>{{.CommitCount}}</span> {{end}}{{svg "octicon-history"}}</a>
<div class="tw-flex-1 gt-ellipsis">
{{$title}}
<div class="ui sub header gt-ellipsis">
@@ -50,7 +50,7 @@
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
<a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_edit">{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}</a>
<a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a>
- <a class="ui small red button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete" data-id="{{.PageURL}}">{{ctx.Locale.Tr "repo.wiki.delete_page_button"}}</a>
+ <a class="ui small red button link-action" href data-modal-confirm="#repo-wiki-delete-page-modal" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete">{{ctx.Locale.Tr "repo.wiki.delete_page_button"}}</a>
{{end}}
</div>
</div>
@@ -62,50 +62,43 @@
{{end}}
<div class="wiki-content-parts">
- {{if .sidebarTocContent}}
+ {{if .WikiSidebarTocHTML}}
<div class="render-content markup wiki-content-sidebar wiki-content-toc">
- {{.sidebarTocContent | SafeHTML}}
+ {{.WikiSidebarTocHTML}}
</div>
{{end}}
- <div class="render-content markup wiki-content-main {{if or .sidebarTocContent .sidebarPresent}}with-sidebar{{end}}">
- {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
- {{.content | SafeHTML}}
+ <div class="render-content markup wiki-content-main {{if or .WikiSidebarTocHTML .WikiSidebarHTML}}with-sidebar{{end}}">
+ {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus}}
+ {{.WikiContentHTML}}
</div>
- {{if .sidebarPresent}}
+ {{if .WikiSidebarHTML}}
<div class="render-content markup wiki-content-sidebar">
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
<a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
{{end}}
- {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .sidebarEscapeStatus "root" $}}
- {{.sidebarContent | SafeHTML}}
+ {{.WikiSidebarHTML}}
</div>
{{end}}
<div class="tw-clear-both"></div>
- {{if .footerPresent}}
+ {{if .WikiFooterHTML}}
<div class="render-content markup wiki-content-footer">
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
<a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
{{end}}
- {{template "repo/unicode_escape_prompt" dict "footerEscapeStatus" .sidebarEscapeStatus "root" $}}
- {{.footerContent | SafeHTML}}
+ {{.WikiFooterHTML}}
</div>
{{end}}
</div>
</div>
</div>
-<div class="ui g-modal-confirm delete modal">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.wiki.delete_page_button"}}
- </div>
- <div class="content">
- <p>{{ctx.Locale.Tr "repo.wiki.delete_page_notice_1" $title}}</p>
- </div>
+<div class="ui small modal" id="repo-wiki-delete-page-modal">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.wiki.delete_page_button"}}</div>
+ <div class="content"><p>{{ctx.Locale.Tr "repo.wiki.delete_page_notice_1" $title}}</p></div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/shared/actions/runner_badge.tmpl b/templates/shared/actions/runner_badge.tmpl
deleted file mode 100644
index 816e87e177..0000000000
--- a/templates/shared/actions/runner_badge.tmpl
+++ /dev/null
@@ -1,25 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{{.Badge.Width}}" height="18"
- role="img" aria-label="{{.Badge.Label.Text}}: {{.Badge.Message.Text}}">
- <title>{{.Badge.Label.Text}}: {{.Badge.Message.Text}}</title>
- <linearGradient id="s" x2="0" y2="100%">
- <stop offset="0" stop-color="#fff" stop-opacity=".7" />
- <stop offset=".1" stop-color="#aaa" stop-opacity=".1" />
- <stop offset=".9" stop-color="#000" stop-opacity=".3" />
- <stop offset="1" stop-color="#000" stop-opacity=".5" />
- </linearGradient>
- <clipPath id="r">
- <rect width="{{.Badge.Width}}" height="18" rx="4" fill="#fff" />
- </clipPath>
- <g clip-path="url(#r)">
- <rect width="{{.Badge.Label.Width}}" height="18" fill="#555" />
- <rect x="{{.Badge.Label.Width}}" width="{{.Badge.Message.Width}}" height="18" fill="{{.Badge.Color}}" />
- <rect width="{{.Badge.Width}}" height="18" fill="url(#s)" />
- </g>
- <g fill="#fff" text-anchor="middle" font-family="Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision"
- font-size="{{.Badge.FontSize}}"><text aria-hidden="true" x="{{.Badge.Label.X}}" y="140" fill="#010101" fill-opacity=".3"
- transform="scale(.1)" textLength="{{.Badge.Label.TextLength}}">{{.Badge.Label.Text}}</text><text x="{{.Badge.Label.X}}" y="130"
- transform="scale(.1)" fill="#fff" textLength="{{.Badge.Label.TextLength}}">{{.Badge.Label.Text}}</text><text aria-hidden="true"
- x="{{.Badge.Message.X}}" y="140" fill="#010101" fill-opacity=".3" transform="scale(.1)"
- textLength="{{.Badge.Message.TextLength}}">{{.Badge.Message.Text}}</text><text x="{{.Badge.Message.X}}" y="130" transform="scale(.1)"
- fill="#fff" textLength="{{.Badge.Message.TextLength}}">{{.Badge.Message.Text}}</text></g>
-</svg>
diff --git a/templates/shared/actions/runner_badge_flat-square.tmpl b/templates/shared/actions/runner_badge_flat-square.tmpl
new file mode 100644
index 0000000000..cc1dc1e8f3
--- /dev/null
+++ b/templates/shared/actions/runner_badge_flat-square.tmpl
@@ -0,0 +1,15 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{{.Badge.Width}}" height="20"
+ role="img" aria-label="{{.Badge.Label.Text}}: {{.Badge.Message.Text}}">
+ <title>{{.Badge.Label.Text}}: {{.Badge.Message.Text}}</title>
+ <g shape-rendering="crispEdges">
+ <rect width="{{.Badge.Label.Width}}" height="20" fill="#555" />
+ <rect x="{{.Badge.Label.Width}}" width="{{.Badge.Message.Width}}" height="20" fill="{{.Badge.Color}}" />
+ </g>
+ <g fill="#fff" text-anchor="middle" font-family="{{.Badge.FontFamily}}"
+ text-rendering="geometricPrecision" font-size="{{.Badge.FontSize}}">
+ <text x="{{.Badge.Label.X}}" y="140"
+ transform="scale(.1)" fill="#fff" textLength="{{.Badge.Label.TextLength}}">{{.Badge.Label.Text}}</text>
+ <text x="{{.Badge.Message.X}}" y="140" transform="scale(.1)" fill="#fff"
+ textLength="{{.Badge.Message.TextLength}}">{{.Badge.Message.Text}}</text>
+ </g>
+</svg>
diff --git a/templates/shared/actions/runner_badge_flat.tmpl b/templates/shared/actions/runner_badge_flat.tmpl
new file mode 100644
index 0000000000..1ba9be09fb
--- /dev/null
+++ b/templates/shared/actions/runner_badge_flat.tmpl
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{{.Badge.Width}}" height="20"
+ role="img" aria-label="{{.Badge.Label.Text}}: {{.Badge.Message.Text}}">
+ <title>{{.Badge.Label.Text}}: {{.Badge.Message.Text}}</title>
+ <linearGradient id="{{.Badge.IDPrefix}}s" x2="0" y2="100%">
+ <stop offset="0" stop-color="#bbb" stop-opacity=".1" />
+ <stop offset="1" stop-opacity=".1" />
+ </linearGradient>
+ <clipPath id="{{.Badge.IDPrefix}}r">
+ <rect width="{{.Badge.Width}}" height="20" rx="3" fill="#fff" />
+ </clipPath>
+ <g clip-path="url(#{{.Badge.IDPrefix}}r)">
+ <rect width="{{.Badge.Label.Width}}" height="20" fill="#555" />
+ <rect x="{{.Badge.Label.Width}}" width="{{.Badge.Message.Width}}" height="20" fill="{{.Badge.Color}}" />
+ <rect width="{{.Badge.Width}}" height="20" fill="url(#{{.Badge.IDPrefix}}s)" />
+ </g>
+ <g fill="#fff" text-anchor="middle" font-family="{{.Badge.FontFamily}}"
+ text-rendering="geometricPrecision" font-size="{{.Badge.FontSize}}">
+ <text aria-hidden="true" x="{{.Badge.Label.X}}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)"
+ textLength="{{.Badge.Label.TextLength}}">{{.Badge.Label.Text}}</text>
+ <text x="{{.Badge.Label.X}}" y="140"
+ transform="scale(.1)" fill="#fff" textLength="{{.Badge.Label.TextLength}}">{{.Badge.Label.Text}}</text>
+ <text aria-hidden="true" x="{{.Badge.Message.X}}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)"
+ textLength="{{.Badge.Message.TextLength}}">{{.Badge.Message.Text}}</text>
+ <text x="{{.Badge.Message.X}}" y="140" transform="scale(.1)" fill="#fff"
+ textLength="{{.Badge.Message.TextLength}}">{{.Badge.Message.Text}}</text>
+ </g>
+</svg>
diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl
index 6436643ee7..43321a8dc5 100644
--- a/templates/shared/actions/runner_list.tmpl
+++ b/templates/shared/actions/runner_list.tmpl
@@ -16,7 +16,7 @@
<div class="header">
Registration Token
</div>
- <div class="ui input">
+ <div class="ui action input">
<input type="text" value="{{.RegistrationToken}}" readonly>
<button class="ui basic label button" aria-label="{{ctx.Locale.Tr "copy"}}" data-clipboard-text="{{.RegistrationToken}}">
{{svg "octicon-copy" 14}}
@@ -64,27 +64,23 @@
</tr>
</thead>
<tbody>
- {{if .Runners}}
- {{range .Runners}}
+ {{range .Runners}}
<tr>
- <td>
- <span class="ui {{if .IsOnline}}green{{end}} label">{{.StatusLocaleName ctx.Locale}}</span>
- </td>
+ <td><span class="ui label {{if .IsOnline}}green{{end}}">{{.StatusLocaleName ctx.Locale}}</span></td>
<td>{{.ID}}</td>
<td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td>
<td>{{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}}</td>
<td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString ctx.Locale}}</span></td>
- <td class="tw-flex tw-flex-wrap tw-gap-2 runner-tags">
- {{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}}
+ <td>
+ <span class="flex-text-inline">{{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}}</span>
</td>
<td>{{if .LastOnline}}{{DateUtils.TimeSince .LastOnline}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td>
- <td class="runner-ops">
- {{if .Editable $.RunnerOwnerID $.RunnerRepoID}}
- <a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
+ <td>
+ {{if .EditableInContext $.RunnerOwnerID $.RunnerRepoID}}
+ <a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
{{end}}
</td>
</tr>
- {{end}}
{{else}}
<tr>
<td class="tw-text-center" colspan="8">{{ctx.Locale.Tr "actions.runners.none"}}</td>
diff --git a/templates/shared/avatar_upload_crop.tmpl b/templates/shared/avatar_upload_crop.tmpl
index 2c4166fa9c..3bc012dd99 100644
--- a/templates/shared/avatar_upload_crop.tmpl
+++ b/templates/shared/avatar_upload_crop.tmpl
@@ -1,6 +1,6 @@
{{- /* we do not need to set for/id here, global aria init code will add them automatically */ -}}
<label>{{.LabelText}}</label>
-<input class="avatar-file-with-cropper" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
+<input class="avatar-file-with-cropper" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp" data-global-init="initAvatarUploader">
{{- /* the cropper-panel must be next sibling of the input "avatar" */ -}}
<div class="cropper-panel tw-hidden">
<div class="tw-my-2">{{ctx.Locale.Tr "settings.cropper_prompt"}}</div>
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index 30670c3b0f..98c26b32dc 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -3,11 +3,14 @@
{{range .Issues}}
<div class="flex-item">
- <div class="flex-item-icon">
- {{if $.CanWriteIssuesOrPulls}}
- <input type="checkbox" autocomplete="off" class="issue-checkbox tw-mr-4" data-issue-id={{.ID}} aria-label="{{ctx.Locale.Tr "repo.issues.action_check"}} &quot;{{.Title}}&quot;">
- {{end}}
- {{template "shared/issueicon" .}}
+ <div class="flex-item-leading">
+ {{/* using some tw helpers is the only way to align the checkbox */}}
+ <div class="flex-text-inline tw-mt-[2px]">
+ {{if $.CanWriteIssuesOrPulls}}
+ <input type="checkbox" autocomplete="off" class="issue-checkbox tw-mr-[14px]" data-issue-id={{.ID}} aria-label="{{ctx.Locale.Tr "repo.issues.action_check"}} &quot;{{.Title}}&quot;">
+ {{end}}
+ {{template "shared/issueicon" .}}
+ </div>
</div>
<div class="flex-item-main">
@@ -19,7 +22,7 @@
{{template "repo/commit_statuses" dict "Status" (index $.CommitLastStatus .PullRequest.ID) "Statuses" (index $.CommitStatuses .PullRequest.ID)}}
{{end}}
{{end}}
- <span class="labels-list tw-ml-1">
+ <span class="labels-list">
{{range .Labels}}
<a href="?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}{{if ne $.listType "milestone"}}&milestone={{$.MilestoneID}}{{end}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.RenderUtils.RenderLabel .}}</a>
{{end}}
diff --git a/templates/explore/repo_list.tmpl b/templates/shared/repo/list.tmpl
index 219b1255c0..2c8af14f9c 100644
--- a/templates/explore/repo_list.tmpl
+++ b/templates/shared/repo/list.tmpl
@@ -2,12 +2,16 @@
{{range .Repos}}
<div class="flex-item">
<div class="flex-item-leading">
- {{template "repo/icon" .}}
+ {{if $.ShowRepoOwnerAvatar}}
+ {{ctx.AvatarUtils.Avatar .Owner 24}}
+ {{else}}
+ {{template "repo/icon" .}}
+ {{end}}
</div>
<div class="flex-item-main">
<div class="flex-item-header">
<div class="flex-item-title">
- {{if and (or $.PageIsExplore $.PageIsProfileStarList) .Owner}}
+ {{if and $.ShowRepoOwnerOnList .Owner}}
<a class="text primary name" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/
{{end}}
<a class="text primary name" href="{{.Link}}">{{.Name}}</a>
@@ -39,12 +43,12 @@
{{end}}
{{if not $.DisableStars}}
<a class="flex-text-inline" href="{{.Link}}/stars">
- <span aria-label="{{ctx.Locale.Tr "repo.stars"}}">{{svg "octicon-star" 16}}</span>
+ <span class="tw-contents" aria-label="{{ctx.Locale.Tr "repo.stars"}}">{{svg "octicon-star" 16}}</span>
<span {{if ge .NumStars 1000}}data-tooltip-content="{{.NumStars}}"{{end}}>{{CountFmt .NumStars}}</span>
</a>
{{end}}
<a class="flex-text-inline" href="{{.Link}}/forks">
- <span aria-label="{{ctx.Locale.Tr "repo.forks"}}">{{svg "octicon-git-branch" 16}}</span>
+ <span class="tw-contents" aria-label="{{ctx.Locale.Tr "repo.forks"}}">{{svg "octicon-git-branch" 16}}</span>
<span {{if ge .NumForks 1000}}data-tooltip-content="{{.NumForks}}"{{end}}>{{CountFmt .NumForks}}</span>
</a>
</div>
diff --git a/templates/shared/repo_search.tmpl b/templates/shared/repo/search.tmpl
index 7fcb5d2361..a909061184 100644
--- a/templates/shared/repo_search.tmpl
+++ b/templates/shared/repo/search.tmpl
@@ -1,5 +1,5 @@
<div class="ui small secondary filter menu">
- <form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-gap-x-2">
+ <form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-items-center tw-gap-x-2">
{{if .Language}}<input type="hidden" name="language" value="{{.Language}}">{{end}}
{{if .PageIsExploreRepositories}}<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">{{end}}
{{if .TabName}}<input type="hidden" name="tab" value="{{.TabName}}">{{end}}
diff --git a/templates/shared/secrets/add_list.tmpl b/templates/shared/secrets/add_list.tmpl
index 977f308b71..44305e9502 100644
--- a/templates/shared/secrets/add_list.tmpl
+++ b/templates/shared/secrets/add_list.tmpl
@@ -4,9 +4,13 @@
<button class="ui primary tiny button show-modal"
data-modal="#add-secret-modal"
data-modal-form.action="{{.Link}}"
- data-modal-header="{{ctx.Locale.Tr "secrets.creation"}}"
+ data-modal-header="{{ctx.Locale.Tr "secrets.add_secret"}}"
+ data-modal-secret-name.value=""
+ data-modal-secret-name.read-only="false"
+ data-modal-secret-data=""
+ data-modal-secret-description=""
>
- {{ctx.Locale.Tr "secrets.creation"}}
+ {{ctx.Locale.Tr "secrets.add_secret"}}
</button>
</div>
</h4>
@@ -33,7 +37,19 @@
<span class="color-text-light-2">
{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}}
</span>
- <button class="ui btn interact-bg link-action tw-p-2"
+ <button class="btn interact-bg show-modal tw-p-2"
+ data-modal="#add-secret-modal"
+ data-modal-form.action="{{$.Link}}"
+ data-modal-header="{{ctx.Locale.Tr "secrets.edit_secret"}}"
+ data-tooltip-content="{{ctx.Locale.Tr "secrets.edit_secret"}}"
+ data-modal-secret-name.value="{{.Name}}"
+ data-modal-secret-name.read-only="true"
+ data-modal-secret-data=""
+ data-modal-secret-description="{{if .Description}}{{.Description}}{{end}}"
+ >
+ {{svg "octicon-pencil"}}
+ </button>
+ <button class="btn interact-bg link-action tw-p-2"
data-url="{{$.Link}}/delete?id={{.ID}}"
data-modal-confirm="{{ctx.Locale.Tr "secrets.deletion.description"}}"
data-tooltip-content="{{ctx.Locale.Tr "secrets.deletion"}}"
@@ -51,9 +67,7 @@
{{/* Add secret dialog */}}
<div class="ui small modal" id="add-secret-modal">
- <div class="header">
- <span id="actions-modal-header"></span>
- </div>
+ <div class="header"></div>
<form class="ui form form-fetch-action" method="post">
<div class="content">
{{.CsrfTokenHtml}}
diff --git a/templates/shared/user/avatarlink.tmpl b/templates/shared/user/avatarlink.tmpl
index 5e3ed7a68c..5d56fef430 100644
--- a/templates/shared/user/avatarlink.tmpl
+++ b/templates/shared/user/avatarlink.tmpl
@@ -1 +1 @@
-<a class="avatar"{{if gt .user.ID 0}} href="{{.user.HomeLink}}"{{end}}>{{ctx.AvatarUtils.Avatar .user}}</a>
+<a class="avatar-with-link" {{if gt .user.ID 0}}href="{{.user.HomeLink}}"{{end}}>{{ctx.AvatarUtils.Avatar .user}}</a>
diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl
index 91f04e0b53..1190dc54ec 100644
--- a/templates/shared/user/profile_big_avatar.tmpl
+++ b/templates/shared/user/profile_big_avatar.tmpl
@@ -103,7 +103,7 @@
<ul class="user-badges">
{{range .Badges}}
<li>
- <img width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-tooltip-content="{{.Description}}">
+ <img loading="lazy" width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-tooltip-content="{{.Description}}">
</li>
{{end}}
</ul>
diff --git a/templates/shared/webhook/icon.tmpl b/templates/shared/webhook/icon.tmpl
index 245ed16505..105212eb56 100644
--- a/templates/shared/webhook/icon.tmpl
+++ b/templates/shared/webhook/icon.tmpl
@@ -5,23 +5,23 @@
{{if eq .HookType "gitea"}}
{{svg "gitea-gitea" $size "img"}}
{{else if eq .HookType "gogs"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png">
{{else if eq .HookType "discord"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png">
{{else if eq .HookType "dingtalk"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
{{else if eq .HookType "telegram"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png">
{{else if eq .HookType "feishu"}}
{{svg "gitea-feishu" $size "img"}}
{{else if eq .HookType "matrix"}}
{{svg "gitea-matrix" $size "img"}}
{{else if eq .HookType "wechatwork"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png">
{{else if eq .HookType "packagist"}}
- <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png">
+ <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png">
{{end}}
diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl
index 6cfc88a0d7..e83dcf463b 100644
--- a/templates/status/404.tmpl
+++ b/templates/status/404.tmpl
@@ -2,6 +2,7 @@
<div role="main" aria-label="{{.Title}}" class="page-content {{if .IsRepo}}repository{{end}}">
{{if .IsRepo}}{{template "repo/header" .}}{{end}}
<div class="ui container">
+ {{template "base/alert" .}}
<div class="status-page-error">
<div class="status-page-error-title">404 Not Found</div>
<div class="tw-text-center">
diff --git a/templates/status/500.tmpl b/templates/status/500.tmpl
index 198f1ea898..6dfa2d8a8c 100644
--- a/templates/status/500.tmpl
+++ b/templates/status/500.tmpl
@@ -38,7 +38,7 @@
{{if .ErrorMsg}}
<div class="tw-mt-8">
<p>{{ctx.Locale.Tr "error.occurred"}}:</p>
- <pre class="tw-whitespace-pre-wrap tw-break-all">{{.ErrorMsg}}</pre>
+ <pre class="tw-whitespace-pre-wrap tw-wrap-anywhere">{{.ErrorMsg}}</pre>
</div>
{{end}}
<div class="tw-mt-8 tw-text-center">
diff --git a/templates/status/503.tmpl b/templates/status/503.tmpl
new file mode 100644
index 0000000000..5b1db9fc07
--- /dev/null
+++ b/templates/status/503.tmpl
@@ -0,0 +1,12 @@
+{{template "base/head" .}}
+<div role="main" aria-label="503 Service Unavailable" class="page-content">
+ <div class="ui container">
+ <div class="status-page-error">
+ <div class="status-page-error-title">503 Service Unavailable</div>
+ <div class="tw-text-center">
+ <div class="tw-my-4">{{ctx.Locale.Tr "error503"}}</div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl
index 9935ab9c5a..4ff3472807 100644
--- a/templates/swagger/ui.tmpl
+++ b/templates/swagger/ui.tmpl
@@ -5,8 +5,10 @@
<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{AssetVersion}}" rel="stylesheet">
</head>
<body>
+ {{/* TODO: add Help & Glossary to help users understand the API, and explain some concepts like "Owner" */}}
<a class="swagger-back-link" href="{{AppSubUrl}}/">{{svg "octicon-reply"}}{{ctx.Locale.Tr "return_to_gitea"}}</a>
<div id="swagger-ui" data-source="{{AppSubUrl}}/swagger.{{.APIJSONVersion}}.json"></div>
+ <footer class="page-footer"></footer>
<script src="{{AssetUrlPrefix}}/js/swagger.js?v={{AssetVersion}}"></script>
</body>
</html>
diff --git a/templates/swagger/v1_input.json b/templates/swagger/v1_input.json
index 1979febebb..e74c8fc9c4 100644
--- a/templates/swagger/v1_input.json
+++ b/templates/swagger/v1_input.json
@@ -1,6 +1,6 @@
{
"info": {
- "version": "{{AppVer | JSEscape}}"
+ "version": "{{.SwaggerAppVer}}"
},
- "basePath": "{{AppSubUrl | JSEscape}}/api/v1"
+ "basePath": "{{.SwaggerAppSubUrl}}/api/v1"
}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 1efaf1a875..35c743dcd4 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -19,9 +19,9 @@
"name": "MIT",
"url": "http://opensource.org/licenses/MIT"
},
- "version": "{{AppVer | JSEscape}}"
+ "version": "{{.SwaggerAppVer}}"
},
- "basePath": "{{AppSubUrl | JSEscape}}/api/v1",
+ "basePath": "{{.SwaggerAppSubUrl}}/api/v1",
"paths": {
"/activitypub/user-id/{user-id}": {
"get": {
@@ -75,6 +75,218 @@
}
}
},
+ "/admin/actions/jobs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "admin"
+ ],
+ "summary": "Lists all jobs",
+ "operationId": "listAdminWorkflowJobs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowJobsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/admin/actions/runners": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "admin"
+ ],
+ "summary": "Get all runners",
+ "operationId": "getAdminRunners",
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunnersResponse"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/admin/actions/runners/registration-token": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "admin"
+ ],
+ "summary": "Get an global actions runner registration token",
+ "operationId": "adminCreateRunnerRegistrationToken",
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
+ "/admin/actions/runners/{runner_id}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "admin"
+ ],
+ "summary": "Get an global runner",
+ "operationId": "getAdminRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunner"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "admin"
+ ],
+ "summary": "Delete an global runner",
+ "operationId": "deleteAdminRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "runner has been deleted"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/admin/actions/runs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "admin"
+ ],
+ "summary": "Lists all runs",
+ "operationId": "listAdminWorkflowRuns",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "workflow event name",
+ "name": "event",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow branch",
+ "name": "branch",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggered by user",
+ "name": "actor",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggering sha of the workflow run",
+ "name": "head_sha",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowRunsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/admin/cron": {
"get": {
"produces": [
@@ -554,7 +766,7 @@
},
{
"type": "string",
- "description": "user's login name to search for",
+ "description": "identifier of the user, provided by the external authenticator",
"name": "login_name",
"in": "query"
},
@@ -630,7 +842,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user to delete",
+ "description": "username of the user to delete",
"name": "username",
"in": "path",
"required": true
@@ -672,7 +884,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user to edit",
+ "description": "username of the user whose data is to be edited",
"name": "username",
"in": "path",
"required": true
@@ -714,7 +926,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose badges are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -744,7 +956,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user to whom a badge is to be added",
"name": "username",
"in": "path",
"required": true
@@ -778,7 +990,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose badge is to be deleted",
"name": "username",
"in": "path",
"required": true
@@ -820,7 +1032,7 @@
"parameters": [
{
"type": "string",
- "description": "username of the user",
+ "description": "username of the user who is to receive a public key",
"name": "username",
"in": "path",
"required": true
@@ -859,7 +1071,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose public key is to be deleted",
"name": "username",
"in": "path",
"required": true
@@ -902,7 +1114,7 @@
"parameters": [
{
"type": "string",
- "description": "username of the user that will own the created organization",
+ "description": "username of the user who will own the created organization",
"name": "username",
"in": "path",
"required": true
@@ -942,7 +1154,7 @@
"parameters": [
{
"type": "string",
- "description": "existing username of user",
+ "description": "current username of the user",
"name": "username",
"in": "path",
"required": true
@@ -985,7 +1197,7 @@
"parameters": [
{
"type": "string",
- "description": "username of the user. This user will own the created repository",
+ "description": "username of the user who will own the created repository",
"name": "username",
"in": "path",
"required": true
@@ -1697,6 +1909,88 @@
}
}
},
+ "/orgs/{org}/actions/jobs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Get org-level workflow jobs",
+ "operationId": "getOrgWorkflowJobs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowJobsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/orgs/{org}/actions/runners": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Get org-level runners",
+ "operationId": "getOrgRunners",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunnersResponse"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/orgs/{org}/actions/runners/registration-token": {
"get": {
"produces": [
@@ -1721,6 +2015,180 @@
"$ref": "#/responses/RegistrationToken"
}
}
+ },
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Get an organization's actions runner registration token",
+ "operationId": "orgCreateRunnerRegistrationToken",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
+ "/orgs/{org}/actions/runners/{runner_id}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Get an org-level runner",
+ "operationId": "getOrgRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunner"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Delete an org-level runner",
+ "operationId": "deleteOrgRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "runner has been deleted"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/orgs/{org}/actions/runs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Get org-level workflow runs",
+ "operationId": "getOrgWorkflowRuns",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "workflow event name",
+ "name": "event",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow branch",
+ "name": "branch",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggered by user",
+ "name": "actor",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggering sha of the workflow run",
+ "name": "head_sha",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowRunsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
}
},
"/orgs/{org}/actions/secrets": {
@@ -2025,16 +2493,16 @@
],
"responses": {
"201": {
- "description": "response when creating an org-level variable"
- },
- "204": {
- "description": "response when creating an org-level variable"
+ "description": "successfully created the org-level variable"
},
"400": {
"$ref": "#/responses/error"
},
- "404": {
- "$ref": "#/responses/notFound"
+ "409": {
+ "description": "variable name already exists."
+ },
+ "500": {
+ "$ref": "#/responses/error"
}
}
},
@@ -2248,7 +2716,7 @@
},
{
"type": "string",
- "description": "user to check",
+ "description": "username of the user to check",
"name": "username",
"in": "path",
"required": true
@@ -2279,7 +2747,7 @@
},
{
"type": "string",
- "description": "user to block",
+ "description": "username of the user to block",
"name": "username",
"in": "path",
"required": true
@@ -2319,7 +2787,7 @@
},
{
"type": "string",
- "description": "user to unblock",
+ "description": "username of the user to unblock",
"name": "username",
"in": "path",
"required": true
@@ -2790,7 +3258,7 @@
},
{
"type": "string",
- "description": "username of the user",
+ "description": "username of the user to check for an organization membership",
"name": "username",
"in": "path",
"required": true
@@ -2827,7 +3295,7 @@
},
{
"type": "string",
- "description": "username of the user",
+ "description": "username of the user to remove from the organization",
"name": "username",
"in": "path",
"required": true
@@ -2901,7 +3369,7 @@
},
{
"type": "string",
- "description": "username of the user",
+ "description": "username of the user to check for a public organization membership",
"name": "username",
"in": "path",
"required": true
@@ -2935,7 +3403,7 @@
},
{
"type": "string",
- "description": "username of the user",
+ "description": "username of the user whose membership is to be publicized",
"name": "username",
"in": "path",
"required": true
@@ -2972,7 +3440,7 @@
},
{
"type": "string",
- "description": "username of the user",
+ "description": "username of the user whose membership is to be concealed",
"name": "username",
"in": "path",
"required": true
@@ -3339,6 +3807,104 @@
}
}
},
+ "/packages/{owner}/{type}/{name}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "package"
+ ],
+ "summary": "Gets all versions of a package",
+ "operationId": "listPackageVersions",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the package",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "type of the package",
+ "name": "type",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the package",
+ "name": "name",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PackageList"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/packages/{owner}/{type}/{name}/-/latest": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "package"
+ ],
+ "summary": "Gets the latest version of a package",
+ "operationId": "getLatestPackageVersion",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the package",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "type of the package",
+ "name": "type",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the package",
+ "name": "name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/Package"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/packages/{owner}/{type}/{name}/-/link/{repo_name}": {
"post": {
"tags": [
@@ -4019,7 +4585,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4064,7 +4630,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4108,7 +4674,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4154,7 +4720,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4187,6 +4753,194 @@
}
}
},
+ "/repos/{owner}/{repo}/actions/jobs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Lists all jobs for a repository",
+ "operationId": "listWorkflowJobs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowJobsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/jobs/{job_id}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Gets a specific workflow job for a workflow run",
+ "operationId": "getWorkflowJob",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "id of the job",
+ "name": "job_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowJob"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/jobs/{job_id}/logs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Downloads the job logs for a workflow run",
+ "operationId": "downloadActionsRunJobLogs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "id of the job",
+ "name": "job_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "output blob content"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/runners": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get repo-level runners",
+ "operationId": "getRepoRunners",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunnersResponse"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/actions/runners/registration-token": {
"get": {
"produces": [
@@ -4218,6 +4972,298 @@
"$ref": "#/responses/RegistrationToken"
}
}
+ },
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get a repository's actions runner registration token",
+ "operationId": "repoCreateRunnerRegistrationToken",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/runners/{runner_id}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get an repo-level runner",
+ "operationId": "getRepoRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunner"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Delete an repo-level runner",
+ "operationId": "deleteRepoRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "runner has been deleted"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/runs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Lists all runs for a repository run",
+ "operationId": "getWorkflowRuns",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "workflow event name",
+ "name": "event",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow branch",
+ "name": "branch",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggered by user",
+ "name": "actor",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggering sha of the workflow run",
+ "name": "head_sha",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowRunsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/runs/{run}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Gets a specific workflow run",
+ "operationId": "GetWorkflowRun",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "id of the run",
+ "name": "run",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowRun"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Delete a workflow run",
+ "operationId": "deleteActionRun",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "runid of the workflow run",
+ "name": "run",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "No Content"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
}
},
"/repos/{owner}/{repo}/actions/runs/{run}/artifacts": {
@@ -4233,7 +5279,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4272,6 +5318,70 @@
}
}
},
+ "/repos/{owner}/{repo}/actions/runs/{run}/jobs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Lists all jobs for a workflow run",
+ "operationId": "listWorkflowRunJobs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "runid of the workflow run",
+ "name": "run",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowJobsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/actions/secrets": {
"get": {
"produces": [
@@ -4285,7 +5395,7 @@
"parameters": [
{
"type": "string",
- "description": "owner of the repository",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4415,7 +5525,7 @@
],
"responses": {
"204": {
- "description": "delete one secret of the organization"
+ "description": "delete one secret of the repository"
},
"400": {
"$ref": "#/responses/error"
@@ -4499,7 +5609,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4550,7 +5660,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4594,7 +5704,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4648,7 +5758,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -4679,14 +5789,14 @@
"201": {
"description": "response when creating a repo-level variable"
},
- "204": {
- "description": "response when creating a repo-level variable"
- },
"400": {
"$ref": "#/responses/error"
},
- "404": {
- "$ref": "#/responses/notFound"
+ "409": {
+ "description": "variable name already exists."
+ },
+ "500": {
+ "$ref": "#/responses/error"
}
}
},
@@ -4702,7 +5812,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the owner",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -5820,7 +6930,7 @@
},
{
"type": "string",
- "description": "username of the collaborator",
+ "description": "username of the user to check for being a collaborator",
"name": "collaborator",
"in": "path",
"required": true
@@ -5864,7 +6974,7 @@
},
{
"type": "string",
- "description": "username of the collaborator to add",
+ "description": "username of the user to add or update as a collaborator",
"name": "collaborator",
"in": "path",
"required": true
@@ -5964,7 +7074,7 @@
},
{
"type": "string",
- "description": "username of the collaborator",
+ "description": "username of the collaborator whose permissions are to be obtained",
"name": "collaborator",
"in": "path",
"required": true
@@ -6021,6 +7131,20 @@
"in": "query"
},
{
+ "type": "string",
+ "format": "date-time",
+ "description": "Only commits after this date will be returned (ISO 8601 format)",
+ "name": "since",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "format": "date-time",
+ "description": "Only commits before this date will be returned (ISO 8601 format)",
+ "name": "until",
+ "in": "query"
+ },
+ {
"type": "boolean",
"description": "include diff stats for every commit (disable for speedup, default 'true')",
"name": "stat",
@@ -6300,13 +7424,14 @@
},
"/repos/{owner}/{repo}/contents": {
"get": {
+ "description": "This API follows GitHub's design, and it is not easy to use. Recommend users to use our \"contents-ext\" API instead.",
"produces": [
"application/json"
],
"tags": [
"repository"
],
- "summary": "Gets the metadata of all the entries of the root dir",
+ "summary": "Gets the metadata of all the entries of the root dir.",
"operationId": "repoGetContentsList",
"parameters": [
{
@@ -6325,7 +7450,7 @@
},
{
"type": "string",
- "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)",
+ "description": "The name of the commit/branch/tag. Default to the repository’s default branch.",
"name": "ref",
"in": "query"
}
@@ -6394,15 +7519,72 @@
}
}
},
+ "/repos/{owner}/{repo}/contents-ext/{filepath}": {
+ "get": {
+ "description": "It guarantees that only one of the response fields is set if the request succeeds. Users can pass \"includes=file_content\" or \"includes=lfs_metadata\" to retrieve more fields. \"includes=file_content\" only works for single file, if you need to retrieve file contents in batch, use \"file-contents\" API after listing the directory.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "The extended \"contents\" API, to get file metadata and/or content, or list a directory.",
+ "operationId": "repoGetContentsExt",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "path of the dir, file, symlink or submodule in the repo. Swagger requires path parameter to be \"required\", you can leave it empty or pass a single dot (\".\") to get the root directory.",
+ "name": "filepath",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "the name of the commit/branch/tag, default to the repository’s default branch.",
+ "name": "ref",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "By default this API's response only contains file's metadata. Use comma-separated \"includes\" options to retrieve more fields. Option \"file_content\" will try to retrieve the file content, \"lfs_metadata\" will try to retrieve LFS metadata, \"commit_metadata\" will try to retrieve commit metadata, and \"commit_message\" will try to retrieve commit message.",
+ "name": "includes",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ContentsExtResponse"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/contents/{filepath}": {
"get": {
+ "description": "This API follows GitHub's design, and it is not easy to use. Recommend users to use the \"contents-ext\" API instead.",
"produces": [
"application/json"
],
"tags": [
"repository"
],
- "summary": "Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir",
+ "summary": "Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir.",
"operationId": "repoGetContents",
"parameters": [
{
@@ -6428,7 +7610,7 @@
},
{
"type": "string",
- "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)",
+ "description": "The name of the commit/branch/tag. Default to the repository’s default branch.",
"name": "ref",
"in": "query"
}
@@ -6620,6 +7802,9 @@
"404": {
"$ref": "#/responses/error"
},
+ "422": {
+ "$ref": "#/responses/error"
+ },
"423": {
"$ref": "#/responses/repoArchivedError"
}
@@ -6710,7 +7895,7 @@
},
{
"type": "string",
- "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)",
+ "description": "The name of the commit/branch/tag. Default to the repository’s default branch.",
"name": "ref",
"in": "query"
}
@@ -6725,6 +7910,105 @@
}
}
},
+ "/repos/{owner}/{repo}/file-contents": {
+ "get": {
+ "description": "See the POST method. This GET method supports using JSON encoded request body in query parameter.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get the metadata and contents of requested files",
+ "operationId": "repoGetFileContents",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "The name of the commit/branch/tag. Default to the repository’s default branch.",
+ "name": "ref",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "The JSON encoded body (see the POST request): {\"files\": [\"filename1\", \"filename2\"]}",
+ "name": "body",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ContentsListResponse"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "post": {
+ "description": "Uses automatic pagination based on default page size and max response size and returns the maximum allowed number of files. Files which could not be retrieved are null. Files which are too large are being returned with `encoding == null`, `content == null` and `size \u003e 0`, they can be requested separately by using the `download_url`.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get the metadata and contents of requested files",
+ "operationId": "repoGetFileContentsPost",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "The name of the commit/branch/tag. Default to the repository’s default branch.",
+ "name": "ref",
+ "in": "query"
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/GetFilesOptions"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ContentsListResponse"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/forks": {
"get": {
"produces": [
@@ -9946,6 +11230,111 @@
}
}
},
+ "/repos/{owner}/{repo}/issues/{index}/lock": {
+ "put": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Lock an issue",
+ "operationId": "issueLockIssue",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "index of the issue",
+ "name": "index",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/LockIssueOption"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Unlock an issue",
+ "operationId": "issueUnlockIssue",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "index of the issue",
+ "name": "index",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/issues/{index}/pin": {
"post": {
"tags": [
@@ -10307,7 +11696,7 @@
"$ref": "#/responses/notFound"
},
"409": {
- "description": "Cannot cancel a non existent stopwatch"
+ "description": "Cannot cancel a non-existent stopwatch"
}
}
}
@@ -10413,7 +11802,7 @@
"$ref": "#/responses/notFound"
},
"409": {
- "description": "Cannot stop a non existent stopwatch"
+ "description": "Cannot stop a non-existent stopwatch"
}
}
}
@@ -10562,7 +11951,7 @@
},
{
"type": "string",
- "description": "user to subscribe",
+ "description": "username of the user to subscribe the issue to",
"name": "user",
"in": "path",
"required": true
@@ -10620,7 +12009,7 @@
},
{
"type": "string",
- "description": "user witch unsubscribe",
+ "description": "username of the user to unsubscribe from an issue",
"name": "user",
"in": "path",
"required": true
@@ -11490,7 +12879,7 @@
},
{
"type": "string",
- "description": "The name of the commit/branch/tag. Default the repository’s default branch",
+ "description": "The name of the commit/branch/tag. Default to the repository’s default branch",
"name": "ref",
"in": "query"
}
@@ -12035,7 +13424,7 @@
"parameters": [
{
"type": "string",
- "description": "Owner of the repo",
+ "description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
@@ -12069,6 +13458,7 @@
"enum": [
"oldest",
"recentupdate",
+ "recentclose",
"leastupdate",
"mostcomment",
"leastcomment",
@@ -13633,7 +15023,7 @@
},
{
"type": "string",
- "description": "The name of the commit/branch/tag. Default the repository’s default branch",
+ "description": "The name of the commit/branch/tag. Default to the repository’s default branch",
"name": "ref",
"in": "query"
}
@@ -14361,6 +15751,42 @@
}
}
},
+ "/repos/{owner}/{repo}/signing-key.pub": {
+ "get": {
+ "produces": [
+ "text/plain"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get signing-key.pub for given repository",
+ "operationId": "repoSigningKeySSH",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "ssh public key",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/stargazers": {
"get": {
"produces": [
@@ -15395,7 +16821,7 @@
},
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose tracked times are to be listed",
"name": "user",
"in": "path",
"required": true
@@ -16037,7 +17463,7 @@
"parameters": [
{
"type": "string",
- "description": "name of the template repository owner",
+ "description": "owner of the template repository",
"name": "template_owner",
"in": "path",
"required": true
@@ -16194,6 +17620,26 @@
}
}
},
+ "/signing-key.pub": {
+ "get": {
+ "produces": [
+ "text/plain"
+ ],
+ "tags": [
+ "miscellaneous"
+ ],
+ "summary": "Get default signing-key.pub",
+ "operationId": "getSigningKeySSH",
+ "responses": {
+ "200": {
+ "description": "ssh public key",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
"/teams/{id}": {
"get": {
"produces": [
@@ -16398,7 +17844,7 @@
},
{
"type": "string",
- "description": "username of the member to list",
+ "description": "username of the user whose data is to be listed",
"name": "username",
"in": "path",
"required": true
@@ -16433,7 +17879,7 @@
},
{
"type": "string",
- "description": "username of the user to add",
+ "description": "username of the user to add to a team",
"name": "username",
"in": "path",
"required": true
@@ -16471,7 +17917,7 @@
},
{
"type": "string",
- "description": "username of the user to remove",
+ "description": "username of the user to remove from a team",
"name": "username",
"in": "path",
"required": true
@@ -16725,6 +18171,72 @@
}
}
},
+ "/user/actions/jobs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Get workflow jobs",
+ "operationId": "getUserWorkflowJobs",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowJobsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/user/actions/runners": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Get user-level runners",
+ "operationId": "getUserRunners",
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunnersResponse"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/user/actions/runners/registration-token": {
"get": {
"produces": [
@@ -16740,6 +18252,150 @@
"$ref": "#/responses/RegistrationToken"
}
}
+ },
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Get an user's actions runner registration token",
+ "operationId": "userCreateRunnerRegistrationToken",
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
+ "/user/actions/runners/{runner_id}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Get an user-level runner",
+ "operationId": "getUserRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/definitions/ActionRunner"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Delete an user-level runner",
+ "operationId": "deleteUserRunner",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "id of the runner",
+ "name": "runner_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "runner has been deleted"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/user/actions/runs": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Get workflow runs",
+ "operationId": "getUserWorkflowRuns",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "workflow event name",
+ "name": "event",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow branch",
+ "name": "branch",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "workflow status (pending, queued, in_progress, failure, success, skipped)",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggered by user",
+ "name": "actor",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "triggering sha of the workflow run",
+ "name": "head_sha",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/WorkflowRunsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
}
},
"/user/actions/secrets/{secretname}": {
@@ -16961,16 +18617,13 @@
],
"responses": {
"201": {
- "description": "response when creating a variable"
- },
- "204": {
- "description": "response when creating a variable"
+ "description": "successfully created the user-level variable"
},
"400": {
"$ref": "#/responses/error"
},
- "404": {
- "$ref": "#/responses/notFound"
+ "409": {
+ "description": "variable name already exists."
}
}
},
@@ -17243,7 +18896,7 @@
"parameters": [
{
"type": "string",
- "description": "user to check",
+ "description": "username of the user to check",
"name": "username",
"in": "path",
"required": true
@@ -17267,7 +18920,7 @@
"parameters": [
{
"type": "string",
- "description": "user to block",
+ "description": "username of the user to block",
"name": "username",
"in": "path",
"required": true
@@ -17300,7 +18953,7 @@
"parameters": [
{
"type": "string",
- "description": "user to unblock",
+ "description": "username of the user to unblock",
"name": "username",
"in": "path",
"required": true
@@ -17462,7 +19115,7 @@
"parameters": [
{
"type": "string",
- "description": "username of followed user",
+ "description": "username of the user to check for authenticated followers",
"name": "username",
"in": "path",
"required": true
@@ -17486,7 +19139,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user to follow",
+ "description": "username of the user to follow",
"name": "username",
"in": "path",
"required": true
@@ -17513,7 +19166,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user to unfollow",
+ "description": "username of the user to unfollow",
"name": "username",
"in": "path",
"required": true
@@ -18467,7 +20120,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user to get",
+ "description": "username of the user whose data is to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18496,7 +20149,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose activity feeds are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18550,7 +20203,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose followers are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18591,7 +20244,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose followed users are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18629,14 +20282,14 @@
"parameters": [
{
"type": "string",
- "description": "username of following user",
+ "description": "username of the following user",
"name": "username",
"in": "path",
"required": true
},
{
"type": "string",
- "description": "username of followed user",
+ "description": "username of the followed user",
"name": "target",
"in": "path",
"required": true
@@ -18665,7 +20318,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose GPG key list is to be obtained",
"name": "username",
"in": "path",
"required": true
@@ -18706,7 +20359,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user to get",
+ "description": "username of the user whose heatmap is to be obtained",
"name": "username",
"in": "path",
"required": true
@@ -18735,7 +20388,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose public keys are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18782,7 +20435,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose organizations are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18823,7 +20476,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose permissions are to be obtained",
"name": "username",
"in": "path",
"required": true
@@ -18862,7 +20515,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose owned repos are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18903,7 +20556,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose starred repos are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18947,7 +20600,7 @@
"parameters": [
{
"type": "string",
- "description": "username of the user",
+ "description": "username of the user whose watched repos are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -18988,7 +20641,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of to user whose access tokens are to be listed",
"name": "username",
"in": "path",
"required": true
@@ -19030,7 +20683,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose token is to be created",
"name": "username",
"in": "path",
"required": true
@@ -19069,7 +20722,7 @@
"parameters": [
{
"type": "string",
- "description": "username of user",
+ "description": "username of the user whose token is to be deleted",
"name": "username",
"in": "path",
"required": true
@@ -19136,11 +20789,21 @@
"type": "object",
"title": "AccessToken represents an API access token.",
"properties": {
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "Created"
+ },
"id": {
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
+ "last_used_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "Updated"
+ },
"name": {
"type": "string",
"x-go-name": "Name"
@@ -19233,6 +20896,80 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ActionRunner": {
+ "description": "ActionRunner represents a Runner",
+ "type": "object",
+ "properties": {
+ "busy": {
+ "type": "boolean",
+ "x-go-name": "Busy"
+ },
+ "ephemeral": {
+ "type": "boolean",
+ "x-go-name": "Ephemeral"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "ID"
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionRunnerLabel"
+ },
+ "x-go-name": "Labels"
+ },
+ "name": {
+ "type": "string",
+ "x-go-name": "Name"
+ },
+ "status": {
+ "type": "string",
+ "x-go-name": "Status"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
+ "ActionRunnerLabel": {
+ "description": "ActionRunnerLabel represents a Runner Label",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "ID"
+ },
+ "name": {
+ "type": "string",
+ "x-go-name": "Name"
+ },
+ "type": {
+ "type": "string",
+ "x-go-name": "Type"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
+ "ActionRunnersResponse": {
+ "description": "ActionRunnersResponse returns Runners",
+ "type": "object",
+ "properties": {
+ "runners": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionRunner"
+ },
+ "x-go-name": "Entries"
+ },
+ "total_count": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "TotalCount"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"ActionTask": {
"description": "ActionTask represents a ActionTask",
"type": "object",
@@ -19400,23 +21137,270 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ActionWorkflowJob": {
+ "description": "ActionWorkflowJob represents a WorkflowJob",
+ "type": "object",
+ "properties": {
+ "completed_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "CompletedAt"
+ },
+ "conclusion": {
+ "type": "string",
+ "x-go-name": "Conclusion"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "CreatedAt"
+ },
+ "head_branch": {
+ "type": "string",
+ "x-go-name": "HeadBranch"
+ },
+ "head_sha": {
+ "type": "string",
+ "x-go-name": "HeadSha"
+ },
+ "html_url": {
+ "type": "string",
+ "x-go-name": "HTMLURL"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "ID"
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "x-go-name": "Labels"
+ },
+ "name": {
+ "type": "string",
+ "x-go-name": "Name"
+ },
+ "run_attempt": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "RunAttempt"
+ },
+ "run_id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "RunID"
+ },
+ "run_url": {
+ "type": "string",
+ "x-go-name": "RunURL"
+ },
+ "runner_id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "RunnerID"
+ },
+ "runner_name": {
+ "type": "string",
+ "x-go-name": "RunnerName"
+ },
+ "started_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "StartedAt"
+ },
+ "status": {
+ "type": "string",
+ "x-go-name": "Status"
+ },
+ "steps": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionWorkflowStep"
+ },
+ "x-go-name": "Steps"
+ },
+ "url": {
+ "type": "string",
+ "x-go-name": "URL"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
+ "ActionWorkflowJobsResponse": {
+ "description": "ActionWorkflowJobsResponse returns ActionWorkflowJobs",
+ "type": "object",
+ "properties": {
+ "jobs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionWorkflowJob"
+ },
+ "x-go-name": "Entries"
+ },
+ "total_count": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "TotalCount"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
+ "ActionWorkflowResponse": {
+ "description": "ActionWorkflowResponse returns a ActionWorkflow",
+ "type": "object",
+ "properties": {
+ "total_count": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "TotalCount"
+ },
+ "workflows": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionWorkflow"
+ },
+ "x-go-name": "Workflows"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"ActionWorkflowRun": {
"description": "ActionWorkflowRun represents a WorkflowRun",
"type": "object",
"properties": {
+ "actor": {
+ "$ref": "#/definitions/User"
+ },
+ "completed_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "CompletedAt"
+ },
+ "conclusion": {
+ "type": "string",
+ "x-go-name": "Conclusion"
+ },
+ "display_title": {
+ "type": "string",
+ "x-go-name": "DisplayTitle"
+ },
+ "event": {
+ "type": "string",
+ "x-go-name": "Event"
+ },
+ "head_branch": {
+ "type": "string",
+ "x-go-name": "HeadBranch"
+ },
+ "head_repository": {
+ "$ref": "#/definitions/Repository"
+ },
"head_sha": {
"type": "string",
"x-go-name": "HeadSha"
},
+ "html_url": {
+ "type": "string",
+ "x-go-name": "HTMLURL"
+ },
"id": {
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
+ "path": {
+ "type": "string",
+ "x-go-name": "Path"
+ },
+ "repository": {
+ "$ref": "#/definitions/Repository"
+ },
"repository_id": {
"type": "integer",
"format": "int64",
"x-go-name": "RepositoryID"
+ },
+ "run_attempt": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "RunAttempt"
+ },
+ "run_number": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "RunNumber"
+ },
+ "started_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "StartedAt"
+ },
+ "status": {
+ "type": "string",
+ "x-go-name": "Status"
+ },
+ "trigger_actor": {
+ "$ref": "#/definitions/User"
+ },
+ "url": {
+ "type": "string",
+ "x-go-name": "URL"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
+ "ActionWorkflowRunsResponse": {
+ "description": "ActionWorkflowRunsResponse returns ActionWorkflowRuns",
+ "type": "object",
+ "properties": {
+ "total_count": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "TotalCount"
+ },
+ "workflow_runs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionWorkflowRun"
+ },
+ "x-go-name": "Entries"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
+ "ActionWorkflowStep": {
+ "description": "ActionWorkflowStep represents a step of a WorkflowJob",
+ "type": "object",
+ "properties": {
+ "completed_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "CompletedAt"
+ },
+ "conclusion": {
+ "type": "string",
+ "x-go-name": "Conclusion"
+ },
+ "name": {
+ "type": "string",
+ "x-go-name": "Name"
+ },
+ "number": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "Number"
+ },
+ "started_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "StartedAt"
+ },
+ "status": {
+ "type": "string",
+ "x-go-name": "Status"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -19558,7 +21542,7 @@
"x-go-name": "Time"
},
"user_name": {
- "description": "User who spent the time (optional)",
+ "description": "username of the user who spent the time working on the issue (optional)",
"type": "string",
"x-go-name": "User"
}
@@ -19905,7 +21889,7 @@
],
"properties": {
"content": {
- "description": "new or updated file content, must be base64 encoded",
+ "description": "new or updated file content, it must be base64 encoded",
"type": "string",
"x-go-name": "ContentBase64"
},
@@ -19915,11 +21899,13 @@
"x-go-name": "FromPath"
},
"operation": {
- "description": "indicates what to do with the file",
+ "description": "indicates what to do with the file: \"create\" for creating a new file, \"update\" for updating an existing file,\n\"upload\" for creating or updating a file, \"rename\" for renaming a file, and \"delete\" for deleting an existing file.",
"type": "string",
"enum": [
"create",
"update",
+ "upload",
+ "rename",
"delete"
],
"x-go-name": "Operation"
@@ -19930,7 +21916,7 @@
"x-go-name": "Path"
},
"sha": {
- "description": "sha is the SHA for the file that already exists, required for update or delete",
+ "description": "the blob ID (SHA) for the file that already exists, required for changing existing files",
"type": "string",
"x-go-name": "SHA"
}
@@ -20046,7 +22032,17 @@
"x-go-name": "SHA"
},
"state": {
- "$ref": "#/definitions/CommitStatusState"
+ "type": "string",
+ "enum": [
+ "pending",
+ "success",
+ "error",
+ "failure",
+ "warning",
+ "skipped"
+ ],
+ "x-go-enum-desc": "pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending\nsuccess CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success\nerror CommitStatusError CommitStatusError is for when the CommitStatus is Error\nfailure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure\nwarning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning\nskipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped",
+ "x-go-name": "State"
},
"statuses": {
"type": "array",
@@ -20274,7 +22270,17 @@
"x-go-name": "ID"
},
"status": {
- "$ref": "#/definitions/CommitStatusState"
+ "type": "string",
+ "enum": [
+ "pending",
+ "success",
+ "error",
+ "failure",
+ "warning",
+ "skipped"
+ ],
+ "x-go-enum-desc": "pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending\nsuccess CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success\nerror CommitStatusError CommitStatusError is for when the CommitStatus is Error\nfailure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure\nwarning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning\nskipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped",
+ "x-go-name": "State"
},
"target_url": {
"type": "string",
@@ -20292,11 +22298,6 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
- "CommitStatusState": {
- "description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\" and \"failure\"",
- "type": "string",
- "x-go-package": "code.gitea.io/gitea/modules/structs"
- },
"CommitUser": {
"type": "object",
"title": "CommitUser contains information of a user in the context of a commit.",
@@ -20336,6 +22337,22 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ContentsExtResponse": {
+ "type": "object",
+ "properties": {
+ "dir_contents": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ContentsResponse"
+ },
+ "x-go-name": "DirContents"
+ },
+ "file_contents": {
+ "$ref": "#/definitions/ContentsResponse"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"ContentsResponse": {
"description": "ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content",
"type": "object",
@@ -20365,10 +22382,33 @@
"type": "string",
"x-go-name": "HTMLURL"
},
+ "last_author_date": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "LastAuthorDate"
+ },
+ "last_commit_message": {
+ "type": "string",
+ "x-go-name": "LastCommitMessage"
+ },
"last_commit_sha": {
"type": "string",
"x-go-name": "LastCommitSHA"
},
+ "last_committer_date": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "LastCommitterDate"
+ },
+ "lfs_oid": {
+ "type": "string",
+ "x-go-name": "LfsOid"
+ },
+ "lfs_size": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "LfsSize"
+ },
"name": {
"type": "string",
"x-go-name": "Name"
@@ -20424,7 +22464,18 @@
"items": {
"type": "string"
},
- "x-go-name": "Scopes"
+ "x-go-name": "Scopes",
+ "example": [
+ "all",
+ "read:activitypub",
+ "read:issue",
+ "write:misc",
+ "read:notification",
+ "read:organization",
+ "read:package",
+ "read:repository",
+ "read:user"
+ ]
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -21030,6 +23081,7 @@
"x-go-name": "RepoAdminChangeTeamAccess"
},
"username": {
+ "description": "username of the organization",
"type": "string",
"x-go-name": "UserName"
},
@@ -21219,6 +23271,10 @@
"type": "boolean",
"x-go-name": "IsPrerelease"
},
+ "tag_message": {
+ "type": "string",
+ "x-go-name": "TagMessage"
+ },
"tag_name": {
"type": "string",
"x-go-name": "TagName"
@@ -21324,7 +23380,17 @@
"x-go-name": "Description"
},
"state": {
- "$ref": "#/definitions/CommitStatusState"
+ "type": "string",
+ "enum": [
+ "pending",
+ "success",
+ "error",
+ "failure",
+ "warning",
+ "skipped"
+ ],
+ "x-go-enum-desc": "pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending\nsuccess CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success\nerror CommitStatusError CommitStatusError is for when the CommitStatus is Error\nfailure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure\nwarning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning\nskipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped",
+ "x-go-name": "State"
},
"target_url": {
"type": "string",
@@ -21466,7 +23532,9 @@
"x-go-name": "FullName"
},
"login_name": {
+ "description": "identifier of the user, provided by the external authenticator (if configured)",
"type": "string",
+ "default": "empty",
"x-go-name": "LoginName"
},
"must_change_password": {
@@ -21491,6 +23559,7 @@
"x-go-name": "SourceID"
},
"username": {
+ "description": "username of the user",
"type": "string",
"x-go-name": "Username"
},
@@ -21620,7 +23689,7 @@
"x-go-name": "NewBranchName"
},
"sha": {
- "description": "sha is the SHA for the file that already exists",
+ "description": "the blob ID (SHA) for the file that already exists, it is required for changing existing files",
"type": "string",
"x-go-name": "SHA"
},
@@ -22476,7 +24545,9 @@
"x-go-name": "Location"
},
"login_name": {
+ "description": "identifier of the user, provided by the external authenticator (if configured)",
"type": "string",
+ "default": "empty",
"x-go-name": "LoginName"
},
"max_repo_creation": {
@@ -22535,6 +24606,7 @@
"x-go-name": "UserID"
},
"username": {
+ "description": "username of the user",
"type": "string",
"x-go-name": "UserName"
},
@@ -22796,6 +24868,11 @@
"format": "int64",
"x-go-name": "DefaultMaxBlobSize"
},
+ "default_max_response_size": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "DefaultMaxResponseSize"
+ },
"default_paging_num": {
"type": "integer",
"format": "int64",
@@ -22891,7 +24968,7 @@
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"GenerateRepoOption": {
- "description": "GenerateRepoOption options when creating repository using a template",
+ "description": "GenerateRepoOption options when creating a repository using a template",
"type": "object",
"required": [
"owner",
@@ -22929,13 +25006,12 @@
"x-go-name": "Labels"
},
"name": {
- "description": "Name of the repository to create",
"type": "string",
"uniqueItems": true,
"x-go-name": "Name"
},
"owner": {
- "description": "The organization or person who will own the new repository",
+ "description": "the organization's name or individual user's name who will own the new repository",
"type": "string",
"x-go-name": "Owner"
},
@@ -22962,6 +25038,20 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "GetFilesOptions": {
+ "description": "GetFilesOptions options for retrieving metadate and content of multiple files",
+ "type": "object",
+ "properties": {
+ "files": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "x-go-name": "Files"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"GitBlobResponse": {
"description": "GitBlobResponse represents a git blob",
"type": "object",
@@ -22974,6 +25064,15 @@
"type": "string",
"x-go-name": "Encoding"
},
+ "lfs_oid": {
+ "type": "string",
+ "x-go-name": "LfsOid"
+ },
+ "lfs_size": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "LfsSize"
+ },
"sha": {
"type": "string",
"x-go-name": "SHA"
@@ -23445,6 +25544,7 @@
"x-go-name": "Index"
},
"owner": {
+ "description": "owner of the issue's repo",
"type": "string",
"x-go-name": "Owner"
},
@@ -23616,6 +25716,17 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "LockIssueOption": {
+ "description": "LockIssueOption options to lock an issue",
+ "type": "object",
+ "properties": {
+ "lock_reason": {
+ "type": "string",
+ "x-go-name": "Reason"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"MarkdownOption": {
"description": "MarkdownOption markdown options",
"type": "object",
@@ -23719,6 +25830,10 @@
"branch": {
"type": "string",
"x-go-name": "Branch"
+ },
+ "ff_only": {
+ "type": "boolean",
+ "x-go-name": "FfOnly"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -23814,7 +25929,7 @@
"x-go-name": "RepoName"
},
"repo_owner": {
- "description": "Name of User or Organisation who will own Repo after migration",
+ "description": "the organization's name or individual user's name who will own the migrated repository",
"type": "string",
"x-go-name": "RepoOwner"
},
@@ -23828,12 +25943,13 @@
"gogs",
"onedev",
"gitbucket",
- "codebase"
+ "codebase",
+ "codecommit"
],
"x-go-name": "Service"
},
"uid": {
- "description": "deprecated (only for backwards compatibility)",
+ "description": "deprecated (only for backwards compatibility, use repo_owner instead)",
"type": "integer",
"format": "int64",
"x-go-name": "RepoOwnerID"
@@ -24215,7 +26331,7 @@
"x-go-name": "RepoAdminChangeTeamAccess"
},
"username": {
- "description": "deprecated",
+ "description": "username of the organization\ndeprecated",
"type": "string",
"x-go-name": "UserName"
},
@@ -24330,10 +26446,6 @@
"description": "PackageFile represents a package file",
"type": "object",
"properties": {
- "Size": {
- "type": "integer",
- "format": "int64"
- },
"id": {
"type": "integer",
"format": "int64",
@@ -24358,6 +26470,11 @@
"sha512": {
"type": "string",
"x-go-name": "HashSHA512"
+ },
+ "size": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "Size"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -24458,6 +26575,7 @@
"x-go-name": "Name"
},
"username": {
+ "description": "username of the user",
"type": "string",
"x-go-name": "UserName"
}
@@ -24509,6 +26627,11 @@
"type": "string",
"x-go-name": "KeyType"
},
+ "last_used_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "Updated"
+ },
"read_only": {
"type": "boolean",
"x-go-name": "ReadOnly"
@@ -25155,6 +27278,10 @@
"type": "boolean",
"x-go-name": "AllowFastForwardOnly"
},
+ "allow_manual_merge": {
+ "type": "boolean",
+ "x-go-name": "AllowManualMerge"
+ },
"allow_merge_commits": {
"type": "boolean",
"x-go-name": "AllowMerge"
@@ -25184,6 +27311,10 @@
"format": "date-time",
"x-go-name": "ArchivedAt"
},
+ "autodetect_manual_merge": {
+ "type": "boolean",
+ "x-go-name": "AutodetectManualMerge"
+ },
"avatar_url": {
"type": "string",
"x-go-name": "AvatarURL"
@@ -25908,6 +28039,7 @@
"x-go-name": "UserID"
},
"user_name": {
+ "description": "username of the user",
"type": "string",
"x-go-name": "UserName"
}
@@ -26011,7 +28143,7 @@
"x-go-name": "NewBranchName"
},
"sha": {
- "description": "sha is the SHA for the file that already exists",
+ "description": "the blob ID (SHA) for the file that already exists, it is required for changing existing files",
"type": "string",
"x-go-name": "SHA"
},
@@ -26149,12 +28281,12 @@
"x-go-name": "Location"
},
"login": {
- "description": "the user's username",
+ "description": "login of the user, same as `username`",
"type": "string",
"x-go-name": "UserName"
},
"login_name": {
- "description": "the user's authentication sign-in name.",
+ "description": "identifier of the user, provided by the external authenticator (if configured)",
"type": "string",
"default": "empty",
"x-go-name": "LoginName"
@@ -26479,10 +28611,7 @@
"ActionWorkflowList": {
"description": "ActionWorkflowList",
"schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/ActionWorkflow"
- }
+ "$ref": "#/definitions/ActionWorkflowResponse"
}
},
"ActivityFeedsList": {
@@ -26690,6 +28819,12 @@
"$ref": "#/definitions/Compare"
}
},
+ "ContentsExtResponse": {
+ "description": "",
+ "schema": {
+ "$ref": "#/definitions/ContentsExtResponse"
+ }
+ },
"ContentsListResponse": {
"description": "ContentsListResponse",
"schema": {
@@ -27254,6 +29389,18 @@
}
}
},
+ "Runner": {
+ "description": "Runner",
+ "schema": {
+ "$ref": "#/definitions/ActionRunner"
+ }
+ },
+ "RunnerList": {
+ "description": "RunnerList",
+ "schema": {
+ "$ref": "#/definitions/ActionRunnersResponse"
+ }
+ },
"SearchResults": {
"description": "SearchResults",
"schema": {
@@ -27464,6 +29611,30 @@
}
}
},
+ "WorkflowJob": {
+ "description": "WorkflowJob",
+ "schema": {
+ "$ref": "#/definitions/ActionWorkflowJob"
+ }
+ },
+ "WorkflowJobsList": {
+ "description": "WorkflowJobsList",
+ "schema": {
+ "$ref": "#/definitions/ActionWorkflowJobsResponse"
+ }
+ },
+ "WorkflowRun": {
+ "description": "WorkflowRun",
+ "schema": {
+ "$ref": "#/definitions/ActionWorkflowRun"
+ }
+ },
+ "WorkflowRunsList": {
+ "description": "WorkflowRunsList",
+ "schema": {
+ "$ref": "#/definitions/ActionWorkflowRunsResponse"
+ }
+ },
"conflict": {
"description": "APIConflict is a conflict empty response"
},
@@ -27512,7 +29683,7 @@
"parameterBodies": {
"description": "parameterBodies",
"schema": {
- "$ref": "#/definitions/UpdateVariableOption"
+ "$ref": "#/definitions/LockIssueOption"
}
},
"redirect": {
diff --git a/templates/user/auth/oidc_wellknown.tmpl b/templates/user/auth/oidc_wellknown.tmpl
index 54bb4a763d..52c9a1b788 100644
--- a/templates/user/auth/oidc_wellknown.tmpl
+++ b/templates/user/auth/oidc_wellknown.tmpl
@@ -1,16 +1,16 @@
{
- "issuer": "{{AppUrl | JSEscape}}",
- "authorization_endpoint": "{{AppUrl | JSEscape}}login/oauth/authorize",
- "token_endpoint": "{{AppUrl | JSEscape}}login/oauth/access_token",
- "jwks_uri": "{{AppUrl | JSEscape}}login/oauth/keys",
- "userinfo_endpoint": "{{AppUrl | JSEscape}}login/oauth/userinfo",
- "introspection_endpoint": "{{AppUrl | JSEscape}}login/oauth/introspect",
+ "issuer": "{{.OidcIssuer}}",
+ "authorization_endpoint": "{{.OidcBaseUrl}}/login/oauth/authorize",
+ "token_endpoint": "{{.OidcBaseUrl}}/login/oauth/access_token",
+ "jwks_uri": "{{.OidcBaseUrl}}/login/oauth/keys",
+ "userinfo_endpoint": "{{.OidcBaseUrl}}/login/oauth/userinfo",
+ "introspection_endpoint": "{{.OidcBaseUrl}}/login/oauth/introspect",
"response_types_supported": [
"code",
"id_token"
],
"id_token_signing_alg_values_supported": [
- "{{.SigningKey.SigningMethod.Alg | JSEscape}}"
+ "{{.SigningKeyMethodAlg}}"
],
"subject_types_supported": [
"public"
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl
index d66568199d..a3f6e1471f 100644
--- a/templates/user/auth/signup_inner.tmpl
+++ b/templates/user/auth/signup_inner.tmpl
@@ -7,6 +7,9 @@
{{end}}
</h4>
<div class="ui attached segment">
+ {{if .IsFirstTimeRegistration}}
+ <p>{{ctx.Locale.Tr "auth.sign_up_tip"}}</p>
+ {{end}}
<form class="ui form" action="{{.SignUpLink}}" method="post">
{{.CsrfTokenHtml}}
{{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
index 47686dd442..37dede7af6 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -91,10 +91,10 @@
{{range $push.Commits}}
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
<div class="flex-text-block">
- <img class="ui avatar" src="{{$push.AvatarLink ctx .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
+ <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="text truncate">
- {{ctx.RenderUtils.RenderCommitMessage .Message ($repo.ComposeMetas ctx)}}
+ {{ctx.RenderUtils.RenderCommitMessage .Message $repo}}
</span>
</div>
{{end}}
diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl
index d0fe0abbc9..15b1b9e30b 100644
--- a/templates/user/dashboard/milestones.tmpl
+++ b/templates/user/dashboard/milestones.tmpl
@@ -116,7 +116,7 @@
{{ctx.Locale.Tr "repo.milestones.closed" $closedDate}}
{{else}}
{{if .DeadlineString}}
- <span{{if .IsOverdue}} class="text red"{{end}}>
+ <span class="flex-text-inline {{if .IsOverdue}}text red{{end}}">
{{svg "octicon-calendar" 14}}
{{DateUtils.AbsoluteShort (.DeadlineString|DateUtils.ParseLegacy)}}
</span>
diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl
index a828bc90e4..7eb845833f 100644
--- a/templates/user/dashboard/navbar.tmpl
+++ b/templates/user/dashboard/navbar.tmpl
@@ -2,32 +2,32 @@
<div class="ui secondary stackable menu">
<div class="item">
<div class="ui floating dropdown jump">
- <span class="text truncated-item-container">
+ <span class="text">
{{ctx.AvatarUtils.Avatar .ContextUser 24 "tw-mr-1"}}
- <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ <span class="gt-ellipsis">{{.ContextUser.ShortName 40}}</span>
<span class="org-visibility">
{{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
{{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon tw-ml-1"}}
</span>
- <div class="context user overflow menu">
+ <div class="menu context-user-switch">
<div class="header">
{{ctx.Locale.Tr "home.switch_dashboard_context"}}
</div>
- <div class="scrolling menu items">
- <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
+ <div class="scrolling menu">
+ <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
{{ctx.AvatarUtils.Avatar .SignedUser}}
- <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ <span class="gt-ellipsis">{{.SignedUser.ShortName 40}}</span>
<span class="org-visibility">
{{if .SignedUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
{{if .SignedUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
</span>
</a>
{{range .Orgs}}
- <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item truncated-item-container" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
+ <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
{{ctx.AvatarUtils.Avatar .}}
- <span class="truncated-item-name">{{.ShortName 40}}</span>
+ <span class="gt-ellipsis">{{.ShortName 40}}</span>
<span class="org-visibility">
{{if .Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
{{if .Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
@@ -37,7 +37,7 @@
</div>
{{if .SignedUser.CanCreateOrganization}}
<a class="item" href="{{AppSubUrl}}/org/create">
- {{svg "octicon-plus"}}&nbsp;&nbsp;&nbsp;{{ctx.Locale.Tr "new_org"}}
+ {{svg "octicon-plus" 16 "tw-ml-1 tw-mr-5"}}{{ctx.Locale.Tr "new_org"}}
</a>
{{end}}
</div>
@@ -77,7 +77,7 @@
{{end}}
{{if .ContextUser.IsOrganization}}
- <div class="right menu">
+ <div class="right menu tw-flex-wrap tw-justify-end">
<a class="{{if .PageIsNews}}active {{end}}item tw-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
{{svg "octicon-rss"}}&nbsp;{{ctx.Locale.Tr "activities"}}
</a>
@@ -98,7 +98,7 @@
{{end}}
<div class="item">
<a class="ui primary basic button" href="{{.ContextUser.HomeLink}}" title="{{ctx.Locale.Tr "home.view_home" .ContextUser.Name}}">
- {{ctx.Locale.Tr "home.view_home" (.ContextUser.ShortName 40)}}
+ {{ctx.Locale.Tr "home.view_home" (.ContextUser.ShortName 20)}}
</a>
</div>
</div>
diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl
index 0d2371a358..b9faba2b90 100644
--- a/templates/user/notification/notification_div.tmpl
+++ b/templates/user/notification/notification_div.tmpl
@@ -1,124 +1,96 @@
<div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_div" data-sequence-number="{{.SequenceNumber}}">
<div class="ui container">
- {{$notificationUnreadCount := call .NotificationUnreadCount}}
- <div class="tw-flex tw-items-center tw-justify-between tw-mb-[--page-spacing]">
+ {{$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="small-menu-items ui compact tiny menu">
- <a class="{{if eq .Status 1}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=unread">
+ <a class="{{if not $pageTypeIsRead}}active{{end}} item" href="{{AppSubUrl}}/notifications?type=unread">
{{ctx.Locale.Tr "notification.unread"}}
<div class="notifications-unread-count ui label {{if not $notificationUnreadCount}}tw-hidden{{end}}">{{$notificationUnreadCount}}</div>
</a>
- <a class="{{if eq .Status 2}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=read">
+ <a class="{{if $pageTypeIsRead}}active{{end}} item" href="{{AppSubUrl}}/notifications?type=read">
{{ctx.Locale.Tr "notification.read"}}
</a>
</div>
- {{if and (eq .Status 1)}}
+ {{if and (not $pageTypeIsRead) $notificationUnreadCount}}
<form action="{{AppSubUrl}}/notifications/purge" method="post">
{{$.CsrfTokenHtml}}
- <div class="{{if not $notificationUnreadCount}}tw-hidden{{end}}">
- <button class="ui mini button primary tw-mr-0" title="{{ctx.Locale.Tr "notification.mark_all_as_read"}}">
- {{svg "octicon-checklist"}}
- </button>
- </div>
+ <button class="ui mini button primary tw-mr-0" title="{{ctx.Locale.Tr "notification.mark_all_as_read"}}">
+ {{svg "octicon-checklist"}}
+ </button>
</form>
{{end}}
</div>
- <div class="tw-p-0">
- <div id="notification_table">
- {{if not .Notifications}}
- <div class="tw-flex tw-items-center tw-flex-col tw-p-4">
- {{svg "octicon-inbox" 56 "tw-mb-4"}}
- {{if eq .Status 1}}
- {{ctx.Locale.Tr "notification.no_unread"}}
+ <div id="notification_table">
+ {{range $one := .Notifications}}
+ <div class="notifications-item" id="notification_{{$one.ID}}" data-status="{{$one.Status}}">
+ <div class="tw-self-start tw-mt-[2px]">
+ {{if $one.Issue}}
+ {{template "shared/issueicon" $one.Issue}}
{{else}}
- {{ctx.Locale.Tr "notification.no_read"}}
+ {{svg "octicon-repo" 16 "text grey"}}
{{end}}
</div>
- {{else}}
- {{range $notification := .Notifications}}
- <div class="notifications-item tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-p-2" id="notification_{{.ID}}" data-status="{{.Status}}">
- <div class="notifications-icon tw-ml-2 tw-mr-1 tw-self-start tw-mt-1">
- {{if .Issue}}
- {{template "shared/issueicon" .Issue}}
- {{else}}
- {{svg "octicon-repo" 16 "text grey"}}
- {{end}}
- </div>
- <a class="notifications-link tw-flex tw-flex-1 tw-flex-col silenced" href="{{.Link ctx}}">
- <div class="notifications-top-row tw-text-13 tw-break-anywhere">
- {{.Repository.FullName}} {{if .Issue}}<span class="text light-3">#{{.Issue.Index}}</span>{{end}}
- {{if eq .Status 3}}
- {{svg "octicon-pin" 13 "text blue tw-mt-0.5 tw-ml-1"}}
- {{end}}
- </div>
- <div class="notifications-bottom-row tw-text-16 tw-py-0.5">
- <span class="issue-title tw-break-anywhere">
- {{if .Issue}}
- {{.Issue.Title | ctx.RenderUtils.RenderIssueSimpleTitle}}
- {{else}}
- {{.Repository.FullName}}
- {{end}}
- </span>
- </div>
- </a>
- <div class="notifications-updated tw-items-center tw-mr-2">
- {{if .Issue}}
- {{DateUtils.TimeSince .Issue.UpdatedUnix}}
- {{else}}
- {{DateUtils.TimeSince .UpdatedUnix}}
- {{end}}
- </div>
- <div class="notifications-buttons tw-items-center tw-justify-end tw-gap-1 tw-px-1">
- {{if ne .Status 3}}
- <form action="{{AppSubUrl}}/notifications/status" method="post">
- {{$.CsrfTokenHtml}}
- <input type="hidden" name="notification_id" value="{{.ID}}">
- <input type="hidden" name="status" value="pinned">
- <button class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.pin"}}"
- data-url="{{AppSubUrl}}/notifications/status"
- data-status="pinned"
- data-page="{{$.Page.Paginater.Current}}"
- data-notification-id="{{.ID}}"
- data-q="{{$.Keyword}}">
- {{svg "octicon-pin"}}
- </button>
- </form>
- {{end}}
- {{if or (eq .Status 1) (eq .Status 3)}}
- <form action="{{AppSubUrl}}/notifications/status" method="post">
- {{$.CsrfTokenHtml}}
- <input type="hidden" name="notification_id" value="{{.ID}}">
- <input type="hidden" name="status" value="read">
- <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}">
- <button class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_read"}}"
- data-url="{{AppSubUrl}}/notifications/status"
- data-status="read"
- data-page="{{$.Page.Paginater.Current}}"
- data-notification-id="{{.ID}}"
- data-q="{{$.Keyword}}">
- {{svg "octicon-check"}}
- </button>
- </form>
- {{else if eq .Status 2}}
- <form action="{{AppSubUrl}}/notifications/status" method="post">
- {{$.CsrfTokenHtml}}
- <input type="hidden" name="notification_id" value="{{.ID}}">
- <input type="hidden" name="status" value="unread">
- <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}">
- <button class="btn interact-bg tw-p-2" title="{{ctx.Locale.Tr "notification.mark_as_unread"}}"
- data-url="{{AppSubUrl}}/notifications/status"
- data-status="unread"
- data-page="{{$.Page.Paginater.Current}}"
- data-notification-id="{{.ID}}"
- data-q="{{$.Keyword}}">
- {{svg "octicon-bell"}}
- </button>
- </form>
- {{end}}
- </div>
+ <a class="notifications-link silenced tw-flex-1" href="{{$one.Link ctx}}">
+ <div class="flex-text-block tw-text-[0.95em]">
+ {{$one.Repository.FullName}} {{if $one.Issue}}<span class="text light-3">#{{$one.Issue.Index}}</span>{{end}}
+ {{if eq $one.Status $statusPinned}}
+ {{svg "octicon-pin" 13 "text blue"}}
+ {{end}}
+ </div>
+ <div class="tw-text-16 tw-py-0.5">
+ {{if $one.Issue}}
+ {{$one.Issue.Title | ctx.RenderUtils.RenderIssueSimpleTitle}}
+ {{else}}
+ {{$one.Repository.FullName}}
+ {{end}}
</div>
+ </a>
+ <div class="notifications-updated flex-text-inline">
+ {{if $one.Issue}}
+ {{DateUtils.TimeSince $one.Issue.UpdatedUnix}}
+ {{else}}
+ {{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"
+ >
+ {{$.CsrfTokenHtml}}
+ <input type="hidden" name="notification_id" value="{{$one.ID}}">
+ {{if ne $one.Status $statusPinned}}
+ <button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "notification.pin"}}"
+ name="notification_action" value="pin"
+ >
+ {{svg "octicon-pin"}}
+ </button>
+ {{end}}
+ {{if or (eq $one.Status $statusUnread) (eq $one.Status $statusPinned)}}
+ <button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "notification.mark_as_read"}}"
+ name="notification_action" value="mark_as_read"
+ >
+ {{svg "octicon-check"}}
+ </button>
+ {{else if eq $one.Status $statusRead}}
+ <button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "notification.mark_as_unread"}}"
+ name="notification_action" value="mark_as_unread"
+ >
+ {{svg "octicon-bell"}}
+ </button>
+ {{end}}
+ </form>
+ </div>
+ {{else}}
+ <div class="empty-placeholder">
+ {{svg "octicon-inbox" 56 "tw-mb-4"}}
+ {{if $pageTypeIsRead}}
+ {{ctx.Locale.Tr "notification.no_read"}}
+ {{else}}
+ {{ctx.Locale.Tr "notification.no_unread"}}
{{end}}
- {{end}}
- </div>
+ </div>
+ {{end}}
</div>
{{template "base/paginate" .}}
</div>
diff --git a/templates/user/notification/notification_subscriptions.tmpl b/templates/user/notification/notification_subscriptions.tmpl
index 6ef53ab654..e4dd27e63b 100644
--- a/templates/user/notification/notification_subscriptions.tmpl
+++ b/templates/user/notification/notification_subscriptions.tmpl
@@ -69,8 +69,8 @@
{{template "shared/issuelist" dict "." . "listType" "dashboard"}}
{{end}}
{{else}}
- {{template "shared/repo_search" .}}
- {{template "explore/repo_list" .}}
+ {{template "shared/repo/search" .}}
+ {{template "shared/repo/list" .}}
{{template "base/paginate" .}}
{{end}}
</div>
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index e5c3412ddd..74a53b937d 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -17,8 +17,8 @@
{{template "user/dashboard/feeds" .}}
{{else if eq .TabName "stars"}}
<div class="stars">
- {{template "shared/repo_search" .}}
- {{template "explore/repo_list" .}}
+ {{template "shared/repo/search" .}}
+ {{template "shared/repo/list" .}}
{{template "base/paginate" .}}
</div>
{{else if eq .TabName "following"}}
@@ -30,8 +30,8 @@
{{else if eq .TabName "organizations"}}
{{template "repo/user_cards" .}}
{{else}}
- {{template "shared/repo_search" .}}
- {{template "explore/repo_list" .}}
+ {{template "shared/repo/search" .}}
+ {{template "shared/repo/list" .}}
{{template "base/paginate" .}}
{{end}}
</div>
diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl
index 27b0ef10c7..7dbac0ebd4 100644
--- a/templates/user/settings/account.tmpl
+++ b/templates/user/settings/account.tmpl
@@ -35,35 +35,12 @@
{{end}}
</div>
- {{if not (and ($.UserDisabledFeatures.Contains "manage_credentials") (not $.EnableNotifyMail))}}
+ {{if not ($.UserDisabledFeatures.Contains "manage_credentials")}}
<h4 class="ui top attached header">
{{ctx.Locale.Tr "settings.manage_emails"}}
</h4>
<div class="ui attached segment">
<div class="ui list flex-items-block">
- {{if $.EnableNotifyMail}}
- <div class="item">
- <div class="tw-mb-2">{{ctx.Locale.Tr "settings.email_desc"}}</div>
- <form action="{{AppSubUrl}}/user/settings/account/email" class="ui form" method="post">
- {{$.CsrfTokenHtml}}
- <input name="_method" type="hidden" value="NOTIFICATION">
- <div class="tw-flex tw-flex-wrap tw-gap-2">
- <div class="ui selection dropdown">
- <input name="preference" type="hidden" value="{{.EmailNotificationsPreference}}">
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
- <div class="text"></div>
- <div class="menu">
- <div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.enable"}}</div>
- <div data-value="andyourown" class="{{if eq .EmailNotificationsPreference "andyourown"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.andyourown"}}</div>
- <div data-value="onmention" class="{{if eq .EmailNotificationsPreference "onmention"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.onmention"}}</div>
- <div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.disable"}}</div>
- </div>
- </div>
- <button class="ui primary button">{{ctx.Locale.Tr "settings.email_notifications.submit"}}</button>
- </div>
- </form>
- </div>
- {{end}}
{{if not ($.UserDisabledFeatures.Contains "manage_credentials")}}
{{range .Emails}}
<div class="item tw-flex-wrap">
diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl
index 501f238c7a..8c24da7fc9 100644
--- a/templates/user/settings/applications.tmpl
+++ b/templates/user/settings/applications.tmpl
@@ -68,7 +68,7 @@
</label>
</div>
<div>
- <div class="tw-my-2">{{ctx.Locale.Tr "settings.access_token_desc" (HTMLFormat `href="%s/api/swagger" target="_blank"` AppSubUrl) (`href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`|SafeHTML)}}</div>
+ <div class="tw-my-2">{{ctx.Locale.Tr "settings.access_token_desc" (HTMLFormat `href="%s/api/swagger" target="_blank"` AppSubUrl) (HTMLFormat `href="%s" target="_blank"` "https://docs.gitea.com/development/oauth2-provider#scopes")}}</div>
<table class="ui table unstackable tw-my-2">
{{range $category := .TokenCategories}}
<tr>
diff --git a/templates/user/settings/hooks.tmpl b/templates/user/settings/hooks.tmpl
index 477c333220..e2d18001f2 100644
--- a/templates/user/settings/hooks.tmpl
+++ b/templates/user/settings/hooks.tmpl
@@ -1,5 +1,5 @@
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings webhooks")}}
<div class="user-setting-content">
- {{template "repo/settings/webhook/list" .}}
+ {{template "repo/settings/webhook/base_list" .}}
</div>
{{template "user/settings/layout_footer" .}}
diff --git a/templates/user/settings/navbar.tmpl b/templates/user/settings/navbar.tmpl
index c6c15512ab..34e089a68a 100644
--- a/templates/user/settings/navbar.tmpl
+++ b/templates/user/settings/navbar.tmpl
@@ -4,11 +4,16 @@
<a class="{{if .PageIsSettingsProfile}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
{{ctx.Locale.Tr "settings.profile"}}
</a>
- {{if not (and ($.UserDisabledFeatures.Contains "manage_credentials" "deletion") (not $.EnableNotifyMail))}}
+ {{if not ($.UserDisabledFeatures.Contains "manage_credentials" "deletion")}}
<a class="{{if .PageIsSettingsAccount}}active {{end}}item" href="{{AppSubUrl}}/user/settings/account">
{{ctx.Locale.Tr "settings.account"}}
</a>
{{end}}
+ {{if $.EnableNotifyMail}}
+ <a class="{{if .PageIsSettingsNotifications}}active {{end}}item" href="{{AppSubUrl}}/user/settings/notifications">
+ {{ctx.Locale.Tr "notifications"}}
+ </a>
+ {{end}}
<a class="{{if .PageIsSettingsAppearance}}active {{end}}item" href="{{AppSubUrl}}/user/settings/appearance">
{{ctx.Locale.Tr "settings.appearance"}}
</a>
diff --git a/templates/user/settings/notifications.tmpl b/templates/user/settings/notifications.tmpl
new file mode 100644
index 0000000000..40094aab4c
--- /dev/null
+++ b/templates/user/settings/notifications.tmpl
@@ -0,0 +1,65 @@
+{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings")}}
+ <div class="user-setting-content">
+ <h4 class="ui top attached header">
+ {{ctx.Locale.Tr "notifications"}}
+ </h4>
+ <div class="ui attached segment">
+ <div class="ui list flex-items-block">
+ <div class="item">
+ <form class="ui form tw-w-full" action="{{AppSubUrl}}/user/settings/notifications/email" method="post">
+ {{$.CsrfTokenHtml}}
+ <div class="field">
+ <label>{{ctx.Locale.Tr "settings.email_desc"}}</label>
+ <div class="ui selection dropdown">
+ <input name="preference" type="hidden" value="{{.EmailNotificationsPreference}}">
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="text"></div>
+ <div class="menu">
+ <div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.enable"}}</div>
+ <div data-value="andyourown" class="{{if eq .EmailNotificationsPreference "andyourown"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.andyourown"}}</div>
+ <div data-value="onmention" class="{{if eq .EmailNotificationsPreference "onmention"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.onmention"}}</div>
+ <div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.disable"}}</div>
+ </div>
+ </div>
+ </div>
+ <div class="field">
+ <button class="ui primary button">{{ctx.Locale.Tr "settings.email_notifications.submit"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+
+ {{if .EnableActions}}
+ <h4 class="ui top attached header">
+ {{ctx.Locale.Tr "actions.actions"}}
+ </h4>
+ <div class="ui attached segment">
+ <div class="ui list flex-items-block">
+ <div class="item">
+ <form class="ui form tw-w-full" action="{{AppSubUrl}}/user/settings/notifications/actions" method="post">
+ {{$.CsrfTokenHtml}}
+ <div class="field">
+ <label>{{ctx.Locale.Tr "settings.email_notifications.actions.desc" "https://docs.gitea.com/usage/actions/overview/"}}</label>
+ <div class="ui selection dropdown">
+ <input name="preference" type="hidden" value="{{.ActionsEmailNotificationsPreference}}">
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="text"></div>
+ <div class="menu">
+ <div data-value="all" class="item">{{ctx.Locale.Tr "all"}}</div>
+ <div data-value="failure-only" class="item">{{ctx.Locale.Tr "settings.email_notifications.actions.failure_only"}}</div>
+ <div data-value="disabled" class="item">{{ctx.Locale.Tr "disabled"}}</div>
+ </div>
+ </div>
+ </div>
+ <div class="field">
+ <button class="ui primary button">{{ctx.Locale.Tr "settings.email_notifications.submit"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ {{end}}
+ </div>
+
+{{template "user/settings/layout_footer" .}}
diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl
index 16c27b52cd..a48ca9ec9b 100644
--- a/templates/user/settings/organization.tmpl
+++ b/templates/user/settings/organization.tmpl
@@ -47,7 +47,7 @@
{{ctx.Locale.Tr "org.members.leave"}}
</div>
<div class="content">
- <p>{{ctx.Locale.Tr "org.members.leave.detail" (`<span class="dataOrganizationName"></span>`|SafeHTML)}}</p>
+ <p>{{ctx.Locale.Tr "org.members.leave.detail" (HTMLFormat `<span class="%s"></span>` "dataOrganizationName")}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl
index 03c3c18f28..d8e5e27b89 100644
--- a/templates/user/settings/profile.tmpl
+++ b/templates/user/settings/profile.tmpl
@@ -12,7 +12,7 @@
<span class="text red tw-hidden" id="name-change-prompt"> {{ctx.Locale.Tr "settings.change_username_prompt"}}</span>
<span class="text red tw-hidden" id="name-change-redirect-prompt"> {{ctx.Locale.Tr "settings.change_username_redirect_prompt"}}</span>
</label>
- <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if or (not .SignedUser.IsLocal) ($.UserDisabledFeatures.Contains "change_username") .IsReverseProxy}}disabled{{end}} maxlength="40">
+ <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" required {{if or (not .SignedUser.IsLocal) ($.UserDisabledFeatures.Contains "change_username") .IsReverseProxy}}disabled{{end}} maxlength="40">
{{if or (not .SignedUser.IsLocal) ($.UserDisabledFeatures.Contains "change_username") .IsReverseProxy}}
<p class="help text blue">{{ctx.Locale.Tr "settings.password_username_disabled"}}</p>
{{end}}