aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/config.tmpl2
-rw-r--r--templates/admin/dashboard.tmpl26
-rw-r--r--templates/admin/user/view_details.tmpl31
-rw-r--r--templates/admin/user/view_emails.tmpl2
-rw-r--r--templates/base/alert.tmpl16
-rw-r--r--templates/base/head.tmpl6
-rw-r--r--templates/base/head_navbar.tmpl31
-rw-r--r--templates/base/paginate.tmpl16
-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/fomantic-modal.tmpl10
-rw-r--r--templates/devtest/repo-action-view.tmpl9
-rw-r--r--templates/install.tmpl2
-rw-r--r--templates/org/home.tmpl9
-rw-r--r--templates/org/team/new.tmpl12
-rw-r--r--templates/org/team/teams.tmpl2
-rw-r--r--templates/package/content/container.tmpl2
-rw-r--r--templates/projects/list.tmpl8
-rw-r--r--templates/projects/view.tmpl39
-rw-r--r--templates/repo/branch/list.tmpl10
-rw-r--r--templates/repo/branch_dropdown.tmpl3
-rw-r--r--templates/repo/clone_panel.tmpl1
-rw-r--r--templates/repo/code/recently_pushed_new_branches.tmpl2
-rw-r--r--templates/repo/commit_page.tmpl4
-rw-r--r--templates/repo/commit_statuses.tmpl4
-rw-r--r--templates/repo/commits_list.tmpl25
-rw-r--r--templates/repo/create.tmpl24
-rw-r--r--templates/repo/diff/box.tmpl42
-rw-r--r--templates/repo/diff/compare.tmpl4
-rw-r--r--templates/repo/diff/image_diff.tmpl12
-rw-r--r--templates/repo/diff/options_dropdown.tmpl1
-rw-r--r--templates/repo/editor/edit.tmpl4
-rw-r--r--templates/repo/header.tmpl5
-rw-r--r--templates/repo/home.tmpl108
-rw-r--r--templates/repo/icon.tmpl2
-rw-r--r--templates/repo/issue/choose.tmpl12
-rw-r--r--templates/repo/issue/fields/markdown.tmpl2
-rw-r--r--templates/repo/issue/filter_item_user_assign.tmpl26
-rw-r--r--templates/repo/issue/filter_list.tmpl4
-rw-r--r--templates/repo/issue/labels/label_list.tmpl12
-rw-r--r--templates/repo/issue/list.tmpl5
-rw-r--r--templates/repo/issue/milestone_issues.tmpl4
-rw-r--r--templates/repo/issue/milestones.tmpl4
-rw-r--r--templates/repo/issue/new_form.tmpl9
-rw-r--r--templates/repo/issue/openclose.tmpl2
-rw-r--r--templates/repo/issue/sidebar/allow_maintainer_edit.tmpl15
-rw-r--r--templates/repo/issue/sidebar/assignee_list.tmpl2
-rw-r--r--templates/repo/issue/sidebar/issue_dependencies.tmpl47
-rw-r--r--templates/repo/issue/sidebar/issue_management.tmpl2
-rw-r--r--templates/repo/issue/sidebar/label_list.tmpl2
-rw-r--r--templates/repo/issue/sidebar/milestone_list.tmpl2
-rw-r--r--templates/repo/issue/sidebar/project_list.tmpl2
-rw-r--r--templates/repo/issue/sidebar/reference_link.tmpl10
-rw-r--r--templates/repo/issue/sidebar/reviewer_list.tmpl4
-rw-r--r--templates/repo/issue/sidebar/stopwatch_timetracker.tmpl8
-rw-r--r--templates/repo/issue/sidebar/wip_switch.tmpl8
-rw-r--r--templates/repo/issue/view_content.tmpl4
-rw-r--r--templates/repo/issue/view_content/add_reaction.tmpl2
-rw-r--r--templates/repo/issue/view_content/conversation.tmpl2
-rw-r--r--templates/repo/issue/view_content/pull.tmpl4
-rw-r--r--templates/repo/issue/view_content/pull_merge_instruction.tmpl98
-rw-r--r--templates/repo/issue/view_content/reactions.tmpl6
-rw-r--r--templates/repo/issue/view_content/reference_issue_dialog.tmpl2
-rw-r--r--templates/repo/issue/view_content/update_branch_by_merge.tmpl2
-rw-r--r--templates/repo/latest_commit.tmpl2
-rw-r--r--templates/repo/migrate/migrating.tmpl8
-rw-r--r--templates/repo/navbar.tmpl23
-rw-r--r--templates/repo/projects/view.tmpl5
-rw-r--r--templates/repo/pulls/tab_menu.tmpl6
-rw-r--r--templates/repo/pulse.tmpl2
-rw-r--r--templates/repo/release/list.tmpl3
-rw-r--r--templates/repo/settings/branches.tmpl2
-rw-r--r--templates/repo/settings/lfs.tmpl2
-rw-r--r--templates/repo/settings/lfs_file.tmpl4
-rw-r--r--templates/repo/settings/lfs_locks.tmpl2
-rw-r--r--templates/repo/settings/navbar.tmpl5
-rw-r--r--templates/repo/settings/options.tmpl55
-rw-r--r--templates/repo/settings/public_access.tmpl54
-rw-r--r--templates/repo/settings/push_mirror_sync_modal.tmpl50
-rw-r--r--templates/repo/settings/tags.tmpl4
-rw-r--r--templates/repo/settings/webhook/settings.tmpl14
-rw-r--r--templates/repo/view.tmpl29
-rw-r--r--templates/repo/view_content.tmpl111
-rw-r--r--templates/repo/view_file.tmpl4
-rw-r--r--templates/repo/view_file_tree.tmpl15
-rw-r--r--templates/repo/view_list.tmpl16
-rw-r--r--templates/repo/wiki/new.tmpl2
-rw-r--r--templates/repo/wiki/pages.tmpl2
-rw-r--r--templates/repo/wiki/revision.tmpl2
-rw-r--r--templates/repo/wiki/view.tmpl8
-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_edit.tmpl2
-rw-r--r--templates/shared/actions/runner_list.tmpl2
-rw-r--r--templates/shared/combomarkdowneditor.tmpl2
-rw-r--r--templates/shared/issuelist.tmpl5
-rw-r--r--templates/shared/search/code/results.tmpl4
-rw-r--r--templates/shared/search/code/search.tmpl8
-rw-r--r--templates/shared/search/combo.tmpl30
-rw-r--r--templates/shared/search/combo_fuzzy.tmpl10
-rw-r--r--templates/shared/search/fuzzy.tmpl10
-rw-r--r--templates/shared/secrets/add_list.tmpl14
-rw-r--r--templates/shared/user/block_user_dialog.tmpl2
-rw-r--r--templates/shared/user/blocked_users.tmpl2
-rw-r--r--templates/shared/variables/variable_list.tmpl16
-rw-r--r--templates/swagger/v1_input.json6
-rw-r--r--templates/swagger/v1_json.tmpl512
-rw-r--r--templates/user/auth/captcha.tmpl6
-rw-r--r--templates/user/auth/grant.tmpl60
-rw-r--r--templates/user/auth/grant_error.tmpl19
-rw-r--r--templates/user/auth/signin_inner.tmpl2
-rw-r--r--templates/user/auth/webauthn.tmpl2
-rw-r--r--templates/user/dashboard/dashboard.tmpl2
-rw-r--r--templates/user/dashboard/feeds.tmpl2
-rw-r--r--templates/user/dashboard/issues.tmpl10
-rw-r--r--templates/user/dashboard/milestones.tmpl6
-rw-r--r--templates/user/notification/notification_div.tmpl2
-rw-r--r--templates/user/notification/notification_subscriptions.tmpl2
-rw-r--r--templates/user/profile.tmpl2
-rw-r--r--templates/user/settings/appearance.tmpl2
-rw-r--r--templates/user/settings/applications.tmpl76
-rw-r--r--templates/user/settings/applications_oauth2_list.tmpl54
-rw-r--r--templates/user/settings/repos.tmpl2
124 files changed, 1438 insertions, 734 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 29a5e1b473..88dadeb3ee 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -148,7 +148,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/dashboard.tmpl b/templates/admin/dashboard.tmpl
index af2349d288..2426a43b15 100644
--- a/templates/admin/dashboard.tmpl
+++ b/templates/admin/dashboard.tmpl
@@ -15,57 +15,57 @@
<tbody>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.delete_repo_archives"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.delete_missing_repos"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.git_gc_repos"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
{{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
{{end}}
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_hooks"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.reinit_missing_repos"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.sync_external_users"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.repo_health_check"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.sync_repo_branches"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
<tr>
<td>{{ctx.Locale.Tr "admin.dashboard.sync_repo_tags"}}</td>
- <td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_repo_tags">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
+ <td class="tw-text-right"><button type="submit" class="ui primary button" name="op" value="sync_repo_tags">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
</tr>
</tbody>
</table>
diff --git a/templates/admin/user/view_details.tmpl b/templates/admin/user/view_details.tmpl
index be2f32b5ec..db61bc9359 100644
--- a/templates/admin/user/view_details.tmpl
+++ b/templates/admin/user/view_details.tmpl
@@ -9,30 +9,25 @@
{{if .User.IsAdmin}}
<span class="ui basic label">{{ctx.Locale.Tr "admin.users.admin"}}</span>
{{end}}
+ {{if .User.IsTypeBot}}
+ <span class="ui basic label">{{ctx.Locale.Tr "admin.users.bot"}}</span>
+ {{end}}
</div>
<div class="flex-item-body">
<b>{{ctx.Locale.Tr "admin.users.auth_source"}}:</b>
- {{if eq .LoginSource.ID 0}}
- {{ctx.Locale.Tr "admin.users.local"}}
- {{else}}
- {{.LoginSource.Name}}
- {{end}}
+ {{Iif (eq .LoginSource.ID 0) (ctx.Locale.Tr "admin.users.local") .LoginSource.Name}}
</div>
<div class="flex-item-body">
<b>{{ctx.Locale.Tr "admin.users.activated"}}:</b>
- {{if .User.IsActive}}
- {{svg "octicon-check"}}
- {{else}}
- {{svg "octicon-x"}}
- {{end}}
+ {{svg (Iif .User.IsActive "octicon-check" "octicon-x")}}
+ </div>
+ <div class="flex-item-body">
+ <b>{{ctx.Locale.Tr "admin.users.prohibit_login"}}:</b>
+ {{svg (Iif .User.ProhibitLogin "octicon-check" "octicon-x")}}
</div>
<div class="flex-item-body">
<b>{{ctx.Locale.Tr "admin.users.restricted"}}:</b>
- {{if .User.IsRestricted}}
- {{svg "octicon-check"}}
- {{else}}
- {{svg "octicon-x"}}
- {{end}}
+ {{svg (Iif .User.IsRestricted "octicon-check" "octicon-x")}}
</div>
<div class="flex-item-body">
<b>{{ctx.Locale.Tr "settings.visibility"}}:</b>
@@ -42,11 +37,7 @@
</div>
<div class="flex-item-body">
<b>{{ctx.Locale.Tr "admin.users.2fa"}}:</b>
- {{if .TwoFactorEnabled}}
- <span class="text green">{{svg "octicon-check"}}</span>
- {{else}}
- {{svg "octicon-x"}}
- {{end}}
+ {{svg (Iif .TwoFactorEnabled "octicon-check" "octicon-x")}}
</div>
{{if .User.Language}}
<div class="flex-item-body">
diff --git a/templates/admin/user/view_emails.tmpl b/templates/admin/user/view_emails.tmpl
index 22ce305a88..7e77206f1c 100644
--- a/templates/admin/user/view_emails.tmpl
+++ b/templates/admin/user/view_emails.tmpl
@@ -3,7 +3,7 @@
<div class="flex-item">
<div class="flex-item-main">
<div class="flex-text-block">
- {{.Email}}
+ <a href="mailto:{{.Email}}">{{.Email}}</a>
{{if .IsPrimary}}
<div class="ui primary label">{{ctx.Locale.Tr "settings.primary"}}</div>
{{end}}
diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl
index 760d3bfa2c..3f6d77a645 100644
--- a/templates/base/alert.tmpl
+++ b/templates/base/alert.tmpl
@@ -1,20 +1,20 @@
-{{if .Flash.ErrorMsg}}
+{{- if .Flash.ErrorMsg -}}
<div class="ui negative message flash-message flash-error">
<p>{{.Flash.ErrorMsg | SanitizeHTML}}</p>
</div>
-{{end}}
-{{if .Flash.SuccessMsg}}
+{{- end -}}
+{{- if .Flash.SuccessMsg -}}
<div class="ui positive message flash-message flash-success">
<p>{{.Flash.SuccessMsg | SanitizeHTML}}</p>
</div>
-{{end}}
-{{if .Flash.InfoMsg}}
+{{- end -}}
+{{- if .Flash.InfoMsg -}}
<div class="ui info message flash-message flash-info">
<p>{{.Flash.InfoMsg | SanitizeHTML}}</p>
</div>
-{{end}}
-{{if .Flash.WarningMsg}}
+{{- end -}}
+{{- if .Flash.WarningMsg -}}
<div class="ui warning message flash-message flash-warning">
<p>{{.Flash.WarningMsg | SanitizeHTML}}</p>
</div>
-{{end}}
+{{- end -}}
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 174267fd2f..e9526818e3 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -19,12 +19,6 @@
<link rel="icon" href="{{AssetUrlPrefix}}/img/favicon.svg" type="image/svg+xml">
<link rel="alternate icon" href="{{AssetUrlPrefix}}/img/favicon.png" type="image/png">
{{template "base/head_script" .}}
- <noscript>
- <style>
- .dropdown:hover > .menu { display: block; }
- .ui.secondary.menu .dropdown.item > .menu { margin-top: 0; }
- </style>
- </noscript>
{{template "base/head_opengraph" .}}
{{template "base/head_style" .}}
{{template "custom/header" .}}
diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl
index baf37494b9..35e14d38d3 100644
--- a/templates/base/head_navbar.tmpl
+++ b/templates/base/head_navbar.tmpl
@@ -1,8 +1,11 @@
{{$notificationUnreadCount := 0}}
{{if and .IsSigned .NotificationUnreadCount}}
- {{$notificationUnreadCount = call .NotificationUnreadCount}}
+ {{$notificationUnreadCount = call .NotificationUnreadCount ctx}}
+{{end}}
+{{$activeStopwatch := NIL}}
+{{if and .IsSigned EnableTimetracking .GetActiveStopwatch}}
+ {{$activeStopwatch = call .GetActiveStopwatch ctx}}
{{end}}
-
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
<div class="navbar-left">
<!-- the logo -->
@@ -12,8 +15,8 @@
<!-- 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}}">
+ {{if $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>
@@ -82,8 +85,8 @@
</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}}">
+ {{if $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>
@@ -175,24 +178,26 @@
{{else}}
{{if .ShowRegistrationButton}}
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
- {{svg "octicon-person"}} {{ctx.Locale.Tr "register"}}
+ {{svg "octicon-person"}}
+ <span class="tw-ml-1">{{ctx.Locale.Tr "register"}}</span>
</a>
{{end}}
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
- {{svg "octicon-sign-in"}} {{ctx.Locale.Tr "sign_in"}}
+ {{svg "octicon-sign-in"}}
+ <span class="tw-ml-1">{{ctx.Locale.Tr "sign_in"}}</span>
</a>
{{end}}
</div><!-- end full right menu -->
- {{if and .IsSigned EnableTimetracking .ActiveStopwatch}}
+ {{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/toggle">
{{.CsrfTokenHtml}}
<button
type="submit"
@@ -200,7 +205,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/paginate.tmpl b/templates/base/paginate.tmpl
index 9a7a6322f7..f6c1785ccf 100644
--- a/templates/base/paginate.tmpl
+++ b/templates/base/paginate.tmpl
@@ -2,32 +2,42 @@
{{$paginationLink := $.Link}}
{{if eq $paginationLink AppSubUrl}}{{$paginationLink = print $paginationLink "/"}}{{end}}
{{with .Page.Paginater}}
- {{if gt .TotalPages 1}}
+ {{if or (eq .TotalPages -1) (gt .TotalPages 1)}}
+ {{$showFirstLast := gt .TotalPages 1}}
<div class="center page buttons">
<div class="ui borderless pagination menu">
+ {{if $showFirstLast}}
<a class="{{if .IsFirst}}disabled{{end}} item navigation" {{if not .IsFirst}}href="{{$paginationLink}}{{if $paginationParams}}?{{$paginationParams}}{{end}}"{{end}}>
{{svg "gitea-double-chevron-left" 16 "tw-mr-1"}}
<span class="navigation_label">{{ctx.Locale.Tr "admin.first_page"}}</span>
</a>
+ {{end}}
+
<a class="{{if not .HasPrevious}}disabled{{end}} item navigation" {{if .HasPrevious}}href="{{$paginationLink}}?page={{.Previous}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>
{{svg "octicon-chevron-left" 16 "tw-mr-1"}}
<span class="navigation_label">{{ctx.Locale.Tr "repo.issues.previous"}}</span>
</a>
- {{range .Pages}}
+ {{$pages := .Pages}}
+ {{$pagesLen := len $pages}}
+ {{range $pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
- <a class="{{if .IsCurrent}}active {{end}}item tw-content-center" {{if not .IsCurrent}}href="{{$paginationLink}}?page={{.Num}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>{{.Num}}</a>
+ {{/* do not highlight the current page if there is only one page */}}
+ <a class="{{if and .IsCurrent (gt $pagesLen 1)}}active {{end}}item" {{if not .IsCurrent}}href="{{$paginationLink}}?page={{.Num}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
<a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$paginationLink}}?page={{.Next}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>
<span class="navigation_label">{{ctx.Locale.Tr "repo.issues.next"}}</span>
{{svg "octicon-chevron-right" 16 "tw-ml-1"}}
</a>
+
+ {{if $showFirstLast}}
<a class="{{if .IsLast}}disabled{{end}} item navigation" {{if not .IsLast}}href="{{$paginationLink}}?page={{.TotalPages}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>
<span class="navigation_label">{{ctx.Locale.Tr "admin.last_page"}}</span>
{{svg "gitea-double-chevron-right" 16 "tw-ml-1"}}
</a>
+ {{end}}
</div>
</div>
{{end}}
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/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl
index 2fbe2bd97d..838c6893a4 100644
--- a/templates/devtest/fomantic-modal.tmpl
+++ b/templates/devtest/fomantic-modal.tmpl
@@ -49,6 +49,16 @@
</form>
</div>
+ <div id="test-modal-form-5" class="ui mini modal">
+ <div class="header">Form dialog (layout 5)</div>
+ <div class="content">
+ <form method="post">
+ <div class="ui input tw-w-full"><input name="user_input"></div>
+ {{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
+ </form>
+ </div>
+ </div>
+
<div class="ui g-modal-confirm modal" id="test-modal-default">
<div class="header">{{svg "octicon-file"}} Default dialog <span>title</span></div>
<div class="content">
diff --git a/templates/devtest/repo-action-view.tmpl b/templates/devtest/repo-action-view.tmpl
index 9c6bdf13da..677eccc062 100644
--- a/templates/devtest/repo-action-view.tmpl
+++ b/templates/devtest/repo-action-view.tmpl
@@ -1,8 +1,13 @@
{{template "base/head" .}}
<div class="page-content">
+ <div class="tw-flex tw-justify-center tw-items-center tw-gap-5">
+ <a href="/devtest/repo-action-view/10/100">Run:CanCancel</a>
+ <a href="/devtest/repo-action-view/20/200">Run:CanApprove</a>
+ <a href="/devtest/repo-action-view/30/300">Run:CanRerun</a>
+ </div>
{{template "repo/actions/view_component" (dict
- "RunIndex" 1
- "JobIndex" 2
+ "RunIndex" (or .RunID 10)
+ "JobIndex" (or .JobID 100)
"ActionsURL" (print AppSubUrl "/devtest/actions-mock")
)}}
</div>
diff --git a/templates/install.tmpl b/templates/install.tmpl
index 6c4cc7df01..058822a6f6 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -1,7 +1,7 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content install">
<div class="ui grid install-config-container">
- <div class="sixteen wide center aligned centered column">
+ <div class="sixteen wide tw-text-center centered column">
<h3 class="ui top attached header">
{{ctx.Locale.Tr "install.title"}}
</h3>
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index db750692bf..cffdfabfaa 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -6,7 +6,7 @@
<div class="ui mobile reversed stackable grid">
<div class="ui {{if .ShowMemberAndTeamTab}}eleven wide{{end}} column">
{{if .ProfileReadmeContent}}
- <div id="readme_profile" class="markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
+ <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" .}}
@@ -16,10 +16,10 @@
{{if .ShowMemberAndTeamTab}}
<div class="ui five wide column">
{{if .CanCreateOrgRepo}}
- <div class="center aligned tw-mb-4">
- <a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
+ <div class="tw-flex tw-flex-wrap tw-justify-center tw-gap-x-1 tw-gap-y-2 tw-mb-4">
+ <a class="ui primary button tw-grow" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
{{if not .DisableNewPullMirrors}}
- <a class="ui primary button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{ctx.Locale.Tr "new_migrate"}}</a>
+ <a class="ui primary button tw-grow" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{ctx.Locale.Tr "new_migrate"}}</a>
{{end}}
</div>
<div class="divider"></div>
@@ -32,7 +32,6 @@
<span class="text">{{svg "octicon-eye"}} {{ctx.Locale.Tr "org.view_as_role" $viewAsRole}}</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
- {{/* TODO: does it really need to use CurrentURL with query parameters? Why not construct a new link with clear parameters */}}
<a href="?view_as=public" class="item {{if not .IsViewingOrgAsMember}}selected{{end}}">
{{svg "octicon-check" 14 (Iif (not .IsViewingOrgAsMember) "" "tw-invisible")}} {{ctx.Locale.Tr "settings.visibility.public"}}
</a>
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
index 410a3c4b62..b67c18dd7d 100644
--- a/templates/org/team/new.tmpl
+++ b/templates/org/team/new.tmpl
@@ -77,11 +77,11 @@
<thead>
<tr>
<th>{{ctx.Locale.Tr "units.unit"}}</th>
- <th class="center aligned">{{ctx.Locale.Tr "org.teams.none_access"}}
+ <th class="tw-text-center">{{ctx.Locale.Tr "org.teams.none_access"}}
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "org.teams.none_access_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
- <th class="center aligned">{{ctx.Locale.Tr "org.teams.read_access"}}
+ <th class="tw-text-center">{{ctx.Locale.Tr "org.teams.read_access"}}
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "org.teams.read_access_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
- <th class="center aligned">{{ctx.Locale.Tr "org.teams.write_access"}}
+ <th class="tw-text-center">{{ctx.Locale.Tr "org.teams.write_access"}}
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "org.teams.write_access_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
</tr>
</thead>
@@ -97,17 +97,17 @@
</div>
</div>
</td>
- <td class="center aligned">
+ <td class="tw-text-center">
<div class="ui radio checkbox">
<input type="radio" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode ctx $unit.Type) 0)}} checked{{end}} title="{{ctx.Locale.Tr "org.teams.none_access"}}">
</div>
</td>
- <td class="center aligned">
+ <td class="tw-text-center">
<div class="ui radio checkbox">
<input type="radio" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode ctx $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{ctx.Locale.Tr "org.teams.read_access"}}">
</div>
</td>
- <td class="center aligned">
+ <td class="tw-text-center">
<div class="ui radio checkbox">
<input type="radio" name="unit_{{$unit.Type.Value}}" value="2"{{if (ge ($.Team.UnitAccessMode ctx $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{ctx.Locale.Tr "org.teams.write_access"}}">
</div>
diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl
index 53c909ee9c..4e3e388cb6 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="text right">
+ <div class="tw-text-right">
<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>
diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl
index a88ebec3bc..7d89f8c6e2 100644
--- a/templates/package/content/container.tmpl
+++ b/templates/package/content/container.tmpl
@@ -82,7 +82,7 @@
<tbody>
{{range $key, $value := .PackageDescriptor.Metadata.Labels}}
<tr>
- <td class="top aligned">{{$key}}</td>
+ <td class="tw-align-top">{{$key}}</td>
<td class="tw-break-anywhere">{{$value}}</td>
</tr>
{{end}}
diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl
index 7c75585bf7..48083811e7 100644
--- a/templates/projects/list.tmpl
+++ b/templates/projects/list.tmpl
@@ -54,11 +54,11 @@
<div class="group">
<div class="flex-text-block">
{{svg "octicon-issue-opened" 14}}
- {{ctx.Locale.PrettyNumber (.NumOpenIssues ctx)}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+ {{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
</div>
<div class="flex-text-block">
{{svg "octicon-check" 14}}
- {{ctx.Locale.PrettyNumber (.NumClosedIssues ctx)}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
+ {{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
</div>
</div>
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
@@ -74,9 +74,7 @@
{{end}}
</div>
{{if .Description}}
- <div class="content">
- {{.RenderedContent}}
- </div>
+ <div class="render-content markup">{{.RenderedContent}}</div>
{{end}}
</li>
{{end}}
diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl
index 2550cae69c..d6a335ef4b 100644
--- a/templates/projects/view.tmpl
+++ b/templates/projects/view.tmpl
@@ -1,25 +1,22 @@
{{$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")
- "TextZeroValue" (ctx.Locale.Tr "repo.issues.filter_assginee_no_select")
- "TextNegativeOne" (ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee")
- }}
- </div>
- </div>
+ <div class="flex-text-block tw-flex-wrap tw-mb-4">
+ <h2 class="tw-mb-0">{{.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" href="{{.Link}}/edit?redirect=project">
@@ -70,7 +67,7 @@
<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}}">
<div class="ui circular label project-column-issue-count">
- {{.NumIssues ctx}}
+ {{.NumIssues}}
</div>
<div class="project-column-title-text gt-ellipsis">{{.Title}}</div>
{{if $canWriteProject}}
@@ -135,7 +132,7 @@
{{template "repo/issue/label_precolors"}}
</div>
</div>
- <div class="actions tw-text-right">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button type="submit" class="ui primary button project-column-button-save">save</button>
</div>
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl
index 5d6a8ddf01..c0accf16fa 100644
--- a/templates/repo/branch/list.tmpl
+++ b/templates/repo/branch/list.tmpl
@@ -30,7 +30,7 @@
<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>
</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="right aligned middle aligned tw-overflow-visible">
+ <td class="tw-text-right tw-overflow-visible">
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
<button class="btn interact-bg show-create-branch-modal tw-p-2"
data-modal="#create-branch-modal"
@@ -121,20 +121,20 @@
</div>
{{end}}
</td>
- <td class="two wide right aligned">
+ <td class="two wide tw-text-right">
{{if not .LatestPullRequest}}
{{if .IsIncluded}}
<span class="ui orange large label" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.included_desc"}}">
{{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}}
@@ -150,7 +150,7 @@
{{end}}
</td>
{{/* FIXME: here and above, the tw-overflow-visible is not quite right */}}
- <td class="three wide right aligned tw-overflow-visible">
+ <td class="three wide tw-text-right tw-overflow-visible">
{{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}}
<button class="btn interact-bg tw-p-2 show-modal show-create-branch-modal"
data-branch-from="{{.DBBranch.Name}}"
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl
index 6efed3427f..f679b8744b 100644
--- a/templates/repo/branch_dropdown.tmpl
+++ b/templates/repo/branch_dropdown.tmpl
@@ -14,7 +14,8 @@
Search "repo/branch_dropdown" in the template directory to find all occurrences.
*/}}
-<div class="js-branch-tag-selector {{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"
+<div class="{{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"
+ data-global-init="initRepoBranchTagSelector"
data-text-release-compare="{{ctx.Locale.Tr "repo.release.compare"}}"
data-text-branches="{{ctx.Locale.Tr "repo.branches"}}"
data-text-tags="{{ctx.Locale.Tr "repo.tags"}}"
diff --git a/templates/repo/clone_panel.tmpl b/templates/repo/clone_panel.tmpl
index b813860150..2ed8f52fbe 100644
--- a/templates/repo/clone_panel.tmpl
+++ b/templates/repo/clone_panel.tmpl
@@ -14,6 +14,7 @@
{{if $.CloneButtonShowSSH}}
<button class="item repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">SSH</button>
{{end}}
+ <button class="item repo-clone-tea" data-link="{{$.CloneButtonOriginLink.Tea}}">Tea CLI</button>
</div>
<div class="divider"></div>
diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl
index f0edf6065b..4a864ba756 100644
--- a/templates/repo/code/recently_pushed_new_branches.tmpl
+++ b/templates/repo/code/recently_pushed_new_branches.tmpl
@@ -5,7 +5,7 @@
{{$branchLink := HTMLFormat `<a href="%s">%s</a>` .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 tw-m-0" href="{{QueryBuild .BranchCompareURL "expand" 1}}">
{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
</a>
</div>
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl
index 2e3ddeb228..ff3dccd534 100644
--- a/templates/repo/commit_page.tmpl
+++ b/templates/repo/commit_page.tmpl
@@ -83,7 +83,7 @@
<input id="new_branch_name" name="new_branch_name" required>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui primary button">{{ctx.Locale.Tr "repo.branch.confirm_create_branch"}}</button>
</div>
@@ -108,7 +108,7 @@
<input id="new_branch_name" name="new_branch_name" required>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui primary button">{{ctx.Locale.Tr "repo.tag.confirm_create_tag"}}</button>
</div>
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 329dc45149..e1bd6b73ae 100644
--- a/templates/repo/commits_list.tmpl
+++ b/templates/repo/commits_list.tmpl
@@ -5,7 +5,7 @@
<th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th>
<th class="two wide sha">{{StringUtils.ToUpper $.Repository.ObjectFormatName}}</th>
<th class="eight wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th>
- <th class="two wide right aligned">{{ctx.Locale.Tr "repo.commits.date"}}</th>
+ <th class="two wide tw-text-right">{{ctx.Locale.Tr "repo.commits.date"}}</th>
<th class="one wide"></th>
</tr>
</thead>
@@ -48,7 +48,7 @@
{{end}}
</span>
{{if IsMultilineCommitMessage .Message}}
- <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
+ <button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>
{{end}}
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
{{if IsMultilineCommitMessage .Message}}
@@ -61,16 +61,25 @@
{{end}}
</td>
{{if .Committer}}
- <td class="text right aligned">{{DateUtils.TimeSince .Committer.When}}</td>
+ <td class="tw-text-right">{{DateUtils.TimeSince .Committer.When}}</td>
{{else}}
- <td class="text right aligned">{{DateUtils.TimeSince .Author.When}}</td>
+ <td class="tw-text-right">{{DateUtils.TimeSince .Author.When}}</td>
{{end}}
- <td class="text right aligned tw-py-0">
- <button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>
- {{if not $.PageIsWiki}}{{/* at the moment, wiki doesn't support "view at history point*/}}
+ <td class="tw-text-right tw-py-0">
+ <button class="btn interact-bg tw-p-2 copy-commit-id" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>
+ {{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}}
+ {{if not $.PageIsWiki}}
+ {{/* view single file diff */}}
+ {{if $.FileName}}
+ <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}}"
+ >{{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}}
- <a class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a>
+ <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>
</tr>
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index ad308c857c..a90c26b423 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -7,25 +7,21 @@
<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" id="repo_owner_dropdown">
+ <input type="hidden" name="uid" value="{{.ContextUser.ID}}">
+ <span class="text truncated-item-name"></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 truncated-item-container" 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>
</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 a3b64b8a11..19f2efecb7 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -1,6 +1,6 @@
-{{$showFileTree := (and (not .DiffNotAvailable) (gt .Diff.NumFiles 1))}}
+{{$showFileTree := (and (not .DiffNotAvailable) (gt .DiffShortStat.NumFiles 1))}}
<div>
- <div class="diff-detail-box diff-box">
+ <div class="diff-detail-box">
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-ml-0.5">
{{if $showFileTree}}
<button class="diff-toggle-file-tree-button not-mobile btn interact-fg" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
@@ -19,7 +19,7 @@
{{end}}
{{if not .DiffNotAvailable}}
<div class="diff-detail-stats tw-flex tw-items-center tw-flex-wrap">
- {{svg "octicon-diff" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion}}
+ {{svg "octicon-diff" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .DiffShortStat.NumFiles .DiffShortStat.TotalAddition .DiffShortStat.TotalDeletion}}
</div>
{{end}}
</div>
@@ -27,9 +27,9 @@
{{if and .PageIsPullFiles $.SignedUserID (not .DiffNotAvailable)}}
<div class="not-mobile tw-flex tw-items-center tw-flex-col tw-whitespace-nowrap tw-mr-1">
<label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{ctx.Locale.Tr "repo.pulls.viewed_files_label"}}">
- {{ctx.Locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
+ {{ctx.Locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .DiffShortStat.NumFiles}}
</label>
- <progress id="viewed-files-summary" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress>
+ <progress id="viewed-files-summary" value="{{.Diff.NumViewedFiles}}" max="{{.DiffShortStat.NumFiles}}"></progress>
</div>
{{end}}
{{template "repo/diff/whitespace_dropdown" .}}
@@ -57,32 +57,6 @@
<div>{{ctx.Locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{ctx.Locale.Tr "repo.pulls.show_all_commits"}}</a></div>
</div>
{{end}}
- <script id="diff-data-script" type="module">
- const diffDataFiles = [{{range $i, $file := .Diff.Files}}{Name:"{{$file.Name}}",NameHash:"{{$file.NameHash}}",Type:{{$file.Type}},IsBin:{{$file.IsBin}},IsSubmodule:{{$file.IsSubmodule}},Addition:{{$file.Addition}},Deletion:{{$file.Deletion}},IsViewed:{{$file.IsViewed}}},{{end}}];
- const diffData = {
- isIncomplete: {{.Diff.IsIncomplete}},
- tooManyFilesMessage: "{{ctx.Locale.Tr "repo.diff.too_many_files"}}",
- binaryFileMessage: "{{ctx.Locale.Tr "repo.diff.bin"}}",
- showMoreMessage: "{{ctx.Locale.Tr "repo.diff.show_more"}}",
- statisticsMessage: "{{ctx.Locale.Tr "repo.diff.stats_desc_file"}}",
- linkLoadMore: "?skip-to={{.Diff.End}}&file-only=true",
- };
-
- // for first time loading, the diffFileInfo is a plain object
- // after the Vue component is mounted, the diffFileInfo is a reactive object
- // keep in mind that this script block would be executed many times when loading more files, by "loadMoreFiles"
- let diffFileInfo = window.config.pageData.diffFileInfo || {
- files:[],
- fileTreeIsVisible: false,
- fileListIsVisible: false,
- isLoadingNewData: false,
- selectedItem: '',
- };
- diffFileInfo = Object.assign(diffFileInfo, diffData);
- diffFileInfo.files.push(...diffDataFiles);
- window.config.pageData.diffFileInfo = diffFileInfo;
- </script>
- <div id="diff-file-list"></div>
{{end}}
<div id="diff-container">
{{if $showFileTree}}
@@ -106,7 +80,7 @@
{{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}}
{{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
{{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.Repository.IsArchived) $.IsShowingAllCommits}}
- <div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} tw-mt-0" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
+ <div class="diff-file-box file-content {{TabSizeClass $.Editorconfig $file.Name}} tw-mt-0" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
<h4 class="diff-file-header sticky-2nd-row ui top attached header">
<div class="diff-file-name tw-flex tw-flex-1 tw-items-center tw-gap-1 tw-flex-wrap">
<button class="fold-file btn interact-bg tw-p-1{{if not $isExpandable}} tw-invisible{{end}}">
@@ -235,7 +209,7 @@
{{end}}
{{if .Diff.IsIncomplete}}
- <div class="diff-file-box diff-box file-content tw-mt-2" id="diff-incomplete">
+ <div class="diff-file-box file-content tw-mt-2" id="diff-incomplete">
<h4 class="ui top attached header tw-font-normal tw-flex tw-items-center tw-justify-between">
{{ctx.Locale.Tr "repo.diff.too_many_files"}}
<a class="ui basic tiny button" id="diff-show-more-files" data-href="?skip-to={{.Diff.End}}&file-only=true">{{ctx.Locale.Tr "repo.diff.show_more"}}</a>
@@ -261,7 +235,7 @@
{{template "repo/upload" .}}
</div>
{{end}}
- <div class="text right edit buttons">
+ <div class="tw-text-right edit buttons">
<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/compare.tmpl b/templates/repo/diff/compare.tmpl
index 9a7a04a328..05cfffd2b7 100644
--- a/templates/repo/diff/compare.tmpl
+++ b/templates/repo/diff/compare.tmpl
@@ -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/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl
index 608174e51b..bbd8d4a2ec 100644
--- a/templates/repo/diff/image_diff.tmpl
+++ b/templates/repo/diff/image_diff.tmpl
@@ -9,15 +9,15 @@
>
<overflow-menu class="ui secondary pointing tabular menu custom">
<div class="overflow-menu-items tw-justify-center">
- <a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.side_by_side"}}</a>
+ <a class="item active" data-tab="diff-side-by-side-{{.file.NameHash}}">{{ctx.Locale.Tr "repo.diff.image.side_by_side"}}</a>
{{if and .blobBase .blobHead}}
- <a class="item" data-tab="diff-swipe-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.swipe"}}</a>
- <a class="item" data-tab="diff-overlay-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.overlay"}}</a>
+ <a class="item" data-tab="diff-swipe-{{.file.NameHash}}">{{ctx.Locale.Tr "repo.diff.image.swipe"}}</a>
+ <a class="item" data-tab="diff-overlay-{{.file.NameHash}}">{{ctx.Locale.Tr "repo.diff.image.overlay"}}</a>
{{end}}
</div>
</overflow-menu>
<div class="image-diff-tabs is-loading">
- <div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{.file.Index}}">
+ <div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{.file.NameHash}}">
<div class="diff-side-by-side">
{{if .blobBase}}
<span class="side">
@@ -52,7 +52,7 @@
</div>
</div>
{{if and .blobBase .blobHead}}
- <div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.Index}}">
+ <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>
@@ -66,7 +66,7 @@
</div>
</div>
</div>
- <div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{.file.Index}}">
+ <div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{.file.NameHash}}">
<div class="diff-overlay">
<input type="range" min="0" max="100" value="50">
<div class="overlay-frame">
diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl
index 09b7b80e41..8d08e7ad46 100644
--- a/templates/repo/diff/options_dropdown.tmpl
+++ b/templates/repo/diff/options_dropdown.tmpl
@@ -1,7 +1,6 @@
<div class="ui dropdown tiny basic button" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.options_button"}}">
{{svg "octicon-kebab-horizontal"}}
<div class="menu">
- <a class="item" id="show-file-list-btn">{{ctx.Locale.Tr "repo.diff.show_diff_stats"}}</a>
{{if .Issue.Index}}
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl
index 577a2be9ad..ae8a60c20c 100644
--- a/templates/repo/editor/edit.tmpl
+++ b/templates/repo/editor/edit.tmpl
@@ -45,10 +45,10 @@
data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea>
<div class="editor-loading is-loading"></div>
</div>
- <div class="ui tab markup tw-px-4 tw-py-3" data-tab="preview">
+ <div class="ui tab tw-px-4 tw-py-3" data-tab="preview">
{{ctx.Locale.Tr "loading"}}
</div>
- <div class="ui tab diff edit-diff" data-tab="diff">
+ <div class="ui tab" data-tab="diff">
<div class="tw-p-16"></div>
</div>
</div>
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 8c2a0da8d0..c7c53b4f5d 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>
@@ -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>
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 31a8167b4b..f86b90502d 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -1,7 +1,8 @@
{{template "base/head" .}}
+{{$showSidebar := and (not .TreeNames) (not .HideRepoInfo) (not .IsBlame)}}
<div role="main" aria-label="{{.Title}}" class="page-content repository file list {{if .IsBlame}}blame{{end}}">
{{template "repo/header" .}}
- <div class="ui container {{if .IsBlame}}fluid padded{{end}}">
+ <div class="ui container {{if or .TreeNames .IsBlame}}fluid padded{{end}}">
{{template "base/alert" .}}
{{if .Repository.IsArchived}}
@@ -16,112 +17,9 @@
{{template "repo/code/recently_pushed_new_branches" .}}
- {{$treeNamesLen := len .TreeNames}}
- {{$isTreePathRoot := eq $treeNamesLen 0}}
- {{$showSidebar := and $isTreePathRoot (not .HideRepoInfo) (not .IsBlame)}}
<div class="{{Iif $showSidebar "repo-grid-filelist-sidebar" "repo-grid-filelist-only"}}">
<div class="repo-home-filelist">
- {{template "repo/sub_menu" .}}
- <div class="repo-button-row">
- <div class="repo-button-row-left">
- {{- /* for repo home (default branch) and /owner/repo/src/{RefType}/{RefShortName} */ -}}
- {{- template "repo/branch_dropdown" dict
- "Repository" .Repository
- "ShowTabBranches" true
- "ShowTabTags" true
- "CurrentRefType" .RefFullName.RefType
- "CurrentRefShortName" .RefFullName.ShortName
- "CurrentTreePath" .TreePath
- "RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
- "AllowCreateNewRef" .CanCreateBranch
- "ShowViewAllRefsEntry" true
- -}}
- {{if and .CanCompareOrPull .RefFullName.IsBranch (not .Repository.IsArchived)}}
- {{$cmpBranch := ""}}
- {{if ne .Repository.ID .BaseRepo.ID}}
- {{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
- {{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}}"
- 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>
- {{end}}
-
- <!-- Show go to file if on home page -->
- {{if $isTreePathRoot}}
- <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}}>
- {{ctx.Locale.Tr "repo.editor.add_file"}}
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
- <div class="menu">
- <a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
- {{ctx.Locale.Tr "repo.editor.new_file"}}
- </a>
- {{if .RepositoryUploadEnabled}}
- <a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
- {{ctx.Locale.Tr "repo.editor.upload_file"}}
- </a>
- {{end}}
- <a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
- {{ctx.Locale.Tr "repo.editor.patch"}}
- </a>
- </div>
- </button>
- {{end}}
-
- {{if and $isTreePathRoot .Repository.IsTemplate}}
- <a role="button" class="ui primary compact button" href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}">
- {{ctx.Locale.Tr "repo.use_template"}}
- </a>
- {{end}}
-
- {{if not $isTreePathRoot}}
- {{$treeNameIdxLast := Eval $treeNamesLen "-" 1}}
- <span class="breadcrumb repo-path tw-ml-1">
- <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>
- {{- if eq $i $treeNameIdxLast -}}
- <span class="active section" title="{{$v}}">{{$v}}</span>
- <button class="btn interact-fg tw-mx-1" data-clipboard-text="{{$.TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "copy_path"}}">{{svg "octicon-copy" 14}}</button>
- {{- else -}}
- {{$p := index $.Paths $i}}<span class="section"><a href="{{$.BranchLink}}/{{PathEscapeSegments $p}}" title="{{$v}}">{{$v}}</a></span>
- {{- end -}}
- {{- end -}}
- </span>
- {{end}}
- </div>
-
- <div class="repo-button-row-right">
- <!-- Only show clone panel in repository home page -->
- {{if $isTreePathRoot}}
- {{template "repo/clone_panel" .}}
- {{end}}
- {{if and (not $isTreePathRoot) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}}
- <a class="ui button" href="{{.RepoLink}}/commits/{{.RefTypeNameSubURL}}/{{.TreePath | PathEscapeSegments}}">
- {{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}}
- </a>
- {{end}}
- </div>
- </div>
- {{if .IsViewFile}}
- {{template "repo/view_file" .}}
- {{else if .IsBlame}}
- {{template "repo/blame" .}}
- {{else}}{{/* IsViewDirectory */}}
- {{if $isTreePathRoot}}
- {{template "repo/code/upstream_diverging_info" .}}
- {{end}}
- {{template "repo/view_list" .}}
- {{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
- {{template "repo/view_file" .}}
- {{end}}
- {{end}}
+ {{template "repo/view_content" .}}
</div>
{{if $showSidebar}}
diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl
index e5e0bd68e7..3747d3a6f5 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/choose.tmpl b/templates/repo/issue/choose.tmpl
index 38cf9e485f..e3314f4260 100644
--- a/templates/repo/issue/choose.tmpl
+++ b/templates/repo/issue/choose.tmpl
@@ -10,11 +10,11 @@
{{range .IssueTemplates}}
<div class="ui attached segment">
<div class="ui two column grid">
- <div class="column left aligned">
+ <div class="column">
<strong>{{.Name}}</strong>
<br>{{.About}}
</div>
- <div class="column right aligned">
+ <div class="column tw-text-right">
<a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a>
</div>
</div>
@@ -23,11 +23,11 @@
{{range .IssueConfig.ContactLinks}}
<div class="ui attached segment">
<div class="ui two column grid">
- <div class="column left aligned">
+ <div class="column">
<strong>{{.Name}}</strong>
<br>{{.About}}
</div>
- <div class="column right aligned">
+ <div class="column tw-text-right">
<a href="{{.URL}}" class="ui primary button">{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues.choose.open_external_link"}}</a>
</div>
</div>
@@ -36,11 +36,11 @@
{{if .IssueConfig.BlankIssuesEnabled}}
<div class="ui attached segment">
<div class="ui two column grid">
- <div class="column left aligned">
+ <div class="column">
<strong>{{ctx.Locale.Tr "repo.issues.choose.blank"}}</strong>
<br/>{{ctx.Locale.Tr "repo.issues.choose.blank_about"}}
</div>
- <div class="column right aligned">
+ <div class="column tw-text-right">
<a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a>
</div>
</div>
diff --git a/templates/repo/issue/fields/markdown.tmpl b/templates/repo/issue/fields/markdown.tmpl
index da8f5e6bdf..dbf4b71ba8 100644
--- a/templates/repo/issue/fields/markdown.tmpl
+++ b/templates/repo/issue/fields/markdown.tmpl
@@ -1,3 +1,3 @@
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}}">
- <div class="markup">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.value}}</div>
+ <div class="render-content markup">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.value}}</div>
</div>
diff --git a/templates/repo/issue/filter_item_user_assign.tmpl b/templates/repo/issue/filter_item_user_assign.tmpl
index 4f1db71d57..42886edaa0 100644
--- a/templates/repo/issue/filter_item_user_assign.tmpl
+++ b/templates/repo/issue/filter_item_user_assign.tmpl
@@ -4,8 +4,8 @@
* UserSearchList
* SelectedUserId: 0 or empty means default, -1 means "no user is set"
* TextFilterTitle
-* TextZeroValue: the text for "all issues"
-* TextNegativeOne: the text for "issues with no assignee"
+* TextFilterMatchNone: the text for "issues with no assignee"
+* TextFilterMatchAny: the text for "issues with any assignee"
*/}}
{{$queryLink := .QueryLink}}
<div class="item ui dropdown jump {{if not .UserSearchList}}disabled{{end}}">
@@ -15,16 +15,24 @@
<i class="icon">{{svg "octicon-search" 16}}</i>
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_user_placeholder"}}">
</div>
- {{if $.TextZeroValue}}
- <a class="item {{if not .SelectedUserId}}selected{{end}}" href="{{QueryBuild $queryLink $.QueryParamKey NIL}}">{{$.TextZeroValue}}</a>
+ {{if $.TextFilterMatchNone}}
+ {{$isSelected := eq .SelectedUserId "(none)"}}
+ <a class="item" href="{{QueryBuild $queryLink $.QueryParamKey (Iif $isSelected NIL "(none)")}}">
+ {{svg "octicon-check" 14 (Iif $isSelected "" "tw-invisible")}} {{$.TextFilterMatchNone}}
+ </a>
{{end}}
- {{if $.TextNegativeOne}}
- <a class="item {{if eq .SelectedUserId -1}}selected{{end}}" href="{{QueryBuild $queryLink $.QueryParamKey -1}}">{{$.TextNegativeOne}}</a>
+ {{if $.TextFilterMatchAny}}
+ {{$isSelected := eq .SelectedUserId "(any)"}}
+ <a class="item" href="{{QueryBuild $queryLink $.QueryParamKey (Iif $isSelected NIL "(any)")}}">
+ {{svg "octicon-check" 14 (Iif $isSelected "" "tw-invisible")}} {{$.TextFilterMatchAny}}
+ </a>
{{end}}
<div class="divider"></div>
- {{range .UserSearchList}}
- <a class="item {{if eq $.SelectedUserId .ID}}selected{{end}}" href="{{QueryBuild $queryLink $.QueryParamKey .ID}}">
- {{ctx.AvatarUtils.Avatar . 20}}{{template "repo/search_name" .}}
+ {{range $user := .UserSearchList}}
+ {{$isSelected := eq $.SelectedUserId (print $user.ID)}}
+ <a class="item" href="{{QueryBuild $queryLink $.QueryParamKey (Iif $isSelected NIL $user.ID)}}">
+ {{svg "octicon-check" 14 (Iif $isSelected "" "tw-invisible")}}
+ {{ctx.AvatarUtils.Avatar $user 20}}{{template "repo/search_name" .}}
</a>
{{end}}
</div>
diff --git a/templates/repo/issue/filter_list.tmpl b/templates/repo/issue/filter_list.tmpl
index 7612d93b21..cd04f1c317 100644
--- a/templates/repo/issue/filter_list.tmpl
+++ b/templates/repo/issue/filter_list.tmpl
@@ -94,8 +94,8 @@
"UserSearchList" $.Assignees
"SelectedUserId" $.AssigneeID
"TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
- "TextZeroValue" (ctx.Locale.Tr "repo.issues.filter_assginee_no_select")
- "TextNegativeOne" (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")
}}
{{if .IsSigned}}
diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl
index 822567301e..cdbcc456f0 100644
--- a/templates/repo/issue/labels/label_list.tmpl
+++ b/templates/repo/issue/labels/label_list.tmpl
@@ -63,13 +63,11 @@
{{if and (not .PageIsOrgSettingsLabels) (.OrgLabels)}}
<li class="item">
- <div class="ui grid middle aligned">
- <div class="ten wide column">
- {{ctx.Locale.Tr "repo.org_labels_desc"}}
- {{if .IsOrganizationOwner}}
- <a href="{{.OrganizationLink}}/settings/labels">({{ctx.Locale.Tr "repo.org_labels_desc_manage"}})</a>:
- {{end}}
- </div>
+ <div>{{/* parent is flex, so use block here to keep sentence spaces */}}
+ {{ctx.Locale.Tr "repo.org_labels_desc"}}
+ {{if .IsOrganizationOwner}}
+ <a href="{{.OrganizationLink}}/settings/labels">({{ctx.Locale.Tr "repo.org_labels_desc_manage"}})</a>:
+ {{end}}
</div>
</li>
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 53d0eca171..0ab761e038 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -14,9 +14,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 abb4e3290d..85068102e6 100644
--- a/templates/repo/issue/milestone_issues.tmpl
+++ b/templates/repo/issue/milestone_issues.tmpl
@@ -6,7 +6,7 @@
<div class="tw-flex">
<h1 class="tw-mb-2">{{.Milestone.Name}}</h1>
{{if not .Repository.IsArchived}}
- <div class="text right tw-flex-1">
+ <div class="tw-text-right tw-flex-1">
{{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"}}
@@ -22,7 +22,7 @@
{{end}}
</div>
{{if .Milestone.RenderedContent}}
- <div class="markup content tw-mb-4">
+ <div class="render-content markup tw-mb-4">
{{.Milestone.RenderedContent}}
</div>
{{end}}
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl
index e7dfe08ee0..5701c1faa6 100644
--- a/templates/repo/issue/milestones.tmpl
+++ b/templates/repo/issue/milestones.tmpl
@@ -81,9 +81,7 @@
{{end}}
</div>
{{if .Content}}
- <div class="markup content">
- {{.RenderedContent}}
- </div>
+ <div class="render-content markup">{{.RenderedContent}}</div>
{{end}}
</li>
{{end}}
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl
index dd4c7617ce..73cf8c6324 100644
--- a/templates/repo/issue/new_form.tmpl
+++ b/templates/repo/issue/new_form.tmpl
@@ -1,6 +1,4 @@
-{{if .Flash}}
{{template "base/alert" .}}
-{{end}}
<form class="issue-content ui comment form form-fetch-action" id="new-issue" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="issue-content-left">
@@ -9,7 +7,10 @@
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
<div class="ui segment content tw-my-0">
<div class="field">
- <input name="title" class="js-autofocus-end" id="issue_title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" required maxlength="255" autocomplete="off">
+ <input name="title" data-global-init="initInputAutoFocusEnd" id="issue_title" required maxlength="255" autocomplete="off"
+ placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}"
+ value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}"
+ >
{{if .PageIsComparePull}}
<div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{ctx.Locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0)}}</div>
{{end}}
@@ -32,7 +33,7 @@
{{else}}
{{template "repo/issue/comment_tab" .}}
{{end}}
- <div class="text right">
+ <div class="tw-text-right">
<button class="ui primary button">
{{if .PageIsComparePull}}
{{ctx.Locale.Tr "repo.pulls.create"}}
diff --git a/templates/repo/issue/openclose.tmpl b/templates/repo/issue/openclose.tmpl
index b9dd04a7db..00a31b5fad 100644
--- a/templates/repo/issue/openclose.tmpl
+++ b/templates/repo/issue/openclose.tmpl
@@ -17,7 +17,7 @@
{{ctx.Locale.PrettyNumber .OpenCount}} {{ctx.Locale.Tr "repo.issues.open_title"}}
</a>
<a class="{{if eq .State "closed"}}active {{end}}item flex-text-inline" href="{{if eq .State "closed"}}{{$allStatesLink}}{{else}}{{$closedLink}}{{end}}">
- {{svg "octicon-check"}}
+ {{svg "octicon-issue-closed"}}
{{ctx.Locale.PrettyNumber .ClosedCount}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
</a>
</div>
diff --git a/templates/repo/issue/sidebar/allow_maintainer_edit.tmpl b/templates/repo/issue/sidebar/allow_maintainer_edit.tmpl
index ad4ce96a47..f584f9076c 100644
--- a/templates/repo/issue/sidebar/allow_maintainer_edit.tmpl
+++ b/templates/repo/issue/sidebar/allow_maintainer_edit.tmpl
@@ -1,13 +1,18 @@
-{{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}}
- {{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
+{{- $isHeadForkedRepo := and .Issue.PullRequest .Issue.PullRequest.HeadRepo (ne .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName) -}}
+{{if $isHeadForkedRepo}}
+ {{- $isPullPoster := and .Issue.IsPull .IsIssuePoster -}}
+ {{- $isPullEditable := and .Issue.PullRequest (not .Issue.IsClosed) (not .Repository.IsArchived) -}}
+ {{- $allowToChange := and $isPullPoster $isPullEditable -}}
<div class="divider"></div>
- <div class="ui checkbox loading-icon-2px" id="allow-edits-from-maintainers"
+ <div class="ui checkbox {{if not $allowToChange}}disabled{{end}} loading-icon-2px"
+ {{if $allowToChange}}
+ id="allow-edits-from-maintainers"
data-url="{{.Issue.Link}}"
data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
+ {{end}}
>
<label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
- <input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}}>
+ <input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}} {{if not $allowToChange}}disabled{{end}}>
</div>
- {{end}}
{{end}}
diff --git a/templates/repo/issue/sidebar/assignee_list.tmpl b/templates/repo/issue/sidebar/assignee_list.tmpl
index f124c3f1ce..19927cbd41 100644
--- a/templates/repo/issue/sidebar/assignee_list.tmpl
+++ b/templates/repo/issue/sidebar/assignee_list.tmpl
@@ -6,7 +6,7 @@
{{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 {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
diff --git a/templates/repo/issue/sidebar/issue_dependencies.tmpl b/templates/repo/issue/sidebar/issue_dependencies.tmpl
index 17e9738c6f..bbae011958 100644
--- a/templates/repo/issue/sidebar/issue_dependencies.tmpl
+++ b/templates/repo/issue/sidebar/issue_dependencies.tmpl
@@ -31,7 +31,9 @@
</div>
<div class="item-right tw-flex tw-items-center tw-m-1">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
- <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
+ <a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
+ data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
+ data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
{{end}}
@@ -63,7 +65,9 @@
</div>
<div class="item-right tw-flex tw-items-center tw-m-1">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
- <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
+ <a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
+ data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blockedBy"
+ data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
{{end}}
@@ -86,7 +90,9 @@
</div>
<div class="item-right tw-flex tw-items-center tw-m-1">
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
- <a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
+ <a class="muted show-modal" data-modal="#issue-remove-dependency-confirm"
+ data-modal-remove-dependency-id="{{.Issue.ID}}" data-modal-dependency-type="blocking"
+ data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
{{svg "octicon-trash" 16}}
</a>
{{end}}
@@ -106,7 +112,7 @@
<form method="post" action="{{.Issue.Link}}/dependency/add" id="addDependencyForm">
{{$.CsrfTokenHtml}}
<div class="ui fluid action input">
- <div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}">
+ <div class="ui search selection dropdown" id="new-dependency-drop-list" data-issue-id="{{.Issue.ID}}" data-issue-cross-repo-search="{{.AllowCrossRepositoryDependencies}}">
<input name="newDependency" type="hidden">
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<input type="text" class="search">
@@ -122,28 +128,19 @@
</div>
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
- <input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}">
-
- <div class="ui g-modal-confirm modal remove-dependency">
- <div class="header">
- {{svg "octicon-trash"}}
- {{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}
- </div>
+ <form id="issue-remove-dependency-confirm" class="ui g-modal-confirm modal" method="post" action="{{.Issue.Link}}/dependency/delete">
+ <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}</div>
<div class="content">
- <form method="post" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm">
- {{$.CsrfTokenHtml}}
- <input type="hidden" value="" name="removeDependencyID" id="removeDependencyID">
- <input type="hidden" value="" name="dependencyType" id="dependencyType">
- </form>
- <p>{{if .Issue.IsPull}}
- {{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}}
- {{else}}
- {{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}}
- {{end}}</p>
+ {{$.CsrfTokenHtml}}
+ <input type="hidden" value="" name="removeDependencyID" class="remove-dependency-id">
+ <input type="hidden" value="" name="dependencyType" class="dependency-type">
+ <p>
+ {{ctx.Locale.Tr (Iif .Issue.IsPull "repo.issues.dependency.pr_remove_text" "repo.issues.dependency.issue_remove_text")}}
+ </p>
+ {{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
+ {{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
+ {{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
</div>
- {{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
- {{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
- {{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
- </div>
+ </form>
{{end}}
{{end}}
diff --git a/templates/repo/issue/sidebar/issue_management.tmpl b/templates/repo/issue/sidebar/issue_management.tmpl
index 76edf16e03..b4922ed04b 100644
--- a/templates/repo/issue/sidebar/issue_management.tmpl
+++ b/templates/repo/issue/sidebar/issue_management.tmpl
@@ -76,7 +76,7 @@
</div>
{{end}}
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button">
{{if .Issue.IsLocked}}
diff --git a/templates/repo/issue/sidebar/label_list.tmpl b/templates/repo/issue/sidebar/label_list.tmpl
index 9b6195a8f4..7d4ad264c2 100644
--- a/templates/repo/issue/sidebar/label_list.tmpl
+++ b/templates/repo/issue/sidebar/label_list.tmpl
@@ -4,7 +4,7 @@
{{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 {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
diff --git a/templates/repo/issue/sidebar/milestone_list.tmpl b/templates/repo/issue/sidebar/milestone_list.tmpl
index bbac78341d..4ca0d1bd3a 100644
--- a/templates/repo/issue/sidebar/milestone_list.tmpl
+++ b/templates/repo/issue/sidebar/milestone_list.tmpl
@@ -6,7 +6,7 @@
{{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 {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
diff --git a/templates/repo/issue/sidebar/project_list.tmpl b/templates/repo/issue/sidebar/project_list.tmpl
index 4520d1f88d..0d8a88e8fa 100644
--- a/templates/repo/issue/sidebar/project_list.tmpl
+++ b/templates/repo/issue/sidebar/project_list.tmpl
@@ -6,7 +6,7 @@
{{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 {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
+ <div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
<a class="text muted">
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
</a>
diff --git a/templates/repo/issue/sidebar/reference_link.tmpl b/templates/repo/issue/sidebar/reference_link.tmpl
index 6b8f120c7b..ad7c0f6bc0 100644
--- a/templates/repo/issue/sidebar/reference_link.tmpl
+++ b/templates/repo/issue/sidebar/reference_link.tmpl
@@ -1,8 +1,6 @@
<div class="divider"></div>
-<div class="ui equal width compact grid">
- {{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
- <div class="row tw-items-center" data-tooltip-content="{{$issueReferenceLink}}">
- <span class="text column truncate">{{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span>
- <button class="ui two wide button column tw-p-2" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button>
- </div>
+{{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
+<div class="flex-text-block" data-tooltip-content="{{$issueReferenceLink}}">
+ <span class="tw-flex-1 gt-ellipsis">{{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span>
+ <button class="ui compact tiny icon button" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button>
</div>
diff --git a/templates/repo/issue/sidebar/reviewer_list.tmpl b/templates/repo/issue/sidebar/reviewer_list.tmpl
index b08af03a01..82e3c0c86a 100644
--- a/templates/repo/issue/sidebar/reviewer_list.tmpl
+++ b/templates/repo/issue/sidebar/reviewer_list.tmpl
@@ -6,7 +6,7 @@
{{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 {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
+ <div class="ui dropdown text-flex-grow {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
<a class="text muted">
<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}}
</a>
@@ -121,7 +121,7 @@
<label for="issue-sidebar-dismiss-review-message">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</label>
<input id="issue-sidebar-dismiss-review-message" name="message">
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button" type="submit">{{ctx.Locale.Tr "ok"}}</button>
</div>
diff --git a/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl b/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl
index d5ac6827ba..a72749a9f3 100644
--- a/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl
+++ b/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl
@@ -2,10 +2,12 @@
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
<div class="divider"></div>
<div>
- <div class="ui dropdown jump">
+ <div class="ui dropdown text-flex-grow jump">
<a class="text muted">
- <strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong> {{svg "octicon-gear"}}
- {{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}}
+ <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">
diff --git a/templates/repo/issue/sidebar/wip_switch.tmpl b/templates/repo/issue/sidebar/wip_switch.tmpl
index 06a3be0d8f..b007399deb 100644
--- a/templates/repo/issue/sidebar/wip_switch.tmpl
+++ b/templates/repo/issue/sidebar/wip_switch.tmpl
@@ -1,7 +1,5 @@
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
- <div class="toggle-wip tw-mt-2" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
- <a class="muted">
- {{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
- </a>
- </div>
+ <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">
+ {{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 50a41654f3..1a7c0716bc 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -83,7 +83,7 @@
{{template "repo/issue/comment_tab" .}}
{{.CsrfTokenHtml}}
<div class="field footer">
- <div class="text right">
+ <div class="tw-text-right">
{{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="text right edit">
+ <div class="tw-text-right edit">
<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/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl
index 6baded8fe9..2f5764d964 100644
--- a/templates/repo/issue/view_content/add_reaction.tmpl
+++ b/templates/repo/issue/view_content/add_reaction.tmpl
@@ -3,7 +3,7 @@
<a class="muted">{{svg "octicon-smiley"}}</a>
<div class="menu">
{{range $value := AllowedReactions}}
- <a class="item emoji comment-reaction-button" data-tooltip-content="{{$value}}" aria-label="{{$value}}" data-reaction-content="{{$value}}">{{ReactionToEmoji $value}}</a>
+ <a class="item emoji" data-tooltip-content="{{$value}}" aria-label="{{$value}}" data-reaction-content="{{$value}}" data-global-click="onCommentReactionButtonClick">{{ReactionToEmoji $value}}</a>
{{end}}
</div>
</div>
diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl
index e30784929f..32e9811335 100644
--- a/templates/repo/issue/view_content/conversation.tmpl
+++ b/templates/repo/issue/view_content/conversation.tmpl
@@ -40,7 +40,7 @@
{{if $diff}}
{{$file := (index $diff.Files 0)}}
<div id="code-preview-{{$comment.ID}}" class="ui table segment{{if $resolved}} tw-hidden{{end}}">
- <div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
+ <div class="diff-file-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
<div class="file-body file-code code-view code-diff code-diff-unified unicode-escaped">
<table>
<tbody>
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 7c53c5edb5..064b62e128 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -83,13 +83,13 @@
{{ctx.Locale.Tr "repo.pulls.data_broken"}}
</div>
{{else if .IsPullWorkInProgress}}
- <div class="item toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
+ <div class="item">
<div class="item-section-left flex-text-inline tw-flex-1">
{{svg "octicon-x"}}
{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
</div>
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
- <button class="ui compact button">
+ <button class="ui compact button toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
{{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
</button>
{{end}}
diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
index 9a3e2cb7d7..a1cff41a3a 100644
--- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
@@ -1,55 +1,57 @@
<div class="divider"></div>
-<div class="instruct-toggle"> {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}} </div>
-<div class="instruct-content tw-mt-2 tw-hidden">
- <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}</div>
- {{$localBranch := .PullRequest.HeadBranch}}
- {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}
- {{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}}
- {{end}}
- <div class="ui secondary segment">
- {{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>
+<details>
+ <summary>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}}</summary>
+ <div class="tw-mt-2">
+ <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}</div>
+ {{$localBranch := .PullRequest.HeadBranch}}
+ {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}
+ {{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}}
{{end}}
- <div>git checkout {{$localBranch}}</div>
- </div>
- {{if .ShowMergeInstructions}}
- <div>
- <h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>
- {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
- {{if not .AutodetectManualMerge}}
- <div>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}</div>
- {{end}}
- </div>
- <div class="ui secondary segment">
- <div data-pull-merge-style="merge">
- <div>git checkout {{.PullRequest.BaseBranch}}</div>
- <div>git merge --no-ff {{$localBranch}}</div>
- </div>
- <div class="tw-hidden" data-pull-merge-style="rebase">
- <div>git checkout {{.PullRequest.BaseBranch}}</div>
- <div>git merge --ff-only {{$localBranch}}</div>
- </div>
- <div class="tw-hidden" data-pull-merge-style="rebase-merge">
+ <div class="ui secondary segment">
+ {{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>
+ {{end}}
<div>git checkout {{$localBranch}}</div>
- <div>git rebase {{.PullRequest.BaseBranch}}</div>
- <div>git checkout {{.PullRequest.BaseBranch}}</div>
- <div>git merge --no-ff {{$localBranch}}</div>
- </div>
- <div class="tw-hidden" data-pull-merge-style="squash">
- <div>git checkout {{.PullRequest.BaseBranch}}</div>
- <div>git merge --squash {{$localBranch}}</div>
</div>
- <div class="tw-hidden" data-pull-merge-style="fast-forward-only">
- <div>git checkout {{.PullRequest.BaseBranch}}</div>
- <div>git merge --ff-only {{$localBranch}}</div>
+ {{if .ShowMergeInstructions}}
+ <div>
+ <h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>
+ {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
+ {{if not .AutodetectManualMerge}}
+ <div>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}</div>
+ {{end}}
</div>
- <div class="tw-hidden" data-pull-merge-style="manually-merged">
- <div>git checkout {{.PullRequest.BaseBranch}}</div>
- <div>git merge {{$localBranch}}</div>
+ <div class="ui secondary segment">
+ <div data-pull-merge-style="merge">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --no-ff {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="rebase">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --ff-only {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="rebase-merge">
+ <div>git checkout {{$localBranch}}</div>
+ <div>git rebase {{.PullRequest.BaseBranch}}</div>
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --no-ff {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="squash">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --squash {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="fast-forward-only">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge --ff-only {{$localBranch}}</div>
+ </div>
+ <div class="tw-hidden" data-pull-merge-style="manually-merged">
+ <div>git checkout {{.PullRequest.BaseBranch}}</div>
+ <div>git merge {{$localBranch}}</div>
+ </div>
+ <div>git push origin {{.PullRequest.BaseBranch}}</div>
</div>
- <div>git push origin {{.PullRequest.BaseBranch}}</div>
+ {{end}}
</div>
- {{end}}
-</div>
+</details>
diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl
index 0011efe8b2..286d93a9b1 100644
--- a/templates/repo/issue/view_content/reactions.tmpl
+++ b/templates/repo/issue/view_content/reactions.tmpl
@@ -1,9 +1,9 @@
<div class="bottom-reactions" data-action-url="{{$.ActionURL}}">
{{range $key, $value := .Reactions}}
{{$hasReacted := $value.HasUser ctx.RootData.SignedUserID}}
- <a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not ctx.RootData.IsSigned}} disabled{{end}} comment-reaction-button"
- data-tooltip-content
- title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
+ <a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not ctx.RootData.IsSigned}} disabled{{end}}"
+ data-global-click="onCommentReactionButtonClick"
+ data-tooltip-content title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
aria-label="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
data-tooltip-placement="bottom-start"
data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}">
diff --git a/templates/repo/issue/view_content/reference_issue_dialog.tmpl b/templates/repo/issue/view_content/reference_issue_dialog.tmpl
index d6c9081001..f6ffeef26d 100644
--- a/templates/repo/issue/view_content/reference_issue_dialog.tmpl
+++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl
@@ -20,7 +20,7 @@
<label><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></label>
<textarea name="content"></textarea>
</div>
- <div class="text right">
+ <div class="tw-text-right">
<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 adce052dee..e0ed262f17 100644
--- a/templates/repo/issue/view_content/update_branch_by_merge.tmpl
+++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl
@@ -8,7 +8,7 @@
<div class="item-section-right">
{{if and $.UpdateAllowed $.UpdateByRebaseAllowed}}
<div class="tw-inline-block">
- <div class="ui buttons update-button">
+ <div id="update-pr-branch-with-base" class="ui buttons">
<button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}">
<span class="button-text">
{{ctx.Locale.Tr "repo.pulls.update_branch"}}
diff --git a/templates/repo/latest_commit.tmpl b/templates/repo/latest_commit.tmpl
index c62efc8e88..0341d60eb2 100644
--- a/templates/repo/latest_commit.tmpl
+++ b/templates/repo/latest_commit.tmpl
@@ -23,7 +23,7 @@
{{$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>
{{if IsMultilineCommitMessage .LatestCommit.Message}}
- <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
+ <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>
{{end}}
</span>
diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl
index bc07b488f2..8b83816b9b 100644
--- a/templates/repo/migrate/migrating.tmpl
+++ b/templates/repo/migrate/migrating.tmpl
@@ -7,19 +7,19 @@
{{template "base/alert" .}}
<div class="home">
<div class="ui stackable middle very relaxed page grid">
- <div id="repo_migrating" class="sixteen wide center aligned centered column" data-migrating-repo-link="{{.Link}}">
+ <div id="repo_migrating" class="sixteen wide tw-text-center centered column" data-migrating-repo-link="{{.Link}}">
<div>
<img src="{{AssetUrlPrefix}}/img/loading.png">
</div>
</div>
- <div id="repo_migrating_failed_image" class="sixteen wide center aligned centered column tw-hidden">
+ <div id="repo_migrating_failed_image" class="sixteen wide tw-text-center centered column tw-hidden">
<div>
<img src="{{AssetUrlPrefix}}/img/failed.png">
</div>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
- <div class="sixteen wide center aligned centered column">
+ <div class="sixteen wide tw-text-center centered column">
<div id="repo_migrating_progress">
<p>{{ctx.Locale.Tr "repo.migrate.migrating" .CloneAddr}}</p>
<p id="repo_migrating_progress_message"></p>
@@ -77,7 +77,7 @@
<input id="repo_name_to_delete" name="repo_name" required>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button>
</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..7267a99b1d 100644
--- a/templates/repo/projects/view.tmpl
+++ b/templates/repo/projects/view.tmpl
@@ -2,8 +2,9 @@
<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>
diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl
index 8b192c44db..a0ecdf96cd 100644
--- a/templates/repo/pulls/tab_menu.tmpl
+++ b/templates/repo/pulls/tab_menu.tmpl
@@ -15,11 +15,11 @@
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.pulls.tab_files")}}
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
</a>
- {{if or .Diff.TotalAddition .Diff.TotalDeletion}}
+ {{if or .DiffShortStat.TotalAddition .DiffShortStat.TotalDeletion}}
<span class="tw-ml-auto tw-pl-3 tw-whitespace-nowrap tw-pr-0 tw-font-bold tw-flex tw-items-center tw-gap-2">
- <span><span class="text green">{{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}}</span> <span class="text red">{{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}</span></span>
+ <span><span class="text green">{{if .DiffShortStat.TotalAddition}}+{{.DiffShortStat.TotalAddition}}{{end}}</span> <span class="text red">{{if .DiffShortStat.TotalDeletion}}-{{.DiffShortStat.TotalDeletion}}{{end}}</span></span>
<span class="diff-stats-bar">
- <div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Diff.TotalAddition "/" "(" .Diff.TotalAddition "+" .Diff.TotalDeletion "+" 0.0 ")"}}%"></div>
+ <div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .DiffShortStat.TotalAddition "/" "(" .DiffShortStat.TotalAddition "+" .DiffShortStat.TotalDeletion "+" 0.0 ")"}}%"></div>
</span>
</span>
{{end}}
diff --git a/templates/repo/pulse.tmpl b/templates/repo/pulse.tmpl
index 6a42a0ba48..12fbb85410 100644
--- a/templates/repo/pulse.tmpl
+++ b/templates/repo/pulse.tmpl
@@ -82,7 +82,7 @@
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
{{if eq .Activity.Code.CommitCountInAllBranches 0}}
- <div class="ui center aligned segment">
+ <div class="ui tw-text-center segment">
<h4 class="ui header">{{ctx.Locale.Tr "repo.activity.no_git_activity"}}</h4>
</div>
{{end}}
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index 041890ca9c..432c3309ce 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -21,6 +21,7 @@
{{$compareTarget = $release.Sha1}}
{{end}}
{{template "repo/branch_dropdown" dict
+ "ContainerClasses" "release-branch-tag-selector"
"Repository" $.Repository
"ShowTabTags" true
"DropdownFixedText" (ctx.Locale.Tr "repo.release.compare")
@@ -64,7 +65,7 @@
| <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>
- <div class="markup desc">
+ <div class="render-content markup">
{{$release.RenderedNote}}
</div>
<div class="divider"></div>
diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl
index 57d9f2c5a8..ef4732540b 100644
--- a/templates/repo/settings/branches.tmpl
+++ b/templates/repo/settings/branches.tmpl
@@ -56,7 +56,7 @@
</div>
</div>
{{else}}
- <div class="flex-item center aligned">
+ <div class="flex-item tw-text-center">
{{ctx.Locale.Tr "repo.settings.no_protected_branch"}}
</div>
{{end}}
diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl
index a95bd51c4f..4b46aeed95 100644
--- a/templates/repo/settings/lfs.tmpl
+++ b/templates/repo/settings/lfs.tmpl
@@ -18,7 +18,7 @@
</td>
<td>{{FileSize .Size}}</td>
<td>{{DateUtils.TimeSince .CreatedUnix}}</td>
- <td class="right aligned">
+ <td class="tw-text-right">
<a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
<button class="ui basic show-modal icon button red" data-modal="#delete-{{.Oid}}">
<span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span>
diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl
index f6fac05b69..9f72d764ae 100644
--- a/templates/repo/settings/lfs_file.tmpl
+++ b/templates/repo/settings/lfs_file.tmpl
@@ -13,7 +13,7 @@
</h4>
<div class="ui bottom attached table unstackable segment">
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
- <div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextFile}} code-view{{end}}">
+ <div class="file-view {{if .IsPlainText}}plain-text{{else if .IsTextFile}}code-view{{end}}">
{{if .IsFileTooLarge}}
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
{{else if not .FileSize}}
@@ -31,7 +31,7 @@
<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
{{else if .IsPDFFile}}
- <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "diff.view_file"}}"></div>
+ <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/lfs_locks.tmpl b/templates/repo/settings/lfs_locks.tmpl
index 64c6b3a550..dfbae0633e 100644
--- a/templates/repo/settings/lfs_locks.tmpl
+++ b/templates/repo/settings/lfs_locks.tmpl
@@ -36,7 +36,7 @@
</a>
</td>
<td>{{DateUtils.TimeSince .Created}}</td>
- <td class="right aligned">
+ <td class="tw-text-right">
<form action="{{$.LFSFilesLink}}/locks/{{$lock.ID}}/unlock" method="post">
{{$.CsrfTokenHtml}}
<button class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{ctx.Locale.Tr "repo.settings.lfs_force_unlock"}}</button>
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 0520c87cc1..202be3fce7 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -117,7 +117,7 @@
<td>{{.PullMirror.RemoteAddress}}</td>
<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
<td>{{DateUtils.FullTime .PullMirror.UpdatedUnix}}</td>
- <td class="right aligned">
+ <td class="tw-text-right">
<form method="post" class="tw-inline-block">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="mirror-sync">
@@ -203,9 +203,18 @@
{{range .PushMirrors}}
<tr>
<td class="tw-break-anywhere">{{.RemoteAddress}}</td>
- <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
- <td>{{if .LastUpdateUnix}}{{DateUtils.FullTime .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
- <td class="right aligned">
+ <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}} ({{.Interval}})</td>
+ <td>
+ <span class="flex-text-block">
+ {{if .LastUpdateUnix}}
+ {{DateUtils.FullTime .LastUpdateUnix}}
+ {{else}}
+ {{ctx.Locale.Tr "never"}}
+ {{end}}
+ {{if .LastError}}<span class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</span>{{end}}
+ </span>
+ </td>
+ <td class="tw-text-right">
<button
class="ui tiny button show-modal"
data-modal="#push-mirror-edit-modal"
@@ -301,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}}
@@ -337,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}}>
@@ -382,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">
@@ -927,7 +908,7 @@
<input name="repo_name" required maxlength="100">
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_confirm"}}</button>
</div>
@@ -958,7 +939,7 @@
<input name="repo_name" required>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_fork_confirm"}}</button>
</div>
@@ -995,7 +976,7 @@
<input id="new_owner_name" name="new_owner_name" required>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_perform"}}</button>
</div>
@@ -1029,7 +1010,7 @@
<input id="repo_name_to_delete" name="repo_name" required>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button>
</div>
@@ -1089,7 +1070,7 @@
<input name="repo_name" required>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_wiki_delete"}}</button>
</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/push_mirror_sync_modal.tmpl b/templates/repo/settings/push_mirror_sync_modal.tmpl
index e8dad61a48..3bd624fab7 100644
--- a/templates/repo/settings/push_mirror_sync_modal.tmpl
+++ b/templates/repo/settings/push_mirror_sync_modal.tmpl
@@ -2,31 +2,27 @@
<div class="header">
{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}
</div>
- <div class="content">
- <form class="ui form ignore-dirty" method="post">
- {{.CsrfTokenHtml}}
- <input type="hidden" name="action" value="push-mirror-update">
- <input type="hidden" name="push_mirror_id" id="push-mirror-edit-id">
- <div class="field">
- <label for="name">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label>
- <div class="ui small input">
- <input id="push-mirror-edit-address" readonly>
- </div>
- </div>
- <div class="inline field">
- <label for="push-mirror-edit-interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
- <input id="push-mirror-edit-interval" name="push_mirror_interval" autofocus>
- </div>
- <div class="actions">
- <button class="ui small basic cancel button">
- {{svg "octicon-x"}}
- {{ctx.Locale.Tr "cancel"}}
- </button>
- <button class="ui primary small approve button">
- {{svg "fontawesome-save"}}
- {{ctx.Locale.Tr "save"}}
- </button>
- </div>
- </form>
- </div>
+ <form class="content ui form ignore-dirty" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="push-mirror-update">
+ <input type="hidden" name="push_mirror_id" id="push-mirror-edit-id">
+ <div class="field">
+ <label>{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label>
+ <span id="push-mirror-edit-address"></span>
+ </div>
+ <div class="field">
+ <label for="push-mirror-edit-interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
+ <input id="push-mirror-edit-interval" name="push_mirror_interval" class="tw-w-auto">
+ </div>
+ <div class="actions">
+ <button class="ui small basic cancel button">
+ {{svg "octicon-x"}}
+ {{ctx.Locale.Tr "cancel"}}
+ </button>
+ <button class="ui primary small approve button">
+ {{svg "fontawesome-save"}}
+ {{ctx.Locale.Tr "save"}}
+ </button>
+ </div>
+ </form>
</div>
diff --git a/templates/repo/settings/tags.tmpl b/templates/repo/settings/tags.tmpl
index 27b0f519a8..12ec9102b7 100644
--- a/templates/repo/settings/tags.tmpl
+++ b/templates/repo/settings/tags.tmpl
@@ -104,7 +104,7 @@
{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.noone"}}
{{end}}
</td>
- <td class="right aligned">
+ <td class="tw-text-right">
<a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{ctx.Locale.Tr "edit"}}</a>
<form class="tw-inline-block" action="{{$.RepoLink}}/settings/tags/delete" method="post">
{{$.CsrfTokenHtml}}
@@ -114,7 +114,7 @@
</td>
</tr>
{{else}}
- <tr class="center aligned"><td colspan="3">{{ctx.Locale.Tr "repo.settings.tags.protection.none"}}</td></tr>
+ <tr class="tw-text-center"><td colspan="3">{{ctx.Locale.Tr "repo.settings.tags.protection.none"}}</td></tr>
{{end}}
</tbody>
</table>
diff --git a/templates/repo/settings/webhook/settings.tmpl b/templates/repo/settings/webhook/settings.tmpl
index 3b28a4c6c0..16ad263e42 100644
--- a/templates/repo/settings/webhook/settings.tmpl
+++ b/templates/repo/settings/webhook/settings.tmpl
@@ -259,6 +259,20 @@
</div>
</div>
</div>
+ <!-- Workflow Events -->
+ <div class="fourteen wide column">
+ <label>{{ctx.Locale.Tr "repo.settings.event_header_workflow"}}</label>
+ </div>
+ <!-- Workflow Job Event -->
+ <div class="seven wide column">
+ <div class="field">
+ <div class="ui checkbox">
+ <input name="workflow_job" type="checkbox" {{if .Webhook.HookEvents.Get "workflow_job"}}checked{{end}}>
+ <label>{{ctx.Locale.Tr "repo.settings.event_workflow_job"}}</label>
+ <span class="help">{{ctx.Locale.Tr "repo.settings.event_workflow_job_desc"}}</span>
+ </div>
+ </div>
+ </div>
</div>
</div>
diff --git a/templates/repo/view.tmpl b/templates/repo/view.tmpl
new file mode 100644
index 0000000000..c3d562003d
--- /dev/null
+++ b/templates/repo/view.tmpl
@@ -0,0 +1,29 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content repository file list {{if .IsBlame}}blame{{end}}">
+ {{template "repo/header" .}}
+ <div class="ui container {{if or .TreeNames .IsBlame}}fluid padded{{end}}">
+ {{template "base/alert" .}}
+
+ {{if .Repository.IsArchived}}
+ <div class="ui warning message tw-text-center">
+ {{if .Repository.ArchivedUnix.IsZero}}
+ {{ctx.Locale.Tr "repo.archive.title"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}}
+ {{end}}
+ </div>
+ {{end}}
+
+ {{template "repo/code/recently_pushed_new_branches" .}}
+
+ <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}}>
+ {{template "repo/view_file_tree" .}}
+ </div>
+ <div class="repo-view-content">
+ {{template "repo/view_content" .}}
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/repo/view_content.tmpl b/templates/repo/view_content.tmpl
new file mode 100644
index 0000000000..292a2f878c
--- /dev/null
+++ b/templates/repo/view_content.tmpl
@@ -0,0 +1,111 @@
+{{$isTreePathRoot := not .TreeNames}}
+
+{{template "repo/sub_menu" .}}
+<div class="repo-button-row">
+ <div class="repo-button-row-left">
+ {{if not $isTreePathRoot}}
+ <button class="repo-view-file-tree-toggle-show ui compact basic button icon not-mobile {{if .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}"
+ data-global-click="onRepoViewFileTreeToggle" data-toggle-action="show"
+ data-tooltip-content="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
+ {{svg "octicon-sidebar-collapse"}}
+ </button>
+ {{end}}
+
+ {{template "repo/branch_dropdown" dict
+ "Repository" .Repository
+ "ShowTabBranches" true
+ "ShowTabTags" true
+ "CurrentRefType" .RefFullName.RefType
+ "CurrentRefShortName" .RefFullName.ShortName
+ "CurrentTreePath" .TreePath
+ "RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
+ "AllowCreateNewRef" .CanCreateBranch
+ "ShowViewAllRefsEntry" true
+ }}
+
+ {{if and .CanCompareOrPull .RefFullName.IsBranch (not .Repository.IsArchived)}}
+ {{$cmpBranch := ""}}
+ {{if ne .Repository.ID .BaseRepo.ID}}
+ {{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
+ {{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="{{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>
+ {{end}}
+
+ <!-- Show go to file if on home page -->
+ {{if $isTreePathRoot}}
+ <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}}>
+ {{ctx.Locale.Tr "repo.editor.add_file"}}
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="menu">
+ <a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
+ {{ctx.Locale.Tr "repo.editor.new_file"}}
+ </a>
+ {{if .RepositoryUploadEnabled}}
+ <a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
+ {{ctx.Locale.Tr "repo.editor.upload_file"}}
+ </a>
+ {{end}}
+ <a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
+ {{ctx.Locale.Tr "repo.editor.patch"}}
+ </a>
+ </div>
+ </button>
+ {{end}}
+
+ {{if and $isTreePathRoot .Repository.IsTemplate}}
+ <a role="button" class="ui primary compact button" href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}">
+ {{ctx.Locale.Tr "repo.use_template"}}
+ </a>
+ {{end}}
+
+ {{if not $isTreePathRoot}}
+ {{$treeNameIdxLast := Eval (len .TreeNames) "-" 1}}
+ <span class="breadcrumb repo-path tw-ml-1">
+ <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>
+ {{- if eq $i $treeNameIdxLast -}}
+ <span class="active section" title="{{$v}}">{{$v}}</span>
+ <button class="btn interact-fg tw-mx-1" data-clipboard-text="{{$.TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "copy_path"}}">{{svg "octicon-copy" 14}}</button>
+ {{- else -}}
+ {{$p := index $.Paths $i}}<span class="section"><a href="{{$.BranchLink}}/{{PathEscapeSegments $p}}" title="{{$v}}">{{$v}}</a></span>
+ {{- end -}}
+ {{- end -}}
+ </span>
+ {{end}}
+ </div>
+
+ <div class="repo-button-row-right">
+ <!-- Only show clone panel in repository home page -->
+ {{if $isTreePathRoot}}
+ {{template "repo/clone_panel" .}}
+ {{end}}
+ {{if and (not $isTreePathRoot) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}}
+ <a class="ui button" href="{{.RepoLink}}/commits/{{.RefTypeNameSubURL}}/{{.TreePath | PathEscapeSegments}}">
+ {{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}}
+ </a>
+ {{end}}
+ </div>
+</div>
+{{if .IsViewFile}}
+ {{template "repo/view_file" .}}
+{{else if .IsBlame}}
+ {{template "repo/blame" .}}
+{{else}}{{/* IsViewDirectory */}}
+ {{if $isTreePathRoot}}
+ {{template "repo/code/upstream_diverging_info" .}}
+ {{end}}
+ {{template "repo/view_list" .}}
+ {{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
+ {{template "repo/view_file" .}}
+ {{end}}
+{{end}}
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 4907d87301..51a8f7d501 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -55,7 +55,7 @@
{{end}}
</div>
<a download class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}" href="{{$.RawFileLink}}">{{svg "octicon-download"}}</a>
- <a id="copy-content" class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}"{{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 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>
{{if .EnableFeed}}
<a class="btn-octicon" href="{{$.RepoLink}}/rss/{{$.RefTypeNameSubURL}}/{{PathEscapeSegments .TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
{{svg "octicon-rss"}}
@@ -108,7 +108,7 @@
<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
{{else if .IsPDFFile}}
- <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "repo.diff.view_file"}}"></div>
+ <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}}
diff --git a/templates/repo/view_file_tree.tmpl b/templates/repo/view_file_tree.tmpl
new file mode 100644
index 0000000000..8aed05f346
--- /dev/null
+++ b/templates/repo/view_file_tree.tmpl
@@ -0,0 +1,15 @@
+<div class="flex-text-block repo-button-row">
+ <button class="ui compact basic icon button"
+ data-global-click="onRepoViewFileTreeToggle" data-toggle-action="hide"
+ data-tooltip-content="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
+ {{svg "octicon-sidebar-expand"}}
+ </button>
+ <b>{{ctx.Locale.Tr "files"}}</b>
+</div>
+
+{{/* TODO: Dynamically move components such as refSelector and createPR here */}}
+<div id="view-file-tree" class="tw-overflow-auto tw-h-full is-loading"
+ data-repo-link="{{.RepoLink}}"
+ data-tree-path="{{$.TreePath}}"
+ data-current-ref-name-sub-url="{{.RefTypeNameSubURL}}"
+></div>
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
index 7540931010..4745110dd2 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -14,20 +14,21 @@
{{$entry := $item.Entry}}
{{$commit := $item.Commit}}
{{$submoduleFile := $item.SubmoduleFile}}
- <div class="repo-file-cell name {{if not $commit}}notready{{end}}">
+ <div class="repo-file-cell name muted-links {{if not $commit}}notready{{end}}">
+ {{ctx.RenderUtils.RenderFileIcon $entry}}
{{if $entry.IsSubModule}}
- {{svg "octicon-file-submodule"}}
{{$submoduleLink := $submoduleFile.SubmoduleWebLink ctx}}
{{if $submoduleLink}}
- <a class="muted" href="{{$submoduleLink.RepoWebLink}}">{{$entry.Name}}</a> <span class="at">@</span> <a href="{{$submoduleLink.CommitWebLink}}">{{ShortSha $submoduleFile.RefID}}</a>
+ <a class="entry-name" href="{{$submoduleLink.RepoWebLink}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
+ @ <a class="text primary" href="{{$submoduleLink.CommitWebLink}}">{{ShortSha $submoduleFile.RefID}}</a>
{{else}}
- {{$entry.Name}} <span class="at">@</span> {{ShortSha $submoduleFile.RefID}}
+ <span class="entry-name" title="{{$entry.Name}}">{{$entry.Name}}</span>
+ @ {{ShortSha $submoduleFile.RefID}}
{{end}}
{{else}}
{{if $entry.IsDir}}
{{$subJumpablePathName := $entry.GetSubJumpablePathName}}
- {{svg "octicon-file-directory-fill"}}
- <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
+ <a class="entry-name" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
{{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}}
{{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}}
{{if eq $subJumpablePathFieldLast 0}}
@@ -38,8 +39,7 @@
{{end}}
</a>
{{else}}
- {{svg (printf "octicon-%s" (EntryIcon $entry))}}
- <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
+ <a class="entry-name" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
{{end}}
{{end}}
</div>
diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl
index ea2913c0fd..9b5e7b907d 100644
--- a/templates/repo/wiki/new.tmpl
+++ b/templates/repo/wiki/new.tmpl
@@ -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="text right">
+ <div class="tw-text-right">
<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/pages.tmpl b/templates/repo/wiki/pages.tmpl
index e6cd10ac09..5ceb8a4d5b 100644
--- a/templates/repo/wiki/pages.tmpl
+++ b/templates/repo/wiki/pages.tmpl
@@ -21,7 +21,7 @@
<a class="wiki-git-entry" href="{{$.RepoLink}}/wiki/{{.GitEntryName | PathEscape}}" data-tooltip-content="{{ctx.Locale.Tr "repo.wiki.original_git_entry_tooltip"}}">{{svg "octicon-chevron-right"}}</a>
</td>
{{$timeSince := DateUtils.TimeSince .UpdatedUnix}}
- <td class="text right">{{ctx.Locale.Tr "repo.wiki.last_updated" $timeSince}}</td>
+ <td class="tw-text-right">{{ctx.Locale.Tr "repo.wiki.last_updated" $timeSince}}</td>
</tr>
{{end}}
</tbody>
diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl
index ca8954928d..80179ce46b 100644
--- a/templates/repo/wiki/revision.tmpl
+++ b/templates/repo/wiki/revision.tmpl
@@ -14,7 +14,7 @@
</div>
</div>
</div>
- <div class="ui eight wide column text right">
+ <div class="ui eight wide column tw-text-right">
{{template "repo/clone_panel" .}}
</div>
</div>
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
index 843a977e3e..efb614280a 100644
--- a/templates/repo/wiki/view.tmpl
+++ b/templates/repo/wiki/view.tmpl
@@ -63,18 +63,18 @@
<div class="wiki-content-parts">
{{if .sidebarTocContent}}
- <div class="markup wiki-content-sidebar wiki-content-toc">
+ <div class="render-content markup wiki-content-sidebar wiki-content-toc">
{{.sidebarTocContent | SafeHTML}}
</div>
{{end}}
- <div class="markup wiki-content-main {{if or .sidebarTocContent .sidebarPresent}}with-sidebar{{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>
{{if .sidebarPresent}}
- <div class="markup wiki-content-sidebar">
+ <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}}
@@ -86,7 +86,7 @@
<div class="tw-clear-both"></div>
{{if .footerPresent}}
- <div class="markup wiki-content-footer">
+ <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}}
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_edit.tmpl b/templates/shared/actions/runner_edit.tmpl
index 54250f830b..d452d69f7a 100644
--- a/templates/shared/actions/runner_edit.tmpl
+++ b/templates/shared/actions/runner_edit.tmpl
@@ -40,7 +40,7 @@
<div class="field">
<button class="ui primary button" data-url="{{.Link}}">{{ctx.Locale.Tr "actions.runners.update_runner"}}</button>
- <button class="ui red button delete-button show-modal" data-url="{{.Link}}/delete" data-modal="#runner-delete-modal">
+ <button class="ui red button delete-button" data-url="{{.Link}}/delete" data-modal="#runner-delete-modal">
{{ctx.Locale.Tr "actions.runners.delete_runner"}}</button>
</div>
</form>
diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl
index e5907da8e8..6436643ee7 100644
--- a/templates/shared/actions/runner_list.tmpl
+++ b/templates/shared/actions/runner_list.tmpl
@@ -87,7 +87,7 @@
{{end}}
{{else}}
<tr>
- <td class="center aligned" colspan="8">{{ctx.Locale.Tr "actions.runners.none"}}</td>
+ <td class="tw-text-center" colspan="8">{{ctx.Locale.Tr "actions.runners.none"}}</td>
</tr>
{{end}}
</tbody>
diff --git a/templates/shared/combomarkdowneditor.tmpl b/templates/shared/combomarkdowneditor.tmpl
index b1c3b29cf3..fa3e6c6ade 100644
--- a/templates/shared/combomarkdowneditor.tmpl
+++ b/templates/shared/combomarkdowneditor.tmpl
@@ -81,7 +81,7 @@
}
</script>
</div>
- <div class="ui tab markup" data-tab-panel="markdown-previewer">
+ <div class="ui tab" data-tab-panel="markdown-previewer">
{{ctx.Locale.Tr "loading"}}
</div>
<div class="markdown-add-table-panel tippy-target">
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index fe7f2fd8bf..30670c3b0f 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -153,6 +153,11 @@
</div>
{{end}}
</div>
+ {{else}}
+ <div class="tw-text-center tw-p-8">
+ <h3 class="tw-my-4">{{ctx.Locale.Tr "repo.issues.filter_no_results"}}</h3>
+ <p class="tw-text-placeholder-text">{{ctx.Locale.Tr "repo.issues.filter_no_results_placeholder"}}</p>
+ </div>
{{end}}
{{if .IssueIndexerUnavailable}}
<div class="ui error message">
diff --git a/templates/shared/search/code/results.tmpl b/templates/shared/search/code/results.tmpl
index a98a662654..8a08f5c25c 100644
--- a/templates/shared/search/code/results.tmpl
+++ b/templates/shared/search/code/results.tmpl
@@ -1,7 +1,7 @@
<div class="flex-text-block tw-flex-wrap">
{{range $term := .SearchResultLanguages}}
<a class="ui {{if eq $.Language $term.Language}}primary{{end}} basic label tw-m-0"
- href="?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}&fuzzy={{$.IsFuzzy}}">
+ href="?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}&search_mode={{$.SelectedSearchMode}}">
<i class="color-icon tw-mr-2" style="background-color: {{$term.Color}}"></i>
{{$term.Language}}
<div class="detail">{{$term.Count}}</div>
@@ -11,7 +11,7 @@
<div class="repository search">
{{range $result := .SearchResults}}
{{$repo := or $.Repo (index $.RepoMaps .RepoID)}}
- <div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result">
+ <div class="diff-file-box file-content non-diff-file-content repo-search-result">
<h4 class="ui top attached header tw-font-normal tw-flex tw-flex-wrap">
{{if not $.Repo}}
<span class="file tw-flex-1">
diff --git a/templates/shared/search/code/search.tmpl b/templates/shared/search/code/search.tmpl
index dde45c0fbf..2041213e19 100644
--- a/templates/shared/search/code/search.tmpl
+++ b/templates/shared/search/code/search.tmpl
@@ -1,5 +1,11 @@
<form class="ui form ignore-dirty">
- {{template "shared/search/combo_fuzzy" dict "Value" .Keyword "Disabled" .CodeIndexerUnavailable "IsFuzzy" .IsFuzzy "Placeholder" (ctx.Locale.Tr "search.code_kind")}}
+ {{template "shared/search/combo" (dict
+ "Disabled" .CodeIndexerUnavailable
+ "Value" .Keyword
+ "Placeholder" (ctx.Locale.Tr "search.code_kind")
+ "SearchModes" .SearchModes
+ "SelectedSearchMode" .SelectedSearchMode
+ )}}
</form>
<div class="divider"></div>
<div class="ui list">
diff --git a/templates/shared/search/combo.tmpl b/templates/shared/search/combo.tmpl
index 788db95cc1..3aba9a7f04 100644
--- a/templates/shared/search/combo.tmpl
+++ b/templates/shared/search/combo.tmpl
@@ -1,8 +1,30 @@
-{{/* Value - value of the search field (for search results page) */}}
-{{/* Disabled (optional) - if search field/button has to be disabled */}}
-{{/* Placeholder (optional) - placeholder text to be used */}}
-{{/* Tooltip (optional) - a tooltip to be displayed on button hover */}}
+{{/* Attributes:
+* Value - value of the search field (for search results page)
+* Disabled (optional) - if search field/button has to be disabled
+* Placeholder (optional) - placeholder text to be used
+* Tooltip (optional) - a tooltip to be displayed on button hover
+* SearchModes - a list of search modes to be displayed in the dropdown
+* SelectedSearchMode - the currently selected search mode
+*/}}
<div class="ui small fluid action input">
{{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}}
+ {{if .SearchModes}}
+ <div class="ui small dropdown selection {{if .Disabled}}disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "search.type_tooltip"}}">
+ <div class="text"></div> {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <input name="search_mode" type="hidden" value="
+ {{- if .SelectedSearchMode -}}
+ {{- .SelectedSearchMode -}}
+ {{- else -}}
+ {{- $defaultSearchMode := index .SearchModes 0 -}}
+ {{- $defaultSearchMode.ModeValue -}}
+ {{- end -}}
+ ">
+ <div class="menu">
+ {{range $mode := .SearchModes}}
+ <div class="item" data-value="{{$mode.ModeValue}}" data-tooltip-content="{{ctx.Locale.Tr $mode.TooltipTrKey}}">{{ctx.Locale.Tr $mode.TitleTrKey}}</div>
+ {{end}}
+ </div>
+ </div>
+ {{end}}
{{template "shared/search/button" dict "Disabled" .Disabled "Tooltip" .Tooltip}}
</div>
diff --git a/templates/shared/search/combo_fuzzy.tmpl b/templates/shared/search/combo_fuzzy.tmpl
deleted file mode 100644
index 3540a89ecb..0000000000
--- a/templates/shared/search/combo_fuzzy.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-{{/* Value - value of the search field (for search results page) */}}
-{{/* Disabled (optional) - if search field/button has to be disabled */}}
-{{/* Placeholder (optional) - placeholder text to be used */}}
-{{/* IsFuzzy - state of the fuzzy search toggle */}}
-{{/* Tooltip (optional) - a tooltip to be displayed on button hover */}}
-<div class="ui small fluid action input">
- {{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}}
- {{template "shared/search/fuzzy" dict "Disabled" .Disabled "IsFuzzy" .IsFuzzy}}
- {{template "shared/search/button" dict "Disabled" .Disabled "Tooltip" .Tooltip}}
-</div>
diff --git a/templates/shared/search/fuzzy.tmpl b/templates/shared/search/fuzzy.tmpl
deleted file mode 100644
index 5c09d3c150..0000000000
--- a/templates/shared/search/fuzzy.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-{{/* Disabled (optional) - if dropdown has to be disabled */}}
-{{/* IsFuzzy - state of the fuzzy search toggle */}}
-<div class="ui small dropdown selection {{if .Disabled}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "search.type_tooltip"}}">
- <input name="fuzzy" type="hidden"{{if .Disabled}} disabled{{end}} value="{{.IsFuzzy}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}}
- <div class="text">{{if .IsFuzzy}}{{ctx.Locale.Tr "search.fuzzy"}}{{else}}{{ctx.Locale.Tr "search.exact"}}{{end}}</div>
- <div class="menu">
- <div class="item" data-value="true" data-tooltip-content="{{ctx.Locale.Tr "search.fuzzy_tooltip"}}">{{ctx.Locale.Tr "search.fuzzy"}}</div>
- <div class="item" data-value="false" data-tooltip-content="{{ctx.Locale.Tr "search.exact_tooltip"}}">{{ctx.Locale.Tr "search.exact"}}</div>
- </div>
-</div>
diff --git a/templates/shared/secrets/add_list.tmpl b/templates/shared/secrets/add_list.tmpl
index 59596d1013..977f308b71 100644
--- a/templates/shared/secrets/add_list.tmpl
+++ b/templates/shared/secrets/add_list.tmpl
@@ -23,6 +23,9 @@
{{.Name}}
</div>
<div class="flex-item-body">
+ {{if .Description}}{{.Description}}{{else}}-{{end}}
+ </div>
+ <div class="flex-item-body">
******
</div>
</div>
@@ -72,9 +75,20 @@
<textarea required
id="secret-data"
name="data"
+ maxlength="{{.DataMaxLength}}"
placeholder="{{ctx.Locale.Tr "secrets.creation.value_placeholder"}}"
></textarea>
</div>
+ <div class="field">
+ <label for="secret-description">{{ctx.Locale.Tr "secrets.creation.description"}}</label>
+ <textarea
+ id="secret-description"
+ name="description"
+ rows="2"
+ maxlength="{{.DescriptionMaxLength}}"
+ placeholder="{{ctx.Locale.Tr "secrets.creation.description_placeholder"}}"
+ ></textarea>
+ </div>
</div>
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
</form>
diff --git a/templates/shared/user/block_user_dialog.tmpl b/templates/shared/user/block_user_dialog.tmpl
index c6db4ca1e4..e1fa939945 100644
--- a/templates/shared/user/block_user_dialog.tmpl
+++ b/templates/shared/user/block_user_dialog.tmpl
@@ -14,7 +14,7 @@
<input id="block-note" name="note">
<p class="help">{{ctx.Locale.Tr "user.block.note.info"}}</p>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "cancel"}}</button>
<button class="ui red button">{{ctx.Locale.Tr "user.block.block"}}</button>
</div>
diff --git a/templates/shared/user/blocked_users.tmpl b/templates/shared/user/blocked_users.tmpl
index e83a039ef5..a4c74c46ac 100644
--- a/templates/shared/user/blocked_users.tmpl
+++ b/templates/shared/user/blocked_users.tmpl
@@ -74,7 +74,7 @@
<input name="note" class="modal-note" />
<p class="help">{{ctx.Locale.Tr "user.block.note.info"}}</p>
</div>
- <div class="text right actions">
+ <div class="actions">
<button class="ui cancel button">{{ctx.Locale.Tr "cancel"}}</button>
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
</div>
diff --git a/templates/shared/variables/variable_list.tmpl b/templates/shared/variables/variable_list.tmpl
index 7a0ab48cef..2edca431c1 100644
--- a/templates/shared/variables/variable_list.tmpl
+++ b/templates/shared/variables/variable_list.tmpl
@@ -7,6 +7,7 @@
data-modal-header="{{ctx.Locale.Tr "actions.variables.creation"}}"
data-modal-dialog-variable-name=""
data-modal-dialog-variable-data=""
+ data-modal-dialog-variable-description=""
>
{{ctx.Locale.Tr "actions.variables.creation"}}
</button>
@@ -25,6 +26,9 @@
{{.Name}}
</div>
<div class="flex-item-body">
+ {{if .Description}}{{.Description}}{{else}}-{{end}}
+ </div>
+ <div class="flex-item-body">
{{.Data}}
</div>
</div>
@@ -39,6 +43,7 @@
data-modal-header="{{ctx.Locale.Tr "actions.variables.edit"}}"
data-modal-dialog-variable-name="{{.Name}}"
data-modal-dialog-variable-data="{{.Data}}"
+ data-modal-dialog-variable-description="{{.Description}}"
>
{{svg "octicon-pencil"}}
</button>
@@ -82,9 +87,20 @@
<textarea required
name="data"
id="dialog-variable-data"
+ maxlength="{{.DataMaxLength}}"
placeholder="{{ctx.Locale.Tr "secrets.creation.value_placeholder"}}"
></textarea>
</div>
+ <div class="field">
+ <label for="dialog-variable-description">{{ctx.Locale.Tr "secrets.creation.description"}}</label>
+ <textarea
+ name="description"
+ id="dialog-variable-description"
+ rows="2"
+ maxlength="{{.DescriptionMaxLength}}"
+ placeholder="{{ctx.Locale.Tr "secrets.creation.description_placeholder"}}"
+ ></textarea>
+ </div>
</div>
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
</form>
diff --git a/templates/swagger/v1_input.json b/templates/swagger/v1_input.json
new file mode 100644
index 0000000000..1979febebb
--- /dev/null
+++ b/templates/swagger/v1_input.json
@@ -0,0 +1,6 @@
+{
+ "info": {
+ "version": "{{AppVer | JSEscape}}"
+ },
+ "basePath": "{{AppSubUrl | JSEscape}}/api/v1"
+}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 80cf1b5623..d0e41e8094 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -3339,6 +3339,93 @@
}
}
},
+ "/packages/{owner}/{type}/{name}/-/link/{repo_name}": {
+ "post": {
+ "tags": [
+ "package"
+ ],
+ "summary": "Link a package to a repository",
+ "operationId": "linkPackage",
+ "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": "string",
+ "description": "name of the repository to link.",
+ "name": "repo_name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "$ref": "#/responses/empty"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/packages/{owner}/{type}/{name}/-/unlink": {
+ "post": {
+ "tags": [
+ "package"
+ ],
+ "summary": "Unlink a package from a repository",
+ "operationId": "unlinkPackage",
+ "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": {
+ "201": {
+ "$ref": "#/responses/empty"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/packages/{owner}/{type}/{name}/{version}": {
"get": {
"produces": [
@@ -3919,6 +4006,233 @@
}
}
},
+ "/repos/{owner}/{repo}/actions/artifacts": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Lists all artifacts for a repository",
+ "operationId": "getArtifacts",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the owner",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repository",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the artifact",
+ "name": "name",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ArtifactsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Gets a specific artifact for a workflow run",
+ "operationId": "getArtifact",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the owner",
+ "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 artifact",
+ "name": "artifact_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/Artifact"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Deletes a specific artifact for a workflow run",
+ "operationId": "deleteArtifact",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the owner",
+ "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 artifact",
+ "name": "artifact_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "No Content"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Downloads a specific artifact for a workflow run redirects to blob url",
+ "operationId": "downloadArtifact",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the owner",
+ "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 artifact",
+ "name": "artifact_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "302": {
+ "description": "redirect to the blob download"
+ },
+ "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": "name of the owner",
+ "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/registration-token": {
"get": {
"produces": [
@@ -3952,6 +4266,58 @@
}
}
},
+ "/repos/{owner}/{repo}/actions/runs/{run}/artifacts": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Lists all artifacts for a repository run",
+ "operationId": "getArtifactsOfRun",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the owner",
+ "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": "name of the artifact",
+ "name": "name",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ArtifactsList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/actions/secrets": {
"get": {
"produces": [
@@ -11728,6 +12094,12 @@
"required": true
},
{
+ "type": "string",
+ "description": "Filter by target base branch of the pull request",
+ "name": "base_branch",
+ "in": "query"
+ },
+ {
"enum": [
"open",
"closed",
@@ -18837,6 +19209,76 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ActionArtifact": {
+ "description": "ActionArtifact represents a ActionArtifact",
+ "type": "object",
+ "properties": {
+ "archive_download_url": {
+ "type": "string",
+ "x-go-name": "ArchiveDownloadURL"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "CreatedAt"
+ },
+ "expired": {
+ "type": "boolean",
+ "x-go-name": "Expired"
+ },
+ "expires_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "ExpiresAt"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "ID"
+ },
+ "name": {
+ "type": "string",
+ "x-go-name": "Name"
+ },
+ "size_in_bytes": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "SizeInBytes"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "UpdatedAt"
+ },
+ "url": {
+ "type": "string",
+ "x-go-name": "URL"
+ },
+ "workflow_run": {
+ "$ref": "#/definitions/ActionWorkflowRun"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
+ "ActionArtifactsResponse": {
+ "description": "ActionArtifactsResponse returns ActionArtifacts",
+ "type": "object",
+ "properties": {
+ "artifacts": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionArtifact"
+ },
+ "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",
@@ -18929,6 +19371,11 @@
"type": "string",
"x-go-name": "Data"
},
+ "description": {
+ "description": "the description of the variable",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"name": {
"description": "the name of the variable",
"type": "string",
@@ -18999,6 +19446,27 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ActionWorkflowRun": {
+ "description": "ActionWorkflowRun represents a WorkflowRun",
+ "type": "object",
+ "properties": {
+ "head_sha": {
+ "type": "string",
+ "x-go-name": "HeadSha"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "ID"
+ },
+ "repository_id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "RepositoryID"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"Activity": {
"type": "object",
"properties": {
@@ -19943,10 +20411,20 @@
"type": "string",
"x-go-name": "HTMLURL"
},
+ "last_author_date": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "LastAuthorDate"
+ },
"last_commit_sha": {
"type": "string",
"x-go-name": "LastCommitSHA"
},
+ "last_committer_date": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "LastCommitterDate"
+ },
"name": {
"type": "string",
"x-go-name": "Name"
@@ -20571,6 +21049,11 @@
"description": "Data of the secret to update",
"type": "string",
"x-go-name": "Data"
+ },
+ "description": {
+ "description": "Description of the secret to update",
+ "type": "string",
+ "x-go-name": "Description"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -21081,6 +21564,11 @@
"value"
],
"properties": {
+ "description": {
+ "description": "Description of the variable to create",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"value": {
"description": "Value of the variable to create",
"type": "string",
@@ -25042,6 +25530,11 @@
"format": "date-time",
"x-go-name": "Created"
},
+ "description": {
+ "description": "the secret's description",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"name": {
"description": "the secret's name",
"type": "string",
@@ -25617,6 +26110,11 @@
"value"
],
"properties": {
+ "description": {
+ "description": "Description of the variable to update",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"name": {
"description": "New name for the variable. If the field is empty, the variable name won't be updated.",
"type": "string",
@@ -26064,6 +26562,18 @@
"$ref": "#/definitions/AnnotatedTag"
}
},
+ "Artifact": {
+ "description": "Artifact",
+ "schema": {
+ "$ref": "#/definitions/ActionArtifact"
+ }
+ },
+ "ArtifactsList": {
+ "description": "ArtifactsList",
+ "schema": {
+ "$ref": "#/definitions/ActionArtifactsResponse"
+ }
+ },
"Attachment": {
"description": "Attachment",
"schema": {
@@ -27157,4 +27667,4 @@
"TOTPHeader": []
}
]
-}
+} \ No newline at end of file
diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl
index 8dd4d1cc51..6779948da5 100644
--- a/templates/user/auth/captcha.tmpl
+++ b/templates/user/auth/captcha.tmpl
@@ -10,12 +10,12 @@
<div class="inline field tw-text-center required">
<div id="captcha" data-captcha-type="g-recaptcha" class="g-recaptcha-style" data-sitekey="{{.RecaptchaSitekey}}"></div>
</div>
- <script src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
+ <script defer src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
{{else if eq .CaptchaType "hcaptcha"}}
<div class="inline field tw-text-center required">
<div id="captcha" data-captcha-type="h-captcha" class="h-captcha-style" data-sitekey="{{.HcaptchaSitekey}}"></div>
</div>
- <script src='https://hcaptcha.com/1/api.js'></script>
+ <script defer src='https://hcaptcha.com/1/api.js'></script>
{{else if eq .CaptchaType "mcaptcha"}}
<div class="inline field tw-text-center">
<div class="m-captcha-style" id="mcaptcha__widget-container"></div>
@@ -25,5 +25,5 @@
<div class="inline field tw-text-center">
<div id="captcha" data-captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
</div>
- <script src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
+ <script defer src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
{{end}}{{end}}
diff --git a/templates/user/auth/grant.tmpl b/templates/user/auth/grant.tmpl
index 4031dd7a63..e56241b0f8 100644
--- a/templates/user/auth/grant.tmpl
+++ b/templates/user/auth/grant.tmpl
@@ -1,35 +1,33 @@
{{template "base/head" .}}
-<div role="main" aria-label="{{.Title}}" class="page-content ui one column stackable center aligned page grid oauth2-authorize-application-box">
- <div class="column seven wide">
- <div class="ui middle centered raised segments">
- <h3 class="ui top attached header">
- {{ctx.Locale.Tr "auth.authorize_title" .Application.Name}}
- </h3>
- <div class="ui attached segment">
- {{template "base/alert" .}}
- <p>
- {{if not .AdditionalScopes}}
- <b>{{ctx.Locale.Tr "auth.authorize_application_description"}}</b><br>
- {{end}}
- {{ctx.Locale.Tr "auth.authorize_application_created_by" .ApplicationCreatorLinkHTML}}<br>
- {{ctx.Locale.Tr "auth.authorize_application_with_scopes" (HTMLFormat "<b>%s</b>" .Scope)}}
- </p>
- </div>
- <div class="ui attached segment">
- <p>{{ctx.Locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML}}</p>
- </div>
- <div class="ui attached segment">
- <form method="post" action="{{AppSubUrl}}/login/oauth/grant">
- {{.CsrfTokenHtml}}
- <input type="hidden" name="client_id" value="{{.Application.ClientID}}">
- <input type="hidden" name="state" value="{{.State}}">
- <input type="hidden" name="scope" value="{{.Scope}}">
- <input type="hidden" name="nonce" value="{{.Nonce}}">
- <input type="hidden" name="redirect_uri" value="{{.RedirectURI}}">
- <button type="submit" id="authorize-app" name="granted" value="true" class="ui red inline button">{{ctx.Locale.Tr "auth.authorize_application"}}</button>
- <button type="submit" name="granted" value="false" class="ui basic primary inline button">{{ctx.Locale.Tr "cancel"}}</button>
- </form>
- </div>
+<div role="main" aria-label="{{.Title}}" class="page-content oauth2-authorize-application-box">
+ <div class="ui container tw-max-w-[500px]">
+ <h3 class="ui top attached header">
+ {{ctx.Locale.Tr "auth.authorize_title" .Application.Name}}
+ </h3>
+ <div class="ui attached segment">
+ {{template "base/alert" .}}
+ <p>
+ {{if not .AdditionalScopes}}
+ <b>{{ctx.Locale.Tr "auth.authorize_application_description"}}</b><br>
+ {{end}}
+ {{ctx.Locale.Tr "auth.authorize_application_created_by" .ApplicationCreatorLinkHTML}}<br>
+ {{ctx.Locale.Tr "auth.authorize_application_with_scopes" (HTMLFormat "<b>%s</b>" .Scope)}}
+ </p>
+ </div>
+ <div class="ui attached segment">
+ <p>{{ctx.Locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML}}</p>
+ </div>
+ <div class="ui attached segment tw-text-center">
+ <form method="post" action="{{AppSubUrl}}/login/oauth/grant">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="client_id" value="{{.Application.ClientID}}">
+ <input type="hidden" name="state" value="{{.State}}">
+ <input type="hidden" name="scope" value="{{.Scope}}">
+ <input type="hidden" name="nonce" value="{{.Nonce}}">
+ <input type="hidden" name="redirect_uri" value="{{.RedirectURI}}">
+ <button type="submit" id="authorize-app" name="granted" value="true" class="ui red inline button">{{ctx.Locale.Tr "auth.authorize_application"}}</button>
+ <button type="submit" name="granted" value="false" class="ui basic primary inline button">{{ctx.Locale.Tr "cancel"}}</button>
+ </form>
</div>
</div>
</div>
diff --git a/templates/user/auth/grant_error.tmpl b/templates/user/auth/grant_error.tmpl
index b2e077960c..7a4521d331 100644
--- a/templates/user/auth/grant_error.tmpl
+++ b/templates/user/auth/grant_error.tmpl
@@ -1,15 +1,12 @@
{{template "base/head" .}}
-<div role="main" aria-label="{{.Title}}" class="page-content ui one column stackable center aligned page grid oauth2-authorize-application-box {{if .IsRepo}}repository{{end}}">
- {{if .IsRepo}}{{template "repo/header" .}}{{end}}
- <div class="column seven wide">
- <div class="ui middle centered raised segments">
- <h1 class="ui top attached header">
- {{ctx.Locale.Tr "auth.authorization_failed"}}
- </h1>
- <h3 class="ui attached segment">{{.Error.ErrorDescription}}</h3>
- <div class="ui attached segment">
- <p>{{ctx.Locale.Tr "auth.authorization_failed_desc"}}</p>
- </div>
+<div role="main" aria-label="{{.Title}}" class="page-content oauth2-authorize-application-box">
+ <div class="ui container tw-max-w-[500px]">
+ <h1 class="ui top attached header">
+ {{ctx.Locale.Tr "auth.authorization_failed"}}
+ </h1>
+ <h3 class="ui attached segment">{{.Error.ErrorDescription}}</h3>
+ <div class="ui attached segment">
+ <p>{{ctx.Locale.Tr "auth.authorization_failed_desc"}}</p>
</div>
</div>
</div>
diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl
index de3a1cdea7..5552363a0a 100644
--- a/templates/user/auth/signin_inner.tmpl
+++ b/templates/user/auth/signin_inner.tmpl
@@ -59,6 +59,7 @@
</div>
</div>
+{{if or .EnablePasskeyAuth .ShowRegistrationButton}}
<div class="ui container fluid">
<div class="ui attached segment header top tw-max-w-2xl tw-m-auto tw-flex tw-flex-col tw-items-center">
{{if .EnablePasskeyAuth}}
@@ -74,3 +75,4 @@
{{end}}
</div>
</div>
+{{end}}
diff --git a/templates/user/auth/webauthn.tmpl b/templates/user/auth/webauthn.tmpl
index 1b84765323..158ad0a546 100644
--- a/templates/user/auth/webauthn.tmpl
+++ b/templates/user/auth/webauthn.tmpl
@@ -1,7 +1,7 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content user signin webauthn-prompt">
<div class="ui page grid">
- <div class="column center aligned">
+ <div class="column tw-text-center">
{{template "user/auth/webauthn_error" .}}
<h3 class="ui top attached header">{{ctx.Locale.Tr "twofa"}}</h3>
<div class="ui attached segment">
diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl
index 3ce3c1eb73..666dd78073 100644
--- a/templates/user/dashboard/dashboard.tmpl
+++ b/templates/user/dashboard/dashboard.tmpl
@@ -5,7 +5,7 @@
<div class="flex-container-main">
{{template "base/alert" .}}
{{template "user/heatmap" .}}
- {{if .Feeds}}
+ {{if .Page.Paginater.TotalPages}}
{{template "user/dashboard/feeds" .}}
{{else}}
{{template "user/dashboard/guide" .}}
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
index 739be586b8..47686dd442 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -110,7 +110,7 @@
<a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
{{$comment := index .GetIssueInfos 1}}
{{if $comment}}
- <div class="markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
+ <div class="render-content markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
{{end}}
{{else if .GetOpType.InActions "merge_pull_request"}}
<div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div>
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index 7924dd2305..54c96a3aa5 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -4,7 +4,7 @@
<div class="ui container">
{{template "base/alert" .}}
<div class="flex-container">
- {{$queryLink := QueryBuild "?" "type" $.ViewType "sort" $.SortType "state" $.State "q" $.Keyword "labels" .SelectLabels "fuzzy" $.IsFuzzy}}
+ {{$queryLink := QueryBuild "?" "type" $.ViewType "sort" $.SortType "state" $.State "q" $.Keyword "labels" .SelectLabels "search_mode" $.SelectedSearchMode}}
<div class="flex-container-nav">
<div class="ui secondary vertical filter menu tw-bg-transparent">
<a class="{{if eq .ViewType "your_repositories"}}active{{end}} item" href="{{QueryBuild $queryLink "type" "your_repositories"}}">
@@ -53,7 +53,13 @@
<input type="hidden" name="type" value="{{$.ViewType}}">
<input type="hidden" name="sort" value="{{$.SortType}}">
<input type="hidden" name="state" value="{{$.State}}">
- {{template "shared/search/combo_fuzzy" dict "Value" $.Keyword "IsFuzzy" $.IsFuzzy "Placeholder" (ctx.Locale.Tr (Iif .PageIsPulls "search.pull_kind" "search.issue_kind")) "Tooltip" (ctx.Locale.Tr "explore.go_to")}}
+ {{template "shared/search/combo" (dict
+ "Value" $.Keyword
+ "Placeholder" (ctx.Locale.Tr (Iif .PageIsPulls "search.pull_kind" "search.issue_kind"))
+ "Tooltip" (ctx.Locale.Tr "explore.go_to")
+ "SearchModes" .SearchModes
+ "SelectedSearchMode" .SelectedSearchMode
+ )}}
</form>
<div class="list-header-filters">
diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl
index 7c1a69a6f5..d0fe0abbc9 100644
--- a/templates/user/dashboard/milestones.tmpl
+++ b/templates/user/dashboard/milestones.tmpl
@@ -33,7 +33,7 @@
{{end}}
</div>
</div>
- <div class="flex-container-main content">
+ <div class="flex-container-main">
<div class="list-header">
<div class="small-menu-items ui compact tiny menu list-header-toggle">
<a class="item{{if not .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
@@ -140,9 +140,7 @@
{{end}}
</div>
{{if .Content}}
- <div class="markup content">
- {{.RenderedContent}}
- </div>
+ <div class="render-content markup">{{.RenderedContent}}</div>
{{end}}
</li>
{{end}}
diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl
index 0d2371a358..9af2cd53b3 100644
--- a/templates/user/notification/notification_div.tmpl
+++ b/templates/user/notification/notification_div.tmpl
@@ -1,6 +1,6 @@
<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}}
+ {{$notificationUnreadCount := call .NotificationUnreadCount ctx}}
<div class="tw-flex tw-items-center 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">
diff --git a/templates/user/notification/notification_subscriptions.tmpl b/templates/user/notification/notification_subscriptions.tmpl
index b92a32a957..6ef53ab654 100644
--- a/templates/user/notification/notification_subscriptions.tmpl
+++ b/templates/user/notification/notification_subscriptions.tmpl
@@ -28,7 +28,7 @@
</div>
</div>
<div class="tw-flex tw-justify-between">
- <div class="ui right aligned secondary filter menu labels">
+ <div class="ui secondary filter menu labels">
<!-- Type -->
<div class="ui dropdown type jump item">
<span class="text">
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 345872b00d..e5c3412ddd 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -26,7 +26,7 @@
{{else if eq .TabName "followers"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "overview"}}
- <div id="readme_profile" class="markup">{{.ProfileReadmeContent}}</div>
+ <div id="readme_profile" class="render-content markup">{{.ProfileReadmeContent}}</div>
{{else if eq .TabName "organizations"}}
{{template "repo/user_cards" .}}
{{else}}
diff --git a/templates/user/settings/appearance.tmpl b/templates/user/settings/appearance.tmpl
index 4fa248910a..362f73bcb8 100644
--- a/templates/user/settings/appearance.tmpl
+++ b/templates/user/settings/appearance.tmpl
@@ -18,7 +18,7 @@
<label>{{ctx.Locale.Tr "settings.ui"}}</label>
<select name="theme" class="ui dropdown">
{{range $theme := .AllThemes}}
- <option value="{{$theme}}" {{Iif (eq $.SignedUser.Theme $theme) "selected"}}>{{$theme}}</option>
+ <option value="{{$theme.InternalName}}" {{Iif (eq $.SignedUser.Theme $theme.InternalName) "selected"}}>{{$theme.DisplayName}}</option>
{{end}}
</select>
</div>
diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl
index 31d1a2ac5b..501f238c7a 100644
--- a/templates/user/settings/applications.tmpl
+++ b/templates/user/settings/applications.tmpl
@@ -50,49 +50,41 @@
</div>
</div>
<div class="ui bottom attached segment">
- <h5 class="ui top header">
- {{ctx.Locale.Tr "settings.generate_new_token"}}
- </h5>
- <form id="scoped-access-form" class="ui form ignore-dirty" action="{{.Link}}" method="post">
- {{.CsrfTokenHtml}}
- <div class="field {{if .Err_Name}}error{{end}}">
- <label for="name">{{ctx.Locale.Tr "settings.token_name"}}</label>
- <input id="name" name="name" value="{{.name}}" autofocus required maxlength="255">
- </div>
- <div class="field">
- <label>{{ctx.Locale.Tr "settings.repo_and_org_access"}}</label>
- <label class="tw-cursor-pointer">
- <input class="enable-system tw-mt-1 tw-mr-1" type="radio" name="scope" value="{{$.AccessTokenScopePublicOnly}}">
- {{ctx.Locale.Tr "settings.permissions_public_only"}}
- </label>
- <label class="tw-cursor-pointer">
- <input class="enable-system tw-mt-1 tw-mr-1" type="radio" name="scope" value="" checked>
- {{ctx.Locale.Tr "settings.permissions_access_all"}}
- </label>
- </div>
- <details class="ui optional field">
- <summary class="tw-pb-4 tw-pl-1">
- {{ctx.Locale.Tr "settings.select_permissions"}}
- </summary>
- <p class="activity meta">
- <i>{{ctx.Locale.Tr "settings.access_token_desc" (HTMLFormat `href="%s/api/swagger" target="_blank"` AppSubUrl) (`href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`|SafeHTML)}}</i>
- </p>
- <div id="scoped-access-token-selector"
- data-is-admin="{{if .IsAdmin}}true{{else}}false{{end}}"
- data-no-access-label="{{ctx.Locale.Tr "settings.permission_no_access"}}"
- data-read-label="{{ctx.Locale.Tr "settings.permission_read"}}"
- data-write-label="{{ctx.Locale.Tr "settings.permission_write"}}"
- data-locale-component-failed-to-load="{{ctx.Locale.Tr "graphs.component_failed_to_load"}}"
- >
+ <details {{if or .name (not .Tokens)}}open{{end}}>
+ <summary><h4 class="ui header tw-inline-block tw-my-2">{{ctx.Locale.Tr "settings.generate_new_token"}}</h4></summary>
+ <form class="ui form ignore-dirty" action="{{.Link}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field {{if .Err_Name}}error{{end}}">
+ <label for="name">{{ctx.Locale.Tr "settings.token_name"}}</label>
+ <input id="name" name="name" value="{{.name}}" required maxlength="255">
</div>
- </details>
- <button id="scoped-access-submit" class="ui primary button">
- {{ctx.Locale.Tr "settings.generate_token"}}
- </button>
- </form>{{/* Fomantic ".ui.form .warning.message" is hidden by default, so put the warning message out of the form*/}}
- <div id="scoped-access-warning" class="ui warning message center tw-hidden">
- {{ctx.Locale.Tr "settings.at_least_one_permission"}}
- </div>
+ <div class="field">
+ <div class="tw-my-2">{{ctx.Locale.Tr "settings.repo_and_org_access"}}</div>
+ <label class="gt-checkbox">
+ <input type="radio" name="scope-public-only" value="{{$.AccessTokenScopePublicOnly}}"> {{ctx.Locale.Tr "settings.permissions_public_only"}}
+ </label>
+ <label class="gt-checkbox">
+ <input type="radio" name="scope-public-only" value="" checked> {{ctx.Locale.Tr "settings.permissions_access_all"}}
+ </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>
+ <table class="ui table unstackable tw-my-2">
+ {{range $category := .TokenCategories}}
+ <tr>
+ <td>{{$category}}</td>
+ <td><label class="gt-checkbox"><input type="radio" name="scope-{{$category}}" value="" checked> {{ctx.Locale.Tr "settings.permission_no_access"}}</label></td>
+ <td><label class="gt-checkbox"><input type="radio" name="scope-{{$category}}" value="read:{{$category}}"> {{ctx.Locale.Tr "settings.permission_read"}}</label></td>
+ <td><label class="gt-checkbox"><input type="radio" name="scope-{{$category}}" value="write:{{$category}}"> {{ctx.Locale.Tr "settings.permission_write"}}</label></td>
+ </tr>
+ {{end}}
+ </table>
+ </div>
+ <button class="ui primary button">
+ {{ctx.Locale.Tr "settings.generate_token"}}
+ </button>
+ </form>
+ </details>
</div>
{{if .EnableOAuth2}}
diff --git a/templates/user/settings/applications_oauth2_list.tmpl b/templates/user/settings/applications_oauth2_list.tmpl
index 61098e118b..418d8e9cfc 100644
--- a/templates/user/settings/applications_oauth2_list.tmpl
+++ b/templates/user/settings/applications_oauth2_list.tmpl
@@ -48,33 +48,33 @@
</div>
<div class="ui bottom attached segment">
- <h5 class="ui top header">
- {{ctx.Locale.Tr "settings.create_oauth2_application"}}
- </h5>
- <form class="ui form ignore-dirty" action="{{.Link}}/oauth2" method="post">
- {{.CsrfTokenHtml}}
- <div class="field {{if .Err_AppName}}error{{end}}">
- <label for="application-name">{{ctx.Locale.Tr "settings.oauth2_application_name"}}</label>
- <input id="application-name" name="application_name" value="{{.application_name}}" required maxlength="255">
- </div>
- <div class="field {{if .Err_RedirectURI}}error{{end}}">
- <label for="redirect-uris">{{ctx.Locale.Tr "settings.oauth2_redirect_uris"}}</label>
- <textarea name="redirect_uris" id="redirect-uris"></textarea>
- </div>
- <div class="field {{if .Err_ConfidentialClient}}error{{end}}">
- <div class="ui checkbox">
- <label>{{ctx.Locale.Tr "settings.oauth2_confidential_client"}}</label>
- <input class="disable-setting" type="checkbox" name="confidential_client" data-target="#skip-secondary-authorization" checked>
+ <details {{if .application_name}}open{{end}}>
+ <summary><h4 class="ui header tw-inline-block tw-my-2">{{ctx.Locale.Tr "settings.create_oauth2_application"}}</h4></summary>
+ <form class="ui form ignore-dirty" action="{{.Link}}/oauth2" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field {{if .Err_AppName}}error{{end}}">
+ <label for="application-name">{{ctx.Locale.Tr "settings.oauth2_application_name"}}</label>
+ <input id="application-name" name="application_name" value="{{.application_name}}" required maxlength="255">
</div>
- </div>
- <div class="field {{if .Err_SkipSecondaryAuthorization}}error{{end}} disabled" id="skip-secondary-authorization">
- <div class="ui checkbox">
- <label>{{ctx.Locale.Tr "settings.oauth2_skip_secondary_authorization"}}</label>
- <input type="checkbox" name="skip_secondary_authorization">
+ <div class="field {{if .Err_RedirectURI}}error{{end}}">
+ <label for="redirect-uris">{{ctx.Locale.Tr "settings.oauth2_redirect_uris"}}</label>
+ <textarea name="redirect_uris" id="redirect-uris"></textarea>
</div>
- </div>
- <button class="ui primary button">
- {{ctx.Locale.Tr "settings.create_oauth2_application_button"}}
- </button>
- </form>
+ <div class="field {{if .Err_ConfidentialClient}}error{{end}}">
+ <div class="ui checkbox">
+ <label>{{ctx.Locale.Tr "settings.oauth2_confidential_client"}}</label>
+ <input class="disable-setting" type="checkbox" name="confidential_client" data-target="#skip-secondary-authorization" checked>
+ </div>
+ </div>
+ <div class="field {{if .Err_SkipSecondaryAuthorization}}error{{end}} disabled" id="skip-secondary-authorization">
+ <div class="ui checkbox">
+ <label>{{ctx.Locale.Tr "settings.oauth2_skip_secondary_authorization"}}</label>
+ <input type="checkbox" name="skip_secondary_authorization">
+ </div>
+ </div>
+ <button class="ui primary button">
+ {{ctx.Locale.Tr "settings.create_oauth2_application_button"}}
+ </button>
+ </form>
+ </details>
</div>
diff --git a/templates/user/settings/repos.tmpl b/templates/user/settings/repos.tmpl
index a50fb586c7..4aed8070de 100644
--- a/templates/user/settings/repos.tmpl
+++ b/templates/user/settings/repos.tmpl
@@ -81,7 +81,7 @@
{{end}}
{{else}}
{{if .Repos}}
- <div class="ui middle aligned divided list">
+ <div class="ui list">
{{range .Repos}}
<div class="item">
<div class="content flex-text-block">