diff options
Diffstat (limited to 'templates')
247 files changed, 5651 insertions, 1918 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 660f0d0881..91b84e13b6 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -15,7 +15,14 @@ </div> <div class="required inline field {{if .Err_Name}}error{{end}}"> <label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label> - <input id="auth_name" name="name" value="{{.Source.Name}}" autofocus required> + <input id="auth_name" name="name" value="{{.Source.Name}}" required> + </div> + <div class="inline field"> + <div class="ui checkbox"> + <label ><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <input name="two_factor_policy" type="checkbox" value="skip" {{if eq .Source.TwoFactorPolicy "skip"}}checked{{end}}> + <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + </div> </div> <!-- LDAP and DLDAP --> @@ -159,13 +166,6 @@ </div> </div> {{end}} - <div class="optional field"> - <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> - <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> - </div> - </div> <div class="inline field"> <div class="ui checkbox"> <label for="allow_deactivate_all"><strong>{{ctx.Locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label> @@ -227,13 +227,6 @@ <input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}"> <p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p> </div> - <div class="optional field"> - <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> - <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> - </div> - </div> {{end}} <!-- PAM --> @@ -247,13 +240,6 @@ <label for="pam_email_domain">{{ctx.Locale.Tr "admin.auths.pam_email_domain"}}</label> <input id="pam_email_domain" name="pam_email_domain" value="{{$cfg.EmailDomain}}"> </div> - <div class="optional field"> - <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> - <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> - </div> - </div> {{end}} <!-- OAuth2 --> @@ -288,13 +274,6 @@ <label for="open_id_connect_auto_discovery_url">{{ctx.Locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> <input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}"> </div> - <div class="optional field"> - <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{ctx.Locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> - <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> - </div> - </div> <div class="oauth2_use_custom_url inline field"> <div class="ui checkbox"> <label><strong>{{ctx.Locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl index 7931014b1a..a1e72b742f 100644 --- a/templates/admin/auth/list.tmpl +++ b/templates/admin/auth/list.tmpl @@ -30,6 +30,8 @@ <td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> <td><a href="{{AppSubUrl}}/-/admin/auths/{{.ID}}">{{svg "octicon-pencil"}}</a></td> </tr> + {{else}} + <tr><td class="tw-text-center" colspan="7">{{ctx.Locale.Tr "no_results_found"}}</td></tr> {{end}} </tbody> </table> diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 29a5e1b473..806347c720 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -69,10 +69,6 @@ {{if not .SSH.StartBuiltinServer}} <dt>{{ctx.Locale.Tr "admin.config.ssh_root_path"}}</dt> <dd>{{.SSH.RootPath}}</dd> - <dt>{{ctx.Locale.Tr "admin.config.ssh_key_test_path"}}</dt> - <dd>{{.SSH.KeyTestPath}}</dd> - <dt>{{ctx.Locale.Tr "admin.config.ssh_keygen_path"}}</dt> - <dd>{{.SSH.KeygenPath}}</dd> <dt>{{ctx.Locale.Tr "admin.config.ssh_minimum_key_size_check"}}</dt> <dd>{{svg (Iif .SSH.MinimumKeySizeCheck "octicon-check" "octicon-x")}}</dd> {{if .SSH.MinimumKeySizeCheck}} @@ -148,7 +144,7 @@ <dt>{{ctx.Locale.Tr "admin.config.enable_openid_signin"}}</dt> <dd>{{svg (Iif .Service.EnableOpenIDSignIn "octicon-check" "octicon-x")}}</dd> <dt>{{ctx.Locale.Tr "admin.config.require_sign_in_view"}}</dt> - <dd>{{svg (Iif .Service.RequireSignInView "octicon-check" "octicon-x")}}</dd> + <dd>{{svg (Iif .Service.RequireSignInViewStrict "octicon-check" "octicon-x")}}</dd> <dt>{{ctx.Locale.Tr "admin.config.mail_notify"}}</dt> <dd>{{svg (Iif .Service.EnableNotifyMail "octicon-check" "octicon-x")}}</dd> <dt>{{ctx.Locale.Tr "admin.config.enable_captcha"}}</dt> diff --git a/templates/admin/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/emails/list.tmpl b/templates/admin/emails/list.tmpl index 0dc1fb9d03..b4335aeeec 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -67,6 +67,8 @@ >{{svg "octicon-trash"}}</a> </td> </tr> + {{else}} + <tr><td class="tw-text-center" colspan="6">{{ctx.Locale.Tr "no_results_found"}}</td></tr> {{end}} </tbody> </table> diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl index 4116357d1d..72584ec799 100644 --- a/templates/admin/navbar.tmpl +++ b/templates/admin/navbar.tmpl @@ -95,7 +95,7 @@ <a class="{{if .PageIsAdminNotices}}active {{end}}item" href="{{AppSubUrl}}/-/admin/notices"> {{ctx.Locale.Tr "admin.notices"}} </a> - <details class="item toggleable-item" {{if or .PageIsAdminMonitorStats .PageIsAdminMonitorCron .PageIsAdminMonitorQueue .PageIsAdminMonitorStacktrace}}open{{end}}> + <details class="item toggleable-item" {{if or .PageIsAdminMonitorStats .PageIsAdminMonitorCron .PageIsAdminMonitorQueue .PageIsAdminMonitorTrace}}open{{end}}> <summary>{{ctx.Locale.Tr "admin.monitor"}}</summary> <div class="menu"> <a class="{{if .PageIsAdminMonitorStats}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/stats"> @@ -107,8 +107,8 @@ <a class="{{if .PageIsAdminMonitorQueue}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/queue"> {{ctx.Locale.Tr "admin.monitor.queues"}} </a> - <a class="{{if .PageIsAdminMonitorStacktrace}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/stacktrace"> - {{ctx.Locale.Tr "admin.monitor.stacktrace"}} + <a class="{{if .PageIsAdminMonitorTrace}}active {{end}}item" href="{{AppSubUrl}}/-/admin/monitor/stacktrace"> + {{ctx.Locale.Tr "admin.monitor.trace"}} </a> </div> </details> diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index fd475d7157..a4c9dc53fb 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -24,6 +24,8 @@ <td nowrap>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> <td class="view-detail"><a href="#">{{svg "octicon-note" 16}}</a></td> </tr> + {{else}} + <tr><td class="tw-text-center" colspan="6">{{ctx.Locale.Tr "no_results_found"}}</td></tr> {{end}} </tbody> {{if .Notices}} diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index d5e09939c5..137c42b45d 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -66,6 +66,8 @@ <td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> <td><a href="{{.OrganisationLink}}/settings" data-tooltip-content="{{ctx.Locale.Tr "edit"}}">{{svg "octicon-pencil"}}</a></td> </tr> + {{else}} + <tr><td class="tw-text-center" colspan="7">{{ctx.Locale.Tr "no_results_found"}}</td></tr> {{end}} </tbody> </table> diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index 08c11442bc..985caf6bdf 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -74,6 +74,8 @@ <td>{{DateUtils.AbsoluteShort .Version.CreatedUnix}}</td> <td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.Version.ID}}" data-name="{{.Package.Name}}" data-data-version="{{.Version.Version}}">{{svg "octicon-trash"}}</a></td> </tr> + {{else}} + <tr><td class="tw-text-center" colspan="10">{{ctx.Locale.Tr "no_results_found"}}</td></tr> {{end}} </tbody> </table> @@ -88,7 +90,7 @@ {{ctx.Locale.Tr "packages.settings.delete"}} </div> <div class="content"> - {{ctx.Locale.Tr "packages.settings.delete.notice" (`<span class="name"></span>`|SafeHTML) (`<span class="dataVersion"></span>`|SafeHTML)}} + {{ctx.Locale.Tr "packages.settings.delete.notice" (HTMLFormat `<span class="%s"></span>` "name") (HTMLFormat `<span class="%s"></span>` "dataVersion")}} </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/admin/perftrace.tmpl b/templates/admin/perftrace.tmpl new file mode 100644 index 0000000000..2e09f14e46 --- /dev/null +++ b/templates/admin/perftrace.tmpl @@ -0,0 +1,13 @@ +{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}} + +<div class="admin-setting-content"> + {{template "admin/trace_tabs" .}} + + {{range $record := .PerfTraceRecords}} + <div class="ui segment tw-w-full tw-overflow-auto"> + <pre class="tw-whitespace-pre">{{$record.Content}}</pre> + </div> + {{end}} +</div> + +{{template "admin/layout_footer" .}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index 08fd893e76..ce08d49656 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -7,7 +7,7 @@ </div> </h4> <div class="ui attached segment"> - {{template "shared/repo_search" .}} + {{template "shared/repo/search" .}} </div> <div class="ui attached table segment"> <table class="ui very basic striped table unstackable"> @@ -86,6 +86,8 @@ <td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> <td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.ID}}" data-name="{{.Name}}">{{svg "octicon-trash"}}</a></td> </tr> + {{else}} + <tr><td class="tw-text-center" colspan="12">{{ctx.Locale.Tr "no_results_found"}}</td></tr> {{end}} </tbody> </table> @@ -101,7 +103,7 @@ </div> <div class="content"> <p>{{ctx.Locale.Tr "repo.settings.delete_desc"}}</p> - {{ctx.Locale.Tr "repo.settings.delete_notices_2" (`<span class="name"></span>`|SafeHTML)}}<br> + {{ctx.Locale.Tr "repo.settings.delete_notices_2" (HTMLFormat `<span class="%s"></span>` "name")}}<br> {{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}<br> </div> {{template "base/modal_actions_confirm" .}} diff --git a/templates/admin/stacktrace-row.tmpl b/templates/admin/stacktrace-row.tmpl index 97c361ff90..db7ed81c79 100644 --- a/templates/admin/stacktrace-row.tmpl +++ b/templates/admin/stacktrace-row.tmpl @@ -17,7 +17,10 @@ </div> <div> {{if or (eq .Process.Type "request") (eq .Process.Type "normal")}} - <a class="delete-button icon" href="" data-url="{{.root.Link}}/cancel/{{.Process.PID}}" data-id="{{.Process.PID}}" data-name="{{.Process.Description}}">{{svg "octicon-trash" 16 "text-red"}}</a> + <a class="link-action" data-url="{{.root.Link}}/cancel/{{.Process.PID}}" + data-modal-confirm-header="{{ctx.Locale.Tr "admin.monitor.process.cancel"}}" + data-modal-confirm-content="{{ctx.Locale.Tr "admin.monitor.process.cancel_desc"}}" + >{{svg "octicon-trash" 16 "text-red"}}</a> {{end}} </div> </div> diff --git a/templates/admin/stacktrace.tmpl b/templates/admin/stacktrace.tmpl index ce03d80555..c5dde6b30c 100644 --- a/templates/admin/stacktrace.tmpl +++ b/templates/admin/stacktrace.tmpl @@ -1,22 +1,7 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}} <div class="admin-setting-content"> - <div class="tw-flex tw-items-center"> - <div class="tw-flex-1"> - <div class="ui compact small menu"> - <a class="{{if eq .ShowGoroutineList "process"}}active {{end}}item" href="?show=process">{{ctx.Locale.Tr "admin.monitor.process"}}</a> - <a class="{{if eq .ShowGoroutineList "stacktrace"}}active {{end}}item" href="?show=stacktrace">{{ctx.Locale.Tr "admin.monitor.stacktrace"}}</a> - </div> - </div> - <form target="_blank" action="{{AppSubUrl}}/-/admin/monitor/diagnosis" class="ui form"> - <div class="ui inline field"> - <button class="ui primary small button">{{ctx.Locale.Tr "admin.monitor.download_diagnosis_report"}}</button> - <input name="seconds" size="3" maxlength="3" value="10"> {{ctx.Locale.Tr "tool.raw_seconds"}} - </div> - </form> - </div> - - <div class="divider"></div> + {{template "admin/trace_tabs" .}} <h4 class="ui top attached header"> {{printf "%d Goroutines" .GoroutineCount}}{{/* Goroutine is non-translatable*/}} @@ -34,15 +19,4 @@ {{end}} </div> -<div class="ui g-modal-confirm delete modal"> - <div class="header"> - {{ctx.Locale.Tr "admin.monitor.process.cancel"}} - </div> - <div class="content"> - <p>{{ctx.Locale.Tr "admin.monitor.process.cancel_notices" (`<span class="name"></span>`|SafeHTML)}}</p> - <p>{{ctx.Locale.Tr "admin.monitor.process.cancel_desc"}}</p> - </div> - {{template "base/modal_actions_confirm" .}} -</div> - {{template "admin/layout_footer" .}} diff --git a/templates/admin/trace_tabs.tmpl b/templates/admin/trace_tabs.tmpl new file mode 100644 index 0000000000..5066c9c41b --- /dev/null +++ b/templates/admin/trace_tabs.tmpl @@ -0,0 +1,19 @@ +<div class="flex-text-block"> + <div class="tw-flex-1"> + <div class="ui compact small menu"> + {{if .ShowAdminPerformanceTraceTab}} + <a class="item {{Iif .PageIsAdminMonitorPerfTrace "active"}}" href="{{AppSubUrl}}/-/admin/monitor/perftrace">{{ctx.Locale.Tr "admin.monitor.performance_logs"}}</a> + {{end}} + <a class="item {{Iif (eq .ShowGoroutineList "process") "active"}}" href="{{AppSubUrl}}/-/admin/monitor/stacktrace?show=process">{{ctx.Locale.Tr "admin.monitor.process"}}</a> + <a class="item {{Iif (eq .ShowGoroutineList "stacktrace") "active"}}" href="{{AppSubUrl}}/-/admin/monitor/stacktrace?show=stacktrace">{{ctx.Locale.Tr "admin.monitor.stacktrace"}}</a> + </div> + </div> + <form target="_blank" action="{{AppSubUrl}}/-/admin/monitor/diagnosis" class="ui form"> + <div class="ui inline field"> + <button class="ui primary small button">{{ctx.Locale.Tr "admin.monitor.download_diagnosis_report"}}</button> + <input name="seconds" size="3" maxlength="3" value="10"> {{ctx.Locale.Tr "tool.raw_seconds"}} + </div> + </form> +</div> + +<div class="divider"></div> diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index d591a645d8..879b5cb550 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -9,7 +9,7 @@ {{.CsrfTokenHtml}} <div class="field {{if .Err_UserName}}error{{end}}"> <label for="user_name">{{ctx.Locale.Tr "username"}}</label> - <input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}} maxlength="40"> + <input id="user_name" name="user_name" value="{{.User.Name}}" {{if not .User.IsLocal}}disabled{{end}} maxlength="40"> </div> <!-- Types and name --> <div class="inline required field {{if .Err_LoginType}}error{{end}}"> @@ -55,7 +55,7 @@ <div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}tw-hidden{{end}}"> <label for="login_name">{{ctx.Locale.Tr "admin.users.auth_login_name"}}</label> - <input id="login_name" name="login_name" value="{{.User.LoginName}}" autofocus> + <input id="login_name" name="login_name" value="{{.User.LoginName}}"> </div> <div class="field {{if .Err_FullName}}error{{end}}"> <label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label> @@ -63,7 +63,7 @@ </div> <div class="required field {{if .Err_Email}}error{{end}}"> <label for="email">{{ctx.Locale.Tr "email"}}</label> - <input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required> + <input id="email" name="email" type="email" value="{{.User.Email}}" required> </div> <div class="local field {{if .Err_Password}}error{{end}} {{if not (or (.User.IsLocal) (.User.IsOAuth2))}}tw-hidden{{end}}"> <label for="password">{{ctx.Locale.Tr "password"}}</label> @@ -195,8 +195,7 @@ </div> <div class="inline field tw-pl-4"> - <label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label> - <input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp"> + {{template "shared/avatar_upload_crop" dict "LabelText" (ctx.Locale.Tr "settings.choose_new_avatar")}} </div> <div class="field"> diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 7e4c8854f5..eb3f6cd720 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -109,6 +109,8 @@ </div> </td> </tr> + {{else}} + <tr class="no-results-row"><td class="tw-text-center" colspan="9">{{ctx.Locale.Tr "no_results_found"}}</td></tr> {{end}} </tbody> </table> diff --git a/templates/admin/user/view.tmpl b/templates/admin/user/view.tmpl index 21943a8382..67f9148e64 100644 --- a/templates/admin/user/view.tmpl +++ b/templates/admin/user/view.tmpl @@ -15,10 +15,7 @@ </div> <div class="tw-flex-1"> <h4 class="ui top attached header"> - {{ctx.Locale.Tr "admin.emails"}} - <div class="ui right"> - {{.EmailsTotal}} - </div> + {{ctx.Locale.Tr "admin.emails"}} ({{ctx.Locale.Tr "admin.total" .EmailsTotal}}) </h4> <div class="ui attached segment"> {{template "admin/user/view_emails" .}} @@ -26,19 +23,13 @@ </div> </div> <h4 class="ui top attached header"> - {{ctx.Locale.Tr "admin.repositories"}} - <div class="ui right"> - {{.ReposTotal}} - </div> + {{ctx.Locale.Tr "admin.repositories"}} ({{ctx.Locale.Tr "admin.total" .ReposTotal}}) </h4> <div class="ui attached segment"> - {{template "explore/repo_list" .}} + {{template "shared/repo/list" .}} </div> <h4 class="ui top attached header"> - {{ctx.Locale.Tr "settings.organization"}} - <div class="ui right"> - {{.OrgsTotal}} - </div> + {{ctx.Locale.Tr "settings.organization"}} ({{ctx.Locale.Tr "admin.total" .OrgsTotal}}) </h4> <div class="ui attached segment"> {{template "explore/user_list" .}} diff --git a/templates/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..5ebe191771 100644 --- a/templates/base/alert.tmpl +++ b/templates/base/alert.tmpl @@ -1,20 +1,25 @@ -{{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 -}} +{{- if .ShowTwoFactorRequiredMessage -}} +<div class="ui negative message flash-message flash-error"> + <p><a href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{ctx.Locale.Tr "auth.twofa_required"}}</a></p> +</div> +{{- end -}} diff --git a/templates/base/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..dacc518873 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/stop"> {{.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-dropdown.tmpl b/templates/devtest/fomantic-dropdown.tmpl index d41a161e86..a10dc890ce 100644 --- a/templates/devtest/fomantic-dropdown.tmpl +++ b/templates/devtest/fomantic-dropdown.tmpl @@ -75,12 +75,12 @@ <h2>Selection</h2> <div> {{/* the "selection" class is optional, it will be added by JS automatically */}} - <select class="ui dropdown selection ellipsis-items-nowrap"> + <select class="ui dropdown selection ellipsis-text-items"> <option>a</option> <option>abcdefuvwxyz</option> <option>loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong</option> </select> - <select class="ui dropdown ellipsis-items-nowrap tw-max-w-[8em]"> + <select class="ui dropdown ellipsis-text-items tw-max-w-[8em]"> <option>loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong</option> <option>abcdefuvwxyz</option> <option>a</option> diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl index 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/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl index 5b40268761..7a435cc433 100644 --- a/templates/devtest/gitea-ui.tmpl +++ b/templates/devtest/gitea-ui.tmpl @@ -9,16 +9,16 @@ <a class="silenced" href="#">silenced</a> </div> <h1>Button</h1> - <div> - Style: - <label><input type="checkbox" name="button-style-compact" value="compact">compact</label> - <label><input type="radio" name="button-style-size" value="">(normal)</label> - <label><input type="radio" name="button-style-size" value="tiny">tiny</label> - <label><input type="radio" name="button-style-size" value="mini">mini</label> + ".ui.button" styles: + <div class="flex-text-block tw-gap-4"> + <label class="gt-checkbox"><input type="radio" name="button-style-size" value="">(normal)</label> + <label class="gt-checkbox"><input type="radio" name="button-style-size" value="small">small</label> + <label class="gt-checkbox"><input type="radio" name="button-style-size" value="tiny">tiny</label> + <label class="gt-checkbox"><input type="radio" name="button-style-size" value="mini">mini</label> </div> - <div> - State: - <label><input type="checkbox" name="button-state-disabled" value="disabled">disabled</label> + <div class="flex-text-block tw-gap-4"> + <label class="gt-checkbox"><input type="checkbox" name="button-style-compact" value="compact">compact</label> + <label class="gt-checkbox"><input type="checkbox" name="button-state-disabled" value="disabled">disabled</label> </div> <div id="devtest-button-samples"> <ul class="button-sample-groups"> diff --git a/templates/devtest/markup-render.tmpl b/templates/devtest/markup-render.tmpl new file mode 100644 index 0000000000..69d29d7829 --- /dev/null +++ b/templates/devtest/markup-render.tmpl @@ -0,0 +1,71 @@ +{{template "devtest/devtest-header"}} +<div class="page-content devtest ui container"> + {{$longCode := "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}} + <div class="tw-flex"> + <div class="tw-w-[50%] tw-p-4"> + <div class="markup render-content"> + Inline <code>code</code> content + </div> + + <div class="divider"></div> + + <div class="markup render-content"> + <p>content before</p> + <pre><code>Very long line with no code block or container: {{$longCode}}</code></pre> + <p>content after</p> + </div> + + <div class="divider"></div> + + <div class="markup render-content"> + <p>content before</p> + <div class="code-block-container code-overflow-wrap"> + <pre class="code-block"><code>Very long line with wrap: {{$longCode}}</code></pre> + </div> + <p>content after</p> + </div> + + <div class="divider"></div> + + <div class="markup render-content"> + <p>content before</p> + <div class="code-block-container code-overflow-scroll"> + <pre class="code-block"><code>Short line in scroll container</code></pre> + </div> + <div class="code-block-container code-overflow-scroll"> + <pre class="code-block"><code>Very long line with scroll: {{$longCode}}</code></pre> + </div> + <p>content after</p> + </div> + </div> + + <div class="tw-w-[50%] tw-p-4"> + <div class="markup render-content"> + <p>content before</p> + <div class="code-block-container"> + <pre class="code-block"><code class="language-math"> + \lim\limits_{n\rightarrow\infty}{\left(1+\frac{1}{n}\right)^n} + </code></pre> + </div> + <p>content after</p> + </div> + + <div class="divider"></div> + + <div class="markup render-content"> + <p>content before</p> + <div class="code-block-container"> + <pre class="code-block"><code class="language-mermaid is-loading"> + graph LR + A[Square Rect] -- Link text --> B((Circle)) + A --> C(Round Rect) + B --> D{Rhombus} + C --> D + </code></pre> + </div> + <p>content after</p> + </div> + </div> + </div> +</div> +{{template "devtest/devtest-footer"}} diff --git a/templates/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/explore/repos.tmpl b/templates/explore/repos.tmpl index 53742bf0d9..68da398306 100644 --- a/templates/explore/repos.tmpl +++ b/templates/explore/repos.tmpl @@ -2,8 +2,8 @@ <div role="main" aria-label="{{.Title}}" class="page-content explore repositories"> {{template "explore/navbar" .}} <div class="ui container"> - {{template "shared/repo_search" .}} - {{template "explore/repo_list" .}} + {{template "shared/repo/search" .}} + {{template "shared/repo/list" .}} {{template "base/paginate" .}} </div> </div> diff --git a/templates/home.tmpl b/templates/home.tmpl index 116dc487dc..cc9da82605 100644 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -4,10 +4,10 @@ <div class="center"> <img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}"> <div class="hero"> - <h1 class="ui icon header title"> + <h1 class="ui icon header title tw-text-balance"> {{AppName}} </h1> - <h2>{{ctx.Locale.Tr "startpage.app_desc"}}</h2> + <h2 class="tw-text-balance">{{ctx.Locale.Tr "startpage.app_desc"}}</h2> </div> </div> </div> @@ -16,7 +16,7 @@ <h1 class="hero ui icon header"> {{svg "octicon-flame"}} {{ctx.Locale.Tr "startpage.install"}} </h1> - <p class="large"> + <p class="large tw-text-balance"> {{ctx.Locale.Tr "startpage.install_desc" "https://docs.gitea.com/installation/install-from-binary" "https://github.com/go-gitea/gitea/tree/master/docker" "https://docs.gitea.com/installation/install-from-package"}} </p> </div> @@ -24,7 +24,7 @@ <h1 class="hero ui icon header"> {{svg "octicon-device-desktop"}} {{ctx.Locale.Tr "startpage.platform"}} </h1> - <p class="large"> + <p class="large tw-text-balance"> {{ctx.Locale.Tr "startpage.platform_desc" "https://go.dev/"}} </p> </div> @@ -34,7 +34,7 @@ <h1 class="hero ui icon header"> {{svg "octicon-rocket"}} {{ctx.Locale.Tr "startpage.lightweight"}} </h1> - <p class="large"> + <p class="large tw-text-balance"> {{ctx.Locale.Tr "startpage.lightweight_desc"}} </p> </div> @@ -42,7 +42,7 @@ <h1 class="hero ui icon header"> {{svg "octicon-code"}} {{ctx.Locale.Tr "startpage.license"}} </h1> - <p class="large"> + <p class="large tw-text-balance"> {{ctx.Locale.Tr "startpage.license_desc" "https://code.gitea.io/gitea" "code.gitea.io/gitea" "https://github.com/go-gitea/gitea"}} </p> </div> diff --git a/templates/install.tmpl b/templates/install.tmpl index 6c4cc7df01..0aec52f27b 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> @@ -351,5 +351,4 @@ </div> </div> </div> -<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/loading.png"> {{template "base/footer" .}} diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl index 7934d5b722..2d6dca5440 100644 --- a/templates/org/create.tmpl +++ b/templates/org/create.tmpl @@ -18,15 +18,15 @@ <label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label> <div class="inline-right"> <div class="ui radio checkbox"> - <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}> + <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if .visibility.IsPublic}}checked{{end}}> <label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label> </div> <div class="ui radio checkbox"> - <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if .DefaultOrgVisibilityMode.IsLimited}}checked{{end}}> + <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if .visibility.IsLimited}}checked{{end}}> <label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label> </div> <div class="ui radio checkbox"> - <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if .DefaultOrgVisibilityMode.IsPrivate}}checked{{end}}> + <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if .visibility.IsPrivate}}checked{{end}}> <label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label> </div> </div> @@ -35,7 +35,7 @@ <div class="inline field" id="permission_box"> <label>{{ctx.Locale.Tr "org.settings.permission"}}</label> <div class="ui checkbox"> - <input type="checkbox" name="repo_admin_change_team_access" checked> + <input type="checkbox" name="repo_admin_change_team_access" {{if .repo_admin_change_team_access}}checked{{end}}> <label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label> </div> </div> diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl index 80519361fd..90798b5d7c 100644 --- a/templates/org/header.tmpl +++ b/templates/org/header.tmpl @@ -18,7 +18,7 @@ {{end}} </span> </div> - {{if .RenderedDescription}}<div class="render-content markup tw-break-anywhere">{{.RenderedDescription}}</div>{{end}} + {{if .RenderedDescription}}<div class="render-content markup">{{.RenderedDescription}}</div>{{end}} <div class="text light meta tw-mt-1"> {{if .Org.Location}}<div class="flex-text-block">{{svg "octicon-location"}} <span>{{.Org.Location}}</span></div>{{end}} {{if .Org.Website}}<div class="flex-text-block">{{svg "octicon-link"}} <a class="muted" target="_blank" rel="noopener noreferrer me" href="{{.Org.Website}}">{{.Org.Website}}</a></div>{{end}} diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index db750692bf..3cde3554c9 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -6,20 +6,20 @@ <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" .}} + {{template "shared/repo/search" .}} + {{template "shared/repo/list" .}} {{template "base/paginate" .}} </div> {{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/member/members.tmpl b/templates/org/member/members.tmpl index 4388dc9520..2d0f4bc423 100644 --- a/templates/org/member/members.tmpl +++ b/templates/org/member/members.tmpl @@ -73,7 +73,7 @@ {{ctx.Locale.Tr "org.members.leave"}} </div> <div class="content"> - <p>{{ctx.Locale.Tr "org.members.leave.detail" (`<span class="dataOrganizationName"></span>`|SafeHTML)}}</p> + <p>{{ctx.Locale.Tr "org.members.leave.detail" (HTMLFormat `<span class="%s"></span>` "dataOrganizationName")}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> @@ -82,7 +82,7 @@ {{ctx.Locale.Tr "org.members.remove"}} </div> <div class="content"> - <p>{{ctx.Locale.Tr "org.members.remove.detail" (`<span class="name"></span>`|SafeHTML) (`<span class="dataOrganizationName"></span>`|SafeHTML)}}</p> + <p>{{ctx.Locale.Tr "org.members.remove.detail" (HTMLFormat `<span class="%s"></span>` "name") (HTMLFormat `<span class="%s"></span>` "dataOrganizationName")}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/org/menu.tmpl b/templates/org/menu.tmpl index 4a8aee68a7..d876dabb44 100644 --- a/templates/org/menu.tmpl +++ b/templates/org/menu.tmpl @@ -44,6 +44,11 @@ {{end}} </a> {{end}} + {{if and EnableTimetracking .IsOrganizationOwner}} + <a class="{{if $.PageIsOrgTimes}}active{{end}} item" href="{{$.OrgLink}}/worktime"> + {{svg "octicon-clock"}} {{ctx.Locale.Tr "org.worktime"}} + </a> + {{end}} {{if .IsOrganizationOwner}} <span class="item-flex-space"></span> <a class="{{if .PageIsOrgSettings}}active {{end}}item" href="{{.OrgLink}}/settings"> diff --git a/templates/org/projects/new.tmpl b/templates/org/projects/new.tmpl index fc52130f68..c021c5a0fe 100644 --- a/templates/org/projects/new.tmpl +++ b/templates/org/projects/new.tmpl @@ -1,9 +1,24 @@ {{template "base/head" .}} -<div role="main" aria-label="{{.Title}}" class="page-content organization projects edit-project new"> - {{template "shared/user/org_profile_avatar" .}} +{{if .ContextUser.IsOrganization}} +<div role="main" aria-label="{{.Title}}" class="page-content organization projects"> + {{template "org/header" .}} <div class="ui container"> - {{template "user/overview/header" .}} - {{template "projects/new" .}} + {{template "projects/new" .}} </div> </div> +{{else}} +<div role="main" aria-label="{{.Title}}" class="page-content user profile"> + <div class="ui container"> + <div class="ui stackable grid"> + <div class="ui four wide column"> + {{template "shared/user/profile_big_avatar" .}} + </div> + <div class="ui twelve wide column tw-mb-4"> + {{template "user/overview/header" .}} + {{template "projects/new" .}} + </div> + </div> + </div> +</div> +{{end}} {{template "base/footer" .}} diff --git a/templates/org/projects/view.tmpl b/templates/org/projects/view.tmpl index bd74114fe2..1bfbc8d8b4 100644 --- a/templates/org/projects/view.tmpl +++ b/templates/org/projects/view.tmpl @@ -8,8 +8,6 @@ {{template "user/overview/header" .}} </div> {{end}} - <div class="ui container fluid padded"> - {{template "projects/view" .}} - </div> + {{template "projects/view" .}} </div> {{template "base/footer" .}} diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl deleted file mode 100644 index e1ef471e34..0000000000 --- a/templates/org/settings/delete.tmpl +++ /dev/null @@ -1,35 +0,0 @@ -{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings delete")}} - - <div class="org-setting-content"> - <h4 class="ui top attached error header"> - {{ctx.Locale.Tr "org.settings.delete_account"}} - </h4> - <div class="ui attached error segment"> - <div class="ui red message"> - <p class="text left">{{svg "octicon-alert"}} {{ctx.Locale.Tr "org.settings.delete_prompt"}}</p> - </div> - <form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - <div class="inline required field {{if .Err_OrgName}}error{{end}}"> - <label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}</label> - <input id="org_name" name="org_name" value="" autocomplete="off" autofocus required> - </div> - <button class="ui red button delete-button" data-type="form" data-form="#delete-form"> - {{ctx.Locale.Tr "org.settings.confirm_delete_account"}} - </button> - </form> - </div> - </div> - -<div class="ui g-modal-confirm delete modal"> - <div class="header"> - {{svg "octicon-trash"}} - {{ctx.Locale.Tr "org.settings.delete_org_title"}} - </div> - <div class="content"> - <p>{{ctx.Locale.Tr "org.settings.delete_org_desc"}}</p> - </div> - {{template "base/modal_actions_confirm" .}} -</div> - -{{template "org/settings/layout_footer" .}} diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl index ce792f667c..58475de7e7 100644 --- a/templates/org/settings/navbar.tmpl +++ b/templates/org/settings/navbar.tmpl @@ -41,8 +41,5 @@ </div> </details> {{end}} - <a class="{{if .PageIsSettingsDelete}}active {{end}}item" href="{{.OrgLink}}/settings/delete"> - {{ctx.Locale.Tr "org.settings.delete"}} - </a> </div> </div> diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl index 3b817d068b..d94bb4c62b 100644 --- a/templates/org/settings/options.tmpl +++ b/templates/org/settings/options.tmpl @@ -1,103 +1,97 @@ {{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}} - <div class="org-setting-content"> - <h4 class="ui top attached header"> - {{ctx.Locale.Tr "org.settings.options"}} - </h4> - <div class="ui attached segment"> - <form class="ui form" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - <div class="required field {{if .Err_Name}}error{{end}}"> - <label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}} - <span class="text red tw-hidden" id="org-name-change-prompt"> - <br>{{ctx.Locale.Tr "org.settings.change_orgname_prompt"}}<br>{{ctx.Locale.Tr "org.settings.change_orgname_redirect_prompt"}} - </span> - </label> - <input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required maxlength="40"> - </div> - <div class="field {{if .Err_FullName}}error{{end}}"> - <label for="full_name">{{ctx.Locale.Tr "org.org_full_name_holder"}}</label> - <input id="full_name" name="full_name" value="{{.Org.FullName}}" maxlength="100"> - </div> - <div class="field {{if .Err_Email}}error{{end}}"> - <label for="email">{{ctx.Locale.Tr "org.settings.email"}}</label> - <input id="email" name="email" type="email" value="{{.Org.Email}}" maxlength="255"> - </div> - <div class="field {{if .Err_Description}}error{{end}}"> - {{/* it is rendered as markdown, but the length is limited, so at the moment we do not use the markdown editor here */}} - <label for="description">{{ctx.Locale.Tr "org.org_desc"}}</label> - <textarea id="description" name="description" rows="2" maxlength="255">{{.Org.Description}}</textarea> - </div> - <div class="field {{if .Err_Website}}error{{end}}"> - <label for="website">{{ctx.Locale.Tr "org.settings.website"}}</label> - <input id="website" name="website" type="url" value="{{.Org.Website}}" maxlength="255"> - </div> - <div class="field"> - <label for="location">{{ctx.Locale.Tr "org.settings.location"}}</label> - <input id="location" name="location" value="{{.Org.Location}}" maxlength="50"> - </div> - <div class="divider"></div> - <div class="field" id="visibility_box"> - <label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label> - <div class="field"> - <div class="ui radio checkbox"> - <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}> - <label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label> - </div> - </div> - <div class="field"> - <div class="ui radio checkbox"> - <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}> - <label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label> - </div> - </div> - <div class="field"> - <div class="ui radio checkbox"> - <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}> - <label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label> - </div> - </div> - </div> +<div class="ui segments org-setting-content"> + <h4 class="ui top attached header"> + {{ctx.Locale.Tr "org.settings.options"}} + </h4> + <div class="ui attached segment"> + <form class="ui form" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <div class="field {{if .Err_FullName}}error{{end}}"> + <label for="full_name">{{ctx.Locale.Tr "org.org_full_name_holder"}}</label> + <input id="full_name" name="full_name" value="{{.Org.FullName}}" maxlength="100"> + </div> + <div class="field {{if .Err_Email}}error{{end}}"> + <label for="email">{{ctx.Locale.Tr "org.settings.email"}}</label> + <input id="email" name="email" type="email" value="{{.Org.Email}}" maxlength="255"> + </div> + <div class="field {{if .Err_Description}}error{{end}}"> + {{/* it is rendered as markdown, but the length is limited, so at the moment we do not use the markdown editor here */}} + <label for="description">{{ctx.Locale.Tr "org.org_desc"}}</label> + <textarea id="description" name="description" rows="2" maxlength="255">{{.Org.Description}}</textarea> + </div> + <div class="field {{if .Err_Website}}error{{end}}"> + <label for="website">{{ctx.Locale.Tr "org.settings.website"}}</label> + <input id="website" name="website" type="url" value="{{.Org.Website}}" maxlength="255"> + </div> + <div class="field"> + <label for="location">{{ctx.Locale.Tr "org.settings.location"}}</label> + <input id="location" name="location" value="{{.Org.Location}}" maxlength="50"> + </div> - <div class="field" id="permission_box"> - <label>{{ctx.Locale.Tr "org.settings.permission"}}</label> - <div class="field"> - <div class="ui checkbox"> - <input type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}> - <label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label> - </div> - </div> - </div> + <div class="divider"></div> + <div class="field" id="visibility_box"> + <label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label> + <div class="field"> + <div class="ui radio checkbox"> + <input class="enable-system-radio" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}> + <label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label> + </div> + </div> + <div class="field"> + <div class="ui radio checkbox"> + <input class="enable-system-radio" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}> + <label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label> + </div> + </div> + <div class="field"> + <div class="ui radio checkbox"> + <input class="enable-system-radio" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}> + <label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label> + </div> + </div> + </div> - {{if .SignedUser.IsAdmin}} - <div class="divider"></div> + <div class="field" id="permission_box"> + <label>{{ctx.Locale.Tr "org.settings.permission"}}</label> + <div class="field"> + <div class="ui checkbox"> + <input type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}> + <label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label> + </div> + </div> + </div> - <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}"> - <label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label> - <input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.Org.MaxRepoCreation}}"> - <p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p> - </div> - {{end}} + {{if .SignedUser.IsAdmin}} + <div class="divider"></div> - <div class="field"> - <button class="ui primary button">{{ctx.Locale.Tr "org.settings.update_settings"}}</button> - </div> - </form> + <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}"> + <label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label> + <input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.Org.MaxRepoCreation}}"> + <p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p> + </div> + {{end}} - <div class="divider"></div> + <div class="field"> + <button class="ui primary button">{{ctx.Locale.Tr "org.settings.update_settings"}}</button> + </div> + </form> - <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data"> - {{.CsrfTokenHtml}} - <div class="inline field"> - <label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label> - <input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp"> - </div> + <div class="divider"></div> - <div class="field"> - <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button> - <button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button> - </div> - </form> - </div> + <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data"> + {{.CsrfTokenHtml}} + <div class="inline field"> + {{template "shared/avatar_upload_crop" dict "LabelText" (ctx.Locale.Tr "settings.choose_new_avatar")}} + </div> + <div class="field"> + <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button> + <button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button> </div> + </form> + </div> +</div> + +{{template "org/settings/options_dangerzone" .}} + {{template "org/settings/layout_footer" .}} diff --git a/templates/org/settings/options_dangerzone.tmpl b/templates/org/settings/options_dangerzone.tmpl new file mode 100644 index 0000000000..01cf3fd405 --- /dev/null +++ b/templates/org/settings/options_dangerzone.tmpl @@ -0,0 +1,93 @@ +<h4 class="ui top attached error header"> + {{ctx.Locale.Tr "repo.settings.danger_zone"}} +</h4> +<div class="ui attached error danger segment"> + <div class="flex-list"> + <div class="flex-item tw-items-center"> + <div class="flex-item-main"> + <div class="flex-item-title">{{ctx.Locale.Tr "org.settings.rename"}}</div> + <div class="flex-item-body">{{ctx.Locale.Tr "org.settings.rename_desc"}}</div> + </div> + <div class="flex-item-trailing"> + <button class="ui basic red show-modal button" data-modal="#rename-org-modal">{{ctx.Locale.Tr "org.settings.rename"}}</button> + </div> + </div> + + <div class="flex-item"> + <div class="flex-item-main"> + <div class="flex-item-title">{{ctx.Locale.Tr "org.settings.delete_account"}}</div> + <div class="flex-item-body">{{ctx.Locale.Tr "org.settings.delete_prompt"}}</div> + </div> + <div class="flex-item-trailing"> + <button class="ui basic red show-modal button" data-modal="#delete-org-modal">{{ctx.Locale.Tr "org.settings.delete_account"}}</button> + </div> + </div> + </div> +</div> + +<div class="ui small modal" id="rename-org-modal"> + <div class="header"> + {{ctx.Locale.Tr "org.settings.rename"}} + </div> + <div class="content"> + <ul class="ui warning message"> + <li>{{ctx.Locale.Tr "org.settings.rename_notices_1"}}</li> + <li>{{ctx.Locale.Tr "org.settings.rename_notices_2"}}</li> + </ul> + <form class="ui form form-fetch-action" action="{{.Link}}/rename" method="post"> + {{.CsrfTokenHtml}} + <div class="field"> + <label> + {{ctx.Locale.Tr "org.settings.name_confirm"}} + <span class="text red">{{.Org.Name}}</span> + </label> + </div> + <div class="required field"> + <label for="org_name_to_rename">{{ctx.Locale.Tr "org.org_name_holder"}}</label> + <input id="org_name_to_rename" name="org_name" required> + </div> + + <div class="required field"> + <label>{{ctx.Locale.Tr "org.settings.rename_new_org_name"}}</label> + <input name="new_org_name" required> + </div> + + <div class="actions"> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "org.settings.rename"}}</button> + </div> + </form> + </div> +</div> + +<div class="ui small modal" id="delete-org-modal"> + <div class="header"> + {{ctx.Locale.Tr "org.settings.delete_account"}} + </div> + <div class="content"> + <ul class="ui warning message"> + <li>{{ctx.Locale.Tr "org.settings.delete_notices_1"}}</li> + <li>{{ctx.Locale.Tr "org.settings.delete_notices_2" .Org.Name}}</li> + <li>{{ctx.Locale.Tr "org.settings.delete_notices_3" .Org.Name}}</li> + <li>{{ctx.Locale.Tr "org.settings.delete_notices_4" .Org.Name}}</li> + </ul> + <form class="ui form form-fetch-action" action="{{.Link}}/delete" method="post"> + {{.CsrfTokenHtml}} + <div class="field"> + <label> + {{ctx.Locale.Tr "org.settings.name_confirm"}} + <span class="text red">{{.Org.Name}}</span> + </label> + </div> + <div class="required field"> + <label>{{ctx.Locale.Tr "org.org_name_holder"}}</label> + <input name="org_name" required> + </div> + + <div class="actions"> + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> + <button class="ui red button">{{ctx.Locale.Tr "org.settings.delete_account"}}</button> + </div> + </form> + </div> +</div> diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl index 5433f01530..4bc063f90c 100644 --- a/templates/org/team/members.tmpl +++ b/templates/org/team/members.tmpl @@ -81,7 +81,7 @@ {{ctx.Locale.Tr "org.members.remove"}} </div> <div class="content"> - <p>{{ctx.Locale.Tr "org.members.remove.detail" (`<span class="name"></span>`|SafeHTML) (`<span class="dataTeamName"></span>`|SafeHTML)}}</p> + <p>{{ctx.Locale.Tr "org.members.remove.detail" (HTMLFormat `<span class="%s"></span>` "name") (HTMLFormat `<span class="%s"></span>` "dataTeamName")}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl index 410a3c4b62..67529ddfba 100644 --- a/templates/org/team/new.tmpl +++ b/templates/org/team/new.tmpl @@ -56,7 +56,7 @@ <br> <div class="field"> <div class="ui radio checkbox"> - <input type="radio" name="permission" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.AccessMode 1) (eq .Team.AccessMode 2)}}checked{{end}}> + <input type="radio" name="permission" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.AccessMode 0) (eq .Team.AccessMode 1) (eq .Team.AccessMode 2)}}checked{{end}}> <label>{{ctx.Locale.Tr "org.teams.general_access"}}</label> <span class="help">{{ctx.Locale.Tr "org.teams.general_access_helper"}}</span> </div> @@ -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/sidebar.tmpl b/templates/org/team/sidebar.tmpl index c4acd8da24..6dd5cb3eeb 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -42,10 +42,12 @@ <li>{{ctx.Locale.Tr "org.teams.can_create_org_repo"}}</li> {{end}} </ul> - {{if (eq .Team.AccessMode 2)}} + {{/* the AccessMode should be either none or admin/owner, the real permissions are provided by each team unit */}} + {{if false}}{{/*(eq .Team.AccessMode 2)*/}} <h3>{{ctx.Locale.Tr "org.settings.permission"}}</h3> {{ctx.Locale.Tr "org.teams.write_permission_desc"}} {{else if (eq .Team.AccessMode 3)}} + {{/* FIXME: here might not right, see "FIXME: TEAM-UNIT-PERMISSION", new units might not have correct admin permission*/}} <h3>{{ctx.Locale.Tr "org.settings.permission"}}</h3> {{ctx.Locale.Tr "org.teams.admin_permission_desc"}} {{else}} @@ -88,7 +90,7 @@ {{ctx.Locale.Tr "org.teams.leave"}} </div> <div class="content"> - <p>{{ctx.Locale.Tr "org.teams.leave.detail" (`<span class="name"></span>`|SafeHTML)}}</p> + <p>{{ctx.Locale.Tr "org.teams.leave.detail" (HTMLFormat `<span class="%s"></span>` "name")}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl index 53c909ee9c..cdd2789128 100644 --- a/templates/org/team/teams.tmpl +++ b/templates/org/team/teams.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> {{template "base/alert" .}} {{if .IsOrganizationOwner}} - <div class="text right"> + <div class="flex-text-block tw-justify-end"> <a class="ui primary button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus"}} {{ctx.Locale.Tr "org.create_new_team"}}</a> </div> <div class="divider"></div> @@ -49,7 +49,7 @@ {{ctx.Locale.Tr "org.teams.leave"}} </div> <div class="content"> - <p>{{ctx.Locale.Tr "org.teams.leave.detail" (`<span class="name"></span>`|SafeHTML)}}</p> + <p>{{ctx.Locale.Tr "org.teams.leave.detail" (HTMLFormat `<span class="%s"></span>` "name")}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/org/worktime.tmpl b/templates/org/worktime.tmpl new file mode 100644 index 0000000000..5d99998129 --- /dev/null +++ b/templates/org/worktime.tmpl @@ -0,0 +1,40 @@ +{{template "base/head" .}} +<div class="page-content organization times"> + {{template "org/header" .}} + <div class="ui container"> + <div class="ui grid"> + <div class="three wide column"> + <form class="ui form" method="get"> + <input type="hidden" name="by" value="{{$.WorktimeBy}}"> + <div class="field"> + <label>{{ctx.Locale.Tr "org.worktime.date_range_start"}}</label> + <input type="date" name="from" value="{{.RangeFrom}}"> + </div> + <div class="field"> + <label>{{ctx.Locale.Tr "org.worktime.date_range_end"}}</label> + <input type="date" name="to" value="{{.RangeTo}}"> + </div> + <button class="ui primary button">{{ctx.Locale.Tr "org.worktime.query"}}</button> + </form> + </div> + <div class="thirteen wide column"> + <div class="ui column"> + <div class="ui compact small menu"> + {{$queryParams := QueryBuild "from" .RangeFrom "to" .RangeTo}} + <a class="{{Iif .WorktimeByRepos "active"}} item" href="{{$.Org.OrganisationLink}}/worktime?by=repos&{{$queryParams}}">{{svg "octicon-repo"}} {{ctx.Locale.Tr "org.worktime.by_repositories"}}</a> + <a class="{{Iif .WorktimeByMilestones "active"}} item" href="{{$.Org.OrganisationLink}}/worktime?by=milestones&{{$queryParams}}">{{svg "octicon-milestone"}} {{ctx.Locale.Tr "org.worktime.by_milestones"}}</a> + <a class="{{Iif .WorktimeByMembers "active"}} item" href="{{$.Org.OrganisationLink}}/worktime?by=members&{{$queryParams}}">{{svg "octicon-people"}} {{ctx.Locale.Tr "org.worktime.by_members"}}</a> + </div> + </div> + {{if .WorktimeByRepos}} + {{template "org/worktime/table_repos" dict "Org" .Org "WorktimeSumResult" .WorktimeSumResult}} + {{else if .WorktimeByMilestones}} + {{template "org/worktime/table_milestones" dict "Org" .Org "WorktimeSumResult" .WorktimeSumResult}} + {{else if .WorktimeByMembers}} + {{template "org/worktime/table_members" dict "Org" .Org "WorktimeSumResult" .WorktimeSumResult}} + {{end}} + </div> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/org/worktime/table_members.tmpl b/templates/org/worktime/table_members.tmpl new file mode 100644 index 0000000000..a59d1941d8 --- /dev/null +++ b/templates/org/worktime/table_members.tmpl @@ -0,0 +1,16 @@ +<table class="ui table"> + <thead> + <tr> + <th>{{ctx.Locale.Tr "org.members.member"}}</th> + <th>{{ctx.Locale.Tr "org.worktime.time"}}</th> + </tr> + </thead> + <tbody> + {{range $.WorktimeSumResult}} + <tr> + <td>{{svg "octicon-person"}} <a href="{{AppSubUrl}}/{{PathEscape .UserName}}">{{.UserName}}</a></td> + <td>{{svg "octicon-clock"}} {{.SumTime | Sec2Hour}}</td> + </tr> + {{end}} + </tbody> +</table> diff --git a/templates/org/worktime/table_milestones.tmpl b/templates/org/worktime/table_milestones.tmpl new file mode 100644 index 0000000000..6ef9289e56 --- /dev/null +++ b/templates/org/worktime/table_milestones.tmpl @@ -0,0 +1,28 @@ +<table class="ui table"> + <thead> + <tr> + <th>{{ctx.Locale.Tr "repository"}}</th> + <th>{{ctx.Locale.Tr "repo.milestone"}}</th> + <th>{{ctx.Locale.Tr "org.worktime.time"}}</th> + </tr> + </thead> + <tbody> + {{range $.WorktimeSumResult}} + <tr> + <td> + {{if not .HideRepoName}} + {{svg "octicon-repo"}} <a href="{{$.Org.HomeLink}}/{{PathEscape .RepoName}}/issues">{{.RepoName}}</a> + {{end}} + </td> + <td> + {{if .MilestoneName}} + {{svg "octicon-milestone"}} <a href="{{$.Org.HomeLink}}/{{PathEscape .RepoName}}/milestone/{{.MilestoneID}}">{{.MilestoneName}}</a> + {{else}} + - + {{end}} + </td> + <td>{{svg "octicon-clock"}} {{.SumTime | Sec2Hour}}</td> + </tr> + {{end}} + </tbody> +</table> diff --git a/templates/org/worktime/table_repos.tmpl b/templates/org/worktime/table_repos.tmpl new file mode 100644 index 0000000000..eaa085df0c --- /dev/null +++ b/templates/org/worktime/table_repos.tmpl @@ -0,0 +1,16 @@ +<table class="ui table"> + <thead> + <tr> + <th>{{ctx.Locale.Tr "repository"}}</th> + <th>{{ctx.Locale.Tr "org.worktime.time"}}</th> + </tr> + </thead> + <tbody> + {{range $.WorktimeSumResult}} + <tr> + <td>{{svg "octicon-repo"}} <a href="{{$.Org.HomeLink}}/{{PathEscape .RepoName}}/issues">{{.RepoName}}</a></td> + <td>{{svg "octicon-clock"}} {{.SumTime | Sec2Hour}}</td> + </tr> + {{end}} + </tbody> +</table> diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index a88ebec3bc..1a1335aaa6 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -16,7 +16,17 @@ </div> <div class="field"> <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.container.digest"}}</label> - <div class="markup"><pre class="code-block"><code>{{range .PackageDescriptor.Files}}{{if eq .File.LowerName "manifest.json"}}{{.Properties.GetByName "container.digest"}}{{end}}{{end}}</code></pre></div> + <div class="markup"> + <div class="code-block-container code-overflow-scroll"> + <pre class="code-block"><code> + {{- range .PackageDescriptor.Files -}} + {{- if eq .File.LowerName "manifest.json" -}} + {{- .Properties.GetByName "container.digest" -}}{{"\n"}} + {{- end -}} + {{- end -}} + </code></pre> + </div> + </div> </div> <div class="field"> <label>{{ctx.Locale.Tr "packages.registry.documentation" "Container" "https://docs.gitea.com/usage/packages/container/"}}</label> @@ -39,7 +49,11 @@ {{/* "unknown/unknown" is attestation-manifest, so we should skip it */}} {{if ne .Platform "unknown/unknown"}} <tr> - <td><a class="tw-font-mono" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}}</a></td> + <td> + <a class="tw-font-mono" href="{{$.PackageDescriptor.PackageWebLink}}/{{$.PackageDescriptor.Version.LowerVersion}}/{{PathEscape .Digest}}"> + {{StringUtils.TrimPrefix .Digest "sha256:" | ShortSha}} + </a> + </td> <td>{{.Platform}}</td> <td>{{FileSize .Size}}</td> </tr> @@ -55,12 +69,24 @@ {{.PackageDescriptor.Metadata.Description}} </div> {{end}} - {{if .PackageDescriptor.Metadata.ImageLayers}} - <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.layers"}}</h4> + + {{/* a container manifest may contain sub manifests, so here we try to display some information of the sub manifest, + not perfect, just better than before */}} + {{$imageMetadata := .ContainerImageMetadata}} + {{if $imageMetadata.ImageLayers}} + <h4 class="ui top attached header flex-text-block"> + {{ctx.Locale.Tr "packages.container.layers"}} + {{/* only show the platform if the image metadata is not the package's, which means that it is a sub manifest */}} + {{if ne .ContainerImageMetadata .PackageDescriptor.Metadata}} + <span class="tw-text-sm flex-text-inline" title="{{ctx.Locale.Tr "packages.container.details.platform"}}"> + ({{svg "octicon-cpu" 12}} {{.ContainerImageMetadata.Platform}}) + </span> + {{end}} + </h4> <div class="ui attached segment tw-break-anywhere"> - <table class="ui very basic compact table"> + <table class="ui very basic compact table tw-font-mono"> <tbody> - {{range .PackageDescriptor.Metadata.ImageLayers}} + {{range $imageMetadata.ImageLayers}} <tr> <td>{{.}}</td> </tr> @@ -69,10 +95,10 @@ </table> </div> {{end}} - {{if .PackageDescriptor.Metadata.Labels}} + {{if $imageMetadata.Labels}} <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.labels"}}</h4> <div class="ui attached segment"> - <table class="ui very basic compact table"> + <table class="ui very basic compact table tw-font-mono"> <thead> <tr> <th>{{ctx.Locale.Tr "packages.container.labels.key"}}</th> @@ -80,9 +106,9 @@ </tr> </thead> <tbody> - {{range $key, $value := .PackageDescriptor.Metadata.Labels}} + {{range $key, $value := $imageMetadata.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/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl index 2a22a6ed71..2625c160fe 100644 --- a/templates/package/content/pypi.tmpl +++ b/templates/package/content/pypi.tmpl @@ -4,7 +4,7 @@ <div class="ui form"> <div class="field"> <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.pypi.install"}}</label> - <div class="markup"><pre class="code-block"><code>pip install --index-url <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple/"></origin-url> {{.PackageDescriptor.Package.Name}}</code></pre></div> + <div class="markup"><pre class="code-block"><code>pip install --index-url <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple/"></origin-url> --extra-index-url https://pypi.org/ {{.PackageDescriptor.Package.Name}}</code></pre></div> </div> <div class="field"> <label>{{ctx.Locale.Tr "packages.registry.documentation" "PyPI" "https://docs.gitea.com/usage/packages/pypi/"}}</label> diff --git a/templates/package/shared/view.tmpl b/templates/package/shared/view.tmpl new file mode 100644 index 0000000000..52673accf9 --- /dev/null +++ b/templates/package/shared/view.tmpl @@ -0,0 +1,107 @@ +<div class="issue-title-header"> + {{$packageVersionLink := print $.PackageDescriptor.PackageWebLink "/" (PathEscape .PackageDescriptor.Version.LowerVersion)}} + <h1>{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</h1> + <div> + {{$timeStr := DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}} + {{if .HasRepositoryAccess}} + {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}} + {{else}} + {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName}} + {{end}} + </div> +</div> +<div class="packages-content"> + <div class="packages-content-left"> + {{template "package/content/alpine" .}} + {{template "package/content/arch" .}} + {{template "package/content/cargo" .}} + {{template "package/content/chef" .}} + {{template "package/content/composer" .}} + {{template "package/content/conan" .}} + {{template "package/content/conda" .}} + {{template "package/content/container" .}} + {{template "package/content/cran" .}} + {{template "package/content/debian" .}} + {{template "package/content/generic" .}} + {{template "package/content/go" .}} + {{template "package/content/helm" .}} + {{template "package/content/maven" .}} + {{template "package/content/npm" .}} + {{template "package/content/nuget" .}} + {{template "package/content/pub" .}} + {{template "package/content/pypi" .}} + {{template "package/content/rpm" .}} + {{template "package/content/rubygems" .}} + {{template "package/content/swift" .}} + {{template "package/content/vagrant" .}} + </div> + <div class="ui segment packages-content-right"> + <strong>{{ctx.Locale.Tr "packages.details"}}</strong> + <div class="ui relaxed list flex-items-block"> + <div class="item">{{svg .PackageDescriptor.Package.Type.SVGName}} {{.PackageDescriptor.Package.Type.Name}}</div> + {{if .HasRepositoryAccess}} + <div class="item">{{svg "octicon-repo"}} <a href="{{.PackageDescriptor.Repository.Link}}">{{.PackageDescriptor.Repository.FullName}}</a></div> + {{end}} + <div class="item">{{svg "octicon-calendar"}} {{DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}</div> + <div class="item">{{svg "octicon-download"}} {{.PackageDescriptor.Version.DownloadCount}}</div> + {{template "package/metadata/alpine" .}} + {{template "package/metadata/arch" .}} + {{template "package/metadata/cargo" .}} + {{template "package/metadata/chef" .}} + {{template "package/metadata/composer" .}} + {{template "package/metadata/conan" .}} + {{template "package/metadata/conda" .}} + {{template "package/metadata/container" .}} + {{template "package/metadata/cran" .}} + {{template "package/metadata/debian" .}} + {{template "package/metadata/generic" .}} + {{template "package/metadata/helm" .}} + {{template "package/metadata/maven" .}} + {{template "package/metadata/npm" .}} + {{template "package/metadata/nuget" .}} + {{template "package/metadata/pub" .}} + {{template "package/metadata/pypi" .}} + {{template "package/metadata/rpm" .}} + {{template "package/metadata/rubygems" .}} + {{template "package/metadata/swift" .}} + {{template "package/metadata/vagrant" .}} + {{if not (and (eq .PackageDescriptor.Package.Type "container") .PackageDescriptor.Metadata.Manifests)}} + <div class="item">{{svg "octicon-database"}} {{FileSize .PackageDescriptor.CalculateBlobSize}}</div> + {{end}} + </div> + {{if not (eq .PackageDescriptor.Package.Type "container")}} + <div class="divider"></div> + <strong>{{ctx.Locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong> + <div class="ui relaxed list"> + {{range .PackageDescriptor.Files}} + <div class="item"> + <a href="{{$packageVersionLink}}/files/{{.File.ID}}">{{.File.Name}}</a> + <span class="text small tw-whitespace-nowrap">{{FileSize .Blob.Size}}</span> + </div> + {{end}} + </div> + {{end}} + <div class="divider"></div> + <strong>{{ctx.Locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong> + <a class="tw-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{ctx.Locale.Tr "packages.versions.view_all"}}</a> + <div class="ui relaxed list"> + {{range .LatestVersions}} + <div class="item tw-flex"> + <a class="tw-flex-1 gt-ellipsis" title="{{.Version}}" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a> + <span class="text small">{{DateUtils.AbsoluteShort .CreatedUnix}}</span> + </div> + {{end}} + </div> + {{if or .CanWritePackages .HasRepositoryAccess}} + <div class="divider"></div> + <div class="ui relaxed list flex-items-block"> + {{if .HasRepositoryAccess}} + <div class="item">{{svg "octicon-issue-opened"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{ctx.Locale.Tr "repo.issues"}}</a></div> + {{end}} + {{if .CanWritePackages}} + <div class="item">{{svg "octicon-tools"}} <a href="{{$packageVersionLink}}/settings">{{ctx.Locale.Tr "repo.settings"}}</a></div> + {{end}} + </div> + {{end}} + </div> +</div> diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl index 9e92207466..9067f44296 100644 --- a/templates/package/view.tmpl +++ b/templates/package/view.tmpl @@ -1,114 +1,24 @@ {{template "base/head" .}} -<div role="main" aria-label="{{.Title}}" class="page-content repository packages"> - {{template "shared/user/org_profile_avatar" .}} +{{if .ContextUser.IsOrganization}} +<div role="main" aria-label="{{.Title}}" class="page-content organization packages"> + {{template "org/header" .}} <div class="ui container"> - {{template "user/overview/header" .}} - <div class="issue-title-header"> - <h1>{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</h1> - <div> - {{$timeStr := DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}} - {{if .HasRepositoryAccess}} - {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}} - {{else}} - {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName}} - {{end}} - </div> - </div> - <div class="issue-content"> - <div class="issue-content-left"> - {{template "package/content/alpine" .}} - {{template "package/content/arch" .}} - {{template "package/content/cargo" .}} - {{template "package/content/chef" .}} - {{template "package/content/composer" .}} - {{template "package/content/conan" .}} - {{template "package/content/conda" .}} - {{template "package/content/container" .}} - {{template "package/content/cran" .}} - {{template "package/content/debian" .}} - {{template "package/content/generic" .}} - {{template "package/content/go" .}} - {{template "package/content/helm" .}} - {{template "package/content/maven" .}} - {{template "package/content/npm" .}} - {{template "package/content/nuget" .}} - {{template "package/content/pub" .}} - {{template "package/content/pypi" .}} - {{template "package/content/rpm" .}} - {{template "package/content/rubygems" .}} - {{template "package/content/swift" .}} - {{template "package/content/vagrant" .}} + {{template "package/shared/view" .}} + </div> +</div> +{{else}} +<div role="main" aria-label="{{.Title}}" class="page-content user profile packages"> + <div class="ui container"> + <div class="ui stackable grid"> + <div class="ui four wide column"> + {{template "shared/user/profile_big_avatar" .}} </div> - <div class="issue-content-right ui segment"> - <strong>{{ctx.Locale.Tr "packages.details"}}</strong> - <div class="ui relaxed list flex-items-block"> - <div class="item">{{svg .PackageDescriptor.Package.Type.SVGName}} {{.PackageDescriptor.Package.Type.Name}}</div> - {{if .HasRepositoryAccess}} - <div class="item">{{svg "octicon-repo"}} <a href="{{.PackageDescriptor.Repository.Link}}">{{.PackageDescriptor.Repository.FullName}}</a></div> - {{end}} - <div class="item">{{svg "octicon-calendar"}} {{DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}</div> - <div class="item">{{svg "octicon-download"}} {{.PackageDescriptor.Version.DownloadCount}}</div> - {{template "package/metadata/alpine" .}} - {{template "package/metadata/arch" .}} - {{template "package/metadata/cargo" .}} - {{template "package/metadata/chef" .}} - {{template "package/metadata/composer" .}} - {{template "package/metadata/conan" .}} - {{template "package/metadata/conda" .}} - {{template "package/metadata/container" .}} - {{template "package/metadata/cran" .}} - {{template "package/metadata/debian" .}} - {{template "package/metadata/generic" .}} - {{template "package/metadata/helm" .}} - {{template "package/metadata/maven" .}} - {{template "package/metadata/npm" .}} - {{template "package/metadata/nuget" .}} - {{template "package/metadata/pub" .}} - {{template "package/metadata/pypi" .}} - {{template "package/metadata/rpm" .}} - {{template "package/metadata/rubygems" .}} - {{template "package/metadata/swift" .}} - {{template "package/metadata/vagrant" .}} - {{if not (and (eq .PackageDescriptor.Package.Type "container") .PackageDescriptor.Metadata.Manifests)}} - <div class="item">{{svg "octicon-database"}} {{FileSize .PackageDescriptor.CalculateBlobSize}}</div> - {{end}} - </div> - {{if not (eq .PackageDescriptor.Package.Type "container")}} - <div class="divider"></div> - <strong>{{ctx.Locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong> - <div class="ui relaxed list"> - {{range .PackageDescriptor.Files}} - <div class="item"> - <a href="{{$.Link}}/files/{{.File.ID}}">{{.File.Name}}</a> - <span class="text small file-size">{{FileSize .Blob.Size}}</span> - </div> - {{end}} - </div> - {{end}} - <div class="divider"></div> - <strong>{{ctx.Locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong> - <a class="tw-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{ctx.Locale.Tr "packages.versions.view_all"}}</a> - <div class="ui relaxed list"> - {{range .LatestVersions}} - <div class="item tw-flex"> - <a class="tw-flex-1 gt-ellipsis" title="{{.Version}}" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a> - <span class="text small">{{DateUtils.AbsoluteShort .CreatedUnix}}</span> - </div> - {{end}} - </div> - {{if or .CanWritePackages .HasRepositoryAccess}} - <div class="divider"></div> - <div class="ui relaxed list flex-items-block"> - {{if .HasRepositoryAccess}} - <div class="item">{{svg "octicon-issue-opened"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{ctx.Locale.Tr "repo.issues"}}</a></div> - {{end}} - {{if .CanWritePackages}} - <div class="item">{{svg "octicon-tools"}} <a href="{{.Link}}/settings">{{ctx.Locale.Tr "repo.settings"}}</a></div> - {{end}} - </div> - {{end}} + <div class="ui twelve wide column tw-mb-4"> + {{template "user/overview/header" .}} + {{template "package/shared/view" .}} </div> </div> </div> </div> +{{end}} {{template "base/footer" .}} diff --git a/templates/post-install.tmpl b/templates/post-install.tmpl index fa10827295..9baac4f84c 100644 --- a/templates/post-install.tmpl +++ b/templates/post-install.tmpl @@ -2,9 +2,9 @@ <div role="main" aria-label="{{.Title}}" class="page-content install post-install tw-h-full"> <div class="home tw-text-center tw-h-full tw-flex tw-flex-col tw-justify-center"><!-- the "home" class makes the links green --> <!-- the "cup" has a handler, so move it a little leftward to make it visually in the center --> - <div class="tw-ml-[-30px]"><img width="160" src="{{AssetUrlPrefix}}/img/loading.png" alt="" aria-hidden="true"></div> + <div class="tw-ml-[-30px]"><img width="160" src="{{AssetUrlPrefix}}/img/loading.png" alt aria-hidden="true"></div> <div class="tw-my-[2em] tw-text-[18px]"> - <a id="goto-user-login" href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "install.installing_desc"}}</a> + <a id="goto-after-install" href="{{AppSubUrl}}{{Iif .IsAccountCreated "/user/login" "/user/sign_up"}}">{{ctx.Locale.Tr "install.installing_desc"}}</a> </div> </div> </div> diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl index f5a48f7241..f6d549a634 100644 --- a/templates/projects/list.tmpl +++ b/templates/projects/list.tmpl @@ -1,5 +1,5 @@ {{if and $.CanWriteProjects (not $.Repository.IsArchived)}} - <div class="tw-flex tw-justify-between tw-mb-4"> + <div class="flex-text-block tw-justify-between tw-mb-4"> <div class="small-menu-items ui compact tiny menu list-header-toggle"> <a class="item{{if not .IsShowClosed}} active{{end}}" href="?state=open&q={{$.Keyword}}"> {{svg "octicon-project-symlink" 16 "tw-mr-2"}} @@ -10,9 +10,7 @@ {{ctx.Locale.PrettyNumber .ClosedCount}} {{ctx.Locale.Tr "repo.issues.closed_title"}} </a> </div> - <div class="tw-text-right"> - <a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.projects.new"}}</a> - </div> + <a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.projects.new"}}</a> </div> {{end}} @@ -34,6 +32,8 @@ {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="?q={{$.Keyword}}&sort=oldest&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="?q={{$.Keyword}}&sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> + <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?q={{$.Keyword}}&sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?q={{$.Keyword}}&sort=recentupdate&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?q={{$.Keyword}}&sort=leastupdate&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> </div> @@ -52,11 +52,11 @@ <div class="group"> <div class="flex-text-block"> {{svg "octicon-issue-opened" 14}} - {{ctx.Locale.PrettyNumber (.NumOpenIssues ctx)}} {{ctx.Locale.Tr "repo.issues.open_title"}} + {{ctx.Locale.PrettyNumber .NumOpenIssues}} {{ctx.Locale.Tr "repo.issues.open_title"}} </div> <div class="flex-text-block"> {{svg "octicon-check" 14}} - {{ctx.Locale.PrettyNumber (.NumClosedIssues ctx)}} {{ctx.Locale.Tr "repo.issues.closed_title"}} + {{ctx.Locale.PrettyNumber .NumClosedIssues}} {{ctx.Locale.Tr "repo.issues.closed_title"}} </div> </div> {{if and $.CanWriteProjects (not $.Repository.IsArchived)}} @@ -72,9 +72,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/new.tmpl b/templates/projects/new.tmpl index a936079c46..f2630be09b 100644 --- a/templates/projects/new.tmpl +++ b/templates/projects/new.tmpl @@ -64,7 +64,7 @@ </div> </div> <div class="divider"></div> - <div class="tw-text-right"> + <div class="flex-text-block tw-justify-end"> <a class="ui cancel button" href="{{$.CancelLink}}"> {{ctx.Locale.Tr "repo.milestones.cancel"}} </a> diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index 2550cae69c..6aa776da02 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -1,27 +1,32 @@ {{$canWriteProject := and .CanWriteProjects (or (not .Repository) (not .Repository.IsArchived))}} -<div class="ui container tw-max-w-full"> - <div class="tw-flex tw-justify-between tw-items-center tw-mb-4 tw-gap-3"> - <h2 class="tw-mb-0 tw-flex-1 tw-break-anywhere">{{.Project.Title}}</h2> - <div class="project-toolbar-right"> - <div class="ui secondary filter menu labels"> - {{$queryLink := QueryBuild "?" "labels" .SelectLabels "assignee" $.AssigneeID "archived_labels" (Iif $.ShowArchivedLabels "true")}} - - {{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLink "SupportArchivedLabel" true}} - - {{template "repo/issue/filter_item_user_assign" dict - "QueryParamKey" "assignee" - "QueryLink" $queryLink - "UserSearchList" $.Assignees - "SelectedUserId" $.AssigneeID - "TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee") - "TextZeroValue" (ctx.Locale.Tr "repo.issues.filter_assginee_no_select") - "TextNegativeOne" (ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee") - }} - </div> - </div> +<div class="ui container fluid padded projects-view"> + <div class="ui container flex-text-block project-header"> + <h2>{{.Project.Title}}</h2> + <div class="tw-flex-1"></div> + <div class="ui secondary menu tw-m-0"> + {{$queryLink := QueryBuild "?" "labels" .SelectLabels "assignee" $.AssigneeID "archived_labels" (Iif $.ShowArchivedLabels "true")}} + {{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLink "SupportArchivedLabel" true}} + {{template "repo/issue/filter_item_user_assign" dict + "QueryParamKey" "assignee" + "QueryLink" $queryLink + "UserSearchList" $.Assignees + "SelectedUserId" $.AssigneeID + "TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee") + "TextFilterMatchNone" (ctx.Locale.Tr "repo.issues.filter_assignee_no_assignee") + "TextFilterMatchAny" (ctx.Locale.Tr "repo.issues.filter_assignee_any_assignee") + }} + </div> {{if $canWriteProject}} <div class="ui compact mini menu"> + <a class="item screen-full"> + {{svg "octicon-screen-full"}} + {{ctx.Locale.Tr "projects.enter_fullscreen"}} + </a> + <a class="item screen-normal tw-hidden"> + {{svg "octicon-screen-normal"}} + {{ctx.Locale.Tr "projects.exit_fullscreen"}} + </a> <a class="item" href="{{.Link}}/edit?redirect=project"> {{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}} @@ -59,18 +64,17 @@ {{end}} </div> - <div class="content">{{$.Project.RenderedContent}}</div> - - <div class="divider"></div> -</div> + <div class="ui container project-description"> + {{$.Project.RenderedContent}} + <div class="divider"></div> + </div> -<div id="project-board" data-project-borad-writable="{{$canWriteProject}}"> - <div class="board {{if $canWriteProject}}sortable{{end}}" {{if $canWriteProject}}data-url="{{$.Link}}/move"{{end}}> + <div id="project-board" class="board {{if $canWriteProject}}sortable{{end}}" data-project-borad-writable="{{$canWriteProject}}" {{if $canWriteProject}}data-url="{{$.Link}}/move"{{end}}> {{range .Columns}} <div class="project-column" {{if .Color}}style="background: {{.Color}} !important; color: {{ContrastColor .Color}} !important"{{end}} data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}"> <div class="project-column-header{{if $canWriteProject}} tw-cursor-grab{{end}}"> <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}} @@ -126,16 +130,16 @@ <input class="project-column-id" type="hidden" name="id"> <div class="required field"> <label class="project-column-title-label" for="project-column-title-input">title</label> - <input id="project-column-title-input" name="title" value="{{.Title}}" required> + <input id="project-column-title-input" name="title" required> </div> <div class="field"> <label class="project-column-color-label" for="project-column-color-input">color</label> <div class="js-color-picker-input column"> - <input maxlength="7" placeholder="#c320f6" id="project-column-color-input" name="color" value="{{.Color}}"> + <input maxlength="7" placeholder="#c320f6" id="project-column-color-input" name="color"> {{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/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl index fa1adb3e3b..23df61a43c 100644 --- a/templates/repo/actions/runs_list.tmpl +++ b/templates/repo/actions/runs_list.tmpl @@ -5,36 +5,55 @@ <h2>{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{ctx.Locale.Tr "actions.runs.no_runs"}}{{end}}</h2> </div> {{end}} - {{range .Runs}} + {{range $run := .Runs}} <div class="flex-item tw-items-center"> <div class="flex-item-leading"> - {{template "repo/actions/status" (dict "status" .Status.String)}} + {{template "repo/actions/status" (dict "status" $run.Status.String)}} </div> <div class="flex-item-main"> - <a class="flex-item-title" title="{{.Title}}" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}"> - {{if .Title}}{{.Title}}{{else}}{{ctx.Locale.Tr "actions.runs.empty_commit_message"}}{{end}} + <a class="flex-item-title" title="{{$run.Title}}" href="{{$run.Link}}"> + {{or $run.Title (ctx.Locale.Tr "actions.runs.empty_commit_message")}} </a> <div class="flex-item-body"> - <span><b>{{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}}</b>:</span> - {{- if .ScheduleID -}} + <span><b>{{if not $.CurWorkflow}}{{$run.WorkflowID}} {{end}}#{{$run.Index}}</b>:</span> + {{- if $run.ScheduleID -}} {{ctx.Locale.Tr "actions.runs.scheduled"}} {{- else -}} {{ctx.Locale.Tr "actions.runs.commit"}} - <a href="{{$.RepoLink}}/commit/{{.CommitSHA}}">{{ShortSha .CommitSHA}}</a> + <a href="{{$.RepoLink}}/commit/{{$run.CommitSHA}}">{{ShortSha $run.CommitSHA}}</a> {{ctx.Locale.Tr "actions.runs.pushed_by"}} - <a href="{{.TriggerUser.HomeLink}}">{{.TriggerUser.GetDisplayName}}</a> + <a href="{{$run.TriggerUser.HomeLink}}">{{$run.TriggerUser.GetDisplayName}}</a> {{- end -}} </div> </div> <div class="flex-item-trailing"> - {{if .IsRefDeleted}} - <span class="ui label run-list-ref gt-ellipsis tw-line-through" data-tooltip-content="{{.PrettyRef}}">{{.PrettyRef}}</span> + {{if $run.IsRefDeleted}} + <span class="ui label run-list-ref gt-ellipsis tw-line-through" data-tooltip-content="{{$run.PrettyRef}}">{{$run.PrettyRef}}</span> {{else}} - <a class="ui label run-list-ref gt-ellipsis" href="{{.RefLink}}" data-tooltip-content="{{.PrettyRef}}">{{.PrettyRef}}</a> + <a class="ui label run-list-ref gt-ellipsis" href="{{$run.RefLink}}" data-tooltip-content="{{$run.PrettyRef}}">{{$run.PrettyRef}}</a> {{end}} <div class="run-list-item-right"> - <div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince .Updated}}</div> - <div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div> + <div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince $run.Updated}}</div> + <div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{$run.Duration}}</div> + </div> + <div class="ui dropdown jump tw-p-2"> + {{svg "octicon-kebab-horizontal"}} + <div class="menu flex-items-menu"> + <a class="item" href="{{$run.Link}}/workflow">{{svg "octicon-play"}}{{ctx.Locale.Tr "actions.runs.view_workflow_file"}}</a> + {{if and $.CanWriteRepoUnitActions (not $run.Status.IsDone)}} + <a class="item link-action" data-url="{{$run.Link}}/cancel"> + {{svg "octicon-x"}}{{ctx.Locale.Tr "actions.runs.cancel"}} + </a> + {{end}} + {{if and $.CanWriteRepoUnitActions $run.Status.IsDone}} + <a class="item link-action" + data-url="{{$run.Link}}/delete" + data-modal-confirm="{{ctx.Locale.Tr "actions.runs.delete.description"}}" + > + {{svg "octicon-trash"}}{{ctx.Locale.Tr "actions.runs.delete"}} + </a> + {{end}} + </div> </div> </div> </div> diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl index 64c2543302..f2020bc160 100644 --- a/templates/repo/actions/status.tmpl +++ b/templates/repo/actions/status.tmpl @@ -16,7 +16,7 @@ {{else if eq .status "blocked"}} {{svg "octicon-blocked" $size (printf "text yellow %s" $className)}} {{else if eq .status "running"}} - {{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}} + {{svg "octicon-meter" $size (printf "text yellow circular-spin %s" $className)}} {{else}}{{/*failure, unknown*/}} {{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}} {{end}} diff --git a/templates/repo/actions/view_component.tmpl b/templates/repo/actions/view_component.tmpl index 8d1de41f70..4e338ffcfc 100644 --- a/templates/repo/actions/view_component.tmpl +++ b/templates/repo/actions/view_component.tmpl @@ -4,7 +4,7 @@ data-actions-url="{{.ActionsURL}}" data-locale-approve="{{ctx.Locale.Tr "repo.diff.review.approve"}}" - data-locale-cancel="{{ctx.Locale.Tr "cancel"}}" + data-locale-cancel="{{ctx.Locale.Tr "actions.runs.cancel"}}" data-locale-rerun="{{ctx.Locale.Tr "rerun"}}" data-locale-rerun-all="{{ctx.Locale.Tr "rerun_all"}}" data-locale-runs-scheduled="{{ctx.Locale.Tr "actions.runs.scheduled"}}" @@ -19,6 +19,7 @@ data-locale-status-skipped="{{ctx.Locale.Tr "actions.status.skipped"}}" data-locale-status-blocked="{{ctx.Locale.Tr "actions.status.blocked"}}" data-locale-artifacts-title="{{ctx.Locale.Tr "artifacts"}}" + data-locale-artifact-expired="{{ctx.Locale.Tr "expired"}}" data-locale-confirm-delete-artifact="{{ctx.Locale.Tr "confirm_delete_artifact"}}" data-locale-show-timestamps="{{ctx.Locale.Tr "show_timestamps"}}" data-locale-show-log-seconds="{{ctx.Locale.Tr "show_log_seconds"}}" diff --git a/templates/repo/actions/workflow_dispatch.tmpl b/templates/repo/actions/workflow_dispatch.tmpl index 55fe122419..540bbe9162 100644 --- a/templates/repo/actions/workflow_dispatch.tmpl +++ b/templates/repo/actions/workflow_dispatch.tmpl @@ -10,7 +10,7 @@ <span class="ui inline required field"> <label>{{ctx.Locale.Tr "actions.workflow.from_ref"}}:</label> </span> - <div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-items-nowrap"> + <div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-text-items"> <input type="hidden" name="ref" hx-sync="this:replace" hx-target="#runWorkflowDispatchModalInputs" hx-swap="innerHTML" hx-get="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}" hx-trigger="change" value="refs/heads/{{index .Branches 0}}"> {{svg "octicon-git-branch" 14}} <div class="default text">{{index .Branches 0}}</div> diff --git a/templates/repo/actions/workflow_dispatch_inputs.tmpl b/templates/repo/actions/workflow_dispatch_inputs.tmpl index 8b8292af1d..37538a318f 100644 --- a/templates/repo/actions/workflow_dispatch_inputs.tmpl +++ b/templates/repo/actions/workflow_dispatch_inputs.tmpl @@ -33,7 +33,8 @@ </div> {{end}} <div class="ui field"> - <button class="ui tiny primary button" type="submit">{{ctx.Locale.Tr "actions.workflow.run"}}</button> + {{/* use autofocus here to prevent the "branch selection" dropdown from getting focus, otherwise it will auto popup */}} + <button class="ui tiny primary button" autofocus type="submit">{{ctx.Locale.Tr "actions.workflow.run"}}</button> </div> {{end}} {{range .workflows}} diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index 05f79612bd..c4d9f0741f 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -10,7 +10,7 @@ </div> {{end}} {{end}} -<div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content"> +<div class="{{TabSizeClass .Editorconfig .FileTreePath}} non-diff-file-content"> <h4 class="file-header ui top attached header tw-flex tw-items-center tw-justify-between tw-flex-wrap"> <div class="file-header-left tw-flex tw-items-center tw-py-2 tw-pr-4"> {{template "repo/file_info" .}} @@ -82,6 +82,8 @@ </table> {{end}}{{/* end if .IsFileTooLarge */}} <div class="code-line-menu tippy-target"> + {{/*FIXME: the "HasSourceRenderedToggle" is never set on blame page, it should mean "whether the file is renderable". + If the file is renderable, then it must has the "display=source" parameter to make sure the file view page shows the source code, then line number works. */}} {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}} <a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a> {{end}} diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 5d6a8ddf01..9e86641c6f 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -20,17 +20,17 @@ <tr> <td> <div class="flex-text-block"> - <a class="gt-ellipsis" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a> + <a class="gt-ellipsis branch-name" href="{{.RepoLink}}/src/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{.DefaultBranchBranch.DBBranch.Name}}</a> {{if .DefaultBranchBranch.IsProtected}} <span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span> {{end}} <button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button> {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} </div> - <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> ยท <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DefaultBranchBranch.DBBranch.CommitMessage (.Repository.ComposeMetas ctx)}}</span> ยท {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p> + <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> ยท <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DefaultBranchBranch.DBBranch.CommitMessage .Repository}}</span> ยท {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{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" @@ -90,25 +90,31 @@ <td class="eight wide"> {{if .DBBranch.IsDeleted}} <div class="flex-text-block"> - <span class="gt-ellipsis">{{.DBBranch.Name}}</span> + <span class="gt-ellipsis branch-name">{{.DBBranch.Name}}</span> <button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button> </div> <p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{DateUtils.TimeSince .DBBranch.DeletedUnix}}</p> {{else}} <div class="flex-text-block"> - <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> + <a class="gt-ellipsis branch-name" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> {{if .IsProtected}} <span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.protected_branch"}}">{{svg "octicon-shield-lock"}}</span> {{end}} <button class="btn interact-fg tw-px-1" data-clipboard-text="{{.DBBranch.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_branch"}}">{{svg "octicon-copy" 14}}</button> {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} </div> - <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> ยท <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DBBranch.CommitMessage ($.Repository.ComposeMetas ctx)}}</span> ยท {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DBBranch.CommitTime}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> + <p class="info tw-flex tw-items-center tw-my-1">{{svg "octicon-git-commit" 16 "tw-mr-1"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> ยท <span class="commit-message">{{ctx.RenderUtils.RenderCommitMessage .DBBranch.CommitMessage $.Repository}}</span> ยท {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DBBranch.CommitTime}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> {{end}} </td> <td class="two wide ui"> - {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}} - <div class="commit-divergence"> + {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}} + {{$tooltipDivergence := ""}} + {{if or .CommitsBehind .CommitsAhead}} + {{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_divergence_from" .CommitsBehind .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}} + {{else}} + {{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_no_divergence" $.DefaultBranchBranch.DBBranch.Name}} + {{end}} + <div class="commit-divergence" data-tooltip-content="{{$tooltipDivergence}}"> <div class="bar-group"> <div class="count count-behind">{{.CommitsBehind}}</div> {{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}} @@ -119,22 +125,22 @@ <div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div> </div> </div> - {{end}} + {{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 +156,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..36dc047c23 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"}}" @@ -45,17 +46,21 @@ Search "repo/branch_dropdown" in the template directory to find all occurrences. data-enable-feed="{{ctx.RootData.EnableFeed}}" > {{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}} - <div class="ui dropdown custom branch-selector-dropdown ellipsis-items-nowrap"> - <div class="ui button branch-dropdown-button"> + <div class="ui dropdown custom branch-selector-dropdown ellipsis-text-items"> + <div class="ui compact button branch-dropdown-button"> <span class="flex-text-block gt-ellipsis"> - {{if not .DropdownFixedText}} - {{if .ShowTabTags}} + {{if .DropdownFixedText}} + {{.DropdownFixedText}} + {{else}} + {{if eq .CurrentRefType "tag"}} {{svg "octicon-tag"}} - {{else if .ShowTabBranches}} + {{else if eq .CurrentRefType "branch"}} {{svg "octicon-git-branch"}} + {{else}} + {{svg "octicon-git-commit"}} {{end}} + <strong class="tw-inline-block gt-ellipsis">{{.CurrentRefShortName}}</strong> {{end}} - <strong class="tw-ml-2 tw-inline-block gt-ellipsis">{{Iif .DropdownFixedText .SelectedRefShortName}}</strong> </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> diff --git a/templates/repo/clone_panel.tmpl b/templates/repo/clone_panel.tmpl index c1c2c87b75..e23bc8a19a 100644 --- a/templates/repo/clone_panel.tmpl +++ b/templates/repo/clone_panel.tmpl @@ -1,5 +1,6 @@ -<button class="ui primary button js-btn-clone-panel"> - <span>{{svg "octicon-code" 16}} Code</span> +<button class="ui compact primary button js-btn-clone-panel"> + {{svg "octicon-code" 16}} + <span>{{ctx.Locale.Tr "repo.code"}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </button> <div class="clone-panel-popup tippy-target"> @@ -13,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/code/upstream_diverging_info.tmpl b/templates/repo/code/upstream_diverging_info.tmpl index 8d6e55959f..b3d35c05e5 100644 --- a/templates/repo/code/upstream_diverging_info.tmpl +++ b/templates/repo/code/upstream_diverging_info.tmpl @@ -1,10 +1,12 @@ -{{if and .UpstreamDivergingInfo (or .UpstreamDivergingInfo.BaseHasNewCommits .UpstreamDivergingInfo.HeadCommitsBehind)}} +{{if and .UpstreamDivergingInfo .UpstreamDivergingInfo.BaseBranchHasNewCommits}} <div class="ui message flex-text-block"> <div class="tw-flex-1"> - {{$upstreamLink := printf "%s/src/branch/%s" .Repository.BaseRepo.Link (.Repository.BaseRepo.DefaultBranch|PathEscapeSegments)}} - {{$upstreamHtml := HTMLFormat `<a href="%s">%s:%s</a>` $upstreamLink .Repository.BaseRepo.FullName .Repository.BaseRepo.DefaultBranch}} - {{if .UpstreamDivergingInfo.HeadCommitsBehind}} - {{ctx.Locale.TrN .UpstreamDivergingInfo.HeadCommitsBehind "repo.pulls.upstream_diverging_prompt_behind_1" "repo.pulls.upstream_diverging_prompt_behind_n" .UpstreamDivergingInfo.HeadCommitsBehind $upstreamHtml}} + {{$upstreamLink := printf "%s/src/branch/%s" .Repository.BaseRepo.Link (.UpstreamDivergingInfo.BaseBranchName|PathEscapeSegments)}} + {{$upstreamRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.BaseRepo.FullName .UpstreamDivergingInfo.BaseBranchName}} + {{$thisRepoBranchDisplay := HTMLFormat "%s:%s" .Repository.FullName .BranchName}} + {{$upstreamHtml := HTMLFormat `<a href="%s">%s</a>` $upstreamLink $upstreamRepoBranchDisplay}} + {{if .UpstreamDivergingInfo.HeadBranchCommitsBehind}} + {{ctx.Locale.TrN .UpstreamDivergingInfo.HeadBranchCommitsBehind "repo.pulls.upstream_diverging_prompt_behind_1" "repo.pulls.upstream_diverging_prompt_behind_n" .UpstreamDivergingInfo.HeadBranchCommitsBehind $upstreamHtml}} {{else}} {{ctx.Locale.Tr "repo.pulls.upstream_diverging_prompt_base_newer" $upstreamHtml}} {{end}} @@ -12,7 +14,7 @@ {{if .CanWriteCode}} <button class="ui compact primary button tw-m-0 link-action" data-modal-confirm-header="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}" - data-modal-confirm-content="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge_confirm" .BranchName}}" + data-modal-confirm-content="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge_confirm" $upstreamRepoBranchDisplay $thisRepoBranchDisplay}}" data-url="{{.Repository.Link}}/branches/merge-upstream?branch={{.BranchName}}"> {{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}} </button> diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 2e3ddeb228..46f641824b 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -5,7 +5,7 @@ <div class="ui container fluid padded"> <div class="ui top attached header clearing segment tw-relative commit-header"> <div class="tw-flex tw-mb-4 tw-gap-1"> - <h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary" title="{{.Commit.Summary}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.Message ($.Repository.ComposeMetas ctx)}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses}}</h3> + <h3 class="tw-mb-0 tw-flex-1"><span class="commit-summary" title="{{.Commit.Summary}}">{{ctx.RenderUtils.RenderCommitMessage .Commit.Message $.Repository}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "AdditionalClasses" "tw-inline"}}</h3> {{if not $.PageIsWiki}} <div class="commit-header-buttons"> <a class="ui primary tiny button" href="{{.SourcePath}}"> @@ -75,7 +75,7 @@ {{.CsrfTokenHtml}} <div class="field"> <label> - {{ctx.Locale.Tr "repo.branch.new_branch_from" (`<span class="text" id="modal-create-branch-from-span"></span>`|SafeHTML)}} + {{ctx.Locale.Tr "repo.branch.new_branch_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-branch-from-span")}} </label> </div> <div class="required field"> @@ -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> @@ -100,7 +100,7 @@ <input type="hidden" name="create_tag" value="true"> <div class="field"> <label> - {{ctx.Locale.Tr "repo.tag.create_tag_from" (`<span class="text" id="modal-create-tag-from-span"></span>`|SafeHTML)}} + {{ctx.Locale.Tr "repo.tag.create_tag_from" (HTMLFormat `<span class="%s" id="%s"></span>` "text" "modal-create-tag-from-span")}} </label> </div> <div class="required field"> @@ -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> @@ -122,7 +122,7 @@ {{end}} </div> {{if IsMultilineCommitMessage .Commit.Message}} - <pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.Message ($.Repository.ComposeMetas ctx)}}</pre> + <pre class="commit-body">{{ctx.RenderUtils.RenderCommitBody .Commit.Message $.Repository}}</pre> {{end}} {{template "repo/commit_load_branches_and_tags" .}} </div> diff --git a/templates/repo/commit_sign_badge.tmpl b/templates/repo/commit_sign_badge.tmpl index aa68e9dd23..02089d7a4c 100644 --- a/templates/repo/commit_sign_badge.tmpl +++ b/templates/repo/commit_sign_badge.tmpl @@ -38,6 +38,8 @@ so this template should be kept as small as possbile, DO NOT put large component {{- else -}} {{- if $verification.Warning -}} {{- $extraClass = print $extraClass " sign-warning" -}} + {{- else -}} + {{- $extraClass = "" -}}{{/* the commit is not signed */}} {{- end -}} {{- $msgReason = ctx.Locale.Tr $verification.Reason -}}{{- /* dirty part: it is the translation key ..... */ -}} {{- end -}} @@ -57,6 +59,7 @@ so this template should be kept as small as possbile, DO NOT put large component <a {{if $commitBaseLink}}href="{{$commitBaseLink}}/{{$commit.ID}}"{{end}} class="ui label commit-id-short {{$extraClass}}" rel="nofollow"> {{- ShortSha $commit.ID.String -}} {{- end -}} +{{- if or (not $commit) $extraClass}}{{/* only show the lock icon if there is no commit info (icon only) or the commit is really signed */}} <span class="ui label commit-sign-badge {{$extraClass}}"> {{- if $verified -}} {{- if and $signingUser $signingUser.ID -}} @@ -70,7 +73,7 @@ so this template should be kept as small as possbile, DO NOT put large component <span data-tooltip-content="{{$msgReason}}">{{svg "gitea-unlock"}}</span> {{- end -}} </span> - +{{- end -}} {{- if $commit -}} </a> {{- end -}} diff --git a/templates/repo/commit_status.tmpl b/templates/repo/commit_status.tmpl index eb700ab2bb..7184f5f8eb 100644 --- a/templates/repo/commit_status.tmpl +++ b/templates/repo/commit_status.tmpl @@ -14,3 +14,6 @@ {{if eq .State "warning"}} {{svg "gitea-exclamation" 18 "commit-status icon text yellow"}} {{end}} +{{if eq .State "skipped"}} + {{svg "octicon-skip" 18 "commit-status icon text grey"}} +{{end}} diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl index a6f75584a3..1bbfb33105 100644 --- a/templates/repo/commit_statuses.tmpl +++ b/templates/repo/commit_statuses.tmpl @@ -1,10 +1,10 @@ {{if .Statuses}} {{if and (eq (len .Statuses) 1) .Status.TargetURL}} - <a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-tippy="commit-statuses" href="{{.Status.TargetURL}}"> + <a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" href="{{.Status.TargetURL}}"> {{template "repo/commit_status" .Status}} </a> {{else}} - <span class="flex-text-inline {{.AdditionalClasses}}" data-tippy="commit-statuses" tabindex="0"> + <span class="flex-text-inline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" tabindex="0"> {{template "repo/commit_status" .Status}} </span> {{end}} diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 329dc45149..8a268a5d14 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> @@ -44,15 +44,15 @@ <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | ctx.RenderUtils.RenderEmoji}}</span> {{else}} {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} - <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink ($.Repository.ComposeMetas ctx)}}</span> + <span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.Repository}}</span> {{end}} </span> {{if IsMultilineCommitMessage .Message}} - <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}} - <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message ($.Repository.ComposeMetas ctx)}}</pre> + <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .Message $.Repository}}</pre> {{end}} {{if $.CommitsTagsMap}} {{range (index $.CommitsTagsMap .ID.String)}} @@ -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 $.FileTreePath}} + <a class="btn interact-bg tw-p-2 view-single-diff" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_file_diff"}}" + href="{{$commitRepoLink}}/commit/{{.ID.String}}?files={{$.FileTreePath}}" + >{{svg "octicon-file-diff"}}</a> + {{end}} + + {{/* view at history point */}} {{$viewCommitLink := printf "%s/src/commit/%s" $commitRepoLink (PathEscape .ID.String)}} - {{if $.FileName}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileName)}}{{end}} - <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> + {{if $.FileTreePath}}{{$viewCommitLink = printf "%s/%s" $viewCommitLink (PathEscapeSegments $.FileTreePath)}}{{end}} + <a class="btn interact-bg tw-p-2 view-commit-path" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{$viewCommitLink}}">{{svg "octicon-file-code"}}</a> {{end}} </td> </tr> diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index 2acf7c58b8..ee94ad7e58 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -15,7 +15,7 @@ {{$commitLink:= printf "%s/%s" $commitBaseLink (PathEscape .ID.String)}} <span class="tw-flex-1 tw-font-mono gt-ellipsis" title="{{.Summary}}"> - {{- ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}} + {{- ctx.RenderUtils.RenderCommitMessageLinkSubject .Message $commitLink $.comment.Issue.PullRequest.BaseRepo -}} </span> {{if IsMultilineCommitMessage .Message}} @@ -29,7 +29,7 @@ </div> {{if IsMultilineCommitMessage .Message}} <pre class="commit-body tw-ml-[33px] tw-hidden" data-singular-commit-body-for="{{$tag}}"> - {{- ctx.RenderUtils.RenderCommitBody .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}} + {{- ctx.RenderUtils.RenderCommitBody .Message $.comment.Issue.PullRequest.BaseRepo -}} </pre> {{end}} {{end}} diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index ad308c857c..ada7e0c092 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -7,32 +7,28 @@ <div class="ui attached segment"> {{template "base/alert" .}} {{template "repo/create_helper" .}} - - {{if not .CanCreateRepo}} - <div class="ui negative message"> - <p>{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p> - </div> - {{end}} <form class="ui form left-right-form new-repo-form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} + <div id="create-repo-error-message" class="ui negative message tw-text-center tw-hidden"></div> <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> - <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> - {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> - </span> + <div class="ui selection dropdown ellipsis-text-items" id="repo_owner_dropdown"> + <input type="hidden" name="uid" value="{{.ContextUser.ID}}"> + <span class="text"></span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"> + <div class="item" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}" + {{if not .CanCreateRepoInDoer}} + data-create-repo-disallowed-prompt="{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimitOfDoer}}" + {{end}} + > {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> @@ -212,7 +208,7 @@ <br> <div class="inline field"> <label></label> - <button class="ui primary button{{if not .CanCreateRepo}} disabled{{end}}"> + <button class="ui primary button"> {{ctx.Locale.Tr "repo.create_repo"}} </button> </div> diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index ea01d96928..22abf9a219 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,17 +19,17 @@ {{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> <div class="diff-detail-actions"> - {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} + {{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" .}} @@ -37,12 +37,12 @@ {{if .PageIsPullFiles}} <div id="diff-commit-select" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-filter_changes_by_commit="{{ctx.Locale.Tr "repo.pulls.filter_changes_by_commit"}}"> {{/* the following will be replaced by vue component, but this avoids any loading artifacts till the vue component is initialized */}} - <div class="ui jump dropdown basic button custom"> + <div class="ui jump dropdown tiny basic button custom"> {{svg "octicon-git-commit"}} </div> </div> {{end}} - {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} + {{if and .PageIsPullFiles $.SignedUserID}} {{template "repo/diff/new_review" .}} {{end}} </div> @@ -57,35 +57,10 @@ <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}} + {{$.FileIconPoolHTML}} <div id="diff-file-tree" class="tw-hidden not-mobile"></div> <script> if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('tw-hidden'); @@ -105,8 +80,8 @@ {{$isCsv := (call $.IsCsvFile $file)}} {{$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 $.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}}> + {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.Repository.IsArchived) $.IsShowingAllCommits}} + <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}}"> @@ -126,8 +101,8 @@ {{end}} </div> <span class="file tw-flex tw-items-center tw-font-mono tw-flex-1"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} โ {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} โ {{end}}{{$file.Name}}</a> - {{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}} <button class="btn interact-fg tw-p-2" data-clipboard-text="{{$file.Name}}" data-tooltip-content="{{ctx.Locale.Tr "copy_path"}}">{{svg "octicon-copy" 14}}</button> + {{if .IsLFSFile}}<span class="ui label">LFS</span>{{end}} {{if $file.IsGenerated}} <span class="ui label">{{ctx.Locale.Tr "repo.diff.generated"}}</span> {{end}} @@ -173,7 +148,7 @@ <a class="item" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> {{else}} <a class="item" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> - {{if and $.Repository.CanEnableEditor $.CanEditFile (not $file.IsLFSFile) (not $file.IsBin)}} + {{if and $.Repository.CanEnableEditor $.CanEditFile}} <a class="item" rel="nofollow" href="{{$.HeadRepoLink}}/_edit/{{PathEscapeSegments $.HeadBranchName}}/{{PathEscapeSegments $file.Name}}?return_uri={{print $.BackToLink "#diff-" $file.NameHash | QueryEscape}}">{{ctx.Locale.Tr "repo.editor.edit_this_file"}}</a> {{end}} {{end}} @@ -235,7 +210,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> @@ -249,6 +224,7 @@ {{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}} <template id="issue-comment-editor-template"> <form class="ui form comment"> + <div class="field"> {{template "shared/combomarkdowneditor" (dict "CustomInit" true "MarkdownPreviewInRepo" $.Repository @@ -256,12 +232,13 @@ "TextareaName" "content" "DropzoneParentContainer" ".ui.form" )}} + </div> {{if .IsAttachmentEnabled}} <div class="field"> {{template "repo/upload" .}} </div> {{end}} - <div class="text right edit buttons"> + <div class="field flex-text-block tw-justify-end"> <button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> <button class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button> </div> diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index 964dc2adc7..58b675467c 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -27,7 +27,7 @@ {{end}} <div class="field footer"> - <div class="tw-text-right"> + <div class="flex-text-block tw-justify-end"> {{if $.reply}} <button class="ui submit primary tiny button btn-reply" type="submit">{{ctx.Locale.Tr "repo.diff.comment.reply"}}</button> <input type="hidden" name="reply" value="{{$.reply}}"> diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 2d716688b9..2e8261e479 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -8,7 +8,7 @@ {{template "shared/user/avatarlink" dict "user" .Poster}} {{end}} <div class="content comment-container"> - <div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between"> + <div class="comment-header"> <div class="comment-header-left tw-flex tw-items-center"> {{if .OriginalAuthor}} <span class="text black tw-font-semibold tw-mr-1"> @@ -48,7 +48,9 @@ </div> {{end}} {{end}} - {{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}} + {{if not $.root.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}} + {{end}} {{template "repo/issue/view_content/context_menu" dict "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}} </div> </div> diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index 9a7a04a328..4e8ad1326c 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -32,7 +32,7 @@ <a class="tw-mr-2" href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a> <div class="ui dropdown jump select-branch"> <div class="ui basic small button"> - <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span> + <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: <strong>{{$BaseCompareName}}:{{$.BaseBranch}}</strong></span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> <div class="menu"> @@ -103,7 +103,7 @@ <div class="ui dropdown jump select-branch"> <div class="ui basic small button"> - <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span> + <span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: <strong>{{$HeadCompareName}}:{{$.HeadBranch}}</strong></span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> <div class="menu"> @@ -189,7 +189,7 @@ <div class="ui segment flex-text-block tw-gap-4"> {{template "shared/issueicon" .}} <div class="issue-title tw-break-anywhere"> - {{ctx.RenderUtils.RenderIssueTitle .PullRequest.Issue.Title ($.Repository.ComposeMetas ctx)}} + {{ctx.RenderUtils.RenderIssueTitle .PullRequest.Issue.Title $.Repository}} <span class="index">#{{.PullRequest.Issue.Index}}</span> </div> <a href="{{$.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui compact button primary"> @@ -205,10 +205,10 @@ {{end}} </div> {{else if $allowCreatePR}} - <div class="ui info message pullrequest-form-toggle {{if .Flash}}tw-hidden{{end}}"> + <div class="ui info message pullrequest-form-toggle {{if .ExpandNewPrForm}}tw-hidden{{end}}"> <button class="ui button primary show-panel toggle" data-panel=".pullrequest-form-toggle, .pullrequest-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button> </div> - <div class="pullrequest-form {{if not .Flash}}tw-hidden{{end}}"> + <div class="pullrequest-form {{if not .ExpandNewPrForm}}tw-hidden{{end}}"> {{template "repo/issue/new_form" .}} </div> {{end}} diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl index 08f60644b3..eb2abfa7e9 100644 --- a/templates/repo/diff/conversation.tmpl +++ b/templates/repo/diff/conversation.tmpl @@ -8,9 +8,9 @@ {{$referenceUrl := printf "%s#%s" $.Issue.Link $comment.HashTag}} <div class="conversation-holder" data-path="{{$comment.TreePath}}" data-side="{{if lt $comment.Line 0}}left{{else}}right{{end}}" data-idx="{{$comment.UnsignedLine}}"> {{if $resolved}} - <div class="ui attached header resolved-placeholder tw-flex tw-items-center tw-justify-between"> - <div class="ui grey text tw-flex tw-items-center tw-flex-wrap tw-gap-1"> - {{svg "octicon-check" 16 "icon tw-mr-1"}} + <div class="resolved-placeholder"> + <div class="flex-text-block tw-flex-wrap grey text"> + {{svg "octicon-check"}} <b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}} {{if $invalid}} <!-- @@ -22,35 +22,33 @@ </a> {{end}} </div> - <div class="tw-flex tw-items-center tw-gap-2"> - <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button show-outdated tw-flex tw-items-center"> - {{svg "octicon-unfold" 16 "tw-mr-2"}} - {{ctx.Locale.Tr "repo.issues.review.show_resolved"}} + <div class="flex-text-block"> + <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny show-outdated"> + {{svg "octicon-unfold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.show_resolved"}} </button> - <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button hide-outdated tw-flex tw-items-center tw-hidden"> - {{svg "octicon-fold" 16 "tw-mr-2"}} - {{ctx.Locale.Tr "repo.issues.review.hide_resolved"}} + <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny hide-outdated tw-hidden"> + {{svg "octicon-fold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}} </button> </div> </div> {{end}} <div id="code-comments-{{$comment.ID}}" class="field comment-code-cloud {{if $resolved}}tw-hidden{{end}}"> <div class="comment-list"> - <ui class="ui comments"> + <div class="ui comments"> {{template "repo/diff/comments" dict "root" $ "comments" .comments}} - </ui> + </div> </div> - <div class="tw-flex tw-justify-end tw-items-center tw-gap-2 tw-mt-2 tw-flex-wrap"> + <div class="flex-text-block tw-mt-2 tw-flex-wrap tw-justify-end"> <div class="ui buttons"> <button class="ui icon tiny basic button previous-conversation"> - {{svg "octicon-arrow-up" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.previous"}} + {{svg "octicon-arrow-up" 12}} {{ctx.Locale.Tr "repo.issues.previous"}} </button> <button class="ui icon tiny basic button next-conversation"> - {{svg "octicon-arrow-down" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.next"}} + {{svg "octicon-arrow-down" 12}} {{ctx.Locale.Tr "repo.issues.next"}} </button> </div> {{if and $.CanMarkConversation $hasReview (not $isReviewPending)}} - <button class="ui icon tiny basic button resolve-conversation tw-mr-0" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> + <button class="ui icon tiny basic button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> {{if $resolved}} {{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}} {{else}} @@ -59,8 +57,8 @@ </button> {{end}} {{if and $.SignedUserID (not $.Repository.IsArchived)}} - <button class="comment-form-reply ui primary tiny labeled icon button tw-mr-0"> - {{svg "octicon-reply" 16 "reply icon tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}} + <button class="comment-form-reply ui primary icon tiny button"> + {{svg "octicon-reply" 12}}{{ctx.Locale.Tr "repo.diff.comment.reply"}} </button> {{end}} </div> diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl index 608174e51b..7557129c64 100644 --- a/templates/repo/diff/image_diff.tmpl +++ b/templates/repo/diff/image_diff.tmpl @@ -9,20 +9,20 @@ > <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"> <p class="side-header">{{ctx.Locale.Tr "repo.diff.file_before"}}</p> - <span class="before-container"><img class="image-before"></span> + <span class="before-container"><img alt class="image-before"></span> <p> <span class="bounds-info-before"> {{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span> @@ -37,7 +37,7 @@ {{if .blobHead}} <span class="side"> <p class="side-header">{{ctx.Locale.Tr "repo.diff.file_after"}}</p> - <span class="after-container"><img class="image-after"></span> + <span class="after-container"><img alt class="image-after"></span> <p> <span class="bounds-info-after"> {{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span> @@ -52,12 +52,12 @@ </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> + <span class="before-container"><img alt class="image-before"></span> <span class="swipe-container"> - <span class="after-container"><img class="image-after"></span> + <span class="after-container"><img alt class="image-after"></span> </span> <span class="swipe-bar"> <span class="handle top-handle"></span> @@ -66,12 +66,12 @@ </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"> - <span class="before-container"><img class="image-before"></span> - <span class="after-container"><img class="image-after"></span> + <span class="before-container"><img alt class="image-before"></span> + <span class="after-container"><img alt class="image-after"></span> </div> </div> </div> diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl index 2febc6303a..3bb01a139a 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -1,56 +1,59 @@ -<div id="review-box"> - <button class="ui tiny primary button tw-pr-1 tw-flex js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}> +<div id="review-box" {{if $.Repository.IsArchived}}data-tooltip-content="{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}"{{end}}> + <button class="ui tiny primary button tw-pr-1 js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" + {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}} + {{if $.Repository.IsArchived}}disabled{{end}} + > {{ctx.Locale.Tr "repo.diff.review"}} <span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </button> - {{if $.IsShowingAllCommits}} - <div class="review-box-panel tippy-target"> - <div class="ui segment"> - <form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> - {{.CsrfTokenHtml}} - <input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> - <div class="field tw-flex tw-items-center"> - <div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> - <a class="muted close">{{svg "octicon-x" 16}}</a> - </div> +</div> +{{if $.IsShowingAllCommits}} +<div class="review-box-panel tippy-target"> + <div class="ui segment"> + <form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post"> + {{.CsrfTokenHtml}} + <input type="hidden" name="commit_id" value="{{.AfterCommitID}}"> + <div class="field tw-flex tw-items-center"> + <div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div> + <a class="muted close">{{svg "octicon-x" 16}}</a> + </div> + <div class="field"> + {{template "shared/combomarkdowneditor" (dict + "MarkdownPreviewInRepo" $.Repository + "MarkdownPreviewMode" "comment" + "TextareaName" "content" + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") + "DropzoneParentContainer" "form" + )}} + </div> + {{if .IsAttachmentEnabled}} <div class="field"> - {{template "shared/combomarkdowneditor" (dict - "MarkdownPreviewInRepo" $.Repository - "MarkdownPreviewMode" "comment" - "TextareaName" "content" - "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder") - "DropzoneParentContainer" "form" - )}} + {{template "repo/upload" .}} </div> - {{if .IsAttachmentEnabled}} - <div class="field"> - {{template "repo/upload" .}} - </div> - {{end}} - <div class="divider"></div> - {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} - {{if not $.Issue.IsClosed}} - {{if $showSelfTooltip}} - <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> - <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> - </span> - {{else}} - <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> - {{end}} + {{end}} + <div class="divider"></div> + {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} + {{if not $.Issue.IsClosed}} + {{if $showSelfTooltip}} + <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}"> + <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> + </span> + {{else}} + <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button> {{end}} - <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> - {{if not $.Issue.IsClosed}} - {{if $showSelfTooltip}} - <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> - <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> - </span> - {{else}} - <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> - {{end}} + {{end}} + <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button> + {{if not $.Issue.IsClosed}} + {{if $showSelfTooltip}} + <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}"> + <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> + </span> + {{else}} + <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button> {{end}} - </form> - </div> + {{end}} + </form> </div> - {{end}} </div> +{{end}} 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/cherry_pick.tmpl b/templates/repo/editor/cherry_pick.tmpl index f9c9eef5aa..7981fd0761 100644 --- a/templates/repo/editor/cherry_pick.tmpl +++ b/templates/repo/editor/cherry_pick.tmpl @@ -3,15 +3,14 @@ {{template "repo/header" .}} <div class="ui container"> {{template "base/alert" .}} - <form class="ui edit form" method="post" action="{{.RepoLink}}/_cherrypick/{{.SHA}}/{{.BranchName | PathEscapeSegments}}"> + <form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}"> {{.CsrfTokenHtml}} - <input type="hidden" name="last_commit" value="{{.last_commit}}"> - <input type="hidden" name="page_has_posted" value="true"> + {{template "repo/editor/common_top" .}} <input type="hidden" name="revert" value="{{if eq .CherryPickType "revert"}}true{{else}}false{{end}}"> <div class="repo-editor-header"> - <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}"> - {{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}} - {{$shalink := HTMLFormat `<a class="ui primary sha label" href="%s">%s</a>` $shaurl (ShortSha .SHA)}} + <div class="breadcrumb"> + {{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .FromCommitID)}} + {{$shalink := HTMLFormat `<a class="ui primary sha label" href="%s">%s</a>` $shaurl (ShortSha .FromCommitID)}} {{if eq .CherryPickType "revert"}} {{ctx.Locale.Tr "repo.editor.revert" $shalink}} {{else}} diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index c050324e93..7067614444 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -1,11 +1,11 @@ <div class="commit-form-wrapper"> {{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}} <div class="commit-form"> - <h3>{{- if .CanCommitToBranch.WillSign}} - <span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span> + <h3>{{- if .CommitFormOptions.WillSign}} + <span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CommitFormOptions.SigningKey}}">{{svg "octicon-lock" 24}}</span> {{ctx.Locale.Tr "repo.editor.commit_signed_changes"}} {{- else}} - <span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span> + <span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CommitFormOptions.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span> {{ctx.Locale.Tr "repo.editor.commit_changes"}} {{- end}}</h3> <div class="field"> @@ -22,17 +22,17 @@ </div> <div class="quick-pull-choice js-quick-pull-choice"> <div class="field"> - <div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}"> + <div class="ui radio checkbox {{if not .CommitFormOptions.CanCommitToBranch}}disabled{{end}}"> <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}> <label> {{svg "octicon-git-commit"}} {{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}} - {{if not .CanCommitToBranch.CanCommitToBranch}} + {{if not .CommitFormOptions.CanCommitToBranch}} <div class="ui visible small warning message"> {{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}} <ul> - {{if not .CanCommitToBranch.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}} - {{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}} + {{if not .CommitFormOptions.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}} + {{if and .CommitFormOptions.RequireSigned (not .CommitFormOptions.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}} </ul> </div> {{end}} @@ -42,14 +42,14 @@ {{if and (not .Repository.IsEmpty) (not .IsEditingFileOnly)}} <div class="field"> <div class="ui radio checkbox"> - {{if .CanCreatePullRequest}} + {{if .CommitFormOptions.CanCreatePullRequest}} <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> {{else}} <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> {{end}} <label> {{svg "octicon-git-pull-request"}} - {{if .CanCreatePullRequest}} + {{if .CommitFormOptions.CanCreatePullRequest}} {{ctx.Locale.Tr "repo.editor.create_new_branch"}} {{else}} {{ctx.Locale.Tr "repo.editor.create_new_branch_np"}} @@ -58,7 +58,7 @@ </div> </div> <div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}tw-hidden{{end}}"> - <div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}"> + <div class="new-branch-name-input field"> {{svg "octicon-git-branch"}} <input type="text" name="new_branch_name" maxlength="100" value="{{.new_branch_name}}" class="input-contrast tw-mr-1 js-quick-pull-new-branch-name" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}"> <span class="text-muted js-quick-pull-normalization-info"></span> @@ -66,7 +66,18 @@ </div> {{end}} </div> + {{if and .CommitCandidateEmails (gt (len .CommitCandidateEmails) 1)}} + <div class="field"> + <label>{{ctx.Locale.Tr "repo.editor.commit_email"}}</label> + <select class="ui selection dropdown" name="commit_email"> + {{- range $email := .CommitCandidateEmails -}} + <option {{if eq $email $.CommitDefaultEmail}}selected{{end}} value="{{$email}}">{{$email}}</option> + {{- end -}} + </select> + </div> + {{end}} </div> + <input type="hidden" name="last_commit" value="{{.last_commit}}"> <button id="commit-button" type="submit" class="ui primary button"> {{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}} </button> diff --git a/templates/repo/editor/common_breadcrumb.tmpl b/templates/repo/editor/common_breadcrumb.tmpl new file mode 100644 index 0000000000..8cfbe09d3e --- /dev/null +++ b/templates/repo/editor/common_breadcrumb.tmpl @@ -0,0 +1,16 @@ +<div class="breadcrumb"> + <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a> + {{$n := len .TreeNames}} + {{$l := Eval $n "-" 1}} + {{range $i, $v := .TreeNames}} + <div class="breadcrumb-divider">/</div> + {{if eq $i $l}} + <input id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr (Iif $.PageIsUpload "repo.editor.add_subdir" "repo.editor.name_your_file")}}" data-editorconfig="{{$.EditorconfigJson}}" {{Iif $.PageIsUpload "" "required"}} autofocus> + <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span> + {{else}} + <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span> + {{end}} + {{end}} + <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{or .ReturnURI (print $.BranchLink "/" (PathEscapeSegments .TreePath))}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span> + <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}"> +</div> diff --git a/templates/repo/editor/common_top.tmpl b/templates/repo/editor/common_top.tmpl new file mode 100644 index 0000000000..23280ed565 --- /dev/null +++ b/templates/repo/editor/common_top.tmpl @@ -0,0 +1,6 @@ +{{if .CommitFormOptions.WillSubmitToFork}} +<div class="ui blue message"> + {{$repoLinkHTML := HTMLFormat `<a href="%s">%s</a>` .CommitFormOptions.TargetRepo.Link .CommitFormOptions.TargetRepo.FullName}} + {{ctx.Locale.Tr "repo.editor.fork_edit_description" $repoLinkHTML}} +</div> +{{end}} diff --git a/templates/repo/editor/delete.tmpl b/templates/repo/editor/delete.tmpl index 2c0c2fc792..bf6143f1cb 100644 --- a/templates/repo/editor/delete.tmpl +++ b/templates/repo/editor/delete.tmpl @@ -3,9 +3,9 @@ {{template "repo/header" .}} <div class="ui container"> {{template "base/alert" .}} - <form class="ui form" method="post"> + <form class="ui form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}"> {{.CsrfTokenHtml}} - <input type="hidden" name="last_commit" value="{{.last_commit}}"> + {{template "repo/editor/common_top" .}} {{template "repo/editor/commit_form" .}} </form> </div> diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index 577a2be9ad..0911d02e1f 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -3,56 +3,49 @@ {{template "repo/header" .}} <div class="ui container"> {{template "base/alert" .}} - <form class="ui edit form" method="post" + <form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}" data-text-empty-confirm-header="{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}" data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}" > {{.CsrfTokenHtml}} - <input type="hidden" name="last_commit" value="{{.last_commit}}"> - <input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}"> + {{template "repo/editor/common_top" .}} <div class="repo-editor-header"> - <div class="ui breadcrumb field{{if .Err_TreePath}} error{{end}}"> - <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a> - {{$n := len .TreeNames}} - {{$l := Eval $n "-" 1}} - {{range $i, $v := .TreeNames}} - <div class="breadcrumb-divider">/</div> - {{if eq $i $l}} - <input id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.EditorconfigJson}}" required autofocus> - <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span> - {{else}} - <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span> - {{end}} - {{end}} - <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span> - <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required> - </div> + {{template "repo/editor/common_breadcrumb" .}} </div> - <div class="field"> - <div class="ui top attached header"> - <div class="ui compact small menu small-menu-items repo-editor-menu"> - <a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a> - <a class="item" data-tab="preview" data-preview-url="{{.Repository.Link}}/markup" data-preview-context-ref="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a> - {{if not .IsNewFile}} - <a class="item" data-tab="diff" hx-params="context,content" hx-vals='{"context":"{{.BranchLink}}"}' hx-include="#edit_area" hx-swap="innerHTML" hx-target=".tab[data-tab='diff']" hx-indicator=".tab[data-tab='diff']" hx-post="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a> - {{end}} - </div> - </div> - <div class="ui bottom attached segment tw-p-0"> - <div class="ui active tab tw-rounded-b" data-tab="write"> - <textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}" - data-previewable-extensions="{{.PreviewableExtensions}}" - data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea> - <div class="editor-loading is-loading"></div> + {{if not .NotEditableReason}} + <div class="field"> + <div class="ui top attached header"> + <div class="ui compact small menu small-menu-items repo-editor-menu"> + <a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a> + <a class="item" data-tab="preview" data-preview-url="{{.Repository.Link}}/markup" data-preview-context-ref="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a> + {{if not .IsNewFile}} + <a class="item" data-tab="diff" hx-params="context,content" hx-vals='{"context":"{{.BranchLink}}"}' hx-include="#edit_area" hx-swap="innerHTML" hx-target=".tab[data-tab='diff']" hx-indicator=".tab[data-tab='diff']" hx-post="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a> + {{end}} + </div> </div> - <div class="ui tab markup tw-px-4 tw-py-3" data-tab="preview"> - {{ctx.Locale.Tr "loading"}} + <div class="ui bottom attached segment tw-p-0"> + <div class="ui active tab tw-rounded-b" data-tab="write"> + <textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}" + data-previewable-extensions="{{.PreviewableExtensions}}" + data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea> + <div class="editor-loading is-loading"></div> + </div> + <div class="ui tab tw-px-4 tw-py-3" data-tab="preview"> + {{ctx.Locale.Tr "loading"}} + </div> + <div class="ui tab" data-tab="diff"> + <div class="tw-p-16"></div> + </div> </div> - <div class="ui tab diff edit-diff" data-tab="diff"> - <div class="tw-p-16"></div> + </div> + {{else}} + <div class="field"> + <div class="ui segment tw-text-center"> + <h4 class="tw-font-semibold tw-mb-2">{{.NotEditableReason}}</h4> + <p>{{ctx.Locale.Tr "repo.editor.file_not_editable_hint"}}</p> </div> </div> - </div> + {{end}} {{template "repo/editor/commit_form" .}} </form> </div> diff --git a/templates/repo/editor/fork.tmpl b/templates/repo/editor/fork.tmpl new file mode 100644 index 0000000000..e28b2ba7a2 --- /dev/null +++ b/templates/repo/editor/fork.tmpl @@ -0,0 +1,18 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content repository"> + {{template "repo/header" .}} + <div class="ui container"> + {{template "base/alert" .}} + <form class="ui form form-fetch-action" method="post" action="{{.RepoLink}}/_fork/{{.BranchName | PathEscapeSegments}}"> + {{.CsrfTokenHtml}} + <div class="tw-text-center"> + <div class="tw-my-[40px]"> + <h3>{{ctx.Locale.Tr "repo.editor.fork_create"}}</h3> + <p>{{ctx.Locale.Tr "repo.editor.fork_create_description"}}</p> + </div> + <button class="ui primary button">{{ctx.Locale.Tr "repo.fork_repo"}}</button> + </div> + </form> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl index 33a7c2a89d..fa00edd92e 100644 --- a/templates/repo/editor/patch.tmpl +++ b/templates/repo/editor/patch.tmpl @@ -3,15 +3,14 @@ {{template "repo/header" .}} <div class="ui container"> {{template "base/alert" .}} - <form class="ui edit form" method="post" action="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}" + <form class="ui edit form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}" data-text-empty-confirm-header="{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}" data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}" > {{.CsrfTokenHtml}} - <input type="hidden" name="last_commit" value="{{.last_commit}}"> - <input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}"> + {{template "repo/editor/common_top" .}} <div class="repo-editor-header"> - <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}"> + <div class="breadcrumb"> {{ctx.Locale.Tr "repo.editor.patching"}} <a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a> <div class="breadcrumb-divider">:</div> diff --git a/templates/repo/editor/upload.tmpl b/templates/repo/editor/upload.tmpl index 5725020406..3e36c77b3b 100644 --- a/templates/repo/editor/upload.tmpl +++ b/templates/repo/editor/upload.tmpl @@ -3,25 +3,11 @@ {{template "repo/header" .}} <div class="ui container"> {{template "base/alert" .}} - <form class="ui comment form" method="post"> + <form class="ui comment form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}"> {{.CsrfTokenHtml}} + {{template "repo/editor/common_top" .}} <div class="repo-editor-header"> - <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}"> - <a class="section" href="{{$.BranchLink}}">{{.Repository.Name}}</a> - {{$n := len .TreeNames}} - {{$l := Eval $n "-" 1}} - {{range $i, $v := .TreeNames}} - <div class="breadcrumb-divider">/</div> - {{if eq $i $l}} - <input type="text" id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.add_subdir"}}" autofocus> - <span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span> - {{else}} - <span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span> - {{end}} - {{end}} - <span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span> - <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required> - </div> + {{template "repo/editor/common_breadcrumb" .}} </div> <div class="field"> {{template "repo/upload" .}} diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index ae3f95045b..32b5c8401b 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -47,7 +47,7 @@ <h3>{{ctx.Locale.Tr "repo.create_new_repo_command"}}</h3> <div class="markup"> <pre><code>touch README.md -git init +git init{{if ne .Repository.ObjectFormatName "sha1"}} --object-format={{.Repository.ObjectFormatName}}{{end}}{{/* for sha256 repo, it needs to set "object-format" explicitly*/}} {{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}} git add README.md git commit -m "first commit" diff --git a/templates/repo/file_info.tmpl b/templates/repo/file_info.tmpl index b63af68973..38133bde2b 100644 --- a/templates/repo/file_info.tmpl +++ b/templates/repo/file_info.tmpl @@ -11,7 +11,7 @@ {{end}} {{if ne .FileSize nil}} <div class="file-info-entry"> - {{FileSize .FileSize}}{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}} + {{FileSize .FileSize}}{{if .IsLFSFile}}<span class="ui label">LFS</span>{{end}} </div> {{end}} {{if .LFSLock}} diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl index 725b67c651..6e46457893 100644 --- a/templates/repo/forks.tmpl +++ b/templates/repo/forks.tmpl @@ -1,20 +1,12 @@ {{template "base/head" .}} <div role="main" aria-label="{{.Title}}" class="page-content repository forks"> {{template "repo/header" .}} - <div class="ui container"> + <div class="ui container fork-list"> <h2 class="ui dividing header"> {{ctx.Locale.Tr "repo.forks"}} </h2> - <div class="flex-list"> - {{range .Forks}} - <div class="flex-item tw-border-0 repo-fork-item"> - <span>{{ctx.AvatarUtils.Avatar .Owner}}</span> - <span><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a></span> - </div> - {{end}} - </div> + {{template "shared/repo/list" .}} + {{template "base/paginate" .}} </div> - - {{template "base/paginate" .}} </div> {{template "base/footer" .}} diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl index 9eb4bd4ecb..93cb5903cf 100644 --- a/templates/repo/graph.tmpl +++ b/templates/repo/graph.tmpl @@ -45,8 +45,8 @@ {{end}} </div> </div> - <button id="flow-color-monochrome" class="ui labelled icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}</button> - <button id="flow-color-colored" class="ui labelled icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.color"}}</button> + <button id="flow-color-monochrome" class="ui icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}</button> + <button id="flow-color-colored" class="ui icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.commit_graph.color"}}</button> </div> </h2> <div class="ui dividing"></div> diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl index 6af0ba1f0f..34167cadc0 100644 --- a/templates/repo/graph/commits.tmpl +++ b/templates/repo/graph/commits.tmpl @@ -8,7 +8,7 @@ {{template "repo/commit_sign_badge" dict "Commit" $commit.Commit "CommitBaseLink" (print $.RepoLink "/commit") "CommitSignVerification" $commit.Verification}} <span class="message tw-inline-block gt-ellipsis"> - <span>{{ctx.RenderUtils.RenderCommitMessage $commit.Subject ($.Repository.ComposeMetas ctx)}}</span> + <span>{{ctx.RenderUtils.RenderCommitMessage $commit.Subject $.Repository}}</span> </span> <span class="commit-refs flex-text-inline"> @@ -17,18 +17,18 @@ {{if eq $refGroup "pull"}} {{if or (not $.HidePRRefs) (SliceUtils.Contains $.SelectedBranches .Name)}} <!-- it's intended to use issues not pulls, if it's a pull you will get redirected --> - <a class="ui labelled basic tiny button" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}"> + <a class="ui basic tiny button" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}"> {{svg "octicon-git-pull-request"}} #{{.ShortName}} </a> {{end}} {{else if eq $refGroup "tags"}} {{- template "repo/tag/name" dict "RepoLink" $.Repository.Link "TagName" .ShortName -}} {{else if eq $refGroup "remotes"}} - <a class="ui labelled basic tiny button" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}"> + <a class="ui basic tiny button" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}"> {{svg "octicon-cross-reference"}} {{.ShortName}} </a> {{else if eq $refGroup "heads"}} - <a class="ui labelled basic tiny button" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}"> + <a class="ui basic tiny button" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}"> {{svg "octicon-git-branch"}} {{.ShortName}} </a> {{else}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 3e7214f48c..b61076ff46 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -25,6 +25,9 @@ <div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.internal"}}">{{svg "octicon-shield-lock" 18}}</div> {{end}} {{end}} + {{if $.Permission.HasAnyUnitPublicAccess}} + <span class="ui basic orange label">{{ctx.Locale.Tr "repo.desc.public_access"}}</span> + {{end}} {{if .IsTemplate}} <span class="ui basic label not-mobile">{{ctx.Locale.Tr "repo.desc.template"}}</span> <div class="repo-icon only-mobile" data-tooltip-content="{{ctx.Locale.Tr "repo.desc.template"}}">{{svg "octicon-repo-template" 18}}</div> @@ -35,20 +38,20 @@ </div> </div> {{if not (or .IsBeingCreated .IsBroken)}} - <div class="repo-buttons"> + <div class="flex-text-block tw-flex-wrap"> {{if $.RepoTransfer}} <form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}"> {{$.CsrfTokenHtml}} - <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}"> - <button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> + <div class="flex-text-inline" data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}"> + <button type="submit" class="ui compact small basic button {{if $.CanUserAcceptOrRejectTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}> {{ctx.Locale.Tr "repo.transfer.accept"}} </button> </div> </form> <form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}"> {{$.CsrfTokenHtml}} - <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}"> - <button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> + <div class="flex-text-inline" data-tooltip-content="{{if $.CanUserAcceptOrRejectTransfer}}{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}"> + <button type="submit" class="ui compact small basic button {{if $.CanUserAcceptOrRejectTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptOrRejectTransfer}} disabled{{end}}> {{ctx.Locale.Tr "repo.transfer.reject"}} </button> </div> @@ -208,7 +211,7 @@ </a> {{end}} - {{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}} + {{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases ctx.Consts.RepoUnitTypeCode) (not .IsEmptyRepo)}} <a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity"> {{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}} </a> @@ -223,11 +226,19 @@ </a> {{end}} </div> - {{else if .Permission.IsAdmin}} + {{else}} <div class="overflow-menu-items"> + {{if(and .Repository.IsBeingCreated (.Permission.CanRead ctx.Consts.RepoUnitTypeCode))}} + <a class="{{if not .PageIsRepoSettings}}active {{end}}item" href="{{.RepoLink}}"> + {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.migration_status"}} + </a> + {{end}} + + {{if .Permission.IsAdmin}} <a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings"> {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} </a> + {{end}} </div> {{end}} </overflow-menu> diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 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/home_sidebar_bottom.tmpl b/templates/repo/home_sidebar_bottom.tmpl index f780dc122d..01e630ccbf 100644 --- a/templates/repo/home_sidebar_bottom.tmpl +++ b/templates/repo/home_sidebar_bottom.tmpl @@ -4,14 +4,14 @@ <div class="flex-item"> <div class="flex-item-main"> <div class="flex-item-title"> - <a class="item muted" href="{{.Link}}/releases"> + <a class="item muted" href="{{.RepoLink}}/releases"> {{ctx.Locale.Tr "repo.releases"}} <span class="ui small label">{{.NumReleases}}</span> </a> </div> <div class="flex-item"> - <div class="flex-item-icon"> - {{svg "octicon-tag" 16}} + <div class="flex-item-leading"> + <div class="tw-mt-1">{{svg "octicon-tag" 16}}</div> </div> <div class="flex-item-main"> <div class="flex-item-header"> diff --git a/templates/repo/home_sidebar_top.tmpl b/templates/repo/home_sidebar_top.tmpl index d7c2b8336f..8c2089c839 100644 --- a/templates/repo/home_sidebar_top.tmpl +++ b/templates/repo/home_sidebar_top.tmpl @@ -1,5 +1,5 @@ <div class="repo-home-sidebar-top"> - <form class="ignore-dirty tw-flex tw-flex-1 tw-mt-1" action="{{.RepoLink}}/search" method="get"> + <form class="ignore-dirty tw-flex tw-flex-1" action="{{.RepoLink}}/search" method="get"> <div class="ui small action input tw-flex-1"> <input name="q" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}"> {{template "shared/search/button"}} </div> @@ -45,7 +45,7 @@ {{end}} {{if .ReadmeExist}} - <a class="flex-text-block muted" href="{{.TreeLink}}/{{.FileName}}"> + <a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.RefTypeNameSubURL}}/{{PathEscapeSegments .FileTreePath}}"> {{svg "octicon-book"}} {{ctx.Locale.Tr "readme"}} </a> {{end}} diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl index e5e0bd68e7..e4a904c46b 100644 --- a/templates/repo/icon.tmpl +++ b/templates/repo/icon.tmpl @@ -1,6 +1,6 @@ {{$avatarLink := (.RelAvatarLink ctx)}} {{if $avatarLink}} - <img class="ui avatar tw-align-middle" src="{{$avatarLink}}" width="24" height="24" alt="{{.FullName}}"> + <img class="ui avatar tw-align-middle" src="{{$avatarLink}}" width="24" height="24" alt aria-hidden="true"> {{else if $.IsMirror}} {{svg "octicon-mirror" 24}} {{else if $.IsFork}} diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl index 9183b7b46a..c8b67490ac 100644 --- a/templates/repo/issue/branch_selector_field.tmpl +++ b/templates/repo/issue/branch_selector_field.tmpl @@ -14,7 +14,7 @@ Still needs to figure out: */}} {{if and (not .Issue.IsPull) (not .PageIsComparePull)}} <input id="ref_selector" name="ref" type="hidden" value="{{.Reference}}"> -<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-items-nowrap {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}}" +<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-text-items {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}}" data-no-results="{{ctx.Locale.Tr "no_results_found"}}" {{if and .Issue (or .IsIssueWriter .HasIssuesOrPullsWritePermission)}}data-url-update-issueref="{{$.RepoLink}}/issues/{{.Issue.Index}}/ref"{{end}} > diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl index c7bbe91885..6dae49c455 100644 --- a/templates/repo/issue/card.tmpl +++ b/templates/repo/issue/card.tmpl @@ -4,7 +4,7 @@ {{if $attachments}} <div class="card-attachment-images"> {{range $attachments}} - <img src="{{.DownloadURL}}" alt="{{.Name}}" /> + <img loading="lazy" src="{{.DownloadURL}}" alt="{{.Name}}" /> {{end}} </div> {{end}} @@ -45,7 +45,7 @@ {{if $.Page.LinkedPRs}} {{range index $.Page.LinkedPRs .ID}} <div class="meta tw-my-1"> - <a href="{{$.Issue.Repo.Link}}/pulls/{{.Index}}"> + <a href="{{.Repo.Link}}/pulls/{{.Index}}"> <span class="tw-m-0 text {{if .PullRequest.HasMerged}}purple{{else if .IsClosed}}red{{else}}green{{end}}">{{svg "octicon-git-merge" 16 "tw-mr-1 tw-align-middle"}}</span> <span class="tw-align-middle">{{.Title}} <span class="text light grey">#{{.Index}}</span></span> </a> @@ -63,16 +63,21 @@ {{if or .Labels .Assignees}} <div class="issue-card-bottom"> - <div class="labels-list"> - {{range .Labels}} - <a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{ctx.RenderUtils.RenderLabel .}}</a> + {{/* the labels container must always be present, to help the assignees list right-aligned */}} + <div class="issue-card-bottom-part labels-list"> + {{range $label := .Labels}} + {{$link := print $.Issue.Repo.Link "/issues"}} + {{$link = QueryBuild $link "labels" $label.ID}} + {{ctx.RenderUtils.RenderLabelWithLink $label $link}} {{end}} </div> - <div class="issue-card-assignees"> + {{if .Assignees}} + <div class="issue-card-bottom-part tw-justify-end"> {{range .Assignees}} - <a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28}}</a> + <a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 24}}</a> {{end}} </div> + {{end}} </div> {{end}} {{end}} diff --git a/templates/repo/issue/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_label.tmpl b/templates/repo/issue/filter_item_label.tmpl index 0883d93804..04c3605a6a 100644 --- a/templates/repo/issue/filter_item_label.tmpl +++ b/templates/repo/issue/filter_item_label.tmpl @@ -22,7 +22,7 @@ <span class="label-filter-exclude-info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude"}}</span> <div class="divider"></div> <a class="item label-filter-query-default" href="{{QueryBuild $queryLink "labels" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a> - <a class="item label-filter-query-not-set" href="{{QueryBuild $queryLink "labels" 0}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a> + <a class="item label-filter-query-not-set" href="{{QueryBuild $queryLink "labels" "0"}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a> {{/* The logic here is not the same as the label selector in the issue sidebar. The one in the issue sidebar renders "repo labels | divider | org labels". Maybe the logic should be updated to be consistent.*/}} diff --git a/templates/repo/issue/filter_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..bfdf94513e 100644 --- a/templates/repo/issue/filter_list.tmpl +++ b/templates/repo/issue/filter_list.tmpl @@ -15,7 +15,7 @@ <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}"> </div> <div class="divider"></div> - <a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" 0}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a> + <a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a> <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="{{QueryBuild $queryLink "milestone" -1}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a> {{if .OpenMilestones}} <div class="divider"></div> @@ -94,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}} @@ -106,7 +106,7 @@ </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "all"}}">{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}</a> + <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "all"}}">{{if .PageIsPullList}}{{ctx.Locale.Tr "repo.issues.filter_type.all_pull_requests"}}{{else}}{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}{{end}}</a> <a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "assigned"}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a> <a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{QueryBuild $queryLink "type" "created_by"}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a> {{if .PageIsPullList}} @@ -133,5 +133,11 @@ <a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "leastcomment"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a> <a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "nearduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a> <a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{QueryBuild $queryLink "sort" "farduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a> + <div class="divider"></div> + <div class="header">{{ctx.Locale.Tr "repo.issues.filter_label"}}</div> + {{range $scope := .ExclusiveLabelScopes}} + {{$sortType := (printf "scope-%s" $scope)}} + <a class="{{if eq $.SortType $sortType}}active {{end}}item" href="{{QueryBuild $queryLink "sort" $sortType}}">{{$scope}}</a> + {{end}} </div> </div> diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl index 06e7c1aa6c..409ec876e6 100644 --- a/templates/repo/issue/filters.tmpl +++ b/templates/repo/issue/filters.tmpl @@ -9,7 +9,7 @@ <div class="ui compact tiny secondary menu"> <span class="item" data-tooltip-content='{{ctx.Locale.Tr "tracked_time_summary"}}'> {{svg "octicon-clock"}} - {{.TotalTrackedTime | Sec2Time}} + {{.TotalTrackedTime | Sec2Hour}} </span> </div> {{end}} diff --git a/templates/repo/issue/labels/label_edit_modal.tmpl b/templates/repo/issue/labels/label_edit_modal.tmpl index 527b7ff900..6837d66dce 100644 --- a/templates/repo/issue/labels/label_edit_modal.tmpl +++ b/templates/repo/issue/labels/label_edit_modal.tmpl @@ -5,7 +5,7 @@ > <div class="header"></div> <div class="content"> - <form class="ui form ignore-dirty" method="post"> + <form class="ui form ignore-dirty form-fetch-action" method="post"> {{.CsrfTokenHtml}} <input name="id" type="hidden"> <div class="required field"> @@ -24,7 +24,13 @@ <div class="desc tw-ml-1 tw-mt-2 tw-hidden label-exclusive-warning"> {{svg "octicon-alert"}} {{ctx.Locale.Tr "repo.issues.label_exclusive_warning"}} </div> - <br> + <div class="field label-exclusive-order-input-field tw-mt-2"> + <label class="flex-text-block"> + {{ctx.Locale.Tr "repo.issues.label_exclusive_order"}} + <span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.label_exclusive_order_tooltip"}}">{{svg "octicon-info"}}</span> + </label> + <input class="label-exclusive-order-input" name="exclusive_order" type="number" maxlength="4"> + </div> </div> <div class="field label-is-archived-input-field"> <div class="ui checkbox"> @@ -44,7 +50,8 @@ <div class="field"> <label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label> <div class="column js-color-picker-input"> - <input name="color" value="#70c24a"placeholder="#c320f6" required maxlength="7"> + <!-- the "#" is optional because backend NormalizeColor is able to handle it, API also accepts both formats, and it is easier for users to directly copy-paste a hex value --> + <input name="color" value="#70c24a" placeholder="#c320f6" required pattern="^#?([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$" maxlength="7"> {{template "repo/issue/label_precolors"}} </div> </div> diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl index 822567301e..c8a6b46cc4 100644 --- a/templates/repo/issue/labels/label_list.tmpl +++ b/templates/repo/issue/labels/label_list.tmpl @@ -26,7 +26,7 @@ <div class="divider"></div> {{end}} - <ul class="issue-label-list"> + <ul class="issue-label-list muted-links"> {{$canEditLabel := and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}} {{$canEditLabel = or $canEditLabel $.PageIsOrgSettingsLabels}} {{range .Labels}} @@ -42,34 +42,31 @@ <a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> {{end}} </div> - <div class="label-operation tw-flex"> + <div class="label-operation"> {{template "repo/issue/labels/label_archived" .}} - <div class="tw-flex tw-ml-auto"> {{if $canEditLabel}} <a class="edit-label-button" href="#" data-label-id="{{.ID}}" data-label-name="{{.Name}}" data-label-color="{{.Color}}" data-label-exclusive="{{.Exclusive}}" data-label-is-archived="{{gt .ArchivedUnix 0}}" data-label-num-issues="{{.NumIssues}}" data-label-description="{{.Description}}" + data-label-exclusive-order="{{.ExclusiveOrder}}" >{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a> <a class="link-action" href="#" data-url="{{$.Link}}/delete?id={{.ID}}" data-modal-confirm-header="{{ctx.Locale.Tr "repo.issues.label_deletion"}}" data-modal-confirm-content="{{ctx.Locale.Tr "repo.issues.label_deletion_desc"}}" >{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a> {{end}} - </div> </div> </li> {{end}} {{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 01b610b39d..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> @@ -40,7 +41,7 @@ <div class="ui compact tiny secondary menu"> <span class="item" data-tooltip-content='{{ctx.Locale.Tr "tracked_time_summary"}}'> {{svg "octicon-clock"}} - {{.TotalTrackedTime | Sec2Time}} + {{.TotalTrackedTime | Sec2Hour}} </span> </div> {{end}} diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index 4fc6057117..591820080f 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -3,10 +3,10 @@ {{template "repo/header" .}} <div class="ui container"> {{template "base/alert" .}} - <div class="tw-flex"> - <h1 class="tw-mb-2">{{.Milestone.Name}}</h1> + <div class="flex-text-block tw-flex-wrap tw-mb-2"> + <h1 class="tw-flex-1 tw-m-0">{{.Milestone.Name}}</h1> {{if not .Repository.IsArchived}} - <div class="text right tw-flex-1"> + <div> {{if or .CanWriteIssues .CanWritePulls}} {{if .Milestone.IsClosed}} <a class="ui primary basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{ctx.Locale.Tr "repo.milestones.open"}} @@ -22,14 +22,14 @@ {{end}} </div> {{if .Milestone.RenderedContent}} - <div class="markup content tw-mb-4"> + <div class="render-content markup tw-mb-4"> {{.Milestone.RenderedContent}} </div> {{end}} <div class="tw-flex tw-flex-col tw-gap-2"> <progress class="milestone-progress-big" value="{{.Milestone.Completeness}}" max="100"></progress> - <div class="tw-flex tw-gap-4"> - <div classs="tw-flex tw-items-center"> + <div class="flex-text-block tw-gap-4"> + <div class="flex-text-inline"> {{$closedDate:= DateUtils.TimeSince .Milestone.ClosedDateUnix}} {{if .IsClosed}} {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} @@ -46,11 +46,11 @@ {{end}} {{end}} </div> - <div class="tw-mr-2">{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness}}</div> + <div>{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness}}</div> {{if .TotalTrackedTime}} <div data-tooltip-content='{{ctx.Locale.Tr "tracked_time_summary"}}'> {{svg "octicon-clock"}} - {{.TotalTrackedTime | Sec2Time}} + {{.TotalTrackedTime | Sec2Hour}} </div> {{end}} </div> diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl index 4809149a21..9bcced6f54 100644 --- a/templates/repo/issue/milestone_new.tmpl +++ b/templates/repo/issue/milestone_new.tmpl @@ -44,7 +44,7 @@ "TextareaPlaceholder" (ctx.Locale.Tr "repo.milestones.desc") )}} </div> - <div class="tw-text-right"> + <div class="flex-text-block tw-justify-end"> {{if .PageIsEditMilestone}} <a class="ui primary basic button" href="{{.RepoLink}}/milestones"> {{ctx.Locale.Tr "repo.milestones.cancel"}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 9515acfb8e..5701c1faa6 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -41,7 +41,7 @@ {{if .TotalTrackedTime}} <div class="flex-text-block"> {{svg "octicon-clock"}} - {{.TotalTrackedTime|Sec2Time}} + {{.TotalTrackedTime|Sec2Hour}} </div> {{end}} {{if .UpdatedUnix}} @@ -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..9413200870 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="flex-text-block tw-justify-end"> <button class="ui primary button"> {{if .PageIsComparePull}} {{ctx.Locale.Tr "repo.pulls.create"}} diff --git a/templates/repo/issue/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/search.tmpl b/templates/repo/issue/search.tmpl index 07732ab5e7..de6c194ee8 100644 --- a/templates/repo/issue/search.tmpl +++ b/templates/repo/issue/search.tmpl @@ -8,6 +8,7 @@ <input type="hidden" name="project" value="{{$.ProjectID}}"> <input type="hidden" name="assignee" value="{{$.AssigneeID}}"> <input type="hidden" name="poster" value="{{$.PosterUsername}}"> + <input type="hidden" name="sort" value="{{$.SortType}}"> {{end}} {{template "shared/search/input" dict "Value" .Keyword}} {{if .PageIsIssueList}} diff --git a/templates/repo/issue/sidebar/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 4fe8043f34..1d2279a45d 100644 --- a/templates/repo/issue/sidebar/assignee_list.tmpl +++ b/templates/repo/issue/sidebar/assignee_list.tmpl @@ -6,8 +6,8 @@ {{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/assignee?issue_ids={{$pageMeta.Issue.ID}}"{{end}} > <input class="combo-value" name="assignee_ids" type="hidden" value="{{$data.SelectedAssigneeIDs}}"> - <div class="ui dropdown {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> - <a class="text muted"> + <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> + <a class="fixed-text muted"> <strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}} </a> <div class="menu"> @@ -15,8 +15,9 @@ <i class="icon">{{svg "octicon-search" 16}}</i> <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}"> </div> - <div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div> <div class="scrolling menu flex-items-block"> + <div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div> + <div class="divider"></div> {{range $data.CandidateAssignees}} <a class="item" href="#" data-value="{{.ID}}"> <span class="item-check-mark">{{svg "octicon-check"}}</span> @@ -26,7 +27,7 @@ </div> </div> </div> - <div class="ui list muted-links flex-items-block tw-flex tw-flex-col tw-gap-2"> + <div class="ui relaxed list muted-links flex-items-block"> <span class="item empty-list {{if $issueAssignees}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}</span> {{range $issueAssignees}} <a class="item" href="{{$pageMeta.RepoLink}}/{{if $pageMeta.IsPullRequest}}pulls{{else}}issues{{end}}?assignee={{.ID}}"> diff --git a/templates/repo/issue/sidebar/issue_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..8876a5054e 100644 --- a/templates/repo/issue/sidebar/issue_management.tmpl +++ b/templates/repo/issue/sidebar/issue_management.tmpl @@ -1,6 +1,7 @@ {{if and .IsRepoAdmin (not .Repository.IsArchived)}} <div class="divider"></div> + {{/* Pin issue */}} {{if or .PinEnabled .Issue.IsPinned}} <form class="tw-mt-1 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.max_pinned"}}"{{end}}> {{$.CsrfTokenHtml}} @@ -16,16 +17,15 @@ </form> {{end}} - <button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock"> + {{/* Lock/unlock conversation */}} + <button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock-conversation"> {{if .Issue.IsLocked}} - {{svg "octicon-key"}} - {{ctx.Locale.Tr "repo.issues.unlock"}} + {{svg "octicon-key"}} {{ctx.Locale.Tr "repo.issues.unlock"}} {{else}} - {{svg "octicon-lock"}} - {{ctx.Locale.Tr "repo.issues.lock"}} + {{svg "octicon-lock"}} {{ctx.Locale.Tr "repo.issues.lock"}} {{end}} </button> - <div class="ui tiny modal" id="lock"> + <div class="ui tiny modal" id="lock-conversation"> <div class="header"> {{if .Issue.IsLocked}} {{ctx.Locale.Tr "repo.issues.unlock.title"}} @@ -45,29 +45,20 @@ {{end}} </div> - <form class="ui form form-fetch-action" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}" - method="post"> + <form class="ui form form-fetch-action" method="post" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"> {{.CsrfTokenHtml}} {{if not .Issue.IsLocked}} <div class="field"> - <strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong> + <strong>{{ctx.Locale.Tr "repo.issues.lock.reason"}}</strong> </div> <div class="field"> <div class="ui fluid dropdown selection"> - - <select name="reason"> - <option value=""> </option> - {{range .LockReasons}} - <option value="{{.}}">{{.}}</option> - {{end}} - </select> - {{svg "octicon-triangle-down" 14 "dropdown icon"}} - - <div class="default text"> </div> - + <input type="hidden" name="reason"> + <div class="text"></div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> + <div class="item" data-value=""></div> {{range .LockReasons}} <div class="item" data-value="{{.}}">{{.}}</div> {{end}} @@ -76,9 +67,10 @@ </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"> + {{/* explicitly focus the submit button, to avoid Fomantic modal focuses and popups the dropdown */}} + <button class="ui red button" autofocus> {{if .Issue.IsLocked}} {{ctx.Locale.Tr "repo.issues.unlock_confirm"}} {{else}} diff --git a/templates/repo/issue/sidebar/label_list.tmpl b/templates/repo/issue/sidebar/label_list.tmpl index 9dd83ba188..15c8760d1a 100644 --- a/templates/repo/issue/sidebar/label_list.tmpl +++ b/templates/repo/issue/sidebar/label_list.tmpl @@ -4,8 +4,8 @@ {{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/labels?issue_ids={{$pageMeta.Issue.ID}}"{{end}} > <input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}"> - <div class="ui dropdown {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> - <a class="text muted"> + <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> + <a class="fixed-text muted"> <strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}} </a> <div class="menu"> @@ -16,8 +16,9 @@ <i class="icon">{{svg "octicon-search" 16}}</i> <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}"> </div> - <a class="item clear-selection" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a> <div class="scrolling menu"> + <a class="item clear-selection" data-text="" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a> + <div class="divider"></div> {{$previousExclusiveScope := "_no_scope"}} {{range $data.RepoLabels}} {{$exclusiveScope := .ExclusiveScope}} @@ -42,7 +43,7 @@ </div> </div> - <div class="ui list labels-list tw-my-2 tw-flex tw-gap-2"> + <div class="ui list labels-list"> <span class="item empty-list {{if $data.SelectedLabelIDs}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span> {{range $data.AllLabels}} {{if .IsChecked}} diff --git a/templates/repo/issue/sidebar/milestone_list.tmpl b/templates/repo/issue/sidebar/milestone_list.tmpl index 18a16dd9a6..5bc961ed3c 100644 --- a/templates/repo/issue/sidebar/milestone_list.tmpl +++ b/templates/repo/issue/sidebar/milestone_list.tmpl @@ -6,8 +6,8 @@ {{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/milestone?issue_ids={{$pageMeta.Issue.ID}}"{{end}} > <input class="combo-value" name="milestone_id" type="hidden" value="{{$data.SelectedMilestoneID}}"> - <div class="ui dropdown {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> - <a class="text muted"> + <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> + <a class="fixed-text muted"> <strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}} </a> <div class="menu"> @@ -18,9 +18,9 @@ <i class="icon">{{svg "octicon-search"}}</i> <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}"> </div> - <div class="divider"></div> - <div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div> <div class="scrolling menu"> + <div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div> + <div class="divider"></div> {{if $data.OpenMilestones}} <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div> {{range $data.OpenMilestones}} diff --git a/templates/repo/issue/sidebar/project_list.tmpl b/templates/repo/issue/sidebar/project_list.tmpl index 39feb089ef..a212261a22 100644 --- a/templates/repo/issue/sidebar/project_list.tmpl +++ b/templates/repo/issue/sidebar/project_list.tmpl @@ -6,8 +6,8 @@ {{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/projects?issue_ids={{$pageMeta.Issue.ID}}"{{end}} > <input class="combo-value" name="project_id" type="hidden" value="{{$data.SelectedProjectID}}"> - <div class="ui dropdown {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> - <a class="text muted"> + <div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}"> + <a class="fixed-text muted"> <strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}} </a> <div class="menu"> @@ -17,8 +17,9 @@ <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}"> </div> {{end}} - <div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div> <div class="scrolling menu"> + <div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div> + <div class="divider"></div> {{if $data.OpenProjects}} <div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div> {{range $data.OpenProjects}} 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..2b5ca80fe7 100644 --- a/templates/repo/issue/sidebar/reviewer_list.tmpl +++ b/templates/repo/issue/sidebar/reviewer_list.tmpl @@ -6,8 +6,8 @@ {{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/request_review?issue_ids={{$pageMeta.Issue.ID}}"{{end}} > <input type="hidden" class="combo-value" name="reviewer_ids">{{/* match CreateIssueForm */}} - <div class="ui dropdown {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}"> - <a class="text muted"> + <div class="ui dropdown full-width {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}"> + <a class="fixed-text muted"> <strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}} </a> <div class="menu flex-items-menu"> @@ -43,7 +43,7 @@ </div> </div> - <div class="ui relaxed list flex-items-block tw-my-4"> + <div class="ui relaxed list flex-items-block"> <span class="item empty-list {{if or $data.OriginalReviews $data.CurrentPullReviewers}}tw-hidden{{end}}"> {{ctx.Locale.Tr "repo.issues.new.no_reviewers"}} </span> @@ -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 f107dc5ef5..ab8600b068 100644 --- a/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl +++ b/templates/repo/issue/sidebar/stopwatch_timetracker.tmpl @@ -2,10 +2,13 @@ {{if and .CanUseTimetracker (not .Repository.IsArchived)}} <div class="divider"></div> <div> - <div class="ui dropdown jump"> - <a class="text muted"> - <strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong> {{svg "octicon-gear"}} - {{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}} + <div class="ui dropdown full-width jump"> + <a class="fixed-text muted"> + <div> + <strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong> + {{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}} + </div> + {{svg "octicon-gear"}} </a> <div class="menu"> <a class="item issue-set-time-estimate show-modal" data-modal="#issue-time-set-estimate-modal"> @@ -13,14 +16,14 @@ </a> <div class="divider"></div> {{if $.IsStopwatchRunning}} - <a class="item issue-stop-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/toggle"> + <a class="item issue-stop-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/stop"> {{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_stop"}} </a> <a class="item issue-cancel-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/cancel"> {{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_discard"}} </a> {{else}} - <a class="item issue-start-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/toggle"> + <a class="item issue-start-time link-action" data-url="{{.Issue.Link}}/times/stopwatch/start"> {{svg "octicon-stopwatch"}} {{ctx.Locale.Tr "repo.issues.timetracker_timer_start"}} </a> <a class="item issue-add-time show-modal" data-modal="#issue-time-manually-add-modal"> @@ -72,7 +75,7 @@ {{end}} {{if .WorkingUsers}} <div class="ui comments tw-mt-2"> - {{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time)}} + {{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Hour)}} <div> {{range $user, $trackedtime := .WorkingUsers}} <div class="comment tw-mt-2"> @@ -82,7 +85,7 @@ <div class="content"> {{template "shared/user/authorlink" $user}} <div class="text"> - {{$trackedtime|Sec2Time}} + {{$trackedtime|Sec2Hour}} </div> </div> </div> diff --git a/templates/repo/issue/sidebar/wip_switch.tmpl b/templates/repo/issue/sidebar/wip_switch.tmpl index 06a3be0d8f..8c40908f62 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 data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title"> + {{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}} + </a> {{end}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 1a68781ecd..dae3c4ee6a 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -13,7 +13,7 @@ </a> {{end}} <div class="content comment-container"> - <div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between" role="heading" aria-level="3"> + <div class="comment-header" role="heading" aria-level="3"> <div class="comment-header-left tw-flex tw-items-center"> {{if .Issue.OriginalAuthor}} <span class="text black tw-font-semibold"> @@ -68,7 +68,7 @@ {{template "repo/issue/view_content/comments" .}} {{if and .Issue.IsPull (not $.Repository.IsArchived)}} - {{template "repo/issue/view_content/pull".}} + {{template "repo/issue/view_content/pull_merge_box".}} {{end}} {{if .IsSigned}} @@ -83,7 +83,7 @@ {{template "repo/issue/comment_tab" .}} {{.CsrfTokenHtml}} <div class="field footer"> - <div class="text right"> + <div class="flex-text-block tw-justify-end"> {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}} {{if .Issue.IsClosed}} <button id="status-button" class="ui primary basic button" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen"> @@ -157,7 +157,7 @@ {{end}} <div class="field"> - <div class="text right edit"> + <div class="flex-text-block tw-justify-end"> <button type="button" class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> <button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button> </div> diff --git a/templates/repo/issue/view_content/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/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl index 2155f78656..e865050559 100644 --- a/templates/repo/issue/view_content/attachments.tmpl +++ b/templates/repo/issue/view_content/attachments.tmpl @@ -31,7 +31,7 @@ {{if FilenameIsImage .Name}} {{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}} <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}"> - <img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}"> + <img loading="lazy" alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}"> </a> {{end}} {{end}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 2e1a67edcc..50b8f58fc3 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -26,7 +26,7 @@ </a> {{end}} <div class="content comment-container"> - <div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between" role="heading" aria-level="3"> + <div class="comment-header" role="heading" aria-level="3"> <div class="comment-header-left tw-flex tw-items-center"> {{if .OriginalAuthor}} <span class="text black tw-font-semibold tw-mr-1"> @@ -163,12 +163,13 @@ </span> <div class="detail flex-text-block"> {{svg "octicon-git-commit"}} + {{/* the content is a link like <a href="{RepoLink}/commit/{CommitID}">message title</a> (from CreateRefComment) */}} <span class="text grey muted-links">{{.Content | SanitizeHTML}}</span> </div> </div> {{else if eq .Type 7}} {{if or .AddedLabels .RemovedLabels}} - <div class="timeline-item event" id="{{.HashTag}}"> + <div class="timeline-item event with-labels-list-inline" id="{{.HashTag}}"> <span class="badge">{{svg "octicon-tag"}}</span> {{template "shared/user/avatarlink" dict "user" .Poster}} <span class="text grey muted-links"> @@ -252,7 +253,7 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} {{$timeStr := .RenderedContent}} {{/* compatibility with time comments made before v1.21 */}} - {{if not $timeStr}}{{$timeStr = .Content|Sec2Time}}{{end}} + {{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}} {{ctx.Locale.Tr "repo.issues.stop_tracking_history" $timeStr $createdStr}} </span> {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} @@ -264,7 +265,7 @@ <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} {{$timeStr := .RenderedContent}} {{/* compatibility with time comments made before v1.21 */}} - {{if not $timeStr}}{{$timeStr = .Content|Sec2Time}}{{end}} + {{if not $timeStr}}{{$timeStr = .Content|Sec2Hour}}{{end}} {{ctx.Locale.Tr "repo.issues.add_time_history" $timeStr $createdStr}} </span> {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} @@ -393,7 +394,7 @@ {{if or .Content .Attachments}} <div class="timeline-item comment"> <div class="content comment-container"> - <div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between"> + <div class="comment-header"> <div class="comment-header-left tw-flex tw-items-center"> {{if gt .Poster.ID 0}} <a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}"> @@ -506,7 +507,7 @@ {{/* compatibility with time comments made before v1.21 */}} <span class="text grey muted-links">{{.RenderedContent}}</span> {{else}} - <span class="text grey muted-links">- {{.Content|Sec2Time}}</span> + <span class="text grey muted-links">- {{.Content|Sec2Hour}}</span> {{end}} </div> </div> @@ -615,7 +616,7 @@ <div class="timeline-item-group"> <div class="timeline-item event" id="{{.HashTag}}"> <a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}> - <img src="{{.Poster.AvatarLink ctx}}" width="40" height="40"> + <img loading="lazy" alt src="{{.Poster.AvatarLink ctx}}" width="40" height="40"> </a> <span class="badge grey">{{svg "octicon-x" 16}}</span> <span class="text grey muted-links"> @@ -633,8 +634,8 @@ </div> {{if .Content}} <div class="timeline-item comment"> - <div class="content"> - <div class="ui top attached header comment-header-left tw-flex tw-items-center arrow-top"> + <div class="content comment-container"> + <div class="comment-header arrow-top"> {{if gt .Poster.ID 0}} <a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}"> {{ctx.AvatarUtils.Avatar .Poster 24}} @@ -644,7 +645,7 @@ {{ctx.Locale.Tr "action.review_dismissed_reason"}} </span> </div> - <div class="ui attached segment"> + <div class="ui attached segment comment-body"> <div class="render-content markup"> {{if .RenderedContent}} {{.RenderedContent}} diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl index 14803298b8..aa94a2dbc4 100644 --- a/templates/repo/issue/view_content/conversation.tmpl +++ b/templates/repo/issue/view_content/conversation.tmpl @@ -17,7 +17,7 @@ </div> <div> {{if or $invalid $resolved}} - <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if not $resolved}}tw-hidden {{end}}ui compact labeled button show-outdated tw-flex tw-items-center"> + <button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if not $resolved}}tw-hidden{{end}} btn tiny show-outdated"> {{svg "octicon-unfold" 16 "tw-mr-2"}} {{if $resolved}} {{ctx.Locale.Tr "repo.issues.review.show_resolved"}} @@ -25,7 +25,7 @@ {{ctx.Locale.Tr "repo.issues.review.show_outdated"}} {{end}} </button> - <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if $resolved}}tw-hidden {{end}}ui compact labeled button hide-outdated tw-flex tw-items-center"> + <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if $resolved}}tw-hidden {{end}} btn tiny hide-outdated"> {{svg "octicon-fold" 16 "tw-mr-2"}} {{if $resolved}} {{ctx.Locale.Tr "repo.issues.review.hide_resolved"}} @@ -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> @@ -57,7 +57,7 @@ {{$createdSubStr:= DateUtils.TimeSince .CreatedUnix}} <div class="comment code-comment" id="{{.HashTag}}"> <div class="content comment-container"> - <div class="header comment-header"> + <div class="comment-header"> <div class="comment-header-left tw-flex tw-items-center"> {{if not .OriginalAuthor}} <a class="avatar"> @@ -109,7 +109,7 @@ </div> {{end}} </div> - <div class="code-comment-buttons tw-flex tw-items-center tw-flex-wrap tw-mt-2 tw-mb-1 tw-mx-2"> + <div class="flex-text-block tw-flex-wrap tw-my-2"> <div class="tw-flex-1"> {{if $resolved}} <div class="ui grey text"> @@ -118,7 +118,7 @@ </div> {{end}} </div> - <div class="code-comment-buttons-buttons"> + <div class="flex-text-block"> {{if and $.CanMarkConversation $hasReview (not $isReviewPending)}} <button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> {{if $resolved}} @@ -129,8 +129,8 @@ </button> {{end}} {{if and $.SignedUserID (not $.Repository.IsArchived)}} - <button class="comment-form-reply ui primary tiny labeled icon button tw-ml-1 tw-mr-0"> - {{svg "octicon-reply" 16 "reply icon tw-mr-1"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}} + <button class="comment-form-reply ui primary icon tiny button"> + {{svg "octicon-reply" 12}}{{ctx.Locale.Tr "repo.diff.comment.reply"}} </button> {{end}} </div> diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull_merge_box.tmpl index 7c53c5edb5..46bcd3b8b3 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull_merge_box.tmpl @@ -1,7 +1,13 @@ {{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}} {{/* Then the merge box will not be displayed because this page already contains enough information */}} {{else}} -<div class="timeline-item comment merge box"> +<div class="timeline-item comment pull-merge-box" + data-global-init="initRepoPullMergeBox" + {{if .PullMergeBoxReloadingInterval}} + data-pull-merge-box-reloading-interval="{{.PullMergeBoxReloadingInterval}}" + data-pull-link="{{.Issue.Link}}" + {{end}} +> <div class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple {{- else if .Issue.IsClosed}}grey {{- else if .IsPullWorkInProgress}}grey @@ -83,13 +89,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" data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title"> {{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}} </button> {{end}} @@ -97,7 +103,7 @@ {{template "repo/issue/view_content/update_branch_by_merge" $}} {{else if .Issue.PullRequest.IsChecking}} <div class="item"> - {{svg "octicon-sync"}} + {{svg "octicon-sync" 16 "circular-spin"}} {{ctx.Locale.Tr "repo.pulls.is_checking"}} </div> {{else if .Issue.PullRequest.IsAncestor}} @@ -191,10 +197,11 @@ </div> {{end}} {{end}} + {{template "repo/issue/view_content/update_branch_by_merge" $}} + {{if .Issue.PullRequest.IsEmpty}} <div class="divider"></div> - <div class="item"> {{svg "octicon-alert"}} {{ctx.Locale.Tr "repo.pulls.is_empty"}} @@ -216,7 +223,7 @@ const defaultMergeMessage = {{.DefaultMergeBody}}; const defaultSquashMergeMessage = {{.DefaultSquashMergeBody}}; const mergeForm = { - 'baseLink': {{.Link}}, + 'baseLink': {{.Issue.Link}}, 'textCancel': {{ctx.Locale.Tr "cancel"}}, 'textDeleteBranch': {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}}, 'textAutoMergeButtonWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_button_when_succeed"}}, @@ -318,7 +325,7 @@ {{if .IsBlockedByApprovals}} <div class="item text red"> {{svg "octicon-x"}} - {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} </div> {{else if .IsBlockedByRejection}} <div class="item text red"> @@ -377,7 +384,7 @@ */}} {{if and $.StillCanManualMerge (not $showGeneralMergeForm)}} <div class="divider"></div> - <form class="ui form form-fetch-action" action="{{.Link}}/merge" method="post">{{/* another similar form is in PullRequestMergeForm.vue*/}} + <form class="ui form form-fetch-action" action="{{.Issue.Link}}/merge" method="post">{{/* another similar form is in PullRequestMergeForm.vue*/}} {{.CsrfTokenHtml}} <div class="field"> <input type="text" name="merge_commit_id" placeholder="{{ctx.Locale.Tr "repo.pulls.merge_commit_id"}}"> diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl index 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..0b28bdc811 100644 --- a/templates/repo/issue/view_content/reference_issue_dialog.tmpl +++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl @@ -7,7 +7,7 @@ {{.CsrfTokenHtml}} <div class="field"> <label><strong>{{ctx.Locale.Tr "repository"}}</strong></label> - <div class="ui search selection dropdown issue_reference_repository_search ellipsis-items-nowrap"> + <div class="ui search selection dropdown issue_reference_repository_search ellipsis-text-items"> <div class="default text gt-ellipsis">{{.Repository.FullName}}</div> <div class="menu"></div> </div> @@ -20,7 +20,7 @@ <label><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></label> <textarea name="content"></textarea> </div> - <div class="text right"> + <div class="flex-text-block tw-justify-end"> <button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button> </div> </form> diff --git a/templates/repo/issue/view_content/update_branch_by_merge.tmpl b/templates/repo/issue/view_content/update_branch_by_merge.tmpl index adce052dee..5d959bf0b3 100644 --- a/templates/repo/issue/view_content/update_branch_by_merge.tmpl +++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl @@ -8,8 +8,8 @@ <div class="item-section-right"> {{if and $.UpdateAllowed $.UpdateByRebaseAllowed}} <div class="tw-inline-block"> - <div class="ui buttons update-button"> - <button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}"> + <div id="update-pr-branch-with-base" class="ui buttons"> + <button class="ui button" data-do="{{$.Issue.Link}}/update" data-redirect="{{$.Issue.Link}}"> <span class="button-text"> {{ctx.Locale.Tr "repo.pulls.update_branch"}} </span> @@ -17,15 +17,15 @@ <div class="ui dropdown icon button"> {{svg "octicon-triangle-down"}} <div class="menu"> - <a class="item active selected" data-do="{{$.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a> - <a class="item" data-do="{{$.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a> + <a class="item active selected" data-do="{{$.Issue.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a> + <a class="item" data-do="{{$.Issue.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a> </div> </div> </div> </div> {{end}} {{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}} - <form action="{{$.Link}}/update" method="post" class="ui update-branch-form"> + <form action="{{$.Issue.Link}}/update" method="post" class="ui update-branch-form"> {{$.CsrfTokenHtml}} <button class="ui compact button"> <span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span> diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index dcc1f48c2c..b8f28dfd9b 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -13,7 +13,7 @@ {{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} <div class="issue-title" id="issue-title-display"> <h1 class="tw-break-anywhere"> - {{ctx.RenderUtils.RenderIssueTitle .Issue.Title ($.Repository.ComposeMetas ctx)}} + {{ctx.RenderUtils.RenderIssueTitle .Issue.Title $.Repository}} <span class="index">#{{.Issue.Index}}</span> </h1> <div class="issue-title-buttons"> diff --git a/templates/repo/latest_commit.tmpl b/templates/repo/latest_commit.tmpl index c62efc8e88..cff338949f 100644 --- a/templates/repo/latest_commit.tmpl +++ b/templates/repo/latest_commit.tmpl @@ -21,10 +21,10 @@ {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses}} {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}} - <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .LatestCommit.Message $commitLink ($.Repository.ComposeMetas ctx)}}</span> + <span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .LatestCommit.Message $commitLink $.Repository}}</span> {{if IsMultilineCommitMessage .LatestCommit.Message}} - <button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button> - <pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .LatestCommit.Message ($.Repository.ComposeMetas ctx)}}</pre> + <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}}</pre> {{end}} </span> {{end}} diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl index d4ca269f02..f4de8ff236 100644 --- a/templates/repo/migrate/codebase.tmpl +++ b/templates/repo/migrate/codebase.tmpl @@ -60,22 +60,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/codecommit.tmpl b/templates/repo/migrate/codecommit.tmpl index 53ca7dda3d..275a2aef09 100644 --- a/templates/repo/migrate/codecommit.tmpl +++ b/templates/repo/migrate/codecommit.tmpl @@ -61,22 +61,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl index 3f447f76eb..41139d4fd6 100644 --- a/templates/repo/migrate/git.tmpl +++ b/templates/repo/migrate/git.tmpl @@ -34,22 +34,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar .}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl index 559988951b..c89aa6c744 100644 --- a/templates/repo/migrate/gitbucket.tmpl +++ b/templates/repo/migrate/gitbucket.tmpl @@ -76,22 +76,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl index 3d692129d5..55cf61a77f 100644 --- a/templates/repo/migrate/gitea.tmpl +++ b/templates/repo/migrate/gitea.tmpl @@ -72,22 +72,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar .}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl index 850a2b3c71..86b585b861 100644 --- a/templates/repo/migrate/github.tmpl +++ b/templates/repo/migrate/github.tmpl @@ -74,22 +74,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl index 9bafa122f1..edd69f0027 100644 --- a/templates/repo/migrate/gitlab.tmpl +++ b/templates/repo/migrate/gitlab.tmpl @@ -71,22 +71,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl index 0495ce67fb..9149c43239 100644 --- a/templates/repo/migrate/gogs.tmpl +++ b/templates/repo/migrate/gogs.tmpl @@ -74,22 +74,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar .}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl index c5c697edff..79ac5cc8a1 100644 --- a/templates/repo/migrate/migrate.tmpl +++ b/templates/repo/migrate/migrate.tmpl @@ -19,7 +19,7 @@ <div class="header tw-text-center"> {{.Title}} </div> - <div class="description tw-text-center"> + <div class="description tw-text-center tw-text-balance"> {{ctx.Locale.Tr (printf "repo.migrate.%s.description" .Name)}} </div> </div> diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl index bc07b488f2..e73e3a9790 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"> + <img alt 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"> + <img alt 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/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl index 55945154ef..a25ccf9438 100644 --- a/templates/repo/migrate/onedev.tmpl +++ b/templates/repo/migrate/onedev.tmpl @@ -61,22 +61,22 @@ <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu" title="{{.SignedUser.Name}}"> - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> + <div class="item" data-value="{{.SignedUser.ID}}"> {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> diff --git a/templates/repo/navbar.tmpl b/templates/repo/navbar.tmpl index b2471dc17e..e004c5254b 100644 --- a/templates/repo/navbar.tmpl +++ b/templates/repo/navbar.tmpl @@ -1,14 +1,19 @@ +{{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}} + <div class="ui fluid vertical menu"> + {{/* the default activity page "pulse" could work with any permission: code, issue, pr, release*/}} <a class="{{if .PageIsPulse}}active {{end}}item" href="{{.RepoLink}}/activity"> {{ctx.Locale.Tr "repo.activity.navbar.pulse"}} </a> - <a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors"> - {{ctx.Locale.Tr "repo.activity.navbar.contributors"}} - </a> - <a class="{{if .PageIsCodeFrequency}}active{{end}} item" href="{{.RepoLink}}/activity/code-frequency"> - {{ctx.Locale.Tr "repo.activity.navbar.code_frequency"}} - </a> - <a class="{{if .PageIsRecentCommits}}active{{end}} item" href="{{.RepoLink}}/activity/recent-commits"> - {{ctx.Locale.Tr "repo.activity.navbar.recent_commits"}} - </a> + {{if $canReadCode}} + <a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors"> + {{ctx.Locale.Tr "repo.activity.navbar.contributors"}} + </a> + <a class="{{if .PageIsCodeFrequency}}active{{end}} item" href="{{.RepoLink}}/activity/code-frequency"> + {{ctx.Locale.Tr "repo.activity.navbar.code_frequency"}} + </a> + <a class="{{if .PageIsRecentCommits}}active{{end}} item" href="{{.RepoLink}}/activity/recent-commits"> + {{ctx.Locale.Tr "repo.activity.navbar.recent_commits"}} + </a> + {{end}} </div> diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index 05ad7264bf..1acaaf8b4b 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -2,14 +2,13 @@ <div role="main" aria-label="{{.Title}}" class="page-content repository projects view-project"> {{template "repo/header" .}} <div class="ui container padded"> - <div class="tw-flex tw-justify-between tw-items-center tw-mb-4"> - {{template "repo/issue/navbar" .}} + <div class="flex-text-block tw-justify-end tw-mb-4"> + <a class="ui small button" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a> + <a class="ui small button" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a> <a class="ui small primary button" href="{{.RepoLink}}/issues/new/choose?project={{.Project.ID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a> </div> </div> - <div class="ui container fluid padded"> - {{template "projects/view" .}} - </div> + {{template "projects/view" .}} </div> {{template "base/footer" .}} diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl index 879e5328f2..0d775ed6a0 100644 --- a/templates/repo/pulls/fork.tmpl +++ b/templates/repo/pulls/fork.tmpl @@ -6,28 +6,28 @@ </h3> <div class="ui attached segment"> {{template "base/alert" .}} - <form class="ui form left-right-form" action="{{.Link}}" method="post"> + <form class="ui form form-fetch-action left-right-form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="inline required field {{if .Err_Owner}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.owner"}}</label> - <div class="ui selection owner dropdown"> + <div class="ui selection owner dropdown ellipsis-text-items"> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> - <span class="text truncated-item-container" title="{{.ContextUser.Name}}"> + <span class="text" title="{{.ContextUser.Name}}"> {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + {{.ContextUser.ShortName 40}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> {{if .CanForkToUser}} - <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"> + <div class="item" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"> {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + {{.SignedUser.ShortName 40}} </div> {{end}} {{range .Orgs}} - <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> + <div class="item" data-value="{{.ID}}" title="{{.Name}}"> {{ctx.AvatarUtils.Avatar . 28 "mini"}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + {{.ShortName 40}} </div> {{end}} </div> @@ -52,10 +52,10 @@ </div> <div class="inline field"> <label>{{ctx.Locale.Tr "repo.fork_branch"}}</label> - <div class="ui selection dropdown ellipsis-items-nowrap"> + <div class="ui selection dropdown ellipsis-text-items"> <input type="hidden" id="fork_single_branch" name="fork_single_branch" value="" required> <div class="text" title="{{ctx.Locale.Tr "repo.all_branches"}}"> - <span class="truncated-item-name">{{ctx.Locale.Tr "repo.all_branches"}}</span> + {{ctx.Locale.Tr "repo.all_branches"}} </div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> @@ -75,7 +75,7 @@ <div class="inline field"> <label></label> - <button class="ui primary button{{if not .CanForkRepo}} disabled{{end}}"> + <button class="ui primary button{{if not .CanForkRepoInNewOwner}} disabled{{end}}"> {{ctx.Locale.Tr "repo.fork_repo"}} </button> </div> diff --git a/templates/repo/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..cbafee9ba9 100644 --- a/templates/repo/pulse.tmpl +++ b/templates/repo/pulse.tmpl @@ -1,12 +1,12 @@ <h2 class="ui header activity-header"> <span>{{DateUtils.AbsoluteLong .DateFrom}} - {{DateUtils.AbsoluteLong .DateUntil}}</span> <!-- Period --> - <div class="ui floating dropdown jump filter"> + <div class="ui floating dropdown jump"> <div class="ui basic compact button"> {{ctx.Locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> - <div class="menu"> + <div class="left menu"> <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{ctx.Locale.Tr "repo.activity.period.daily"}}</a> <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{ctx.Locale.Tr "repo.activity.period.halfweekly"}}</a> <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{ctx.Locale.Tr "repo.activity.period.weekly"}}</a> @@ -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..882ffe40b7 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") @@ -49,7 +50,11 @@ {{svg (MigrationIcon $release.Repo.GetOriginalURLHostname) 20 "tw-mr-1"}}{{$release.OriginalAuthor}} {{else if $release.Publisher}} {{ctx.AvatarUtils.Avatar $release.Publisher 20 "tw-mr-1"}} - <a href="{{$release.Publisher.HomeLink}}">{{$release.Publisher.GetDisplayName}}</a> + {{if gt $release.PublisherID 0}} + <a href="{{$release.Publisher.HomeLink}}">{{$release.Publisher.GetDisplayName}}</a> + {{else}} + {{$release.Publisher.GetDisplayName}} + {{end}} {{else}} Ghost {{end}} @@ -60,11 +65,11 @@ {{if $release.CreatedUnix}} <span class="time">{{DateUtils.TimeSince $release.CreatedUnix}}</span> {{end}} - {{if and (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}} + {{if and (gt $release.NumCommits 0) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}} | <span class="ahead"><a href="{{$.RepoLink}}/compare/{{$release.TagName | PathEscapeSegments}}...{{$release.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}}</span> {{end}} </p> - <div class="markup desc"> + <div class="render-content markup"> {{$release.RenderedNote}} </div> <div class="divider"></div> @@ -72,25 +77,31 @@ <summary> {{ctx.Locale.Tr "repo.release.downloads"}} </summary> - <ul class="list"> + <ul class="ui divided list attachment-list"> {{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}} - <li> - <a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong></a> + <li class="item"> + <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow"> + <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong> + </a> </li> - <li> - <a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a> + <li class="item"> + <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"> + <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong> + </a> </li> {{end}} - {{range $release.Attachments}} - <li> - <a target="_blank" rel="nofollow" href="{{.DownloadURL}}" download> - <strong>{{svg "octicon-package" 16 "download-icon"}}{{.Name}}</strong> + {{range $att := $release.Attachments}} + <li class="item"> + <a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}"> + <strong class="flex-text-inline">{{svg "octicon-package" 16 "download-icon"}}<span class="gt-ellipsis">{{$att.Name}}</span></strong> </a> - <div> - <span class="text grey">{{.Size | FileSize}}</span> - <span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}"> + <div class="attachment-right-info flex-text-inline"> + <span class="tw-pl-5">{{$att.Size | FileSize}}</span> + <span class="flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber $att.DownloadCount)}}"> {{svg "octicon-info"}} </span> + <div class="tw-flex-1"></div> + {{DateUtils.TimeSince $att.CreatedUnix}} </div> </li> {{end}} diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index 8b6aa252af..f61a8ef9e7 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -100,7 +100,7 @@ </div> <span class="help">{{ctx.Locale.Tr "repo.release.prerelease_helper"}}</span> <div class="divider tw-mt-0"></div> - <div class="tw-flex tw-justify-end"> + <div class="flex-text-block tw-justify-end"> {{if .PageIsEditRelease}} <a class="ui small button" href="{{.RepoLink}}/releases"> {{ctx.Locale.Tr "repo.release.cancel"}} diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl index fb17cf44c4..12acf4bfeb 100644 --- a/templates/repo/release_tag_header.tmpl +++ b/templates/repo/release_tag_header.tmpl @@ -2,7 +2,7 @@ {{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}} {{if $canReadReleases}} - <div class="tw-flex"> + <div class="flex-text-block"> <div class="tw-flex-1 tw-flex tw-items-center"> <h2 class="ui compact small menu small-menu-items"> <a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a> diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl index 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/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 4461398258..e941a2c4b6 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -63,13 +63,33 @@ {{.Name}} </a> <div class="flex-item-body flex-text-block"> + {{/*FIXME: TEAM-UNIT-PERMISSION this display is not right, search the fixme keyword to see more details */}} {{svg "octicon-shield-lock"}} - {{if eq .AccessMode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{ctx.Locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}} + {{if eq .AccessMode 0}} + {{ctx.Locale.Tr "repo.settings.collaboration.per_unit"}} + {{else if eq .AccessMode 1}} + {{ctx.Locale.Tr "repo.settings.collaboration.read"}} + {{else if eq .AccessMode 2}} + {{ctx.Locale.Tr "repo.settings.collaboration.write"}} + {{else if eq .AccessMode 3}} + {{ctx.Locale.Tr "repo.settings.collaboration.admin"}} + {{else if eq .AccessMode 4}} + {{ctx.Locale.Tr "repo.settings.collaboration.owner"}} + {{else}} + {{ctx.Locale.Tr "repo.settings.collaboration.undefined"}} + {{end}} </div> - {{if or (eq .AccessMode 1) (eq .AccessMode 2)}} + {{if or (eq .AccessMode 0) (eq .AccessMode 1) (eq .AccessMode 2)}} {{$first := true}} <div class="flex-item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}"> - Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled ctx $unit.Type) ($team.UnitEnabled ctx $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{ctx.Locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}} + Units: + {{range $u, $unit := $.Units}} + {{- if and ($.Repo.UnitEnabled ctx $unit.Type) ($team.UnitEnabled ctx $unit.Type) -}} + {{- Iif $first "" ", "}}{{ctx.Locale.Tr $unit.NameKey -}} + {{- $first = false -}} + {{- end -}} + {{end}} + {{if $first}}None{{end}} </div> {{end}} </div> @@ -90,7 +110,7 @@ <form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post"> {{.CsrfTokenHtml}} <div id="search-team-box" class="ui search input tw-align-middle" data-org-name="{{.OrgName}}"> - <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" autofocus required> + <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" required> </div> <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button> </form> diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl index 1a603f9fe8..9b17af1406 100644 --- a/templates/repo/settings/githooks.tmpl +++ b/templates/repo/settings/githooks.tmpl @@ -4,18 +4,14 @@ {{ctx.Locale.Tr "repo.settings.githooks"}} </h4> <div class="ui attached segment"> - <div class="ui list"> + <div class="ui list flex-items-block"> + <div class="item"><span>{{ctx.Locale.Tr "repo.settings.githooks_desc"}}</span></div> + {{range .Hooks}} <div class="item"> - {{ctx.Locale.Tr "repo.settings.githooks_desc"}} + <span class="text {{if .IsActive}}green{{else}}grey{{end}}">{{svg "octicon-dot-fill" 22}}</span> + <span class="gt-ellipsis tw-flex-1">{{.Name}}</span> + <a class="muted tw-p-2" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}">{{svg "octicon-pencil"}}</a> </div> - {{range .Hooks}} - <div class="item truncated-item-container"> - <span class="text {{if .IsActive}}green{{else}}grey{{end}} tw-mr-2">{{svg "octicon-dot-fill" 22}}</span> - <span class="text truncate tw-flex-1 tw-mr-2">{{.Name}}</span> - <a class="muted tw-float-right tw-p-2" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}"> - {{svg "octicon-pencil"}} - </a> - </div> {{end}} </div> </div> diff --git a/templates/repo/settings/lfs.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..cd1b168401 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}} @@ -21,7 +21,7 @@ {{else if not .IsTextFile}} <div class="view-raw"> {{if .IsImageFile}} - <img src="{{$.RawFileLink}}"> + <img loading="lazy" alt="{{$.RawFileLink}}" src="{{$.RawFileLink}}"> {{else if .IsVideoFile}} <video controls src="{{$.RawFileLink}}"> <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong> @@ -30,8 +30,6 @@ <audio controls src="{{$.RawFileLink}}"> <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong> </audio> - {{else if .IsPDFFile}} - <div class="pdf-content is-loading" data-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 cb596f013b..fc42056e0a 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -10,7 +10,7 @@ <input type="hidden" name="action" value="update"> <div class="required field {{if .Err_RepoName}}error{{end}}"> <label>{{ctx.Locale.Tr "repo.repo_name"}}</label> - <input name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required> + <input name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" required> </div> <div class="inline field"> <label>{{ctx.Locale.Tr "repo.repo_size"}}</label> @@ -40,8 +40,7 @@ <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data"> {{.CsrfTokenHtml}} <div class="inline field"> - <label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label> - <input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp"> + {{template "shared/avatar_upload_crop" dict "LabelText" (ctx.Locale.Tr "settings.choose_new_avatar")}} </div> <div class="field"> <button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button> @@ -118,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"> @@ -204,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" @@ -302,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}} @@ -338,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}}> @@ -383,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"> @@ -822,7 +802,7 @@ </div> </div> {{end}} - {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}} + {{if .CanConvertFork}} <div class="flex-item"> <div class="flex-item-main"> <div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div> @@ -928,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> @@ -936,7 +916,7 @@ </div> </div> {{end}} - {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}} + {{if .CanConvertFork}} <div class="ui small modal" id="convert-fork-repo-modal"> <div class="header"> {{ctx.Locale.Tr "repo.settings.convert_fork"}} @@ -959,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> @@ -996,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> @@ -1030,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> @@ -1090,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/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl index 61cc6077a1..3c311c18c3 100644 --- a/templates/repo/settings/protected_branch.tmpl +++ b/templates/repo/settings/protected_branch.tmpl @@ -2,13 +2,17 @@ <div class="repo-setting-content"> <form class="ui form" action="{{.Link}}" method="post"> <h4 class="ui top attached header"> - {{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}} + {{if .Rule.RuleName}} + {{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}} + {{else}} + {{ctx.Locale.Tr "repo.settings.branches.add_new_rule"}} + {{end}} </h4> <div class="ui attached segment branch-protection"> <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5> - <div class="field"> + <div class="field required"> <label>{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern"}}</label> - <input name="rule_name" type="text" value="{{.Rule.RuleName}}"> + <input name="rule_name" type="text" value="{{.Rule.RuleName}}" required> <input name="rule_id" type="hidden" value="{{.Rule.ID}}"> <p class="help tw-ml-0">{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern_desc" "https://github.com/gobwas/glob"}}</p> </div> diff --git a/templates/repo/settings/public_access.tmpl b/templates/repo/settings/public_access.tmpl new file mode 100644 index 0000000000..c1c198bcce --- /dev/null +++ b/templates/repo/settings/public_access.tmpl @@ -0,0 +1,54 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}} +<div class="repo-setting-content"> + <h4 class="ui top attached header"> + {{ctx.Locale.Tr "repo.settings.public_access"}} + </h4> + <div class="ui attached segment"> + <p> + {{ctx.Locale.Tr "repo.settings.public_access_desc"}} + </p> + {{$paNotSet := "not-set"}} + {{$paAnonymousRead := "anonymous-read"}} + {{$paEveryoneRead := "everyone-read"}} + {{$paEveryoneWrite := "everyone-write"}} + <form class="ui form" method="post"> + {{.CsrfTokenHtml}} + <table class="ui table unstackable tw-my-2"> + <thead> + <tr> + <th>{{ctx.Locale.Tr "units.unit"}}</th> + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_not_set"}}</th> + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_anonymous_read"}}</th> + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_everyone_read"}}</th> + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_everyone_write"}}</th> + </tr> + </thead> + <tbody> + {{range $ua := .RepoUnitPublicAccesses}} + <tr> + <td>{{$ua.DisplayName}}</td> + <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paNotSet}}" {{Iif (eq $paNotSet $ua.UnitPublicAccess) "checked"}}></label></td> + <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paAnonymousRead}}" {{Iif (eq $paAnonymousRead $ua.UnitPublicAccess) "checked"}}></label></td> + <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneRead}}" {{Iif (eq $paEveryoneRead $ua.UnitPublicAccess) "checked"}}></label></td> + <td class="tw-text-center"> + {{if SliceUtils.Contains $ua.PublicAccessTypes $paEveryoneWrite}} + <label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneWrite}}" {{Iif (eq $paEveryoneWrite $ua.UnitPublicAccess) "checked"}}></label> + {{else}} + - + {{end}} + </td> + </tr> + {{end}} + </tbody> + </table> + <ul class="tw-my-3 tw-pl-5 tw-flex tw-flex-col tw-gap-3"> + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.not_set"}}</li> + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.anonymous_read"}}</li> + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_read"}}</li> + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_write"}}</li> + </ul> + <button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> + </form> + </div> +</div> +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/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/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl index 36e75a7eb5..a63771b97e 100644 --- a/templates/repo/settings/webhook/base_list.tmpl +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -8,14 +8,12 @@ </div> </h4> <div class="ui attached segment"> - <div class="ui list"> - <div class="item"> - {{.Description}} - </div> + <div class="ui list flex-items-block"> + <div class="item"><span>{{.Description}}</span></div> {{range .Webhooks}} - <div class="item truncated-item-container"> - <span class="text {{if eq .LastStatus 1}}green{{else if eq .LastStatus 2}}red{{else}}grey{{end}} tw-mr-2">{{svg "octicon-dot-fill" 22}}</span> - <div class="text truncate tw-flex-1 tw-mr-2"> + <div class="item"> + <span class="text {{if eq .LastStatus 1}}green{{else if eq .LastStatus 2}}red{{else}}grey{{end}}">{{svg "octicon-dot-fill" 22}}</span> + <div class="gt-ellipsis tw-flex-1"> <a title="{{.URL}}" href="{{$.BaseLink}}/{{.ID}}">{{.URL}}</a> </div> <a class="muted tw-p-2" href="{{$.BaseLink}}/{{.ID}}">{{svg "octicon-pencil"}}</a> diff --git a/templates/repo/settings/webhook/settings.tmpl b/templates/repo/settings/webhook/settings.tmpl index cf3b0eb053..a330448c9e 100644 --- a/templates/repo/settings/webhook/settings.tmpl +++ b/templates/repo/settings/webhook/settings.tmpl @@ -31,7 +31,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="create" type="checkbox" {{if .Webhook.Create}}checked{{end}}> + <input name="create" type="checkbox" {{if .Webhook.HookEvents.Get "create"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_create"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_create_desc"}}</span> </div> @@ -41,7 +41,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="delete" type="checkbox" {{if .Webhook.Delete}}checked{{end}}> + <input name="delete" type="checkbox" {{if .Webhook.HookEvents.Get "delete"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_delete"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_delete_desc"}}</span> </div> @@ -51,7 +51,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="fork" type="checkbox" {{if .Webhook.Fork}}checked{{end}}> + <input name="fork" type="checkbox" {{if .Webhook.HookEvents.Get "fork"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_fork"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_fork_desc"}}</span> </div> @@ -61,7 +61,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="push" type="checkbox" {{if .Webhook.Push}}checked{{end}}> + <input name="push" type="checkbox" {{if .Webhook.HookEvents.Get "push"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_push"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_push_desc"}}</span> </div> @@ -71,7 +71,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="repository" type="checkbox" {{if .Webhook.Repository}}checked{{end}}> + <input name="repository" type="checkbox" {{if .Webhook.HookEvents.Get "repository"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_repository"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_repository_desc"}}</span> </div> @@ -81,7 +81,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="release" type="checkbox" {{if .Webhook.Release}}checked{{end}}> + <input name="release" type="checkbox" {{if .Webhook.HookEvents.Get "release"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_release"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_release_desc"}}</span> </div> @@ -91,7 +91,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="package" type="checkbox" {{if .Webhook.Package}}checked{{end}}> + <input name="package" type="checkbox" {{if .Webhook.HookEvents.Get "package"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_package"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_package_desc"}}</span> </div> @@ -102,13 +102,24 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="wiki" type="checkbox" {{if .Webhook.Wiki}}checked{{end}}> + <input name="wiki" type="checkbox" {{if .Webhook.HookEvents.Get "wiki"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_wiki"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_wiki_desc"}}</span> </div> </div> </div> + <!-- Status --> + <div class="seven wide column"> + <div class="field"> + <div class="ui checkbox"> + <input name="status" type="checkbox" {{if .Webhook.HookEvents.Get "status"}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.event_statuses"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_statuses_desc"}}</span> + </div> + </div> + </div> + <!-- Issue Events --> <div class="fourteen wide column"> <label>{{ctx.Locale.Tr "repo.settings.event_header_issue"}}</label> @@ -117,7 +128,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="issues" type="checkbox" {{if .Webhook.Issues}}checked{{end}}> + <input name="issues" type="checkbox" {{if .Webhook.HookEvents.Get "issues"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_issues"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_issues_desc"}}</span> </div> @@ -127,7 +138,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="issue_assign" type="checkbox" {{if .Webhook.IssueAssign}}checked{{end}}> + <input name="issue_assign" type="checkbox" {{if .Webhook.HookEvents.Get "issue_assign"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_issue_assign"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_assign_desc"}}</span> </div> @@ -137,7 +148,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="issue_label" type="checkbox" {{if .Webhook.IssueLabel}}checked{{end}}> + <input name="issue_label" type="checkbox" {{if .Webhook.HookEvents.Get "issue_label"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_issue_label"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_label_desc"}}</span> </div> @@ -147,7 +158,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="issue_milestone" type="checkbox" {{if .Webhook.IssueMilestone}}checked{{end}}> + <input name="issue_milestone" type="checkbox" {{if .Webhook.HookEvents.Get "issue_milestone"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_issue_milestone"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_milestone_desc"}}</span> </div> @@ -157,7 +168,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="issue_comment" type="checkbox" {{if .Webhook.IssueComment}}checked{{end}}> + <input name="issue_comment" type="checkbox" {{if .Webhook.HookEvents.Get "issue_comment"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_issue_comment"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_comment_desc"}}</span> </div> @@ -172,7 +183,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request" type="checkbox" {{if .Webhook.PullRequest}}checked{{end}}> + <input name="pull_request" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_desc"}}</span> </div> @@ -182,7 +193,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request_assign" type="checkbox" {{if .Webhook.PullRequestAssign}}checked{{end}}> + <input name="pull_request_assign" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request_assign"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_assign"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span> </div> @@ -192,7 +203,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request_label" type="checkbox" {{if .Webhook.PullRequestLabel}}checked{{end}}> + <input name="pull_request_label" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request_label"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_label"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_label_desc"}}</span> </div> @@ -202,7 +213,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request_milestone" type="checkbox" {{if .Webhook.PullRequestMilestone}}checked{{end}}> + <input name="pull_request_milestone" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request_milestone"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span> </div> @@ -212,7 +223,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request_comment" type="checkbox" {{if .Webhook.PullRequestComment}}checked{{end}}> + <input name="pull_request_comment" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request_comment"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_comment"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span> </div> @@ -222,7 +233,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request_review" type="checkbox" {{if .Webhook.PullRequestReview}}checked{{end}}> + <input name="pull_request_review" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request_review"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_desc"}}</span> </div> @@ -232,7 +243,7 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request_sync" type="checkbox" {{if .Webhook.PullRequestSync}}checked{{end}}> + <input name="pull_request_sync" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request_sync"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_sync"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span> </div> @@ -242,12 +253,36 @@ <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> - <input name="pull_request_review_request" type="checkbox" {{if .Webhook.PullRequestReviewRequest}}checked{{end}}> + <input name="pull_request_review_request" type="checkbox" {{if .Webhook.HookEvents.Get "pull_request_review_request"}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request"}}</label> <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span> </div> </div> </div> + <!-- Workflow Events --> + <div class="fourteen wide column"> + <label>{{ctx.Locale.Tr "repo.settings.event_header_workflow"}}</label> + </div> + <!-- Workflow Run Event --> + <div class="seven wide column"> + <div class="field"> + <div class="ui checkbox"> + <input name="workflow_run" type="checkbox" {{if .Webhook.HookEvents.Get "workflow_run"}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.event_workflow_run"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_workflow_run_desc"}}</span> + </div> + </div> + </div> + <!-- Workflow Job Event --> + <div class="seven wide column"> + <div class="field"> + <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> @@ -263,7 +298,7 @@ <label for="authorization_header">{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label> <input id="authorization_header" name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}"{{if eq .HookType "matrix"}} placeholder="Bearer $access_token" required{{end}}> {{if ne .HookType "matrix"}}{{/* Matrix doesn't make the authorization optional but it is implied by the help string, should be changed.*/}} - <span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" ("<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | SafeHTML)}}</span> + <span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" (HTMLFormat "<code>%s</code>, <code>%s</code>" "Bearer token123456" "Basic YWxhZGRpbjpvcGVuc2VzYW1l")}}</span> {{end}} </div> diff --git a/templates/repo/star_unstar.tmpl b/templates/repo/star_unstar.tmpl index 9234a0d196..dea965ab30 100644 --- a/templates/repo/star_unstar.tmpl +++ b/templates/repo/star_unstar.tmpl @@ -1,10 +1,10 @@ -<form hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}unstar{{else}}star{{end}}"> +<form class="flex-text-inline" hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}unstar{{else}}star{{end}}"> <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.star_guest_user"}}"{{end}}> {{$buttonText := ctx.Locale.Tr "repo.star"}} {{if $.IsStaringRepo}}{{$buttonText = ctx.Locale.Tr "repo.unstar"}}{{end}} <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}"> {{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}} - <span aria-hidden="true">{{$buttonText}}</span> + <span class="not-mobile" aria-hidden="true">{{$buttonText}}</span> </button> <a hx-boost="false" class="ui basic label" href="{{$.RepoLink}}/stars"> {{CountFmt .Repository.NumStars}} diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index 3533bfed0b..66ab86cb55 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -1,5 +1,5 @@ {{if and (not .HideRepoInfo) (not .IsBlame)}} -<div class="ui segments repository-summary tw-mt-1 tw-mb-0"> +<div class="ui segments repository-summary tw-my-0"> <div class="ui segment sub-menu repository-menu"> {{if and (.Permission.CanRead ctx.Consts.RepoUnitTypeCode) (not .IsEmptyRepo)}} <a class="item muted {{if .PageIsCommits}}active{{end}}" href="{{.RepoLink}}/commits/{{.RefFullName.RefWebLinkPath}}"> diff --git a/templates/repo/tag/list.tmpl b/templates/repo/tag/list.tmpl index 9789943b49..8b33b96f86 100644 --- a/templates/repo/tag/list.tmpl +++ b/templates/repo/tag/list.tmpl @@ -5,9 +5,7 @@ {{template "base/alert" .}} {{template "repo/release_tag_header" .}} <h4 class="ui top attached header"> - <div class="five wide column tw-flex tw-items-center"> - {{.TagCount}} {{ctx.Locale.Tr "repo.release.tags"}} - </div> + {{.TagCount}} {{ctx.Locale.Tr "repo.release.tags"}} </h4> {{$canReadReleases := $.Permission.CanRead ctx.Consts.RepoUnitTypeReleases}} <div class="ui attached segment"> @@ -15,53 +13,49 @@ {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.tag_kind") "Tooltip" (ctx.Locale.Tr "search.tag_tooltip")}} </form> </div> - <div class="ui attached table segment"> + <div class="ui attached segment tw-p-0"> {{if .Releases}} - <table class="ui very basic striped fixed table single line" id="tags-table"> - <tbody class="tag-list"> - {{range $idx, $release := .Releases}} - <tr> - <td class="tag-list-row"> - <h3 class="tag-list-row-title tw-mb-2"> - {{if $canReadReleases}} - <a class="tag-list-row-link tw-flex tw-items-center" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a> - {{else}} - <a class="tag-list-row-link tw-flex tw-items-center" href="{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a> - {{end}} - </h3> - <div class="download tw-flex tw-items-center"> - {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}} - {{if .CreatedUnix}} - <span class="tw-mr-2">{{svg "octicon-clock" 16 "tw-mr-1"}}{{DateUtils.TimeSince .CreatedUnix}}</span> - {{end}} + <div class="ui divided list" id="tags-table"> + {{range $idx, $release := .Releases}} + <div class="item tag-list-row tw-p-4"> + <h3 class="tag-list-row-title tw-mb-2"> + {{if $canReadReleases}} + <a class="tag-list-row-link" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a> + {{else}} + <a class="tag-list-row-link" href="{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}" rel="nofollow">{{.TagName}}</a> + {{end}} + </h3> + <div class="flex-text-block muted-links tw-gap-4 tw-flex-wrap"> + {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}} + {{if .CreatedUnix}} + <span class="flex-text-inline">{{svg "octicon-clock"}}{{DateUtils.TimeSince .CreatedUnix}}</span> + {{end}} - <a class="tw-mr-2 tw-font-mono muted" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .Sha1}}</a> + <a class="flex-text-inline tw-font-mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit"}}{{ShortSha .Sha1}}</a> - {{if not $.DisableDownloadSourceArchives}} - <a class="archive-link tw-mr-2 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-1"}}ZIP</a> - <a class="archive-link tw-mr-2 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-1"}}TAR.GZ</a> - {{end}} + {{if not $.DisableDownloadSourceArchives}} + <a class="archive-link flex-text-inline" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}ZIP</a> + <a class="archive-link flex-text-inline" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}TAR.GZ</a> + {{end}} - {{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}} - <a class="tw-mr-2 muted" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.new_release"}}</a> - {{end}} + {{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}} + <a class="flex-text-inline" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.release.new_release"}}</a> + {{end}} - {{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}} - <a class="ui delete-button tw-mr-2 muted" data-url="{{$.RepoLink}}/tags/delete" data-id="{{.ID}}"> - {{svg "octicon-trash" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.delete_tag"}} - </a> - {{end}} + {{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}} + <a class="flex-text-inline link-action" data-url="{{$.RepoLink}}/tags/delete?id={{.ID}}" data-modal-confirm="#confirm-delete-tag-modal"> + {{svg "octicon-trash"}}{{ctx.Locale.Tr "repo.release.delete_tag"}} + </a> + {{end}} - {{if and $canReadReleases (not $release.IsTag)}} - <a class="tw-mr-2 muted" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.detail"}}</a> - {{end}} - {{end}} - </div> - </td> - </tr> - {{end}} - </tbody> - </table> + {{if and $canReadReleases (not $release.IsTag)}} + <a class="flex-text-inline" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.release.detail"}}</a> + {{end}} + {{end}} + </div> + </div> + {{end}} + </div> {{else}} {{if .NumTags}} <p class="tw-p-4">{{ctx.Locale.Tr "no_results_found"}}</p> @@ -73,9 +67,8 @@ </div> {{if $.Permission.CanWrite ctx.Consts.RepoUnitTypeCode}} -<div class="ui g-modal-confirm delete modal"> +<div id="confirm-delete-tag-modal" class="ui small modal"> <div class="header"> - {{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.release.delete_tag"}} </div> <div class="content"> diff --git a/templates/repo/tag/name.tmpl b/templates/repo/tag/name.tmpl index c3042014d3..b6692dfc53 100644 --- a/templates/repo/tag/name.tmpl +++ b/templates/repo/tag/name.tmpl @@ -1,3 +1,3 @@ -<a class="ui label basic tiny button{{if .IsRelease}} primary{{end}}" href="{{.RepoLink}}/src/tag/{{.TagName|PathEscape}}"> +<a class="ui basic label tw-p-1 {{if .IsRelease}}primary{{end}}" href="{{.RepoLink}}/src/tag/{{.TagName|PathEscape}}"> {{svg "octicon-tag"}} {{.TagName}} </a> diff --git a/templates/repo/unicode_escape_prompt.tmpl b/templates/repo/unicode_escape_prompt.tmpl index 8bceafa8bb..f8226ec728 100644 --- a/templates/repo/unicode_escape_prompt.tmpl +++ b/templates/repo/unicode_escape_prompt.tmpl @@ -1,22 +1,22 @@ {{if .EscapeStatus}} {{if .EscapeStatus.HasInvisible}} - <div class="ui warning message unicode-escape-prompt tw-text-left"> + <div class="ui warning message unicode-escape-prompt"> <button class="btn close icon hide-panel" data-panel-closest=".message">{{svg "octicon-x" 16 "close inside"}}</button> <div class="header"> {{ctx.Locale.Tr "repo.invisible_runes_header"}} </div> - <p>{{ctx.Locale.Tr "repo.invisible_runes_description"}}</p> + <div>{{ctx.Locale.Tr "repo.invisible_runes_description"}}</div> {{if .EscapeStatus.HasAmbiguous}} - <p>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</p> + <div>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</div> {{end}} </div> {{else if .EscapeStatus.HasAmbiguous}} - <div class="ui warning message unicode-escape-prompt tw-text-left"> + <div class="ui warning message unicode-escape-prompt"> <button class="btn close icon hide-panel" data-panel-closest=".message">{{svg "octicon-x" 16 "close inside"}}</button> <div class="header"> {{ctx.Locale.Tr "repo.ambiguous_runes_header"}} </div> - <p>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</p> + <div>{{ctx.Locale.Tr "repo.ambiguous_runes_description"}}</div> </div> {{end}} {{end}} diff --git a/templates/repo/view.tmpl b/templates/repo/view.tmpl new file mode 100644 index 0000000000..85d09d03a1 --- /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="tw-flex tw-flex-col repo-view-file-tree-container not-mobile {{if not .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}" {{if .IsSigned}}data-user-is-signed-in{{end}}> + {{template "repo/view_file_tree" .}} + </div> + <div class="repo-view-content"> + {{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..3ba04a9974 --- /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 .RefFullName.IsBranch (not .IsViewFile)}} + <button class="ui dropdown basic compact jump button repo-add-file" {{if not .Repository.CanEnableEditor}}disabled{{end}}> + {{ctx.Locale.Tr "repo.editor.add_file"}} + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + <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"> + <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..1486d7181d 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -1,4 +1,6 @@ -<div {{if .ReadmeInList}}id="readme" {{end}}class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content"> +<div {{if .ReadmeInList}}id="readme"{{end}} class="{{TabSizeClass .Editorconfig .FileTreePath}} non-diff-file-content" + data-global-init="initRepoFileView" data-raw-file-link="{{.RawFileLink}}"> + {{- if .FileError}} <div class="ui error message"> <div class="text left tw-whitespace-pre">{{.FileError}}</div> @@ -27,18 +29,19 @@ <div class="file-header-left tw-flex tw-items-center tw-py-2 tw-pr-4"> {{if .ReadmeInList}} {{svg "octicon-book" 16 "tw-mr-2"}} - <strong><a class="muted" href="#readme">{{.FileName}}</a></strong> + <strong><a class="muted" href="#readme">{{.ReadmeInList}}</a></strong> {{else}} {{template "repo/file_info" .}} {{end}} </div> - <div class="file-header-right file-actions tw-flex tw-items-center tw-flex-wrap"> - {{if .HasSourceRenderedToggle}} - <div class="ui compact icon buttons"> - <a href="?display=source" class="ui mini basic button {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a> - <a href="{{$.Link}}" class="ui mini basic button {{if .IsDisplayingRendered}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a> - </div> - {{end}} + <div class="file-header-right file-actions flex-text-block tw-flex-wrap"> + {{/* this componment is also controlled by frontend plugin renders */}} + <div class="ui compact icon buttons file-view-toggle-buttons {{Iif .HasSourceRenderedToggle "" "tw-hidden"}}"> + {{if .IsRepresentableAsText}} + <a href="?display=source" class="ui mini basic button file-view-toggle-source {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a> + {{end}} + <a href="?display=rendered" class="ui mini basic button file-view-toggle-rendered {{if not .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a> + </div> {{if not .ReadmeInList}} <div class="ui buttons tw-mr-1"> <a class="ui mini basic button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a> @@ -55,7 +58,10 @@ {{end}} </div> <a download class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}" href="{{$.RawFileLink}}">{{svg "octicon-download"}}</a> - <a 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 not .IsDisplayingSource}}data-raw-file-link="{{$.RawFileLink}}"{{end}} + data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}" + >{{svg "octicon-copy"}}</a> {{if .EnableFeed}} <a class="btn-octicon" href="{{$.RepoLink}}/rss/{{$.RefTypeNameSubURL}}/{{PathEscapeSegments .TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}"> {{svg "octicon-rss"}} @@ -78,45 +84,28 @@ <button class="ui mini basic button escape-button tw-mr-1">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button> {{end}} {{if and .ReadmeInList .CanEditReadmeFile}} - <a class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.edit_this_file"}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}/{{PathEscapeSegments .FileName}}">{{svg "octicon-pencil"}}</a> + <a class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.edit_this_file"}}" href="{{.RepoLink}}/_edit/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .FileTreePath}}">{{svg "octicon-pencil"}}</a> {{end}} </div> </h4> + <div class="ui bottom attached table unstackable segment"> - {{if not (or .IsMarkup .IsRenderedHTML)}} - {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{if not .IsMarkup}} + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus}} {{end}} - <div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextSource}} code-view{{end}}"> + <div class="file-view {{if .IsMarkup}}markup {{.MarkupType}}{{else if .IsPlainText}}plain-text{{else if .IsDisplayingSource}}code-view{{end}}"> {{if .IsFileTooLarge}} {{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}} {{else if not .FileSize}} {{template "shared/fileisempty"}} {{else if .IsMarkup}} - {{if .FileContent}}{{.FileContent}}{{end}} + {{.FileContent}} {{else if .IsPlainText}} <pre>{{if .FileContent}}{{.FileContent}}{{end}}</pre> - {{else if not .IsTextSource}} - <div class="view-raw"> - {{if .IsImageFile}} - <img src="{{$.RawFileLink}}"> - {{else if .IsVideoFile}} - <video controls src="{{$.RawFileLink}}"> - <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong> - </video> - {{else if .IsAudioFile}} - <audio controls src="{{$.RawFileLink}}"> - <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong> - </audio> - {{else if .IsPDFFile}} - <div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "repo.diff.view_file"}}"></div> - {{else}} - <a href="{{$.RawFileLink}}" rel="nofollow" class="tw-p-4">{{ctx.Locale.Tr "repo.file_view_raw"}}</a> - {{end}} - </div> - {{else if .FileSize}} + {{else if .FileContent}} <table> <tbody> - {{range $idx, $code := .FileContent}} + {{range $idx, $code := .FileContent}} {{$line := Eval $idx "+" 1}} <tr> <td id="L{{$line}}" class="lines-num"><span id="L{{$line}}" data-line-number="{{$line}}"></span></td> @@ -125,17 +114,38 @@ {{end}} <td rel="L{{$line}}" class="lines-code chroma"><code class="code-inner">{{$code}}</code></td> </tr> - {{end}} + {{end}} </tbody> </table> - <div class="code-line-menu tippy-target"> - {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}} - <a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a> + {{else}} + <div class="view-raw"> + {{if .IsImageFile}} + <img alt="{{$.RawFileLink}}" src="{{$.RawFileLink}}"> + {{else if .IsVideoFile}} + <video controls src="{{$.RawFileLink}}"> + <strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong> + </video> + {{else if .IsAudioFile}} + <audio controls src="{{$.RawFileLink}}"> + <strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong> + </audio> + {{else}} + <div class="file-view-render-container"> + <div class="file-view-raw-prompt tw-p-4"> + <a href="{{$.RawFileLink}}" rel="nofollow">{{ctx.Locale.Tr "repo.file_view_raw"}}</a> + </div> + </div> {{end}} - <a class="item view_git_blame" role="menuitem" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a> - <a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a> </div> {{end}} </div> + + <div class="code-line-menu tippy-target"> + {{if $.Permission.CanRead ctx.Consts.RepoUnitTypeIssues}} + <a class="item ref-in-new-issue" role="menuitem" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a> + {{end}} + <a class="item view_git_blame" role="menuitem" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a> + <a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a> + </div> </div> </div> diff --git a/templates/repo/view_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..b655f735a3 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -4,9 +4,10 @@ {{template "repo/latest_commit" .}} <div>{{if and .LatestCommit .LatestCommit.Committer}}{{DateUtils.TimeSince .LatestCommit.Committer.When}}{{end}}</div> </div> + {{$.FileIconPoolHTML}} {{if .HasParentPath}} <a class="repo-file-line parent-link silenced" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}"> - {{svg "octicon-file-directory-fill"}} .. + {{index $.FileIcons ".."}} .. </a> {{end}} {{range $item := .Files}} @@ -14,20 +15,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}}"> + {{index $.FileIcons $entry.Name}} {{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,15 +40,17 @@ {{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> + {{if $entry.IsLink}} + <a class="entry-symbol-link flex-text-inline" data-tooltip-content title="{{ctx.Locale.Tr "repo.find_file.follow_symlink"}}" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}?follow_symlink=1">{{svg "octicon-link" 12}}</a> + {{end}} {{end}} {{end}} </div> <div class="repo-file-cell message loading-icon-2px"> {{if $commit}} {{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}} - {{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.Message $commitLink ($.Repository.ComposeMetas ctx)}} + {{ctx.RenderUtils.RenderCommitMessageLinkSubject $commit.Message $commitLink $.Repository}} {{else}} โฆ {{/* will be loaded again by LastCommitLoaderURL */}} {{end}} diff --git a/templates/repo/watch_unwatch.tmpl b/templates/repo/watch_unwatch.tmpl index 465cd91c2b..6f2e5b7a19 100644 --- a/templates/repo/watch_unwatch.tmpl +++ b/templates/repo/watch_unwatch.tmpl @@ -1,10 +1,10 @@ -<form hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}"> +<form class="flex-text-inline" hx-boost="true" hx-target="this" method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}"> <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}> {{$buttonText := ctx.Locale.Tr "repo.watch"}} {{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}} <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}"> {{svg "octicon-eye"}} - <span aria-hidden="true">{{$buttonText}}</span> + <span class="not-mobile" aria-hidden="true">{{$buttonText}}</span> </button> <a hx-boost="false" class="ui basic label" href="{{.RepoLink}}/watchers"> {{CountFmt .Repository.NumWatches}} diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl index ea2913c0fd..12f0983904 100644 --- a/templates/repo/wiki/new.tmpl +++ b/templates/repo/wiki/new.tmpl @@ -18,7 +18,7 @@ {{ctx.Locale.Tr "repo.wiki.page_name_desc"}} </div> - {{$content := .content}} + {{$content := .WikiEditContent}} {{if not .PageIsWikiEdit}} {{$content = ctx.Locale.Tr "repo.wiki.welcome"}} {{end}} @@ -35,7 +35,7 @@ <input name="message" aria-label="{{ctx.Locale.Tr "repo.wiki.default_commit_message"}}" placeholder="{{ctx.Locale.Tr "repo.wiki.default_commit_message"}}"> </div> <div class="divider"></div> - <div class="text right"> + <div class="flex-text-block tw-justify-end"> <a class="ui basic cancel button" href="{{.Link}}">{{ctx.Locale.Tr "cancel"}}</a> <button class="ui primary button">{{ctx.Locale.Tr "repo.wiki.save_page"}}</button> </div> diff --git a/templates/repo/wiki/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..108e378937 100644 --- a/templates/repo/wiki/revision.tmpl +++ b/templates/repo/wiki/revision.tmpl @@ -3,18 +3,18 @@ {{template "repo/header" .}} {{$title := .title}} <div class="ui container"> - <div class="ui stackable grid"> - <div class="ui eight wide column"> - <div class="ui header"> - <a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a> + <div class="ui dividing header flex-text-block tw-flex-wrap tw-justify-between"> + <div class="flex-text-block"> + <a class="ui basic button tw-px-3" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}">{{svg "octicon-home"}}</a> + <div class="tw-flex-1 gt-ellipsis"> {{$title}} - <div class="ui sub header tw-break-anywhere"> + <div class="ui sub header gt-ellipsis"> {{$timeSince := DateUtils.TimeSince .Author.When}} {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}} </div> </div> </div> - <div class="ui eight wide column text right"> + <div class="flex-text-block"> {{template "repo/clone_panel" .}} </div> </div> diff --git a/templates/repo/wiki/start.tmpl b/templates/repo/wiki/start.tmpl index 1b3c3d538a..e622db5eb5 100644 --- a/templates/repo/wiki/start.tmpl +++ b/templates/repo/wiki/start.tmpl @@ -7,7 +7,7 @@ <h2>{{ctx.Locale.Tr "repo.wiki.welcome"}}</h2> <p>{{ctx.Locale.Tr "repo.wiki.welcome_desc"}}</p> {{if and .CanWriteWiki (not .Repository.IsMirror)}} - <a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a> + <a class="ui primary button tw-mr-0" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a> {{end}} </div> </div> diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index 843a977e3e..f6f82fb52d 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -33,7 +33,7 @@ <div class="ui dividing header"> <div class="flex-text-block tw-flex-wrap tw-justify-end"> <div class="flex-text-block tw-flex-1 tw-min-w-[300px]"> - <a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" ><span>{{.CommitCount}}</span> {{svg "octicon-history"}}</a> + <a class="ui basic button tw-px-3 tw-gap-3" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" >{{if .CommitCount}}<span>{{.CommitCount}}</span> {{end}}{{svg "octicon-history"}}</a> <div class="tw-flex-1 gt-ellipsis"> {{$title}} <div class="ui sub header gt-ellipsis"> @@ -62,36 +62,34 @@ {{end}} <div class="wiki-content-parts"> - {{if .sidebarTocContent}} - <div class="markup wiki-content-sidebar wiki-content-toc"> - {{.sidebarTocContent | SafeHTML}} + {{if .WikiSidebarTocHTML}} + <div class="render-content markup wiki-content-sidebar wiki-content-toc"> + {{.WikiSidebarTocHTML}} </div> {{end}} - <div class="markup wiki-content-main {{if or .sidebarTocContent .sidebarPresent}}with-sidebar{{end}}"> - {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} - {{.content | SafeHTML}} + <div class="render-content markup wiki-content-main {{if or .WikiSidebarTocHTML .WikiSidebarHTML}}with-sidebar{{end}}"> + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus}} + {{.WikiContentHTML}} </div> - {{if .sidebarPresent}} - <div class="markup wiki-content-sidebar"> + {{if .WikiSidebarHTML}} + <div class="render-content markup wiki-content-sidebar"> {{if and .CanWriteWiki (not .Repository.IsMirror)}} <a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a> {{end}} - {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .sidebarEscapeStatus "root" $}} - {{.sidebarContent | SafeHTML}} + {{.WikiSidebarHTML}} </div> {{end}} <div class="tw-clear-both"></div> - {{if .footerPresent}} - <div class="markup wiki-content-footer"> + {{if .WikiFooterHTML}} + <div class="render-content markup wiki-content-footer"> {{if and .CanWriteWiki (not .Repository.IsMirror)}} <a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a> {{end}} - {{template "repo/unicode_escape_prompt" dict "footerEscapeStatus" .sidebarEscapeStatus "root" $}} - {{.footerContent | SafeHTML}} + {{.WikiFooterHTML}} </div> {{end}} </div> 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..43321a8dc5 100644 --- a/templates/shared/actions/runner_list.tmpl +++ b/templates/shared/actions/runner_list.tmpl @@ -16,7 +16,7 @@ <div class="header"> Registration Token </div> - <div class="ui input"> + <div class="ui action input"> <input type="text" value="{{.RegistrationToken}}" readonly> <button class="ui basic label button" aria-label="{{ctx.Locale.Tr "copy"}}" data-clipboard-text="{{.RegistrationToken}}"> {{svg "octicon-copy" 14}} @@ -64,30 +64,26 @@ </tr> </thead> <tbody> - {{if .Runners}} - {{range .Runners}} + {{range .Runners}} <tr> - <td> - <span class="ui {{if .IsOnline}}green{{end}} label">{{.StatusLocaleName ctx.Locale}}</span> - </td> + <td><span class="ui label {{if .IsOnline}}green{{end}}">{{.StatusLocaleName ctx.Locale}}</span></td> <td>{{.ID}}</td> <td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td> <td>{{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}}</td> <td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString ctx.Locale}}</span></td> - <td class="tw-flex tw-flex-wrap tw-gap-2 runner-tags"> - {{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}} + <td> + <span class="flex-text-inline">{{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}}</span> </td> <td>{{if .LastOnline}}{{DateUtils.TimeSince .LastOnline}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td> - <td class="runner-ops"> - {{if .Editable $.RunnerOwnerID $.RunnerRepoID}} - <a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a> + <td> + {{if .EditableInContext $.RunnerOwnerID $.RunnerRepoID}} + <a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a> {{end}} </td> </tr> - {{end}} {{else}} <tr> - <td class="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/avatar_upload_crop.tmpl b/templates/shared/avatar_upload_crop.tmpl new file mode 100644 index 0000000000..3bc012dd99 --- /dev/null +++ b/templates/shared/avatar_upload_crop.tmpl @@ -0,0 +1,8 @@ +{{- /* we do not need to set for/id here, global aria init code will add them automatically */ -}} +<label>{{.LabelText}}</label> +<input class="avatar-file-with-cropper" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp" data-global-init="initAvatarUploader"> +{{- /* the cropper-panel must be next sibling of the input "avatar" */ -}} +<div class="cropper-panel tw-hidden"> + <div class="tw-my-2">{{ctx.Locale.Tr "settings.cropper_prompt"}}</div> + <div class="cropper-wrapper"><img class="cropper-source" src alt></div> +</div> 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 e8015b40ea..b25bcc14b9 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -3,11 +3,14 @@ {{range .Issues}} <div class="flex-item"> - <div class="flex-item-icon"> - {{if $.CanWriteIssuesOrPulls}} - <input type="checkbox" autocomplete="off" class="issue-checkbox tw-mr-4" data-issue-id={{.ID}} aria-label="{{ctx.Locale.Tr "repo.issues.action_check"}} "{{.Title}}""> - {{end}} - {{template "shared/issueicon" .}} + <div class="flex-item-leading"> + {{/* using some tw helpers is the only way to align the checkbox */}} + <div class="flex-text-inline tw-mt-[2px]"> + {{if $.CanWriteIssuesOrPulls}} + <input type="checkbox" autocomplete="off" class="issue-checkbox tw-mr-[14px]" data-issue-id={{.ID}} aria-label="{{ctx.Locale.Tr "repo.issues.action_check"}} "{{.Title}}""> + {{end}} + {{template "shared/issueicon" .}} + </div> </div> <div class="flex-item-main"> @@ -19,7 +22,7 @@ {{template "repo/commit_statuses" dict "Status" (index $.CommitLastStatus .PullRequest.ID) "Statuses" (index $.CommitStatuses .PullRequest.ID)}} {{end}} {{end}} - <span class="labels-list tw-ml-1"> + <span class="labels-list"> {{range .Labels}} <a href="?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}{{if ne $.listType "milestone"}}&milestone={{$.MilestoneID}}{{end}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.RenderUtils.RenderLabel .}}</a> {{end}} @@ -28,11 +31,11 @@ {{if .TotalTrackedTime}} <div class="text grey flex-text-block"> {{svg "octicon-clock" 16}} - {{.TotalTrackedTime | Sec2Time}} + {{.TotalTrackedTime | Sec2Hour}} </div> {{end}} </div> - <div class="flex-item-body"> + <div class="flex-item-body tw-mt-1"> <a class="index" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}"> {{if eq $.listType "dashboard"}} {{.Repo.FullName}}#{{.Index}} @@ -153,6 +156,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/explore/repo_list.tmpl b/templates/shared/repo/list.tmpl index 219b1255c0..2c8af14f9c 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/shared/repo/list.tmpl @@ -2,12 +2,16 @@ {{range .Repos}} <div class="flex-item"> <div class="flex-item-leading"> - {{template "repo/icon" .}} + {{if $.ShowRepoOwnerAvatar}} + {{ctx.AvatarUtils.Avatar .Owner 24}} + {{else}} + {{template "repo/icon" .}} + {{end}} </div> <div class="flex-item-main"> <div class="flex-item-header"> <div class="flex-item-title"> - {{if and (or $.PageIsExplore $.PageIsProfileStarList) .Owner}} + {{if and $.ShowRepoOwnerOnList .Owner}} <a class="text primary name" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/ {{end}} <a class="text primary name" href="{{.Link}}">{{.Name}}</a> @@ -39,12 +43,12 @@ {{end}} {{if not $.DisableStars}} <a class="flex-text-inline" href="{{.Link}}/stars"> - <span aria-label="{{ctx.Locale.Tr "repo.stars"}}">{{svg "octicon-star" 16}}</span> + <span class="tw-contents" aria-label="{{ctx.Locale.Tr "repo.stars"}}">{{svg "octicon-star" 16}}</span> <span {{if ge .NumStars 1000}}data-tooltip-content="{{.NumStars}}"{{end}}>{{CountFmt .NumStars}}</span> </a> {{end}} <a class="flex-text-inline" href="{{.Link}}/forks"> - <span aria-label="{{ctx.Locale.Tr "repo.forks"}}">{{svg "octicon-git-branch" 16}}</span> + <span class="tw-contents" aria-label="{{ctx.Locale.Tr "repo.forks"}}">{{svg "octicon-git-branch" 16}}</span> <span {{if ge .NumForks 1000}}data-tooltip-content="{{.NumForks}}"{{end}}>{{CountFmt .NumForks}}</span> </a> </div> diff --git a/templates/shared/repo_search.tmpl b/templates/shared/repo/search.tmpl index 7fcb5d2361..a909061184 100644 --- a/templates/shared/repo_search.tmpl +++ b/templates/shared/repo/search.tmpl @@ -1,5 +1,5 @@ <div class="ui small secondary filter menu"> - <form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-gap-x-2"> + <form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-items-center tw-gap-x-2"> {{if .Language}}<input type="hidden" name="language" value="{{.Language}}">{{end}} {{if .PageIsExploreRepositories}}<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">{{end}} {{if .TabName}}<input type="hidden" name="tab" value="{{.TabName}}">{{end}} diff --git a/templates/shared/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..44305e9502 100644 --- a/templates/shared/secrets/add_list.tmpl +++ b/templates/shared/secrets/add_list.tmpl @@ -4,9 +4,13 @@ <button class="ui primary tiny button show-modal" data-modal="#add-secret-modal" data-modal-form.action="{{.Link}}" - data-modal-header="{{ctx.Locale.Tr "secrets.creation"}}" + data-modal-header="{{ctx.Locale.Tr "secrets.add_secret"}}" + data-modal-secret-name.value="" + data-modal-secret-name.read-only="false" + data-modal-secret-data="" + data-modal-secret-description="" > - {{ctx.Locale.Tr "secrets.creation"}} + {{ctx.Locale.Tr "secrets.add_secret"}} </button> </div> </h4> @@ -23,6 +27,9 @@ {{.Name}} </div> <div class="flex-item-body"> + {{if .Description}}{{.Description}}{{else}}-{{end}} + </div> + <div class="flex-item-body"> ****** </div> </div> @@ -30,7 +37,19 @@ <span class="color-text-light-2"> {{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} </span> - <button class="ui btn interact-bg link-action tw-p-2" + <button class="btn interact-bg show-modal tw-p-2" + data-modal="#add-secret-modal" + data-modal-form.action="{{$.Link}}" + data-modal-header="{{ctx.Locale.Tr "secrets.edit_secret"}}" + data-tooltip-content="{{ctx.Locale.Tr "secrets.edit_secret"}}" + data-modal-secret-name.value="{{.Name}}" + data-modal-secret-name.read-only="true" + data-modal-secret-data="" + data-modal-secret-description="{{if .Description}}{{.Description}}{{end}}" + > + {{svg "octicon-pencil"}} + </button> + <button class="btn interact-bg link-action tw-p-2" data-url="{{$.Link}}/delete?id={{.ID}}" data-modal-confirm="{{ctx.Locale.Tr "secrets.deletion.description"}}" data-tooltip-content="{{ctx.Locale.Tr "secrets.deletion"}}" @@ -48,9 +67,7 @@ {{/* Add secret dialog */}} <div class="ui small modal" id="add-secret-modal"> - <div class="header"> - <span id="actions-modal-header"></span> - </div> + <div class="header"></div> <form class="ui form form-fetch-action" method="post"> <div class="content"> {{.CsrfTokenHtml}} @@ -72,9 +89,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/authorlink.tmpl b/templates/shared/user/authorlink.tmpl index d57a635b4b..abfee6aae3 100644 --- a/templates/shared/user/authorlink.tmpl +++ b/templates/shared/user/authorlink.tmpl @@ -1 +1 @@ -<a class="author text black tw-font-semibold muted"{{if gt .ID 0}} href="{{.HomeLink}}"{{end}}>{{.GetDisplayName}}</a>{{if .IsBot}}<span class="ui basic label tw-p-1">bot</span>{{end}} +<a class="author text black tw-font-semibold muted"{{if gt .ID 0}} href="{{.HomeLink}}"{{end}}>{{.GetDisplayName}}</a>{{if .IsTypeBot}}<span class="ui basic label tw-p-1 tw-align-baseline">bot</span>{{end}} 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/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl index 91f04e0b53..1190dc54ec 100644 --- a/templates/shared/user/profile_big_avatar.tmpl +++ b/templates/shared/user/profile_big_avatar.tmpl @@ -103,7 +103,7 @@ <ul class="user-badges"> {{range .Badges}} <li> - <img width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-tooltip-content="{{.Description}}"> + <img loading="lazy" width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-tooltip-content="{{.Description}}"> </li> {{end}} </ul> diff --git a/templates/shared/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/shared/webhook/icon.tmpl b/templates/shared/webhook/icon.tmpl index 0f80787c57..105212eb56 100644 --- a/templates/shared/webhook/icon.tmpl +++ b/templates/shared/webhook/icon.tmpl @@ -5,23 +5,23 @@ {{if eq .HookType "gitea"}} {{svg "gitea-gitea" $size "img"}} {{else if eq .HookType "gogs"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico"> {{else if eq .HookType "slack"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/slack.png"> {{else if eq .HookType "discord"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/discord.png"> {{else if eq .HookType "dingtalk"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/dingtalk.ico"> {{else if eq .HookType "telegram"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/telegram.png"> {{else if eq .HookType "msteams"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/msteams.png"> {{else if eq .HookType "feishu"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/feishu.png"> + {{svg "gitea-feishu" $size "img"}} {{else if eq .HookType "matrix"}} {{svg "gitea-matrix" $size "img"}} {{else if eq .HookType "wechatwork"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png"> {{else if eq .HookType "packagist"}} - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png"> + <img alt width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png"> {{end}} diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl index 6cfc88a0d7..e83dcf463b 100644 --- a/templates/status/404.tmpl +++ b/templates/status/404.tmpl @@ -2,6 +2,7 @@ <div role="main" aria-label="{{.Title}}" class="page-content {{if .IsRepo}}repository{{end}}"> {{if .IsRepo}}{{template "repo/header" .}}{{end}} <div class="ui container"> + {{template "base/alert" .}} <div class="status-page-error"> <div class="status-page-error-title">404 Not Found</div> <div class="tw-text-center"> diff --git a/templates/status/500.tmpl b/templates/status/500.tmpl index 198f1ea898..6dfa2d8a8c 100644 --- a/templates/status/500.tmpl +++ b/templates/status/500.tmpl @@ -38,7 +38,7 @@ {{if .ErrorMsg}} <div class="tw-mt-8"> <p>{{ctx.Locale.Tr "error.occurred"}}:</p> - <pre class="tw-whitespace-pre-wrap tw-break-all">{{.ErrorMsg}}</pre> + <pre class="tw-whitespace-pre-wrap tw-wrap-anywhere">{{.ErrorMsg}}</pre> </div> {{end}} <div class="tw-mt-8 tw-text-center"> diff --git a/templates/status/503.tmpl b/templates/status/503.tmpl new file mode 100644 index 0000000000..5b1db9fc07 --- /dev/null +++ b/templates/status/503.tmpl @@ -0,0 +1,12 @@ +{{template "base/head" .}} +<div role="main" aria-label="503 Service Unavailable" class="page-content"> + <div class="ui container"> + <div class="status-page-error"> + <div class="status-page-error-title">503 Service Unavailable</div> + <div class="tw-text-center"> + <div class="tw-my-4">{{ctx.Locale.Tr "error503"}}</div> + </div> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/swagger/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 8082fc594a..879f59df2e 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -75,6 +75,218 @@ } } }, + "/admin/actions/jobs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Lists all jobs", + "operationId": "listAdminWorkflowJobs", + "parameters": [ + { + "type": "string", + "description": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowJobsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/admin/actions/runners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get all runners", + "operationId": "getAdminRunners", + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/admin/actions/runners/registration-token": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get an global actions runner registration token", + "operationId": "adminCreateRunnerRegistrationToken", + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/admin/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Get an global runner", + "operationId": "getAdminRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Delete an global runner", + "operationId": "deleteAdminRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/admin/actions/runs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "Lists all runs", + "operationId": "listAdminWorkflowRuns", + "parameters": [ + { + "type": "string", + "description": "workflow event name", + "name": "event", + "in": "query" + }, + { + "type": "string", + "description": "workflow branch", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "description": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "triggered by user", + "name": "actor", + "in": "query" + }, + { + "type": "string", + "description": "triggering sha of the workflow run", + "name": "head_sha", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowRunsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/admin/cron": { "get": { "produces": [ @@ -554,7 +766,7 @@ }, { "type": "string", - "description": "user's login name to search for", + "description": "identifier of the user, provided by the external authenticator", "name": "login_name", "in": "query" }, @@ -630,7 +842,7 @@ "parameters": [ { "type": "string", - "description": "username of user to delete", + "description": "username of the user to delete", "name": "username", "in": "path", "required": true @@ -672,7 +884,7 @@ "parameters": [ { "type": "string", - "description": "username of user to edit", + "description": "username of the user whose data is to be edited", "name": "username", "in": "path", "required": true @@ -714,7 +926,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose badges are to be listed", "name": "username", "in": "path", "required": true @@ -744,7 +956,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user to whom a badge is to be added", "name": "username", "in": "path", "required": true @@ -778,7 +990,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose badge is to be deleted", "name": "username", "in": "path", "required": true @@ -820,7 +1032,7 @@ "parameters": [ { "type": "string", - "description": "username of the user", + "description": "username of the user who is to receive a public key", "name": "username", "in": "path", "required": true @@ -859,7 +1071,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose public key is to be deleted", "name": "username", "in": "path", "required": true @@ -902,7 +1114,7 @@ "parameters": [ { "type": "string", - "description": "username of the user that will own the created organization", + "description": "username of the user who will own the created organization", "name": "username", "in": "path", "required": true @@ -942,7 +1154,7 @@ "parameters": [ { "type": "string", - "description": "existing username of user", + "description": "current username of the user", "name": "username", "in": "path", "required": true @@ -985,7 +1197,7 @@ "parameters": [ { "type": "string", - "description": "username of the user. This user will own the created repository", + "description": "username of the user who will own the created repository", "name": "username", "in": "path", "required": true @@ -1697,6 +1909,88 @@ } } }, + "/orgs/{org}/actions/jobs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get org-level workflow jobs", + "operationId": "getOrgWorkflowJobs", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowJobsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/orgs/{org}/actions/runners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get org-level runners", + "operationId": "getOrgRunners", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/orgs/{org}/actions/runners/registration-token": { "get": { "produces": [ @@ -1721,6 +2015,180 @@ "$ref": "#/responses/RegistrationToken" } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get an organization's actions runner registration token", + "operationId": "orgCreateRunnerRegistrationToken", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/orgs/{org}/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get an org-level runner", + "operationId": "getOrgRunner", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Delete an org-level runner", + "operationId": "deleteOrgRunner", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/orgs/{org}/actions/runs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Get org-level workflow runs", + "operationId": "getOrgWorkflowRuns", + "parameters": [ + { + "type": "string", + "description": "name of the organization", + "name": "org", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "workflow event name", + "name": "event", + "in": "query" + }, + { + "type": "string", + "description": "workflow branch", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "description": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "triggered by user", + "name": "actor", + "in": "query" + }, + { + "type": "string", + "description": "triggering sha of the workflow run", + "name": "head_sha", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowRunsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } } }, "/orgs/{org}/actions/secrets": { @@ -2025,16 +2493,16 @@ ], "responses": { "201": { - "description": "response when creating an org-level variable" - }, - "204": { - "description": "response when creating an org-level variable" + "description": "successfully created the org-level variable" }, "400": { "$ref": "#/responses/error" }, - "404": { - "$ref": "#/responses/notFound" + "409": { + "description": "variable name already exists." + }, + "500": { + "$ref": "#/responses/error" } } }, @@ -2248,7 +2716,7 @@ }, { "type": "string", - "description": "user to check", + "description": "username of the user to check", "name": "username", "in": "path", "required": true @@ -2279,7 +2747,7 @@ }, { "type": "string", - "description": "user to block", + "description": "username of the user to block", "name": "username", "in": "path", "required": true @@ -2319,7 +2787,7 @@ }, { "type": "string", - "description": "user to unblock", + "description": "username of the user to unblock", "name": "username", "in": "path", "required": true @@ -2790,7 +3258,7 @@ }, { "type": "string", - "description": "username of the user", + "description": "username of the user to check for an organization membership", "name": "username", "in": "path", "required": true @@ -2827,7 +3295,7 @@ }, { "type": "string", - "description": "username of the user", + "description": "username of the user to remove from the organization", "name": "username", "in": "path", "required": true @@ -2901,7 +3369,7 @@ }, { "type": "string", - "description": "username of the user", + "description": "username of the user to check for a public organization membership", "name": "username", "in": "path", "required": true @@ -2935,7 +3403,7 @@ }, { "type": "string", - "description": "username of the user", + "description": "username of the user whose membership is to be publicized", "name": "username", "in": "path", "required": true @@ -2972,7 +3440,7 @@ }, { "type": "string", - "description": "username of the user", + "description": "username of the user whose membership is to be concealed", "name": "username", "in": "path", "required": true @@ -2991,6 +3459,46 @@ } } }, + "/orgs/{org}/rename": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "organization" + ], + "summary": "Rename an organization", + "operationId": "renameOrg", + "parameters": [ + { + "type": "string", + "description": "existing org name", + "name": "org", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RenameOrgOption" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, "/orgs/{org}/repos": { "get": { "produces": [ @@ -3299,6 +3807,191 @@ } } }, + "/packages/{owner}/{type}/{name}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "package" + ], + "summary": "Gets all versions of a package", + "operationId": "listPackageVersions", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/PackageList" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/packages/{owner}/{type}/{name}/-/latest": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "package" + ], + "summary": "Gets the latest version of a package", + "operationId": "getLatestPackageVersion", + "parameters": [ + { + "type": "string", + "description": "owner of the package", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "type of the package", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the package", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Package" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/packages/{owner}/{type}/{name}/-/link/{repo_name}": { + "post": { + "tags": [ + "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": [ @@ -3879,6 +4572,375 @@ } } }, + "/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": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Lists all jobs for a repository", + "operationId": "listWorkflowJobs", + "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": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowJobsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/jobs/{job_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets a specific workflow job for a workflow run", + "operationId": "getWorkflowJob", + "parameters": [ + { + "type": "string", + "description": "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 job", + "name": "job_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowJob" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/jobs/{job_id}/logs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Downloads the job logs for a workflow run", + "operationId": "downloadActionsRunJobLogs", + "parameters": [ + { + "type": "string", + "description": "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": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get repo-level runners", + "operationId": "getRepoRunners", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/actions/runners/registration-token": { "get": { "produces": [ @@ -3910,6 +4972,414 @@ "$ref": "#/responses/RegistrationToken" } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a repository's actions runner registration token", + "operationId": "repoCreateRunnerRegistrationToken", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/repos/{owner}/{repo}/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get an repo-level runner", + "operationId": "getRepoRunner", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete an repo-level runner", + "operationId": "deleteRepoRunner", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/runs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Lists all runs for a repository run", + "operationId": "getWorkflowRuns", + "parameters": [ + { + "type": "string", + "description": "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": "workflow event name", + "name": "event", + "in": "query" + }, + { + "type": "string", + "description": "workflow branch", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "description": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "triggered by user", + "name": "actor", + "in": "query" + }, + { + "type": "string", + "description": "triggering sha of the workflow run", + "name": "head_sha", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ArtifactsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/repos/{owner}/{repo}/actions/runs/{run}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Gets a specific workflow run", + "operationId": "GetWorkflowRun", + "parameters": [ + { + "type": "string", + "description": "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 run", + "name": "run", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowRun" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Delete a workflow run", + "operationId": "deleteActionRun", + "parameters": [ + { + "type": "string", + "description": "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 + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/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/runs/{run}/jobs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Lists all jobs for a workflow run", + "operationId": "listWorkflowRunJobs", + "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": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowJobsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } } }, "/repos/{owner}/{repo}/actions/secrets": { @@ -4055,7 +5525,7 @@ ], "responses": { "204": { - "description": "delete one secret of the organization" + "description": "delete one secret of the repository" }, "400": { "$ref": "#/responses/error" @@ -4319,14 +5789,14 @@ "201": { "description": "response when creating a repo-level variable" }, - "204": { - "description": "response when creating a repo-level variable" - }, "400": { "$ref": "#/responses/error" }, - "404": { - "$ref": "#/responses/notFound" + "409": { + "description": "variable name already exists." + }, + "500": { + "$ref": "#/responses/error" } } }, @@ -4381,6 +5851,275 @@ } } }, + "/repos/{owner}/{repo}/actions/workflows": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "List repository workflows", + "operationId": "ActionsListRepositoryWorkflows", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ActionWorkflowList" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + }, + "500": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get a workflow", + "operationId": "ActionsGetWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ActionWorkflow" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + }, + "500": { + "$ref": "#/responses/error" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Disable a workflow", + "operationId": "ActionsDisableWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Create a workflow dispatch event", + "operationId": "ActionsDispatchWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateActionWorkflowDispatch" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable": { + "put": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Enable a workflow", + "operationId": "ActionsEnableWorkflow", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "id of the workflow", + "name": "workflow_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "$ref": "#/responses/error" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + }, + "409": { + "$ref": "#/responses/conflict" + }, + "422": { + "$ref": "#/responses/validationError" + } + } + } + }, "/repos/{owner}/{repo}/activities/feeds": { "get": { "produces": [ @@ -5191,7 +6930,7 @@ }, { "type": "string", - "description": "username of the collaborator", + "description": "username of the user to check for being a collaborator", "name": "collaborator", "in": "path", "required": true @@ -5235,7 +6974,7 @@ }, { "type": "string", - "description": "username of the collaborator to add", + "description": "username of the user to add or update as a collaborator", "name": "collaborator", "in": "path", "required": true @@ -5335,7 +7074,7 @@ }, { "type": "string", - "description": "username of the collaborator", + "description": "username of the collaborator whose permissions are to be obtained", "name": "collaborator", "in": "path", "required": true @@ -5392,6 +7131,20 @@ "in": "query" }, { + "type": "string", + "format": "date-time", + "description": "Only commits after this date will be returned (ISO 8601 format)", + "name": "since", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Only commits before this date will be returned (ISO 8601 format)", + "name": "until", + "in": "query" + }, + { "type": "boolean", "description": "include diff stats for every commit (disable for speedup, default 'true')", "name": "stat", @@ -5671,13 +7424,14 @@ }, "/repos/{owner}/{repo}/contents": { "get": { + "description": "This API follows GitHub's design, and it is not easy to use. Recommend users to use our \"contents-ext\" API instead.", "produces": [ "application/json" ], "tags": [ "repository" ], - "summary": "Gets the metadata of all the entries of the root dir", + "summary": "Gets the metadata of all the entries of the root dir.", "operationId": "repoGetContentsList", "parameters": [ { @@ -5696,7 +7450,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repositoryโs default branch (usually master)", + "description": "The name of the commit/branch/tag. Default to the repositoryโs default branch.", "name": "ref", "in": "query" } @@ -5765,15 +7519,72 @@ } } }, + "/repos/{owner}/{repo}/contents-ext/{filepath}": { + "get": { + "description": "It guarantees that only one of the response fields is set if the request succeeds. Users can pass \"includes=file_content\" or \"includes=lfs_metadata\" to retrieve more fields. \"includes=file_content\" only works for single file, if you need to retrieve file contents in batch, use \"file-contents\" API after listing the directory.", + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "The extended \"contents\" API, to get file metadata and/or content, or list a directory.", + "operationId": "repoGetContentsExt", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "path of the dir, file, symlink or submodule in the repo. Swagger requires path parameter to be \"required\", you can leave it empty or pass a single dot (\".\") to get the root directory.", + "name": "filepath", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "the name of the commit/branch/tag, default to the repositoryโs default branch.", + "name": "ref", + "in": "query" + }, + { + "type": "string", + "description": "By default this API's response only contains file's metadata. Use comma-separated \"includes\" options to retrieve more fields. Option \"file_content\" will try to retrieve the file content, \"lfs_metadata\" will try to retrieve LFS metadata, \"commit_metadata\" will try to retrieve commit metadata, and \"commit_message\" will try to retrieve commit message.", + "name": "includes", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/ContentsExtResponse" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/contents/{filepath}": { "get": { + "description": "This API follows GitHub's design, and it is not easy to use. Recommend users to use the \"contents-ext\" API instead.", "produces": [ "application/json" ], "tags": [ "repository" ], - "summary": "Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir", + "summary": "Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir.", "operationId": "repoGetContents", "parameters": [ { @@ -5799,7 +7610,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repositoryโs default branch (usually master)", + "description": "The name of the commit/branch/tag. Default to the repositoryโs default branch.", "name": "ref", "in": "query" } @@ -5991,6 +7802,9 @@ "404": { "$ref": "#/responses/error" }, + "422": { + "$ref": "#/responses/error" + }, "423": { "$ref": "#/responses/repoArchivedError" } @@ -6081,7 +7895,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repositoryโs default branch (usually master)", + "description": "The name of the commit/branch/tag. Default to the repositoryโs default branch.", "name": "ref", "in": "query" } @@ -6096,6 +7910,105 @@ } } }, + "/repos/{owner}/{repo}/file-contents": { + "get": { + "description": "See the POST method. This GET method supports using JSON encoded request body in query parameter.", + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get the metadata and contents of requested files", + "operationId": "repoGetFileContents", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default to the repositoryโs default branch.", + "name": "ref", + "in": "query" + }, + { + "type": "string", + "description": "The JSON encoded body (see the POST request): {\"files\": [\"filename1\", \"filename2\"]}", + "name": "body", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ContentsListResponse" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "post": { + "description": "Uses automatic pagination based on default page size and max response size and returns the maximum allowed number of files. Files which could not be retrieved are null. Files which are too large are being returned with `encoding == null`, `content == null` and `size \u003e 0`, they can be requested separately by using the `download_url`.", + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get the metadata and contents of requested files", + "operationId": "repoGetFileContentsPost", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default to the repositoryโs default branch.", + "name": "ref", + "in": "query" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetFilesOptions" + } + } + ], + "responses": { + "200": { + "$ref": "#/responses/ContentsListResponse" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/forks": { "get": { "produces": [ @@ -9317,6 +11230,111 @@ } } }, + "/repos/{owner}/{repo}/issues/{index}/lock": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Lock an issue", + "operationId": "issueLockIssue", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/LockIssueOption" + } + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Unlock an issue", + "operationId": "issueUnlockIssue", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + }, + "403": { + "$ref": "#/responses/forbidden" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/issues/{index}/pin": { "post": { "tags": [ @@ -9678,7 +11696,7 @@ "$ref": "#/responses/notFound" }, "409": { - "description": "Cannot cancel a non existent stopwatch" + "description": "Cannot cancel a non-existent stopwatch" } } } @@ -9784,7 +11802,7 @@ "$ref": "#/responses/notFound" }, "409": { - "description": "Cannot stop a non existent stopwatch" + "description": "Cannot stop a non-existent stopwatch" } } } @@ -9933,7 +11951,7 @@ }, { "type": "string", - "description": "user to subscribe", + "description": "username of the user to subscribe the issue to", "name": "user", "in": "path", "required": true @@ -9991,7 +12009,7 @@ }, { "type": "string", - "description": "user witch unsubscribe", + "description": "username of the user to unsubscribe from an issue", "name": "user", "in": "path", "required": true @@ -10861,7 +12879,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repositoryโs default branch", + "description": "The name of the commit/branch/tag. Default to the repositoryโs default branch", "name": "ref", "in": "query" } @@ -11419,6 +13437,12 @@ "required": true }, { + "type": "string", + "description": "Filter by target base branch of the pull request", + "name": "base_branch", + "in": "query" + }, + { "enum": [ "open", "closed", @@ -11434,6 +13458,7 @@ "enum": [ "oldest", "recentupdate", + "recentclose", "leastupdate", "mostcomment", "leastcomment", @@ -12998,7 +15023,7 @@ }, { "type": "string", - "description": "The name of the commit/branch/tag. Default the repositoryโs default branch", + "description": "The name of the commit/branch/tag. Default to the repositoryโs default branch", "name": "ref", "in": "query" } @@ -13726,6 +15751,42 @@ } } }, + "/repos/{owner}/{repo}/signing-key.pub": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "repository" + ], + "summary": "Get signing-key.pub for given repository", + "operationId": "repoSigningKeySSH", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ssh public key", + "schema": { + "type": "string" + } + } + } + } + }, "/repos/{owner}/{repo}/stargazers": { "get": { "produces": [ @@ -13768,6 +15829,9 @@ "200": { "$ref": "#/responses/UserList" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -14757,7 +16821,7 @@ }, { "type": "string", - "description": "username of user", + "description": "username of the user whose tracked times are to be listed", "name": "user", "in": "path", "required": true @@ -15556,6 +17620,26 @@ } } }, + "/signing-key.pub": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "miscellaneous" + ], + "summary": "Get default signing-key.pub", + "operationId": "getSigningKeySSH", + "responses": { + "200": { + "description": "ssh public key", + "schema": { + "type": "string" + } + } + } + } + }, "/teams/{id}": { "get": { "produces": [ @@ -15760,7 +17844,7 @@ }, { "type": "string", - "description": "username of the member to list", + "description": "username of the user whose data is to be listed", "name": "username", "in": "path", "required": true @@ -15795,7 +17879,7 @@ }, { "type": "string", - "description": "username of the user to add", + "description": "username of the user to add to a team", "name": "username", "in": "path", "required": true @@ -15833,7 +17917,7 @@ }, { "type": "string", - "description": "username of the user to remove", + "description": "username of the user to remove from a team", "name": "username", "in": "path", "required": true @@ -16087,6 +18171,72 @@ } } }, + "/user/actions/jobs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get workflow jobs", + "operationId": "getUserWorkflowJobs", + "parameters": [ + { + "type": "string", + "description": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowJobsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/user/actions/runners": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user-level runners", + "operationId": "getUserRunners", + "responses": { + "200": { + "$ref": "#/definitions/ActionRunnersResponse" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/user/actions/runners/registration-token": { "get": { "produces": [ @@ -16102,6 +18252,150 @@ "$ref": "#/responses/RegistrationToken" } } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get an user's actions runner registration token", + "operationId": "userCreateRunnerRegistrationToken", + "responses": { + "200": { + "$ref": "#/responses/RegistrationToken" + } + } + } + }, + "/user/actions/runners/{runner_id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get an user-level runner", + "operationId": "getUserRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/definitions/ActionRunner" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + }, + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete an user-level runner", + "operationId": "deleteUserRunner", + "parameters": [ + { + "type": "string", + "description": "id of the runner", + "name": "runner_id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "runner has been deleted" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, + "/user/actions/runs": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get workflow runs", + "operationId": "getUserWorkflowRuns", + "parameters": [ + { + "type": "string", + "description": "workflow event name", + "name": "event", + "in": "query" + }, + { + "type": "string", + "description": "workflow branch", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "description": "workflow status (pending, queued, in_progress, failure, success, skipped)", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "triggered by user", + "name": "actor", + "in": "query" + }, + { + "type": "string", + "description": "triggering sha of the workflow run", + "name": "head_sha", + "in": "query" + }, + { + "type": "integer", + "description": "page number of results to return (1-based)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "page size of results", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/WorkflowRunsList" + }, + "400": { + "$ref": "#/responses/error" + }, + "404": { + "$ref": "#/responses/notFound" + } + } } }, "/user/actions/secrets/{secretname}": { @@ -16323,16 +18617,13 @@ ], "responses": { "201": { - "description": "response when creating a variable" - }, - "204": { - "description": "response when creating a variable" + "description": "successfully created the user-level variable" }, "400": { "$ref": "#/responses/error" }, - "404": { - "$ref": "#/responses/notFound" + "409": { + "description": "variable name already exists." } } }, @@ -16605,7 +18896,7 @@ "parameters": [ { "type": "string", - "description": "user to check", + "description": "username of the user to check", "name": "username", "in": "path", "required": true @@ -16629,7 +18920,7 @@ "parameters": [ { "type": "string", - "description": "user to block", + "description": "username of the user to block", "name": "username", "in": "path", "required": true @@ -16662,7 +18953,7 @@ "parameters": [ { "type": "string", - "description": "user to unblock", + "description": "username of the user to unblock", "name": "username", "in": "path", "required": true @@ -16824,7 +19115,7 @@ "parameters": [ { "type": "string", - "description": "username of followed user", + "description": "username of the user to check for authenticated followers", "name": "username", "in": "path", "required": true @@ -16848,7 +19139,7 @@ "parameters": [ { "type": "string", - "description": "username of user to follow", + "description": "username of the user to follow", "name": "username", "in": "path", "required": true @@ -16875,7 +19166,7 @@ "parameters": [ { "type": "string", - "description": "username of user to unfollow", + "description": "username of the user to unfollow", "name": "username", "in": "path", "required": true @@ -17506,6 +19797,9 @@ "responses": { "200": { "$ref": "#/responses/RepositoryList" + }, + "403": { + "$ref": "#/responses/forbidden" } } } @@ -17537,6 +19831,9 @@ "204": { "$ref": "#/responses/empty" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -17602,6 +19899,9 @@ "204": { "$ref": "#/responses/empty" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -17820,7 +20120,7 @@ "parameters": [ { "type": "string", - "description": "username of user to get", + "description": "username of the user whose data is to be listed", "name": "username", "in": "path", "required": true @@ -17849,7 +20149,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose activity feeds are to be listed", "name": "username", "in": "path", "required": true @@ -17903,7 +20203,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose followers are to be listed", "name": "username", "in": "path", "required": true @@ -17944,7 +20244,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose followed users are to be listed", "name": "username", "in": "path", "required": true @@ -17982,14 +20282,14 @@ "parameters": [ { "type": "string", - "description": "username of following user", + "description": "username of the following user", "name": "username", "in": "path", "required": true }, { "type": "string", - "description": "username of followed user", + "description": "username of the followed user", "name": "target", "in": "path", "required": true @@ -18018,7 +20318,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose GPG key list is to be obtained", "name": "username", "in": "path", "required": true @@ -18059,7 +20359,7 @@ "parameters": [ { "type": "string", - "description": "username of user to get", + "description": "username of the user whose heatmap is to be obtained", "name": "username", "in": "path", "required": true @@ -18088,7 +20388,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose public keys are to be listed", "name": "username", "in": "path", "required": true @@ -18135,7 +20435,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose organizations are to be listed", "name": "username", "in": "path", "required": true @@ -18176,7 +20476,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose permissions are to be obtained", "name": "username", "in": "path", "required": true @@ -18215,7 +20515,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose owned repos are to be listed", "name": "username", "in": "path", "required": true @@ -18256,7 +20556,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose starred repos are to be listed", "name": "username", "in": "path", "required": true @@ -18278,6 +20578,9 @@ "200": { "$ref": "#/responses/RepositoryList" }, + "403": { + "$ref": "#/responses/forbidden" + }, "404": { "$ref": "#/responses/notFound" } @@ -18297,7 +20600,7 @@ "parameters": [ { "type": "string", - "description": "username of the user", + "description": "username of the user whose watched repos are to be listed", "name": "username", "in": "path", "required": true @@ -18338,7 +20641,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of to user whose access tokens are to be listed", "name": "username", "in": "path", "required": true @@ -18380,7 +20683,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose token is to be created", "name": "username", "in": "path", "required": true @@ -18419,7 +20722,7 @@ "parameters": [ { "type": "string", - "description": "username of user", + "description": "username of the user whose token is to be deleted", "name": "username", "in": "path", "required": true @@ -18486,11 +20789,21 @@ "type": "object", "title": "AccessToken represents an API access token.", "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Created" + }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, + "last_used_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, "name": { "type": "string", "x-go-name": "Name" @@ -18513,6 +20826,150 @@ }, "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" + }, + "ActionRunner": { + "description": "ActionRunner represents a Runner", + "type": "object", + "properties": { + "busy": { + "type": "boolean", + "x-go-name": "Busy" + }, + "ephemeral": { + "type": "boolean", + "x-go-name": "Ephemeral" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "labels": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionRunnerLabel" + }, + "x-go-name": "Labels" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionRunnerLabel": { + "description": "ActionRunnerLabel represents a Runner Label", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "type": { + "type": "string", + "x-go-name": "Type" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionRunnersResponse": { + "description": "ActionRunnersResponse returns Runners", + "type": "object", + "properties": { + "runners": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionRunner" + }, + "x-go-name": "Entries" + }, + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "ActionTask": { "description": "ActionTask represents a ActionTask", "type": "object", @@ -18605,6 +21062,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", @@ -18625,6 +21087,305 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "ActionWorkflow": { + "description": "ActionWorkflow represents a ActionWorkflow", + "type": "object", + "properties": { + "badge_url": { + "type": "string", + "x-go-name": "BadgeURL" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "deleted_at": { + "type": "string", + "format": "date-time", + "x-go-name": "DeletedAt" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "state": { + "type": "string", + "x-go-name": "State" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "UpdatedAt" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionWorkflowJob": { + "description": "ActionWorkflowJob represents a WorkflowJob", + "type": "object", + "properties": { + "completed_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CompletedAt" + }, + "conclusion": { + "type": "string", + "x-go-name": "Conclusion" + }, + "created_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CreatedAt" + }, + "head_branch": { + "type": "string", + "x-go-name": "HeadBranch" + }, + "head_sha": { + "type": "string", + "x-go-name": "HeadSha" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Labels" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "run_attempt": { + "type": "integer", + "format": "int64", + "x-go-name": "RunAttempt" + }, + "run_id": { + "type": "integer", + "format": "int64", + "x-go-name": "RunID" + }, + "run_url": { + "type": "string", + "x-go-name": "RunURL" + }, + "runner_id": { + "type": "integer", + "format": "int64", + "x-go-name": "RunnerID" + }, + "runner_name": { + "type": "string", + "x-go-name": "RunnerName" + }, + "started_at": { + "type": "string", + "format": "date-time", + "x-go-name": "StartedAt" + }, + "status": { + "type": "string", + "x-go-name": "Status" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionWorkflowStep" + }, + "x-go-name": "Steps" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionWorkflowJobsResponse": { + "description": "ActionWorkflowJobsResponse returns ActionWorkflowJobs", + "type": "object", + "properties": { + "jobs": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionWorkflowJob" + }, + "x-go-name": "Entries" + }, + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionWorkflowRun": { + "description": "ActionWorkflowRun represents a WorkflowRun", + "type": "object", + "properties": { + "actor": { + "$ref": "#/definitions/User" + }, + "completed_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CompletedAt" + }, + "conclusion": { + "type": "string", + "x-go-name": "Conclusion" + }, + "display_title": { + "type": "string", + "x-go-name": "DisplayTitle" + }, + "event": { + "type": "string", + "x-go-name": "Event" + }, + "head_branch": { + "type": "string", + "x-go-name": "HeadBranch" + }, + "head_repository": { + "$ref": "#/definitions/Repository" + }, + "head_sha": { + "type": "string", + "x-go-name": "HeadSha" + }, + "html_url": { + "type": "string", + "x-go-name": "HTMLURL" + }, + "id": { + "type": "integer", + "format": "int64", + "x-go-name": "ID" + }, + "path": { + "type": "string", + "x-go-name": "Path" + }, + "repository": { + "$ref": "#/definitions/Repository" + }, + "repository_id": { + "type": "integer", + "format": "int64", + "x-go-name": "RepositoryID" + }, + "run_attempt": { + "type": "integer", + "format": "int64", + "x-go-name": "RunAttempt" + }, + "run_number": { + "type": "integer", + "format": "int64", + "x-go-name": "RunNumber" + }, + "started_at": { + "type": "string", + "format": "date-time", + "x-go-name": "StartedAt" + }, + "status": { + "type": "string", + "x-go-name": "Status" + }, + "trigger_actor": { + "$ref": "#/definitions/User" + }, + "url": { + "type": "string", + "x-go-name": "URL" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionWorkflowRunsResponse": { + "description": "ActionWorkflowRunsResponse returns ActionWorkflowRuns", + "type": "object", + "properties": { + "total_count": { + "type": "integer", + "format": "int64", + "x-go-name": "TotalCount" + }, + "workflow_runs": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionWorkflowRun" + }, + "x-go-name": "Entries" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "ActionWorkflowStep": { + "description": "ActionWorkflowStep represents a step of a WorkflowJob", + "type": "object", + "properties": { + "completed_at": { + "type": "string", + "format": "date-time", + "x-go-name": "CompletedAt" + }, + "conclusion": { + "type": "string", + "x-go-name": "Conclusion" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "number": { + "type": "integer", + "format": "int64", + "x-go-name": "Number" + }, + "started_at": { + "type": "string", + "format": "date-time", + "x-go-name": "StartedAt" + }, + "status": { + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "Activity": { "type": "object", "properties": { @@ -18762,7 +21523,7 @@ "x-go-name": "Time" }, "user_name": { - "description": "User who spent the time (optional)", + "description": "username of the user who spent the time working on the issue (optional)", "type": "string", "x-go-name": "User" } @@ -19109,7 +21870,7 @@ ], "properties": { "content": { - "description": "new or updated file content, must be base64 encoded", + "description": "new or updated file content, it must be base64 encoded", "type": "string", "x-go-name": "ContentBase64" }, @@ -19119,11 +21880,13 @@ "x-go-name": "FromPath" }, "operation": { - "description": "indicates what to do with the file", + "description": "indicates what to do with the file: \"create\" for creating a new file, \"update\" for updating an existing file,\n\"upload\" for creating or updating a file, \"rename\" for renaming a file, and \"delete\" for deleting an existing file.", "type": "string", "enum": [ "create", "update", + "upload", + "rename", "delete" ], "x-go-name": "Operation" @@ -19134,7 +21897,7 @@ "x-go-name": "Path" }, "sha": { - "description": "sha is the SHA for the file that already exists, required for update or delete", + "description": "the blob ID (SHA) for the file that already exists, required for changing existing files", "type": "string", "x-go-name": "SHA" } @@ -19250,7 +22013,17 @@ "x-go-name": "SHA" }, "state": { - "$ref": "#/definitions/CommitStatusState" + "type": "string", + "enum": [ + "pending", + "success", + "error", + "failure", + "warning", + "skipped" + ], + "x-go-enum-desc": "pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending\nsuccess CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success\nerror CommitStatusError CommitStatusError is for when the CommitStatus is Error\nfailure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure\nwarning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning\nskipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped", + "x-go-name": "State" }, "statuses": { "type": "array", @@ -19478,7 +22251,17 @@ "x-go-name": "ID" }, "status": { - "$ref": "#/definitions/CommitStatusState" + "type": "string", + "enum": [ + "pending", + "success", + "error", + "failure", + "warning", + "skipped" + ], + "x-go-enum-desc": "pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending\nsuccess CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success\nerror CommitStatusError CommitStatusError is for when the CommitStatus is Error\nfailure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure\nwarning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning\nskipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped", + "x-go-name": "State" }, "target_url": { "type": "string", @@ -19496,11 +22279,6 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, - "CommitStatusState": { - "description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\" and \"failure\"", - "type": "string", - "x-go-package": "code.gitea.io/gitea/modules/structs" - }, "CommitUser": { "type": "object", "title": "CommitUser contains information of a user in the context of a commit.", @@ -19540,6 +22318,22 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "ContentsExtResponse": { + "type": "object", + "properties": { + "dir_contents": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentsResponse" + }, + "x-go-name": "DirContents" + }, + "file_contents": { + "$ref": "#/definitions/ContentsResponse" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "ContentsResponse": { "description": "ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content", "type": "object", @@ -19569,10 +22363,33 @@ "type": "string", "x-go-name": "HTMLURL" }, + "last_author_date": { + "type": "string", + "format": "date-time", + "x-go-name": "LastAuthorDate" + }, + "last_commit_message": { + "type": "string", + "x-go-name": "LastCommitMessage" + }, "last_commit_sha": { "type": "string", "x-go-name": "LastCommitSHA" }, + "last_committer_date": { + "type": "string", + "format": "date-time", + "x-go-name": "LastCommitterDate" + }, + "lfs_oid": { + "type": "string", + "x-go-name": "LfsOid" + }, + "lfs_size": { + "type": "integer", + "format": "int64", + "x-go-name": "LfsSize" + }, "name": { "type": "string", "x-go-name": "Name" @@ -19628,7 +22445,40 @@ "items": { "type": "string" }, - "x-go-name": "Scopes" + "x-go-name": "Scopes", + "example": [ + "all", + "read:activitypub", + "read:issue", + "write:misc", + "read:notification", + "read:organization", + "read:package", + "read:repository", + "read:user" + ] + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, + "CreateActionWorkflowDispatch": { + "description": "CreateActionWorkflowDispatch represents the payload for triggering a workflow dispatch event", + "type": "object", + "required": [ + "ref" + ], + "properties": { + "inputs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Inputs" + }, + "ref": { + "type": "string", + "x-go-name": "Ref", + "example": "refs/heads/main" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" @@ -20175,6 +23025,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" @@ -20207,6 +23062,7 @@ "x-go-name": "RepoAdminChangeTeamAccess" }, "username": { + "description": "username of the organization", "type": "string", "x-go-name": "UserName" }, @@ -20396,6 +23252,10 @@ "type": "boolean", "x-go-name": "IsPrerelease" }, + "tag_message": { + "type": "string", + "x-go-name": "TagMessage" + }, "tag_name": { "type": "string", "x-go-name": "TagName" @@ -20501,7 +23361,17 @@ "x-go-name": "Description" }, "state": { - "$ref": "#/definitions/CommitStatusState" + "type": "string", + "enum": [ + "pending", + "success", + "error", + "failure", + "warning", + "skipped" + ], + "x-go-enum-desc": "pending CommitStatusPending CommitStatusPending is for when the CommitStatus is Pending\nsuccess CommitStatusSuccess CommitStatusSuccess is for when the CommitStatus is Success\nerror CommitStatusError CommitStatusError is for when the CommitStatus is Error\nfailure CommitStatusFailure CommitStatusFailure is for when the CommitStatus is Failure\nwarning CommitStatusWarning CommitStatusWarning is for when the CommitStatus is Warning\nskipped CommitStatusSkipped CommitStatusSkipped is for when CommitStatus is Skipped", + "x-go-name": "State" }, "target_url": { "type": "string", @@ -20643,7 +23513,9 @@ "x-go-name": "FullName" }, "login_name": { + "description": "identifier of the user, provided by the external authenticator (if configured)", "type": "string", + "default": "empty", "x-go-name": "LoginName" }, "must_change_password": { @@ -20668,6 +23540,7 @@ "x-go-name": "SourceID" }, "username": { + "description": "username of the user", "type": "string", "x-go-name": "Username" }, @@ -20685,6 +23558,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", @@ -20792,7 +23670,7 @@ "x-go-name": "NewBranchName" }, "sha": { - "description": "sha is the SHA for the file that already exists", + "description": "the blob ID (SHA) for the file that already exists, it is required for changing existing files", "type": "string", "x-go-name": "SHA" }, @@ -21648,7 +24526,9 @@ "x-go-name": "Location" }, "login_name": { + "description": "identifier of the user, provided by the external authenticator (if configured)", "type": "string", + "default": "empty", "x-go-name": "LoginName" }, "max_repo_creation": { @@ -21707,6 +24587,7 @@ "x-go-name": "UserID" }, "username": { + "description": "username of the user", "type": "string", "x-go-name": "UserName" }, @@ -21968,6 +24849,11 @@ "format": "int64", "x-go-name": "DefaultMaxBlobSize" }, + "default_max_response_size": { + "type": "integer", + "format": "int64", + "x-go-name": "DefaultMaxResponseSize" + }, "default_paging_num": { "type": "integer", "format": "int64", @@ -22134,6 +25020,20 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "GetFilesOptions": { + "description": "GetFilesOptions options for retrieving metadate and content of multiple files", + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Files" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "GitBlobResponse": { "description": "GitBlobResponse represents a git blob", "type": "object", @@ -22146,6 +25046,15 @@ "type": "string", "x-go-name": "Encoding" }, + "lfs_oid": { + "type": "string", + "x-go-name": "LfsOid" + }, + "lfs_size": { + "type": "integer", + "format": "int64", + "x-go-name": "LfsSize" + }, "sha": { "type": "string", "x-go-name": "SHA" @@ -22788,6 +25697,17 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "LockIssueOption": { + "description": "LockIssueOption options to lock an issue", + "type": "object", + "properties": { + "lock_reason": { + "type": "string", + "x-go-name": "Reason" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "MarkdownOption": { "description": "MarkdownOption markdown options", "type": "object", @@ -22891,6 +25811,10 @@ "branch": { "type": "string", "x-go-name": "Branch" + }, + "ff_only": { + "type": "boolean", + "x-go-name": "FfOnly" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" @@ -23000,7 +25924,8 @@ "gogs", "onedev", "gitbucket", - "codebase" + "codebase", + "codecommit" ], "x-go-name": "Service" }, @@ -23387,7 +26312,7 @@ "x-go-name": "RepoAdminChangeTeamAccess" }, "username": { - "description": "deprecated", + "description": "username of the organization\ndeprecated", "type": "string", "x-go-name": "UserName" }, @@ -23502,10 +26427,6 @@ "description": "PackageFile represents a package file", "type": "object", "properties": { - "Size": { - "type": "integer", - "format": "int64" - }, "id": { "type": "integer", "format": "int64", @@ -23530,6 +26451,11 @@ "sha512": { "type": "string", "x-go-name": "HashSHA512" + }, + "size": { + "type": "integer", + "format": "int64", + "x-go-name": "Size" } }, "x-go-package": "code.gitea.io/gitea/modules/structs" @@ -23630,6 +26556,7 @@ "x-go-name": "Name" }, "username": { + "description": "username of the user", "type": "string", "x-go-name": "UserName" } @@ -23681,6 +26608,11 @@ "type": "string", "x-go-name": "KeyType" }, + "last_used_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, "read_only": { "type": "boolean", "x-go-name": "ReadOnly" @@ -24207,6 +27139,22 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "RenameOrgOption": { + "description": "RenameOrgOption options when renaming an organization", + "type": "object", + "required": [ + "new_name" + ], + "properties": { + "new_name": { + "description": "New username for this org. This name cannot be in use yet by any other user.", + "type": "string", + "uniqueItems": true, + "x-go-name": "NewName" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "RenameUserOption": { "description": "RenameUserOption options when renaming a user", "type": "object", @@ -24311,6 +27259,10 @@ "type": "boolean", "x-go-name": "AllowFastForwardOnly" }, + "allow_manual_merge": { + "type": "boolean", + "x-go-name": "AllowManualMerge" + }, "allow_merge_commits": { "type": "boolean", "x-go-name": "AllowMerge" @@ -24340,6 +27292,10 @@ "format": "date-time", "x-go-name": "ArchivedAt" }, + "autodetect_manual_merge": { + "type": "boolean", + "x-go-name": "AutodetectManualMerge" + }, "avatar_url": { "type": "string", "x-go-name": "AvatarURL" @@ -24630,6 +27586,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", @@ -25059,6 +28020,7 @@ "x-go-name": "UserID" }, "user_name": { + "description": "username of the user", "type": "string", "x-go-name": "UserName" } @@ -25162,7 +28124,7 @@ "x-go-name": "NewBranchName" }, "sha": { - "description": "sha is the SHA for the file that already exists", + "description": "the blob ID (SHA) for the file that already exists, it is required for changing existing files", "type": "string", "x-go-name": "SHA" }, @@ -25205,6 +28167,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", @@ -25295,12 +28262,12 @@ "x-go-name": "Location" }, "login": { - "description": "the user's username", + "description": "login of the user, same as `username`", "type": "string", "x-go-name": "UserName" }, "login_name": { - "description": "the user's authentication sign-in name.", + "description": "identifier of the user, provided by the external authenticator (if configured)", "type": "string", "default": "empty", "x-go-name": "LoginName" @@ -25616,6 +28583,21 @@ "$ref": "#/definitions/ActionVariable" } }, + "ActionWorkflow": { + "description": "ActionWorkflow", + "schema": { + "$ref": "#/definitions/ActionWorkflow" + } + }, + "ActionWorkflowList": { + "description": "ActionWorkflowList", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionWorkflow" + } + } + }, "ActivityFeedsList": { "description": "ActivityFeedsList", "schema": { @@ -25637,6 +28619,18 @@ "$ref": "#/definitions/AnnotatedTag" } }, + "Artifact": { + "description": "Artifact", + "schema": { + "$ref": "#/definitions/ActionArtifact" + } + }, + "ArtifactsList": { + "description": "ArtifactsList", + "schema": { + "$ref": "#/definitions/ActionArtifactsResponse" + } + }, "Attachment": { "description": "Attachment", "schema": { @@ -25809,6 +28803,12 @@ "$ref": "#/definitions/Compare" } }, + "ContentsExtResponse": { + "description": "", + "schema": { + "$ref": "#/definitions/ContentsExtResponse" + } + }, "ContentsListResponse": { "description": "ContentsListResponse", "schema": { @@ -26373,6 +29373,18 @@ } } }, + "Runner": { + "description": "Runner", + "schema": { + "$ref": "#/definitions/ActionRunner" + } + }, + "RunnerList": { + "description": "RunnerList", + "schema": { + "$ref": "#/definitions/ActionRunnersResponse" + } + }, "SearchResults": { "description": "SearchResults", "schema": { @@ -26583,6 +29595,30 @@ } } }, + "WorkflowJob": { + "description": "WorkflowJob", + "schema": { + "$ref": "#/definitions/ActionWorkflowJob" + } + }, + "WorkflowJobsList": { + "description": "WorkflowJobsList", + "schema": { + "$ref": "#/definitions/ActionWorkflowJobsResponse" + } + }, + "WorkflowRun": { + "description": "WorkflowRun", + "schema": { + "$ref": "#/definitions/ActionWorkflowRun" + } + }, + "WorkflowRunsList": { + "description": "WorkflowRunsList", + "schema": { + "$ref": "#/definitions/ActionWorkflowRunsResponse" + } + }, "conflict": { "description": "APIConflict is a conflict empty response" }, @@ -26631,7 +29667,7 @@ "parameterBodies": { "description": "parameterBodies", "schema": { - "$ref": "#/definitions/UpdateVariableOption" + "$ref": "#/definitions/LockIssueOption" } }, "redirect": { @@ -26730,4 +29766,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/link_account.tmpl b/templates/user/auth/link_account.tmpl index a99e172d05..d244ce38c2 100644 --- a/templates/user/auth/link_account.tmpl +++ b/templates/user/auth/link_account.tmpl @@ -16,13 +16,18 @@ </div> </overflow-menu> <div class="ui middle very relaxed page grid"> - <div class="column"> + <div class="column tw-my-5"> + {{/* these styles are quite tricky but it needs to be the same as the signin page */}} <div class="ui tab {{if not .user_exists}}active{{end}}" data-tab="auth-link-signup-tab"> + <div class="tw-flex tw-flex-col tw-gap-4 tw-max-w-2xl tw-m-auto"> {{if .AutoRegistrationFailedPrompt}}<div class="ui message">{{.AutoRegistrationFailedPrompt}}</div>{{end}} {{template "user/auth/signup_inner" .}} + </div> </div> <div class="ui tab {{if .user_exists}}active{{end}}" data-tab="auth-link-signin-tab"> + <div class="tw-flex tw-flex-col tw-gap-4 tw-max-w-2xl tw-m-auto"> {{template "user/auth/signin_inner" .}} + </div> </div> </div> </div> diff --git a/templates/user/auth/signin.tmpl b/templates/user/auth/signin.tmpl index 54cc82d49d..75e1bb27f9 100644 --- a/templates/user/auth/signin.tmpl +++ b/templates/user/auth/signin.tmpl @@ -1,6 +1,7 @@ {{template "base/head" .}} <div role="main" aria-label="{{.Title}}" class="page-content user signin{{if .LinkAccountMode}} icon{{end}}"> <div class="ui middle very relaxed page grid"> + {{/* these styles are quite tricky and should also apply to the signup and link_account pages */}} <div class="column tw-flex tw-flex-col tw-gap-4 tw-max-w-2xl tw-m-auto"> {{template "user/auth/signin_inner" .}} </div> diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index fbf86a92bf..5552363a0a 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -59,11 +59,13 @@ </div> </div> +{{if or .EnablePasskeyAuth .ShowRegistrationButton}} <div class="ui container fluid"> - {{template "user/auth/webauthn_error" .}} - <div class="ui attached segment header top tw-max-w-2xl tw-m-auto tw-flex tw-flex-col tw-items-center"> - <a class="signin-passkey">{{ctx.Locale.Tr "auth.signin_passkey"}}</a> + {{if .EnablePasskeyAuth}} + {{template "user/auth/webauthn_error" .}} + <a class="signin-passkey">{{ctx.Locale.Tr "auth.signin_passkey"}}</a> + {{end}} {{if .ShowRegistrationButton}} <div class="field"> @@ -73,3 +75,4 @@ {{end}} </div> </div> +{{end}} diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index b3b2a4205e..a3f6e1471f 100644 --- a/templates/user/auth/signup_inner.tmpl +++ b/templates/user/auth/signup_inner.tmpl @@ -7,6 +7,9 @@ {{end}} </h4> <div class="ui attached segment"> + {{if .IsFirstTimeRegistration}} + <p>{{ctx.Locale.Tr "auth.sign_up_tip"}}</p> + {{end}} <form class="ui form" action="{{.SignUpLink}}" method="post"> {{.CsrfTokenHtml}} {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}} @@ -59,12 +62,12 @@ </div> <div class="ui container fluid"> + {{if not .LinkAccountMode}} <div class="ui attached segment header top tw-flex tw-flex-col tw-items-center"> - {{if not .LinkAccountMode}} <div class="field"> <span>{{ctx.Locale.Tr "auth.already_have_account"}}</span> <a href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "auth.sign_in_now"}}</a> </div> - {{end}} </div> + {{end}} </div> 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 5dc46dc0a5..666dd78073 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -5,7 +5,11 @@ <div class="flex-container-main"> {{template "base/alert" .}} {{template "user/heatmap" .}} - {{template "user/dashboard/feeds" .}} + {{if .Page.Paginater.TotalPages}} + {{template "user/dashboard/feeds" .}} + {{else}} + {{template "user/dashboard/guide" .}} + {{end}} </div> {{template "user/dashboard/repolist" .}} </div> diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 1c1ba5566f..37dede7af6 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -73,10 +73,13 @@ {{else if .GetOpType.InActions "publish_release"}} {{$linkText := .Content | ctx.RenderUtils.RenderEmoji}} {{ctx.Locale.Tr "action.publish_release" (.GetRepoLink ctx) (printf "%s/releases/tag/%s" (.GetRepoLink ctx) .GetTag) (.ShortRepoPath ctx) $linkText}} - {{else if .GetOpType.InActions "review_dismissed"}} + {{else if .GetOpType.InActions "pull_review_dismissed"}} {{$index := index .GetIssueInfos 0}} {{$reviewer := index .GetIssueInfos 1}} {{ctx.Locale.Tr "action.review_dismissed" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx) $reviewer}} + {{else if .GetOpType.InActions "auto_merge_pull_request"}} + {{$index := index .GetIssueInfos 0}} + {{ctx.Locale.Tr "action.auto_merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}} {{end}} {{DateUtils.TimeSince .GetCreate}} </div> @@ -88,10 +91,10 @@ {{range $push.Commits}} {{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}} <div class="flex-text-block"> - <img class="ui avatar" src="{{$push.AvatarLink ctx .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16"> + <img loading="lazy" alt class="ui avatar" src="{{$push.AvatarLink ctx .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16"> <a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a> <span class="text truncate"> - {{ctx.RenderUtils.RenderCommitMessage .Message ($repo.ComposeMetas ctx)}} + {{ctx.RenderUtils.RenderCommitMessage .Message $repo}} </span> </div> {{end}} @@ -107,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/guide.tmpl b/templates/user/dashboard/guide.tmpl new file mode 100644 index 0000000000..bdbe81ece0 --- /dev/null +++ b/templates/user/dashboard/guide.tmpl @@ -0,0 +1,10 @@ +<div class="tw-text-center tw-p-8"> + {{svg "octicon-package" 24 "tw-text-placeholder-text"}} + <h3 class="tw-my-4">{{ctx.Locale.Tr "home.guide_title"}}</h3> + <p class="tw-text-placeholder-text">{{ctx.Locale.Tr "home.guide_desc"}}</p> + <div> + <a href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "home.explore_repos"}}</a> + <span>ยท</span> + <a href="{{AppSubUrl}}/explore/users">{{ctx.Locale.Tr "home.explore_users"}}</a> + </div> +</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 c0059d3cd4..15b1b9e30b 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}}"> @@ -100,7 +100,7 @@ {{if .TotalTrackedTime}} <div class="flex-text-block"> {{svg "octicon-clock"}} - {{.TotalTrackedTime|Sec2Time}} + {{.TotalTrackedTime|Sec2Hour}} </div> {{end}} {{if .UpdatedUnix}} @@ -116,7 +116,7 @@ {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} {{else}} {{if .DeadlineString}} - <span{{if .IsOverdue}} class="text red"{{end}}> + <span class="flex-text-inline {{if .IsOverdue}}text red{{end}}"> {{svg "octicon-calendar" 14}} {{DateUtils.AbsoluteShort (.DeadlineString|DateUtils.ParseLegacy)}} </span> @@ -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/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index a828bc90e4..7eb845833f 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -2,32 +2,32 @@ <div class="ui secondary stackable menu"> <div class="item"> <div class="ui floating dropdown jump"> - <span class="text truncated-item-container"> + <span class="text"> {{ctx.AvatarUtils.Avatar .ContextUser 24 "tw-mr-1"}} - <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> + <span class="gt-ellipsis">{{.ContextUser.ShortName 40}}</span> <span class="org-visibility"> {{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} </span> {{svg "octicon-triangle-down" 14 "dropdown icon tw-ml-1"}} </span> - <div class="context user overflow menu"> + <div class="menu context-user-switch"> <div class="header"> {{ctx.Locale.Tr "home.switch_dashboard_context"}} </div> - <div class="scrolling menu items"> - <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}"> + <div class="scrolling menu"> + <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}"> {{ctx.AvatarUtils.Avatar .SignedUser}} - <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + <span class="gt-ellipsis">{{.SignedUser.ShortName 40}}</span> <span class="org-visibility"> {{if .SignedUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .SignedUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} </span> </a> {{range .Orgs}} - <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item truncated-item-container" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}"> + <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}"> {{ctx.AvatarUtils.Avatar .}} - <span class="truncated-item-name">{{.ShortName 40}}</span> + <span class="gt-ellipsis">{{.ShortName 40}}</span> <span class="org-visibility"> {{if .Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} @@ -37,7 +37,7 @@ </div> {{if .SignedUser.CanCreateOrganization}} <a class="item" href="{{AppSubUrl}}/org/create"> - {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_org"}} + {{svg "octicon-plus" 16 "tw-ml-1 tw-mr-5"}}{{ctx.Locale.Tr "new_org"}} </a> {{end}} </div> @@ -77,7 +77,7 @@ {{end}} {{if .ContextUser.IsOrganization}} - <div class="right menu"> + <div class="right menu tw-flex-wrap tw-justify-end"> <a class="{{if .PageIsNews}}active {{end}}item tw-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}"> {{svg "octicon-rss"}} {{ctx.Locale.Tr "activities"}} </a> @@ -98,7 +98,7 @@ {{end}} <div class="item"> <a class="ui primary basic button" href="{{.ContextUser.HomeLink}}" title="{{ctx.Locale.Tr "home.view_home" .ContextUser.Name}}"> - {{ctx.Locale.Tr "home.view_home" (.ContextUser.ShortName 40)}} + {{ctx.Locale.Tr "home.view_home" (.ContextUser.ShortName 20)}} </a> </div> </div> diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl index a2764ba608..8b0fcbb401 100644 --- a/templates/user/dashboard/repolist.tmpl +++ b/templates/user/dashboard/repolist.tmpl @@ -5,6 +5,10 @@ const data = { isMirrorsEnabled: {{.MirrorsEnabled}}, isStarsEnabled: {{not .IsDisableStars}}, + canCreateMigrations: {{not .DisableMigrations}}, + + textNoOrg: {{ctx.Locale.Tr "home.empty_org"}}, + textNoRepo: {{ctx.Locale.Tr "home.empty_repo"}}, textRepository: {{ctx.Locale.Tr "repository"}}, textOrganization: {{ctx.Locale.Tr "organization"}}, textMyRepos: {{ctx.Locale.Tr "home.my_repos"}}, 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..e4dd27e63b 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"> @@ -69,8 +69,8 @@ {{template "shared/issuelist" dict "." . "listType" "dashboard"}} {{end}} {{else}} - {{template "shared/repo_search" .}} - {{template "explore/repo_list" .}} + {{template "shared/repo/search" .}} + {{template "shared/repo/list" .}} {{template "base/paginate" .}} {{end}} </div> diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 345872b00d..74a53b937d 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -17,8 +17,8 @@ {{template "user/dashboard/feeds" .}} {{else if eq .TabName "stars"}} <div class="stars"> - {{template "shared/repo_search" .}} - {{template "explore/repo_list" .}} + {{template "shared/repo/search" .}} + {{template "shared/repo/list" .}} {{template "base/paginate" .}} </div> {{else if eq .TabName "following"}} @@ -26,12 +26,12 @@ {{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}} - {{template "shared/repo_search" .}} - {{template "explore/repo_list" .}} + {{template "shared/repo/search" .}} + {{template "shared/repo/list" .}} {{template "base/paginate" .}} {{end}} </div> diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl index 27b0ef10c7..2c01c88d47 100644 --- a/templates/user/settings/account.tmpl +++ b/templates/user/settings/account.tmpl @@ -43,11 +43,11 @@ <div class="ui list flex-items-block"> {{if $.EnableNotifyMail}} <div class="item"> - <div class="tw-mb-2">{{ctx.Locale.Tr "settings.email_desc"}}</div> - <form action="{{AppSubUrl}}/user/settings/account/email" class="ui form" method="post"> + <form class="ui form tw-w-full" action="{{AppSubUrl}}/user/settings/account/email" method="post"> {{$.CsrfTokenHtml}} <input name="_method" type="hidden" value="NOTIFICATION"> - <div class="tw-flex tw-flex-wrap tw-gap-2"> + <div class="field"> + <label>{{ctx.Locale.Tr "settings.email_desc"}}</label> <div class="ui selection dropdown"> <input name="preference" type="hidden" value="{{.EmailNotificationsPreference}}"> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -59,6 +59,8 @@ <div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.disable"}}</div> </div> </div> + </div> + <div class="field"> <button class="ui primary button">{{ctx.Locale.Tr "settings.email_notifications.submit"}}</button> </div> </form> 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..8c24da7fc9 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) (HTMLFormat `href="%s" target="_blank"` "https://docs.gitea.com/development/oauth2-provider#scopes")}}</div> + <table class="ui table unstackable tw-my-2"> + {{range $category := .TokenCategories}} + <tr> + <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/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl index b894ccdfbd..9d62d4ab08 100644 --- a/templates/user/settings/keys_ssh.tmpl +++ b/templates/user/settings/keys_ssh.tmpl @@ -78,7 +78,16 @@ <input readonly="" value="{{$.TokenToSign}}"> <div class="help"> <p>{{ctx.Locale.Tr "settings.ssh_token_help"}}</p> - <p><code>{{printf "echo -n '%s' | ssh-keygen -Y sign -n gitea -f /path_to_PrivateKey_or_RelatedPublicKey" $.TokenToSign}}</code></p> + <p><code>echo -n '{{$.TokenToSign}}' | ssh-keygen -Y sign -n gitea -f /path_to_PrivateKey_or_RelatedPublicKey</code></p> + <details> + <summary>Windows PowerShell</summary> + <p><code>cmd /c "<NUL set /p=`"{{$.TokenToSign}}`"| ssh-keygen -Y sign -n gitea -f /path_to_PrivateKey_or_RelatedPublicKey"</code></p> + </details> + <br> + <details> + <summary>Windows CMD</summary> + <p><code>set /p={{$.TokenToSign}}| ssh-keygen -Y sign -n gitea -f /path_to_PrivateKey_or_RelatedPublicKey</code></p> + </details> </div> <br> </div> diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl index 16c27b52cd..a48ca9ec9b 100644 --- a/templates/user/settings/organization.tmpl +++ b/templates/user/settings/organization.tmpl @@ -47,7 +47,7 @@ {{ctx.Locale.Tr "org.members.leave"}} </div> <div class="content"> - <p>{{ctx.Locale.Tr "org.members.leave.detail" (`<span class="dataOrganizationName"></span>`|SafeHTML)}}</p> + <p>{{ctx.Locale.Tr "org.members.leave.detail" (HTMLFormat `<span class="%s"></span>` "dataOrganizationName")}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index 197763425c..d8e5e27b89 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -12,7 +12,7 @@ <span class="text red tw-hidden" id="name-change-prompt"> {{ctx.Locale.Tr "settings.change_username_prompt"}}</span> <span class="text red tw-hidden" id="name-change-redirect-prompt"> {{ctx.Locale.Tr "settings.change_username_redirect_prompt"}}</span> </label> - <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if or (not .SignedUser.IsLocal) ($.UserDisabledFeatures.Contains "change_username") .IsReverseProxy}}disabled{{end}} maxlength="40"> + <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" required {{if or (not .SignedUser.IsLocal) ($.UserDisabledFeatures.Contains "change_username") .IsReverseProxy}}disabled{{end}} maxlength="40"> {{if or (not .SignedUser.IsLocal) ($.UserDisabledFeatures.Contains "change_username") .IsReverseProxy}} <p class="help text blue">{{ctx.Locale.Tr "settings.password_username_disabled"}}</p> {{end}} @@ -124,13 +124,7 @@ </div> <div class="inline field tw-pl-4"> - <label for="new-avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label> - <input id="new-avatar" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp"> - </div> - - <div class="field tw-pl-4 cropper-panel tw-hidden"> - <div>{{ctx.Locale.Tr "settings.cropper_prompt"}}</div> - <div class="cropper-wrapper"><img class="cropper-source" src alt></div> + {{template "shared/avatar_upload_crop" dict "LabelText" (ctx.Locale.Tr "settings.choose_new_avatar")}} </div> <div class="field"> 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"> |