summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorEarl Warren <earl-warren@noreply.codeberg.org>2024-03-24 06:42:37 +0100
committerEarl Warren <earl-warren@noreply.codeberg.org>2024-03-24 06:42:37 +0100
commit0bfd4ca532f11e5200d1a713bbe9fd38617b1d19 (patch)
tree20a3774cac01a20aa756f3f25930ddc6f3cb1803 /templates
parentMerge pull request '[META] Adjust default issues and pull requests labels' (#... (diff)
parentAllow users to hide all "Add more units..." hints (diff)
downloadforgejo-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.tmpl2
-rw-r--r--templates/swagger/v1_json.tmpl8
-rw-r--r--templates/user/settings/appearance.tmpl19
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"}}