2023-04-23 06:21:21 -04:00
{{ template "repo/settings/layout_head" ( dict "ctxData" . "pageClass" "repository settings options" ) }}
< div class = "user-main-content twelve wide column" >
2017-03-15 18:39:38 -04:00
< h4 class = "ui top attached header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.basic_settings" }}
2017-03-15 18:39:38 -04:00
< / h4 >
< div class = "ui attached segment" >
< form class = "ui form" action = " {{ .Link }} " method = "post" >
2021-10-18 18:08:41 -04:00
{{ template "base/disable_form_autofill" }}
2017-03-15 18:39:38 -04:00
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "update" >
< div class = "required field {{ if .Err_RepoName }} error {{ end }} " >
2024-04-18 05:01:06 -04:00
< label > {{ ctx .Locale.Tr "repo.repo_name" }} </ label >
< input name = "repo_name" value = " {{ .Repository.Name }} " data-repo-name = " {{ .Repository.Name }} " autofocus required >
2017-03-15 18:39:38 -04:00
< / div >
2019-11-12 19:45:19 -05:00
< div class = "inline field" >
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.repo_size" }} </ label >
2024-03-19 06:52:32 -04:00
< span {{ if not ( eq .Repository.Size 0 ) }} data-tooltip-content = " {{ .Repository.SizeDetailsString ctx .Locale }} " {{ end }} > {{ ctx .Locale.TrSize .Repository.Size }} </ span >
2019-11-12 19:45:19 -05:00
< / div >
2019-11-11 10:15:29 -05:00
< div class = "inline field" >
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.template" }} </ label >
2019-11-11 10:15:29 -05:00
< div class = "ui checkbox" >
< input name = "template" type = "checkbox" {{ if .Repository.IsTemplate }} checked {{ end }} >
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.template_helper" }} </ label >
2019-11-11 10:15:29 -05:00
< / div >
< / div >
2017-03-15 18:39:38 -04:00
{{ if not .Repository.IsFork }}
< div class = "inline field" >
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.visibility" }} </ label >
< div class = "ui checkbox" {{ if and ( not .Repository.IsPrivate ) ( gt .Repository.NumStars 0 ) }} data-tooltip-content = " {{ ctx .Locale.Tr "repo.stars_remove_warning" }} " {{ end }} >
2019-04-11 04:32:42 -04:00
{{ if .IsAdmin }}
< input name = "private" type = "checkbox" {{ if .Repository.IsPrivate }} checked {{ end }} >
{{ else }}
2019-02-22 16:56:05 -05:00
< input name = "private" type = "checkbox" {{ if .Repository.IsPrivate }} checked {{ end }}{{ if and $.ForcePrivate .Repository.IsPrivate }} readonly {{ end }} >
2019-04-11 04:32:42 -04:00
{{ end }}
2024-02-22 12:02:33 -05:00
< label > {{ ctx .Locale.Tr "repo.visibility_helper" }} {{ if .Repository.NumForks }} < span class = "text red" > {{ ctx .Locale.Tr "repo.visibility_fork_helper" }} </ span > {{ end }} </ label >
2017-02-21 10:02:10 -05:00
< / div >
2017-03-15 18:39:38 -04:00
< / div >
{{ end }}
< div class = "field {{ if .Err_Description }} error {{ end }} " >
2023-09-25 04:56:50 -04:00
< label for = "description" > {{ ctx .Locale.Tr "repo.repo_desc" }} </ label >
2022-09-16 03:19:16 -04:00
< textarea id = "description" name = "description" rows = "2" maxlength = "2048" > {{ .Repository.Description }} </ textarea >
2017-03-15 18:39:38 -04:00
< / div >
< div class = "field {{ if .Err_Website }} error {{ end }} " >
2023-09-25 04:56:50 -04:00
< label for = "website" > {{ ctx .Locale.Tr "repo.settings.site" }} </ label >
2022-09-16 03:19:16 -04:00
< input id = "website" name = "website" type = "url" maxlength = "1024" value = " {{ .Repository.Website }} " >
2017-03-15 18:39:38 -04:00
< / div >
< div class = "field" >
2023-09-25 04:56:50 -04:00
< button class = "ui primary button" > {{ ctx .Locale.Tr "repo.settings.update_settings" }} </ button >
2016-08-30 19:18:33 -04:00
< / div >
2017-03-15 18:39:38 -04:00
< / form >
2019-05-29 22:22:26 -04:00
2023-06-29 08:24:22 -04:00
< div class = "divider" > < / div >
2019-05-29 22:22:26 -04:00
< form class = "ui form" action = " {{ .Link }} /avatar" method = "post" enctype = "multipart/form-data" >
{{ .CsrfTokenHtml }}
< div class = "inline field" >
2023-09-25 04:56:50 -04:00
< label for = "avatar" > {{ ctx .Locale.Tr "settings.choose_new_avatar" }} </ label >
2023-04-21 17:58:59 -04:00
< input name = "avatar" type = "file" accept = "image/png,image/jpeg,image/gif,image/webp" >
2019-05-29 22:22:26 -04:00
< / div >
< div class = "field" >
2023-09-25 04:56:50 -04:00
< 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 >
2019-05-29 22:22:26 -04:00
< / div >
< / form >
2017-03-15 18:39:38 -04:00
< / div >
2016-08-30 19:18:33 -04:00
2023-05-29 07:32:52 -04:00
{{/* These variables exist to make the logic in the Settings window easier to comprehend and are not used later on. */}}
{{ $newMirrorsPartiallyEnabled := or ( not .DisableNewPullMirrors ) ( not .DisableNewPushMirrors ) }}
{{/* .Repository.IsMirror is not always reliable if the repository is not actively acting as a mirror because of errors. */}}
2024-01-10 06:55:59 -05:00
{{ $showMirrorSettings := and ( .Repository.UnitEnabled $.Context $.UnitTypeCode ) ( or $newMirrorsPartiallyEnabled .Repository.IsMirror .PullMirror .PushMirrors ) }}
2023-05-29 07:32:52 -04:00
{{ $newMirrorsEntirelyEnabled := and ( not .DisableNewPullMirrors ) ( not .DisableNewPushMirrors ) }}
{{ $onlyNewPushMirrorsEnabled := and ( not .DisableNewPushMirrors ) .DisableNewPullMirrors }}
{{ $onlyNewPullMirrorsEnabled := and .DisableNewPushMirrors ( not .DisableNewPullMirrors ) }}
{{ $existingPushMirror := or .Repository.IsMirror .PushMirrors }}
{{ $modifyBrokenPullMirror := and .Repository.IsMirror ( not .PullMirror ) }}
{{ $isWorkingPullMirror := .PullMirror }}
{{ if $showMirrorSettings }}
2017-03-15 18:39:38 -04:00
< h4 class = "ui top attached header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.mirror_settings" }}
2017-03-15 18:39:38 -04:00
< / h4 >
< div class = "ui attached segment" >
2024-01-23 21:32:57 -05:00
{{ if .Repository.IsArchived }}
2024-03-03 22:33:20 -05:00
< div class = "ui warning message tw-text-center" >
2024-01-23 21:32:57 -05:00
{{ ctx .Locale.Tr "repo.settings.archive.mirrors_unavailable" }}
< / div >
2023-05-29 07:32:52 -04:00
{{ else }}
2024-01-23 21:32:57 -05:00
{{ if $newMirrorsEntirelyEnabled }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs" }}
2024-04-27 17:27:57 -04:00
< a target = "_blank" rel = "noopener noreferrer" href = "https://forgejo.org/docs/latest/user/repo-mirror#pushing-to-a-remote-repository" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title" }} </ a >< br >< br >
2024-01-23 21:32:57 -05:00
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions" }}
2024-04-27 17:27:57 -04:00
< a target = "_blank" rel = "noopener noreferrer" href = "https://forgejo.org/docs/latest/user/repo-mirror#pulling-from-a-remote-repository" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section" }} </ a >< br >
2024-01-23 21:32:57 -05:00
{{ else if $onlyNewPushMirrorsEnabled }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions" }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled" }}
2024-04-27 17:27:57 -04:00
< a target = "_blank" rel = "noopener noreferrer" href = "https://forgejo.org/docs/latest/user/repo-mirror#pulling-from-a-remote-repository" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title" }} </ a >< br >
2024-01-23 21:32:57 -05:00
{{ else if $onlyNewPullMirrorsEnabled }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions" }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning" }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled" }}
2024-04-27 17:27:57 -04:00
< a target = "_blank" rel = "noopener noreferrer" href = "https://forgejo.org/docs/latest/user/repo-mirror#pulling-from-a-remote-repository" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title" }} </ a >< br >< br >
2024-01-23 21:32:57 -05:00
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info" }}
{{ if $existingPushMirror }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.can_still_use" }}
{{ end }}
{{ else }}
{{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors" }} {{ ctx .Locale.Tr "repo.settings.mirror_settings.docs.can_still_use" }} < br >
2021-04-08 18:25:57 -04:00
{{ end }}
2024-01-31 19:04:23 -05:00
{{ if .Repository.IsMirror }}
2024-01-23 21:32:57 -05:00
< table class = "ui table" >
< thead >
< tr >
2024-03-23 16:11:15 -04:00
< th class = "tw-w-2/5" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.mirrored_repository" }} </ th >
2024-01-23 21:32:57 -05:00
< th > {{ ctx .Locale.Tr "repo.settings.mirror_settings.direction" }} </ th >
< th > {{ ctx .Locale.Tr "repo.settings.mirror_settings.last_update" }} </ th >
< th > < / th >
< / tr >
< / thead >
{{ if $modifyBrokenPullMirror }}
{{/* even if a repo is a pull mirror (IsMirror=true), the PullMirror might still be nil if the mirror migration is broken */}}
< tbody >
< tr >
< td colspan = "4" >
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 12:42:49 -04:00
< div class = "text red tw-py-4" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.direction.pull" }} : {{ ctx .Locale.Tr "error.occurred" }} </ div >
2024-01-23 21:32:57 -05:00
< / td >
< / tr >
< / tbody >
{{ else if $isWorkingPullMirror }}
2023-05-15 15:02:10 -04:00
< tbody >
< tr >
2024-01-23 21:32:57 -05:00
< td > {{ .PullMirror.RemoteAddress }} </ td >
< td > {{ ctx .Locale.Tr "repo.settings.mirror_settings.direction.pull" }} </ td >
< td > {{ DateTime "full" .PullMirror.UpdatedUnix }} </ td >
< td class = "right aligned" >
2024-03-22 09:45:10 -04:00
< form method = "post" class = "tw-inline-block" >
2024-01-23 21:32:57 -05:00
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "mirror-sync" >
2024-04-22 07:21:06 -04:00
< button class = "ui primary tiny button inline" > {{ ctx .Locale.Tr "repo.settings.sync_mirror" }} </ button >
2024-01-23 21:32:57 -05:00
< / form >
2023-05-15 15:02:10 -04:00
< / td >
< / tr >
2021-09-07 11:49:36 -04:00
< tr >
< td colspan = "4" >
< form class = "ui form" method = "post" >
2021-10-18 18:08:41 -04:00
{{ template "base/disable_form_autofill" }}
2021-09-07 11:49:36 -04:00
{{ .CsrfTokenHtml }}
2024-01-23 21:32:57 -05:00
< input type = "hidden" name = "action" value = "mirror" >
< div class = "inline field {{ if .Err_EnablePrune }} error {{ end }} " >
< label > {{ ctx .Locale.Tr "repo.mirror_prune" }} </ label >
< div class = "ui checkbox" >
< input id = "enable_prune" name = "enable_prune" type = "checkbox" {{ if .PullMirror.EnablePrune }} checked {{ end }} >
< label > {{ ctx .Locale.Tr "repo.mirror_prune_desc" }} </ label >
< / div >
< / div >
< div class = "inline field {{ if .Err_Interval }} error {{ end }} " >
< label for = "interval" > {{ ctx .Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval }} </ label >
< input id = "interval" name = "interval" value = " {{ .PullMirror.Interval }} " >
< / div >
2024-04-13 11:41:57 -04:00
{{ $address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName }}
2024-01-23 21:32:57 -05:00
< div class = "field {{ if .Err_MirrorAddress }} error {{ end }} " >
< label for = "mirror_address" > {{ ctx .Locale.Tr "repo.mirror_address" }} </ label >
< input id = "mirror_address" name = "mirror_address" value = " {{ $address .Address }} " required >
2023-09-25 04:56:50 -04:00
< p class = "help" > {{ ctx .Locale.Tr "repo.mirror_address_desc" }} </ p >
2021-09-07 11:49:36 -04:00
< / div >
2024-01-23 21:32:57 -05:00
< details class = "ui optional field" {{ if or .Err_Auth $address .Username }} open {{ end }} >
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 12:42:49 -04:00
< summary class = "tw-p-1" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.need_auth" }}
2021-09-07 11:49:36 -04:00
< / summary >
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 12:42:49 -04:00
< div class = "tw-p-1" >
2024-01-23 21:32:57 -05:00
< div class = "inline field {{ if .Err_Auth }} error {{ end }} " >
< label for = "mirror_username" > {{ ctx .Locale.Tr "username" }} </ label >
< input id = "mirror_username" name = "mirror_username" value = " {{ $address .Username }} " {{ if not .mirror_username }} data-need-clear = "true" {{ end }} >
2021-09-07 11:49:36 -04:00
< / div >
2024-01-23 21:32:57 -05:00
< div class = "inline field {{ if .Err_Auth }} error {{ end }} " >
< label for = "mirror_password" > {{ ctx .Locale.Tr "password" }} </ label >
< input id = "mirror_password" name = "mirror_password" type = "password" placeholder = " {{ if $address .Password }}{{ ctx .Locale.Tr "repo.mirror_password_placeholder" }}{{ else }}{{ ctx .Locale.Tr "repo.mirror_password_blank_placeholder" }}{{ end }} " value = "" {{ if not .mirror_password }} data-need-clear = "true" {{ end }} autocomplete = "off" >
2021-09-07 11:49:36 -04:00
< / div >
2024-01-23 21:32:57 -05:00
< p class = "help" > {{ ctx .Locale.Tr "repo.mirror_password_help" }} </ p >
2021-06-14 13:20:43 -04:00
< / div >
2021-09-07 11:49:36 -04:00
< / details >
2024-01-23 21:32:57 -05:00
{{ if .LFSStartServer }}
< div class = "inline field" >
< label > {{ ctx .Locale.Tr "repo.mirror_lfs" }} </ label >
2022-07-08 15:45:12 -04:00
< div class = "ui checkbox" >
2024-01-23 21:32:57 -05:00
< input id = "mirror_lfs" name = "mirror_lfs" type = "checkbox" {{ if .PullMirror.LFS }} checked {{ end }} >
< label > {{ ctx .Locale.Tr "repo.mirror_lfs_desc" }} </ label >
2022-07-08 15:45:12 -04:00
< / div >
< / div >
2024-01-23 21:32:57 -05:00
< div class = "field {{ if .Err_LFSEndpoint }} error {{ end }} " >
< label for = "mirror_lfs_endpoint" > {{ ctx .Locale.Tr "repo.mirror_lfs_endpoint" }} </ label >
< input id = "mirror_lfs_endpoint" name = "mirror_lfs_endpoint" value = " {{ .PullMirror.LFSEndpoint }} " placeholder = " {{ ctx .Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder" }} " >
2024-03-10 04:51:19 -04:00
< p class = "help" > {{ ctx .Locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" }} </ p >
2021-06-14 13:20:43 -04:00
< / div >
2024-01-23 21:32:57 -05:00
{{ end }}
2021-09-07 11:49:36 -04:00
< div class = "field" >
2024-01-23 21:32:57 -05:00
< button class = "ui primary button" > {{ ctx .Locale.Tr "repo.settings.update_mirror_settings" }} </ button >
2021-09-07 11:49:36 -04:00
< / div >
< / form >
< / td >
< / tr >
2024-01-23 21:32:57 -05:00
< / tbody >
2024-03-18 10:47:05 -04:00
{{ end }} {{/* end if: $modifyBrokenPullMirror / $isWorkingPullMirror */}}
2024-01-31 19:04:23 -05:00
< / table >
2024-03-18 10:47:05 -04:00
{{ end }} {{/* end if .Repository.IsMirror */}}
2024-01-31 19:04:23 -05:00
< table class = "ui table" >
< thead >
< tr >
2024-03-23 16:11:15 -04:00
< th class = "tw-w-2/5" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.pushed_repository" }} </ th >
2024-01-31 19:04:23 -05:00
< th > {{ ctx .Locale.Tr "repo.settings.mirror_settings.direction" }} </ th >
< th > {{ ctx .Locale.Tr "repo.settings.mirror_settings.last_update" }} </ th >
< th > < / th >
< / tr >
< / thead >
2024-01-23 21:32:57 -05:00
< tbody >
{{ range .PushMirrors }}
< tr >
< td class = "gt-word-break" > {{ .RemoteAddress }} </ td >
< td > {{ ctx .Locale.Tr "repo.settings.mirror_settings.direction.push" }} </ td >
< td > {{ if .LastUpdateUnix }}{{ DateTime "full" .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" >
< button
class="ui tiny button show-modal"
data-modal="#push-mirror-edit-modal"
data-tooltip-content="{{ ctx .Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time" }} "
data-modal-push-mirror-edit-id="{{ .ID }} "
data-modal-push-mirror-edit-interval="{{ .Interval }} "
data-modal-push-mirror-edit-address="{{ .RemoteAddress }} "
>
{{ svg "octicon-pencil" 14 }}
< / button >
2024-03-22 09:45:10 -04:00
< form method = "post" class = "tw-inline-block" >
2024-01-23 21:32:57 -05:00
{{ $.CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "push-mirror-sync" >
< input type = "hidden" name = "push_mirror_id" value = " {{ .ID }} " >
< button class = "ui primary tiny button" data-tooltip-content = " {{ ctx .Locale.Tr "repo.settings.sync_mirror" }} " > {{ svg "octicon-sync" 14 }} </ button >
< / form >
2024-03-22 09:45:10 -04:00
< form method = "post" class = "tw-inline-block" >
2024-01-23 21:32:57 -05:00
{{ $.CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "push-mirror-remove" >
< input type = "hidden" name = "push_mirror_id" value = " {{ .ID }} " >
< button class = "ui basic red tiny button" data-tooltip-content = " {{ ctx .Locale.Tr "remove" }} " > {{ svg "octicon-trash" 14 }} </ button >
< / form >
< / td >
< / tr >
{{ else }}
< tr >
< td > {{ ctx .Locale.Tr "repo.settings.mirror_settings.push_mirror.none" }} </ td >
< / tr >
{{ end }}
{{ if ( not .DisableNewPushMirrors ) }}
< tr >
< td colspan = "4" >
< form class = "ui form" method = "post" >
{{ template "base/disable_form_autofill" }}
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "push-mirror-add" >
< div class = "field {{ if .Err_PushMirrorAddress }} error {{ end }} " >
< label for = "push_mirror_address" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url" }} </ label >
< input id = "push_mirror_address" name = "push_mirror_address" value = " {{ .push_mirror_address }} " required >
< p class = "help" > {{ ctx .Locale.Tr "repo.mirror_address_desc" }} </ p >
< / div >
< details class = "ui optional field" {{ if or .Err_PushMirrorAuth .push_mirror_username }} open {{ end }} >
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 12:42:49 -04:00
< summary class = "tw-p-1" >
2024-01-23 21:32:57 -05:00
{{ ctx .Locale.Tr "repo.need_auth" }}
< / summary >
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 12:42:49 -04:00
< div class = "tw-p-1" >
2024-01-23 21:32:57 -05:00
< div class = "inline field {{ if .Err_PushMirrorAuth }} error {{ end }} " >
< label for = "push_mirror_username" > {{ ctx .Locale.Tr "username" }} </ label >
< input id = "push_mirror_username" name = "push_mirror_username" value = " {{ .push_mirror_username }} " >
< / div >
< div class = "inline field {{ if .Err_PushMirrorAuth }} error {{ end }} " >
< label for = "push_mirror_password" > {{ ctx .Locale.Tr "password" }} </ label >
< input id = "push_mirror_password" name = "push_mirror_password" type = "password" value = " {{ .push_mirror_password }} " autocomplete = "off" >
< / div >
< / div >
< / details >
< div class = "field" >
< div class = "ui checkbox" >
< input id = "push_mirror_sync_on_commit" name = "push_mirror_sync_on_commit" type = "checkbox" {{ if .push_mirror_sync_on_commit }} checked {{ end }} >
< label for = "push_mirror_sync_on_commit" > {{ ctx .Locale.Tr "repo.mirror_sync_on_commit" }} </ label >
< / div >
< / div >
< div class = "inline field {{ if .Err_PushMirrorInterval }} error {{ end }} " >
< label for = "push_mirror_interval" > {{ ctx .Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval }} </ label >
< input id = "push_mirror_interval" name = "push_mirror_interval" value = " {{ if .push_mirror_interval }}{{ .push_mirror_interval }}{{ else }}{{ .DefaultMirrorInterval }}{{ end }} " >
< / div >
< div class = "field" >
< button class = "ui primary button" > {{ ctx .Locale.Tr "repo.settings.mirror_settings.push_mirror.add" }} </ button >
< / div >
< / form >
< / td >
< / tr >
{{ end }}
< / tbody >
< / table >
{{ end }}
2017-03-15 18:39:38 -04:00
< / div >
{{ end }}
2015-12-07 17:30:52 -05:00
2020-09-19 12:44:55 -04:00
< h4 class = "ui top attached header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.signing_settings" }}
2020-09-19 12:44:55 -04:00
< / h4 >
< div class = "ui attached segment" >
< form class = "ui form" method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "signing" >
< div class = "field" >
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.trust_model" }} </ label >< br >
2020-09-19 12:44:55 -04:00
< div class = "field" >
< div class = "ui radio checkbox" >
< input type = "radio" id = "trust_model_default" name = "trust_model" {{ if eq .Repository.TrustModel.String "default" }} checked = "checked" {{ end }} value = "default" >
2023-09-25 04:56:50 -04:00
< label for = "trust_model_default" > {{ ctx .Locale.Tr "repo.settings.trust_model.default" }} </ label >
< p class = "help" > {{ ctx .Locale.Tr "repo.settings.trust_model.default.desc" }} </ p >
2020-09-19 12:44:55 -04:00
< / div >
< / div >
< div class = "field" >
< div class = "ui radio checkbox" >
< input type = "radio" id = "trust_model_collaborator" name = "trust_model" {{ if eq .Repository.TrustModel.String "collaborator" }} checked = "checked" {{ end }} value = "collaborator" >
2023-09-25 04:56:50 -04:00
< label for = "trust_model_collaborator" > {{ ctx .Locale.Tr "repo.settings.trust_model.collaborator.long" }} </ label >
< p class = "help" > {{ ctx .Locale.Tr "repo.settings.trust_model.collaborator.desc" }} </ p >
2020-09-19 12:44:55 -04:00
< / div >
< / div >
< div class = "field" >
< div class = "ui radio checkbox" >
< input type = "radio" name = "trust_model" id = "trust_model_committer" {{ if eq .Repository.TrustModel.String "committer" }} checked = "checked" {{ end }} value = "committer" >
2023-09-25 04:56:50 -04:00
< label for = "trust_model_committer" > {{ ctx .Locale.Tr "repo.settings.trust_model.committer.long" }} </ label >
< p class = "help" > {{ ctx .Locale.Tr "repo.settings.trust_model.committer.desc" }} </ p >
2020-09-19 12:44:55 -04:00
< / div >
< / div >
< div class = "field" >
< div class = "ui radio checkbox" >
< input type = "radio" name = "trust_model" id = "trust_model_collaboratorcommitter" {{ if eq .Repository.TrustModel.String "collaboratorcommitter" }} checked = "checked" {{ end }} value = "collaboratorcommitter" >
2023-09-25 04:56:50 -04:00
< label for = "trust_model_collaboratorcommitter" > {{ ctx .Locale.Tr "repo.settings.trust_model.collaboratorcommitter.long" }} </ label >
< p class = "help" > {{ ctx .Locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc" }} </ p >
2020-09-19 12:44:55 -04:00
< / div >
< / div >
< / div >
2023-06-29 08:24:22 -04:00
< div class = "divider" > < / div >
2020-09-19 12:44:55 -04:00
< div class = "field" >
2023-09-25 04:56:50 -04:00
< button class = "ui primary button" > {{ ctx .Locale.Tr "repo.settings.update_settings" }} </ button >
2020-09-19 12:44:55 -04:00
< / div >
< / form >
< / div >
2018-03-27 10:13:20 -04:00
{{ if .IsAdmin }}
< h4 class = "ui top attached header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.admin_settings" }}
2018-03-27 10:13:20 -04:00
< / h4 >
< div class = "ui attached segment" >
< form class = "ui form" method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "admin" >
< div class = "field" >
< div class = "ui checkbox" >
< input name = "enable_health_check" type = "checkbox" {{ if .Repository.IsFsckEnabled }} checked {{ end }} >
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.admin_enable_health_check" }} </ label >
2018-03-27 10:13:20 -04:00
< / div >
< / div >
< div class = "field" >
2023-09-25 04:56:50 -04:00
< button class = "ui primary button" > {{ ctx .Locale.Tr "repo.settings.update_settings" }} </ button >
2018-03-27 10:13:20 -04:00
< / div >
< / form >
2021-12-16 10:55:12 -05:00
2023-06-29 08:24:22 -04:00
< div class = "divider" > < / div >
2021-12-16 10:55:12 -05:00
< form class = "ui form" method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "admin_index" >
{{ if .CodeIndexerEnabled }}
2023-09-25 04:56:50 -04:00
< h4 class = "ui header" > {{ ctx .Locale.Tr "repo.settings.admin_code_indexer" }} </ h4 >
2021-12-16 10:55:12 -05:00
< div class = "inline fields" >
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.admin_indexer_commit_sha" }} </ label >
2021-12-16 10:55:12 -05:00
< span class = "field" >
{{ if .CodeIndexerStatus }}
< a rel = "nofollow" class = "ui sha label" href = " {{ .RepoLink }} /commit/ {{ .CodeIndexerStatus.CommitSha }} " >
< span class = "shortsha" > {{ ShortSha .CodeIndexerStatus.CommitSha }} </ span >
< / a >
{{ else }}
2023-09-25 04:56:50 -04:00
< span > {{ ctx .Locale.Tr "repo.settings.admin_indexer_unindexed" }} </ span >
2021-12-16 10:55:12 -05:00
{{ end }}
< / span >
< div class = "field" >
2023-09-25 04:56:50 -04:00
< button class = "ui primary button" name = "request_reindex_type" value = "code" > {{ ctx .Locale.Tr "repo.settings.reindex_button" }} </ button >
2021-12-16 10:55:12 -05:00
< / div >
< / div >
{{ end }}
2023-09-25 04:56:50 -04:00
< h4 class = "ui header" > {{ ctx .Locale.Tr "repo.settings.admin_stats_indexer" }} </ h4 >
2021-12-16 10:55:12 -05:00
< div class = "inline fields" >
2023-08-05 07:04:14 -04:00
{{ if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha }}
2023-09-25 04:56:50 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.admin_indexer_commit_sha" }} </ label >
2023-08-05 07:04:14 -04:00
{{ end }}
2021-12-16 10:55:12 -05:00
< span class = "field" >
2023-08-05 07:04:14 -04:00
{{ if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha }}
2021-12-16 10:55:12 -05:00
< a rel = "nofollow" class = "ui sha label" href = " {{ .RepoLink }} /commit/ {{ .StatsIndexerStatus.CommitSha }} " >
< span class = "shortsha" > {{ ShortSha .StatsIndexerStatus.CommitSha }} </ span >
< / a >
{{ else }}
2023-09-25 04:56:50 -04:00
< span > {{ ctx .Locale.Tr "repo.settings.admin_indexer_unindexed" }} </ span >
2021-12-16 10:55:12 -05:00
{{ end }}
< / span >
< div class = "field" >
2023-09-25 04:56:50 -04:00
< button class = "ui primary button" name = "request_reindex_type" value = "stats" > {{ ctx .Locale.Tr "repo.settings.reindex_button" }} </ button >
2021-12-16 10:55:12 -05:00
< / div >
< / div >
< / form >
2018-03-27 10:13:20 -04:00
< / div >
{{ end }}
2018-11-28 06:26:14 -05:00
{{ if .Permission.IsOwner }}
2020-10-04 16:54:22 -04:00
< h4 class = "ui top attached error header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.danger_zone" }}
2017-03-15 18:39:38 -04:00
< / h4 >
2023-07-31 18:13:42 -04:00
< div class = "ui attached error danger segment" >
< div class = "flex-list" >
{{ if .Repository.IsMirror }}
< div class = "flex-item" >
< div class = "flex-item-main" >
2023-09-25 04:56:50 -04:00
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.convert" }} </ div >
< div class = "flex-item-body" > {{ ctx .Locale.Tr "repo.settings.convert_desc" }} </ div >
2023-07-31 18:13:42 -04:00
< / div >
< div class = "flex-item-trailing" >
2023-09-25 04:56:50 -04:00
< button class = "ui basic red show-modal button" data-modal = "#convert-mirror-repo-modal" > {{ ctx .Locale.Tr "repo.settings.convert" }} </ button >
2023-07-31 18:13:42 -04:00
< / div >
2020-07-02 10:09:09 -04:00
< / div >
2023-07-31 18:13:42 -04:00
{{ end }}
{{ if and .Repository.IsFork .Repository.Owner.CanCreateRepo }}
< div class = "flex-item" >
< div class = "flex-item-main" >
2023-09-25 04:56:50 -04:00
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.convert_fork" }} </ div >
< div class = "flex-item-body" > {{ ctx .Locale.Tr "repo.settings.convert_fork_desc" }} </ div >
2023-07-31 18:13:42 -04:00
< / div >
< div class = "flex-item-trailing" >
2023-09-25 04:56:50 -04:00
< button class = "ui basic red show-modal button" data-modal = "#convert-fork-repo-modal" > {{ ctx .Locale.Tr "repo.settings.convert_fork" }} </ button >
2023-07-31 18:13:42 -04:00
< / div >
2020-07-02 10:09:09 -04:00
< / div >
2023-07-31 18:13:42 -04:00
{{ end }}
< div class = "flex-item" >
< div class = "flex-item-main" >
2023-09-25 04:56:50 -04:00
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.transfer" }} </ div >
2023-07-31 18:13:42 -04:00
< div class = "flex-item-body" >
{{ if .RepoTransfer }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName }}
2023-07-31 18:13:42 -04:00
{{ else }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.transfer_desc" }}
2023-07-31 18:13:42 -04:00
{{ end }}
< / div >
2020-07-02 10:09:09 -04:00
< / div >
2023-07-31 18:13:42 -04:00
< div class = "flex-item-trailing" >
{{ if .RepoTransfer }}
< form class = "ui form" action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "cancel_transfer" >
2023-09-25 04:56:50 -04:00
< button class = "ui red button" > {{ ctx .Locale.Tr "repo.settings.transfer_abort" }} </ button >
2023-07-31 18:13:42 -04:00
< / form >
{{ else }}
2023-09-25 04:56:50 -04:00
< button class = "ui basic red show-modal button" data-modal = "#transfer-repo-modal" > {{ ctx .Locale.Tr "repo.settings.transfer" }} </ button >
2023-07-31 18:13:42 -04:00
{{ end }}
2020-07-02 10:09:09 -04:00
< / div >
2017-03-15 18:39:38 -04:00
< / div >
2023-07-31 18:13:42 -04:00
{{ if .Permission.CanRead $.UnitTypeWiki }}
[GITEA] Allow changing the repo Wiki branch to main
Previously, the repo wiki was hardcoded to use `master` as its branch,
this change makes it possible to use `main` (or something else, governed
by `[repository].DEFAULT_BRANCH`, a setting that already exists and
defaults to `main`).
The way it is done is that a new column is added to the `repository`
table: `wiki_branch`. The migration will make existing repositories
default to `master`, for compatibility's sake, even if they don't have a
Wiki (because it's easier to do that). Newly created repositories will
default to `[repository].DEFAULT_BRANCH` instead.
The Wiki service was updated to use the branch name stored in the
database, and fall back to the default if it is empty.
Old repositories with Wikis using the older `master` branch will have
the option to do a one-time transition to `main`, available via the
repository settings in the "Danger Zone". This option will only be
available for repositories that have the internal wiki enabled, it is
not empty, and the wiki branch is not `[repository].DEFAULT_BRANCH`.
When migrating a repository with a Wiki, Forgejo will use the same
branch name for the wiki as the source repository did. If that's not the
same as the default, the option to normalize it will be available after
the migration's done.
Additionally, the `/api/v1/{owner}/{repo}` endpoint was updated: it will
now include the wiki branch name in `GET` requests, and allow changing
the wiki branch via `PATCH`.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d87c526d2a313fa45093ab49b78bb30322b33298)
2024-01-30 06:18:53 -05:00
{{ if ne $.Repository.GetWikiBranchName .DefaultWikiBranchName }}
< div class = "flex-item" >
< div class = "flex-item-main" >
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.wiki_rename_branch_main" }} </ div >
< div class = "flex-item-body" > {{ ctx .Locale.Tr "repo.settings.wiki_rename_branch_main_desc" .DefaultWikiBranchName }} </ div >
< / div >
< div class = "flex-item-trailing" >
< button class = "ui basic red show-modal button" data-modal = "#rename-wiki-branch-modal" > {{ ctx .Locale.Tr "repo.settings.wiki_rename_branch_main" }} </ button >
< / div >
< / div >
{{ end }}
2023-07-31 18:13:42 -04:00
< div class = "flex-item" >
< div class = "flex-item-main" >
2023-09-25 04:56:50 -04:00
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.wiki_delete" }} </ div >
< div class = "flex-item-body" > {{ ctx .Locale.Tr "repo.settings.wiki_delete_desc" }} </ div >
2023-07-31 18:13:42 -04:00
< / div >
< div class = "flex-item-trailing" >
2023-09-25 04:56:50 -04:00
< button class = "ui basic red show-modal button" data-modal = "#delete-wiki-modal" > {{ ctx .Locale.Tr "repo.settings.wiki_delete" }} </ button >
2023-07-31 18:13:42 -04:00
< / div >
2017-03-15 18:39:38 -04:00
< / div >
2023-07-31 18:13:42 -04:00
{{ end }}
< div class = "flex-item" >
< div class = "flex-item-main" >
2023-09-25 04:56:50 -04:00
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.delete" }} </ div >
< div class = "flex-item-body" > {{ ctx .Locale.Tr "repo.settings.delete_desc" }} </ div >
2023-07-31 18:13:42 -04:00
< / div >
< div class = "flex-item-trailing" >
2023-09-25 04:56:50 -04:00
< button class = "ui basic red show-modal button" data-modal = "#delete-repo-modal" > {{ ctx .Locale.Tr "repo.settings.delete" }} </ button >
2015-08-29 15:21:59 -04:00
< / div >
2015-12-07 17:30:52 -05:00
< / div >
2023-07-31 18:13:42 -04:00
{{ if not .Repository.IsMirror }}
2024-03-22 15:51:29 -04:00
< div class = "flex-item tw-items-center" >
2023-07-31 18:13:42 -04:00
< div class = "flex-item-main" >
2019-01-23 13:58:38 -05:00
{{ if .Repository.IsArchived }}
2023-09-25 04:56:50 -04:00
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.unarchive.header" }} </ div >
< div class = "flex-item-body" > {{ ctx .Locale.Tr "repo.settings.unarchive.text" }} </ div >
2019-01-23 13:58:38 -05:00
{{ else }}
2023-09-25 04:56:50 -04:00
< div class = "flex-item-title" > {{ ctx .Locale.Tr "repo.settings.archive.header" }} </ div >
< div class = "flex-item-body" > {{ ctx .Locale.Tr "repo.settings.archive.text" }} </ div >
2019-01-23 13:58:38 -05:00
{{ end }}
2023-07-31 18:13:42 -04:00
< / div >
< div class = "flex-item-trailing" >
< button class = "ui basic red show-modal button" data-modal = "#archive-repo-modal" >
{{ if .Repository.IsArchived }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.unarchive.button" }}
2023-07-31 18:13:42 -04:00
{{ else }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.archive.button" }}
2023-07-31 18:13:42 -04:00
{{ end }}
< / button >
< / div >
2019-01-23 13:58:38 -05:00
< / div >
2023-07-31 18:13:42 -04:00
{{ end }}
< / div >
2015-12-07 17:30:52 -05:00
< / div >
2017-03-15 18:39:38 -04:00
{{ end }}
2015-12-07 17:30:52 -05:00
< / div >
2023-04-23 06:21:21 -04:00
{{ template "repo/settings/layout_footer" . }}
2015-08-29 15:21:59 -04:00
2018-11-28 06:26:14 -05:00
{{ if .Permission.IsOwner }}
2016-03-05 20:45:23 -05:00
{{ if .Repository.IsMirror }}
2020-07-02 10:09:09 -04:00
< div class = "ui small modal" id = "convert-mirror-repo-modal" >
< div class = "header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.convert" }}
2016-02-14 15:12:00 -05:00
< / div >
2020-07-02 10:09:09 -04:00
< div class = "content" >
2023-05-03 14:32:10 -04:00
< div class = "ui warning message" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.convert_notices_1" }}
2016-03-05 20:45:23 -05:00
< / div >
2020-07-02 10:09:09 -04:00
< form class = "ui form" action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "convert" >
< div class = "field" >
< label >
2024-01-31 05:20:57 -05:00
{{ ctx .Locale.Tr "repo.settings.enter_repo_name" }}
2023-11-23 14:24:52 -05:00
< span class = "text red" > {{ .Repository.FullName }} </ span >
2020-07-02 10:09:09 -04:00
< / label >
< / div >
< div class = "required field" >
2024-04-18 05:01:06 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.confirmation_string" }} </ label >
< input name = "repo_name" required maxlength = "100" >
2020-07-02 10:09:09 -04:00
< / div >
2016-02-14 15:12:00 -05:00
2020-07-02 10:09:09 -04:00
< div class = "text right actions" >
2023-09-25 04:56:50 -04:00
< button class = "ui cancel button" > {{ ctx .Locale.Tr "settings.cancel" }} </ button >
< button class = "ui red button" > {{ ctx .Locale.Tr "repo.settings.convert_confirm" }} </ button >
2020-07-02 10:09:09 -04:00
< / div >
< / form >
< / div >
2016-03-05 20:45:23 -05:00
< / div >
{{ end }}
2020-07-02 10:09:09 -04:00
{{ if and .Repository.IsFork .Repository.Owner.CanCreateRepo }}
< div class = "ui small modal" id = "convert-fork-repo-modal" >
< div class = "header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.convert_fork" }}
2020-07-02 10:09:09 -04:00
< / div >
< div class = "content" >
2023-05-03 14:32:10 -04:00
< div class = "ui warning message" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.convert_fork_notices_1" }}
2020-07-02 10:09:09 -04:00
< / div >
< form class = "ui form" action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "convert_fork" >
< div class = "field" >
< label >
2024-01-31 05:20:57 -05:00
{{ ctx .Locale.Tr "repo.settings.enter_repo_name" }}
2023-11-23 14:24:52 -05:00
< span class = "text red" > {{ .Repository.FullName }} </ span >
2020-07-02 10:09:09 -04:00
< / label >
< / div >
< div class = "required field" >
2024-04-18 05:01:06 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.confirmation_string" }} </ label >
< input name = "repo_name" required >
2020-07-02 10:09:09 -04:00
< / div >
2016-02-14 15:12:00 -05:00
2020-07-02 10:09:09 -04:00
< div class = "text right actions" >
2023-09-25 04:56:50 -04:00
< 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 >
2020-07-02 10:09:09 -04:00
< / div >
< / form >
< / div >
< / div >
{{ end }}
2016-03-05 20:45:23 -05:00
< div class = "ui small modal" id = "transfer-repo-modal" >
< div class = "header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.transfer" }}
2015-09-01 06:31:47 -04:00
< / div >
2016-03-05 20:45:23 -05:00
< div class = "content" >
2023-05-03 14:32:10 -04:00
< div class = "ui warning message" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.transfer_notices_1" }} < br >
{{ ctx .Locale.Tr "repo.settings.transfer_notices_2" }} < br >
{{ ctx .Locale.Tr "repo.settings.transfer_notices_3" }}
2015-12-07 17:30:52 -05:00
< / div >
2016-03-05 20:45:23 -05:00
< form class = "ui form" action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "transfer" >
< div class = "field" >
< label >
2024-01-31 05:20:57 -05:00
{{ ctx .Locale.Tr "repo.settings.enter_repo_name" }}
2023-11-23 14:24:52 -05:00
< span class = "text red" > {{ .Repository.FullName }} </ span >
2016-03-05 20:45:23 -05:00
< / label >
< / div >
< div class = "required field" >
2024-04-18 05:01:06 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.confirmation_string" }} </ label >
< input name = "repo_name" required >
2016-03-05 20:45:23 -05:00
< / div >
< div class = "required field" >
2023-09-25 04:56:50 -04:00
< label for = "new_owner_name" > {{ ctx .Locale.Tr "repo.settings.transfer_owner" }} </ label >
2016-03-05 20:45:23 -05:00
< input id = "new_owner_name" name = "new_owner_name" required >
< / div >
2015-12-07 17:30:52 -05:00
2016-03-05 20:45:23 -05:00
< div class = "text right actions" >
2023-09-25 04:56:50 -04:00
< button class = "ui cancel button" > {{ ctx .Locale.Tr "settings.cancel" }} </ button >
< button class = "ui red button" > {{ ctx .Locale.Tr "repo.settings.transfer_perform" }} </ button >
2016-03-05 20:45:23 -05:00
< / div >
< / form >
< / div >
2015-12-07 17:30:52 -05:00
< / div >
2015-08-29 15:21:59 -04:00
2016-03-05 20:45:23 -05:00
< div class = "ui small modal" id = "delete-repo-modal" >
< div class = "header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.delete" }}
2015-12-07 17:30:52 -05:00
< / div >
2016-03-05 20:45:23 -05:00
< div class = "content" >
2023-05-03 14:32:10 -04:00
< div class = "ui warning message" >
2024-02-22 12:02:33 -05:00
{{ ctx .Locale.Tr "repo.settings.delete_notices_1" }} < br >
{{ ctx .Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName }}
2016-03-05 20:45:23 -05:00
{{ if .Repository.NumForks }} < br >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.delete_notices_fork_1" }}
2016-03-05 20:45:23 -05:00
{{ end }}
2016-02-14 15:12:00 -05:00
< / div >
2016-03-05 20:45:23 -05:00
< form class = "ui form" action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "delete" >
< div class = "field" >
< label >
2024-01-31 05:20:57 -05:00
{{ ctx .Locale.Tr "repo.settings.enter_repo_name" }}
2023-11-23 14:24:52 -05:00
< span class = "text red" > {{ .Repository.FullName }} </ span >
2016-03-05 20:45:23 -05:00
< / label >
< / div >
< div class = "required field" >
2024-02-27 08:39:59 -05:00
< label for = "repo_name_to_delete" > {{ ctx .Locale.Tr "repo.settings.confirmation_string" }} </ label >
2023-12-18 23:40:05 -05:00
< input id = "repo_name_to_delete" name = "repo_name" required >
2016-03-05 20:45:23 -05:00
< / div >
2015-12-07 17:30:52 -05:00
2016-03-05 20:45:23 -05:00
< div class = "text right actions" >
2023-09-25 04:56:50 -04:00
< button class = "ui cancel button" > {{ ctx .Locale.Tr "settings.cancel" }} </ button >
< button class = "ui red button" > {{ ctx .Locale.Tr "repo.settings.confirm_delete" }} </ button >
2016-03-05 20:45:23 -05:00
< / div >
< / form >
< / div >
2016-02-14 15:12:00 -05:00
< / div >
2016-03-03 15:38:25 -05:00
2022-12-09 21:46:31 -05:00
{{ if .Repository.UnitEnabled $.Context $.UnitTypeWiki }}
2016-03-05 20:45:23 -05:00
< div class = "ui small modal" id = "delete-wiki-modal" >
< div class = "header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.wiki_delete" }}
2016-03-03 15:38:25 -05:00
< / div >
2016-03-05 20:45:23 -05:00
< div class = "content" >
2023-05-03 14:32:10 -04:00
< div class = "ui warning message" >
2024-02-22 12:02:33 -05:00
{{ ctx .Locale.Tr "repo.settings.delete_notices_1" }} < br >
{{ ctx .Locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name }}
2016-03-03 15:38:25 -05:00
< / div >
2016-03-05 20:45:23 -05:00
< form class = "ui form" action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "delete-wiki" >
< div class = "field" >
< label >
2024-01-31 05:20:57 -05:00
{{ ctx .Locale.Tr "repo.settings.enter_repo_name" }}
2023-11-23 14:24:52 -05:00
< span class = "text red" > {{ .Repository.FullName }} </ span >
2016-03-05 20:45:23 -05:00
< / label >
< / div >
< div class = "required field" >
2024-04-18 05:01:06 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.confirmation_string" }} </ label >
< input name = "repo_name" required >
2016-03-05 20:45:23 -05:00
< / div >
2016-03-03 15:38:25 -05:00
2016-03-05 20:45:23 -05:00
< div class = "text right actions" >
2023-09-25 04:56:50 -04:00
< 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 >
2016-03-05 20:45:23 -05:00
< / div >
< / form >
< / div >
2016-03-03 15:38:25 -05:00
< / div >
[GITEA] Allow changing the repo Wiki branch to main
Previously, the repo wiki was hardcoded to use `master` as its branch,
this change makes it possible to use `main` (or something else, governed
by `[repository].DEFAULT_BRANCH`, a setting that already exists and
defaults to `main`).
The way it is done is that a new column is added to the `repository`
table: `wiki_branch`. The migration will make existing repositories
default to `master`, for compatibility's sake, even if they don't have a
Wiki (because it's easier to do that). Newly created repositories will
default to `[repository].DEFAULT_BRANCH` instead.
The Wiki service was updated to use the branch name stored in the
database, and fall back to the default if it is empty.
Old repositories with Wikis using the older `master` branch will have
the option to do a one-time transition to `main`, available via the
repository settings in the "Danger Zone". This option will only be
available for repositories that have the internal wiki enabled, it is
not empty, and the wiki branch is not `[repository].DEFAULT_BRANCH`.
When migrating a repository with a Wiki, Forgejo will use the same
branch name for the wiki as the source repository did. If that's not the
same as the default, the option to normalize it will be available after
the migration's done.
Additionally, the `/api/v1/{owner}/{repo}` endpoint was updated: it will
now include the wiki branch name in `GET` requests, and allow changing
the wiki branch via `PATCH`.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d87c526d2a313fa45093ab49b78bb30322b33298)
2024-01-30 06:18:53 -05:00
{{ if ne $.Repository.GetWikiBranchName .DefaultWikiBranchName }}
< div class = "ui small modal" id = "rename-wiki-branch-modal" >
< div class = "header" >
{{ ctx .Locale.Tr "repo.settings.wiki_rename_branch_main" }}
< / div >
< div class = "content" >
< div class = "ui warning message" >
< ul >
2024-02-25 15:36:45 -05:00
< li > {{ ctx .Locale.Tr "repo.settings.wiki_rename_branch_main_notices_1" }} </ li >
[GITEA] Allow changing the repo Wiki branch to main
Previously, the repo wiki was hardcoded to use `master` as its branch,
this change makes it possible to use `main` (or something else, governed
by `[repository].DEFAULT_BRANCH`, a setting that already exists and
defaults to `main`).
The way it is done is that a new column is added to the `repository`
table: `wiki_branch`. The migration will make existing repositories
default to `master`, for compatibility's sake, even if they don't have a
Wiki (because it's easier to do that). Newly created repositories will
default to `[repository].DEFAULT_BRANCH` instead.
The Wiki service was updated to use the branch name stored in the
database, and fall back to the default if it is empty.
Old repositories with Wikis using the older `master` branch will have
the option to do a one-time transition to `main`, available via the
repository settings in the "Danger Zone". This option will only be
available for repositories that have the internal wiki enabled, it is
not empty, and the wiki branch is not `[repository].DEFAULT_BRANCH`.
When migrating a repository with a Wiki, Forgejo will use the same
branch name for the wiki as the source repository did. If that's not the
same as the default, the option to normalize it will be available after
the migration's done.
Additionally, the `/api/v1/{owner}/{repo}` endpoint was updated: it will
now include the wiki branch name in `GET` requests, and allow changing
the wiki branch via `PATCH`.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d87c526d2a313fa45093ab49b78bb30322b33298)
2024-01-30 06:18:53 -05:00
< li > {{ ctx .Locale.Tr "repo.settings.wiki_rename_branch_main_notices_2" .Repository.Name }} </ li >
< / ul >
< / div >
< form class = "ui form" action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = "rename-wiki-branch" >
< div class = "field" >
< label >
2024-01-31 05:20:57 -05:00
{{ ctx .Locale.Tr "repo.settings.enter_repo_name" }}
[GITEA] Allow changing the repo Wiki branch to main
Previously, the repo wiki was hardcoded to use `master` as its branch,
this change makes it possible to use `main` (or something else, governed
by `[repository].DEFAULT_BRANCH`, a setting that already exists and
defaults to `main`).
The way it is done is that a new column is added to the `repository`
table: `wiki_branch`. The migration will make existing repositories
default to `master`, for compatibility's sake, even if they don't have a
Wiki (because it's easier to do that). Newly created repositories will
default to `[repository].DEFAULT_BRANCH` instead.
The Wiki service was updated to use the branch name stored in the
database, and fall back to the default if it is empty.
Old repositories with Wikis using the older `master` branch will have
the option to do a one-time transition to `main`, available via the
repository settings in the "Danger Zone". This option will only be
available for repositories that have the internal wiki enabled, it is
not empty, and the wiki branch is not `[repository].DEFAULT_BRANCH`.
When migrating a repository with a Wiki, Forgejo will use the same
branch name for the wiki as the source repository did. If that's not the
same as the default, the option to normalize it will be available after
the migration's done.
Additionally, the `/api/v1/{owner}/{repo}` endpoint was updated: it will
now include the wiki branch name in `GET` requests, and allow changing
the wiki branch via `PATCH`.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d87c526d2a313fa45093ab49b78bb30322b33298)
2024-01-30 06:18:53 -05:00
< span class = "text red" > {{ .Repository.FullName }} </ span >
< / label >
< / div >
< div class = "required field" >
2024-04-18 05:01:06 -04:00
< label > {{ ctx .Locale.Tr "repo.settings.confirmation_string" }} </ label >
< input name = "repo_name" required >
[GITEA] Allow changing the repo Wiki branch to main
Previously, the repo wiki was hardcoded to use `master` as its branch,
this change makes it possible to use `main` (or something else, governed
by `[repository].DEFAULT_BRANCH`, a setting that already exists and
defaults to `main`).
The way it is done is that a new column is added to the `repository`
table: `wiki_branch`. The migration will make existing repositories
default to `master`, for compatibility's sake, even if they don't have a
Wiki (because it's easier to do that). Newly created repositories will
default to `[repository].DEFAULT_BRANCH` instead.
The Wiki service was updated to use the branch name stored in the
database, and fall back to the default if it is empty.
Old repositories with Wikis using the older `master` branch will have
the option to do a one-time transition to `main`, available via the
repository settings in the "Danger Zone". This option will only be
available for repositories that have the internal wiki enabled, it is
not empty, and the wiki branch is not `[repository].DEFAULT_BRANCH`.
When migrating a repository with a Wiki, Forgejo will use the same
branch name for the wiki as the source repository did. If that's not the
same as the default, the option to normalize it will be available after
the migration's done.
Additionally, the `/api/v1/{owner}/{repo}` endpoint was updated: it will
now include the wiki branch name in `GET` requests, and allow changing
the wiki branch via `PATCH`.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d87c526d2a313fa45093ab49b78bb30322b33298)
2024-01-30 06:18:53 -05:00
< / div >
< div class = "text right actions" >
< button class = "ui cancel button" > {{ ctx .Locale.Tr "settings.cancel" }} </ button >
< button class = "ui red button" > {{ ctx .Locale.Tr "repo.settings.confirm_wiki_branch_rename" }} </ button >
< / div >
< / form >
< / div >
< / div >
{{ end }}
2016-03-05 20:45:23 -05:00
{{ end }}
2019-01-23 13:58:38 -05:00
{{ if not .Repository.IsMirror }}
2023-04-24 07:08:59 -04:00
< div class = "ui g-modal-confirm modal" id = "archive-repo-modal" >
2023-04-23 05:24:19 -04:00
< div class = "header" >
2019-01-23 13:58:38 -05:00
{{ if .Repository.IsArchived }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.unarchive.header" }}
2019-01-23 13:58:38 -05:00
{{ else }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.archive.header" }}
2019-01-23 13:58:38 -05:00
{{ end }}
< / div >
2023-04-23 05:24:19 -04:00
< div class = "content" >
2023-09-12 19:08:37 -04:00
< div class = "ui warning message" >
2019-01-23 13:58:38 -05:00
{{ if .Repository.IsArchived }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.unarchive.text" }}
2019-01-23 13:58:38 -05:00
{{ else }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "repo.settings.archive.text" }}
2019-01-23 13:58:38 -05:00
{{ end }}
2023-09-12 19:08:37 -04:00
< / div >
< form action = " {{ .Link }} " method = "post" >
{{ .CsrfTokenHtml }}
< input type = "hidden" name = "action" value = " {{ if .Repository.IsArchived }} unarchive {{ else }} archive {{ end }} " >
< input type = "hidden" name = "repo_id" value = " {{ .Repository.ID }} " >
< div class = "text right actions" >
< button class = "ui cancel button" > {{ ctx .Locale.Tr "settings.cancel" }} </ button >
2024-03-04 05:32:31 -05:00
< button class = "ui red button" >
{{ if .Repository.IsArchived }}
{{ ctx .Locale.Tr "repo.settings.unarchive.button" }}
{{ else }}
{{ ctx .Locale.Tr "repo.settings.archive.button" }}
{{ end }}
< / button >
2023-09-12 19:08:37 -04:00
< / div >
2019-01-23 13:58:38 -05:00
< / form >
2023-09-12 19:08:37 -04:00
< / div >
2019-01-23 13:58:38 -05:00
< / div >
{{ end }}
2016-03-03 23:24:22 -05:00
{{ end }}
2023-08-01 12:00:59 -04:00
{{ template "repo/settings/push_mirror_sync_modal" . }}