2024-01-23 15:16:34 +05:30
< h4 class = "ui top attached header" id = "wiki" >
{{ ctx .Locale.Tr "repo.wiki" }}
< / h4 >
< div class = "ui attached segment" >
{{ $isWikiEnabled := or ( .Repository.UnitEnabled $.Context $.UnitTypeWiki ) ( .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki ) }}
{{ $isWikiGlobalDisabled := .UnitTypeWiki.UnitGlobalDisabled }}
{{ $isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled }}
{{ $isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled }}
< div class = "inline field" >
< label > {{ ctx .Locale.Tr "repo.wiki" }} </ label >
< div class = "ui checkbox {{ if $isBothWikiGlobalDisabled }} disabled {{ end }} " {{ if $isBothWikiGlobalDisabled }} data-tooltip-content = " {{ ctx .Locale.Tr "repo.unit_disabled" }} " {{ end }} >
< input class = "enable-system" name = "enable_wiki" type = "checkbox" data-target = "#wiki_box" {{ if $isWikiEnabled }} checked {{ end }} >
< label > {{ ctx .Locale.Tr "repo.settings.wiki_desc" }} </ label >
< / div >
< / div >
< div class = "field {{ if not $isWikiEnabled }} disabled {{ end }} " id = "wiki_box" >
< div class = "field" >
< div class = "ui radio checkbox {{ if $isWikiGlobalDisabled }} disabled {{ end }} " {{ if $isWikiGlobalDisabled }} data-tooltip-content = " {{ ctx .Locale.Tr "repo.unit_disabled" }} " {{ end }} >
UI: Disable internal wiki options when enabling external wiki
Using "data-target", it is possible to set a value to a target element
that can enable it or disable it. Using "data-context" lets us perform
the opposite action on a different target.
Before, only the #external_wiki_box target was used, which was enabled
or disabled depending on whether the user has chosen to use the internal
wiki or the external wiki. If the user chooses to use the internal wiki,
they will disable the box that lets them enter a link pointing to an
external wiki, and vice versa. Although it is not possible to use, say,
boolean operations, we can introduce a target that is
called #globally_writeable_checkbox that gets enabled when
the #external_wiki_box box is disabled, and vice versa.
This makes the box's behavior more consistent with the behavior in the
"Issues" section. To keep things consistent with that section, a new
property was assigned to the "globally_writeable_checkbox" that makes
the box go a bit further in (`tw-pl-4`).
2024-04-29 23:18:21 +05:30
< input class = "enable-system-radio" name = "enable_external_wiki" type = "radio" value = "false" data-context = "#globally_writeable_checkbox" data-target = "#external_wiki_box" {{ if not ( .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki ) }} checked {{ end }} >
2024-01-23 15:16:34 +05:30
< label > {{ ctx .Locale.Tr "repo.settings.use_internal_wiki" }} </ label >
< / div >
< / div >
{{ if ( not .Repository.IsPrivate ) }}
UI: Disable internal wiki options when enabling external wiki
Using "data-target", it is possible to set a value to a target element
that can enable it or disable it. Using "data-context" lets us perform
the opposite action on a different target.
Before, only the #external_wiki_box target was used, which was enabled
or disabled depending on whether the user has chosen to use the internal
wiki or the external wiki. If the user chooses to use the internal wiki,
they will disable the box that lets them enter a link pointing to an
external wiki, and vice versa. Although it is not possible to use, say,
boolean operations, we can introduce a target that is
called #globally_writeable_checkbox that gets enabled when
the #external_wiki_box box is disabled, and vice versa.
This makes the box's behavior more consistent with the behavior in the
"Issues" section. To keep things consistent with that section, a new
property was assigned to the "globally_writeable_checkbox" that makes
the box go a bit further in (`tw-pl-4`).
2024-04-29 23:18:21 +05:30
< div class = "field {{ if ( .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki ) }} disabled {{ end }} " id = "globally_writeable_checkbox" >
< div class = "field tw-pl-4" >
2024-01-23 15:16:34 +05:30
< div class = "ui checkbox" >
< input name = "globally_writeable_wiki" type = "checkbox" {{ if .Permission.IsGloballyWriteable $.UnitTypeWiki }} checked {{ end }} >
< label > {{ ctx .Locale.Tr "repo.settings.wiki_globally_editable" }} </ label >
< / div >
< / div >
< / div >
{{ end }}
< div class = "field" >
< div class = "ui radio checkbox {{ if $isExternalWikiGlobalDisabled }} disabled {{ end }} " {{ if $isExternalWikiGlobalDisabled }} data-tooltip-content = " {{ ctx .Locale.Tr "repo.unit_disabled" }} " {{ end }} >
UI: Disable internal wiki options when enabling external wiki
Using "data-target", it is possible to set a value to a target element
that can enable it or disable it. Using "data-context" lets us perform
the opposite action on a different target.
Before, only the #external_wiki_box target was used, which was enabled
or disabled depending on whether the user has chosen to use the internal
wiki or the external wiki. If the user chooses to use the internal wiki,
they will disable the box that lets them enter a link pointing to an
external wiki, and vice versa. Although it is not possible to use, say,
boolean operations, we can introduce a target that is
called #globally_writeable_checkbox that gets enabled when
the #external_wiki_box box is disabled, and vice versa.
This makes the box's behavior more consistent with the behavior in the
"Issues" section. To keep things consistent with that section, a new
property was assigned to the "globally_writeable_checkbox" that makes
the box go a bit further in (`tw-pl-4`).
2024-04-29 23:18:21 +05:30
< input class = "enable-system-radio" name = "enable_external_wiki" type = "radio" value = "true" data-context = "#globally_writeable_checkbox" data-target = "#external_wiki_box" {{ if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki }} checked {{ end }} >
2024-01-23 15:16:34 +05:30
< label > {{ ctx .Locale.Tr "repo.settings.use_external_wiki" }} </ label >
< / div >
< / div >
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 22:12:49 +05:30
< div class = "field tw-pl-4 {{ if not ( .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki ) }} disabled {{ end }} " id = "external_wiki_box" >
2024-01-23 15:16:34 +05:30
< label for = "external_wiki_url" > {{ ctx .Locale.Tr "repo.settings.external_wiki_url" }} </ label >
< input id = "external_wiki_url" name = "external_wiki_url" type = "url" value = " {{ ( .Repository.MustGetUnit $.Context $.UnitTypeExternalWiki ) .ExternalWikiConfig.ExternalWikiURL }} " >
< p class = "help" > {{ ctx .Locale.Tr "repo.settings.external_wiki_url_desc" }} </ p >
< / div >
< / div >
< div class = "divider" > < / div >
< div class = "field" >
< button class = "ui primary button" > {{ ctx .Locale.Tr "repo.settings.update_settings" }} </ button >
< / div >
< / div >