From ba9258c4788855e82c9dab5c7fa8f829797c7bd7 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 11 Apr 2026 16:38:56 +0200 Subject: [PATCH] Indicate form field readonly via background (#37175) The `Run As Username` field on the install page was a `readonly` input that looked editable but wasn't, confusing users. Style `readonly` inputs with a subtle background, matching other frameworks. Fixes: #37174 Signed-off-by: wxiaoguang Signed-off-by: silverwind Co-authored-by: Claude (Opus 4.6) Co-authored-by: wxiaoguang --- options/locale/locale_en-US.json | 2 +- templates/devtest/form-fields.tmpl | 109 +++++++++++++++++++++++++++++ templates/install.tmpl | 2 +- web_src/css/modules/form.css | 8 ++- 4 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 templates/devtest/form-fields.tmpl diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 9d61e3f1d7..778104fcc8 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -269,7 +269,7 @@ "install.lfs_path": "Git LFS Root Path", "install.lfs_path_helper": "Files tracked by Git LFS will be stored in this directory. Leave empty to disable.", "install.run_user": "Run As Username", - "install.run_user_helper": "The operating system username that Gitea runs as. Note that this user must have access to the repository root path.", + "install.run_user_helper": "The operating system username that Gitea runs as, it must have write access to the data paths. This value is auto-detected and cannot be changed here. To use a different user, restart Gitea under that account.", "install.domain": "Server Domain", "install.domain_helper": "Domain or host address for the server.", "install.ssh_port": "SSH Server Port", diff --git a/templates/devtest/form-fields.tmpl b/templates/devtest/form-fields.tmpl new file mode 100644 index 0000000000..ee6df2e813 --- /dev/null +++ b/templates/devtest/form-fields.tmpl @@ -0,0 +1,109 @@ +{{template "devtest/devtest-header"}} +
+
+

Input

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +

Textarea

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +

Dropdown

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +

Required

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+{{template "devtest/devtest-footer"}} diff --git a/templates/install.tmpl b/templates/install.tmpl index 45f14d5c57..bc6fed08e9 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -117,7 +117,7 @@ {{ctx.Locale.Tr "install.lfs_path_helper"}} -
+
{{ctx.Locale.Tr "install.run_user_helper"}} diff --git a/web_src/css/modules/form.css b/web_src/css/modules/form.css index 2d315786c6..2999f64cf6 100644 --- a/web_src/css/modules/form.css +++ b/web_src/css/modules/form.css @@ -99,6 +99,13 @@ textarea:focus, color: var(--color-input-text); } +.ui.form input:not([type="checkbox"], [type="radio"])[readonly], +.ui.form textarea[readonly], +.ui.form select[readonly], +.ui.form .ui.selection.dropdown[readonly] { + background: var(--color-secondary-bg); +} + .ui.input { color: var(--color-input-text); } @@ -198,7 +205,6 @@ textarea:focus, background-color: var(--color-error-bg); border-color: var(--color-error-border); color: var(--color-error-text); - border-radius: 0; } .ui.form .field.error textarea:focus, .ui.form .field.error select:focus,