diff options
author | Earl Warren <earl-warren@noreply.codeberg.org> | 2024-03-24 06:42:37 +0100 |
---|---|---|
committer | Earl Warren <earl-warren@noreply.codeberg.org> | 2024-03-24 06:42:37 +0100 |
commit | 0bfd4ca532f11e5200d1a713bbe9fd38617b1d19 (patch) | |
tree | 20a3774cac01a20aa756f3f25930ddc6f3cb1803 /templates | |
parent | Merge pull request '[META] Adjust default issues and pull requests labels' (#... (diff) | |
parent | Allow users to hide all "Add more units..." hints (diff) | |
download | forgejo-0bfd4ca532f11e5200d1a713bbe9fd38617b1d19.tar.xz forgejo-0bfd4ca532f11e5200d1a713bbe9fd38617b1d19.zip |
Merge pull request 'Allow users to hide all "Add more units..." hints' (#2533) from algernon/forgejo:less-is-more into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2533
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/header.tmpl | 2 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 8 | ||||
-rw-r--r-- | templates/user/settings/appearance.tmpl | 19 |
3 files changed, 28 insertions, 1 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 64eb790d41..f59dd621bf 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -172,7 +172,7 @@ {{end}} {{if .Permission.IsAdmin}} - {{if not (.Repository.AllUnitsEnabled ctx)}} + {{if and .SignedUser.EnableRepoUnitHints (not (.Repository.AllUnitsEnabled ctx))}} <a class="{{if .PageIsRepoSettingsUnits}}active {{end}}item" href="{{.RepoLink}}/settings/units"> {{svg "octicon-diff-added"}} {{ctx.Locale.Tr "repo.settings.units.add_more"}} </a> diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 6366f05617..56d10e659e 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -23853,6 +23853,10 @@ "type": "string", "x-go-name": "DiffViewStyle" }, + "enable_repo_unit_hints": { + "type": "boolean", + "x-go-name": "EnableRepoUnitHints" + }, "full_name": { "type": "string", "x-go-name": "FullName" @@ -23897,6 +23901,10 @@ "type": "string", "x-go-name": "DiffViewStyle" }, + "enable_repo_unit_hints": { + "type": "boolean", + "x-go-name": "EnableRepoUnitHints" + }, "full_name": { "type": "string", "x-go-name": "FullName" diff --git a/templates/user/settings/appearance.tmpl b/templates/user/settings/appearance.tmpl index 0997d721e1..075c19f0c3 100644 --- a/templates/user/settings/appearance.tmpl +++ b/templates/user/settings/appearance.tmpl @@ -66,6 +66,25 @@ </form> </div> + <!-- Hints --> + <h4 class="ui top attached header"> + {{ctx.Locale.Tr "settings.hints"}} + </h4> + <div class="ui attached segment"> + <form class="ui form" action="{{.Link}}/hints" method="post"> + {{.CsrfTokenHtml}} + <div class="inline field"> + <div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "settings.additional_repo_units_hint_description"}}"> + <input name="enable_repo_unit_hints" type="checkbox" {{if $.SignedUser.EnableRepoUnitHints}}checked{{end}}> + <label>{{ctx.Locale.Tr "settings.additional_repo_units_hint"}}</label> + </div> + </div> + <div class="field"> + <button class="ui primary button">{{ctx.Locale.Tr "settings.update_hints"}}</button> + </div> + </form> + </div> + <!-- Shown comment event types --> <h4 class="ui top attached header"> {{ctx.Locale.Tr "settings.hidden_comment_types"}} |