From ad894696c1795d295c24ae7f9e63367aa229cf5d Mon Sep 17 00:00:00 2001 From: Daniel Kastl Date: Sat, 2 Dec 2023 00:56:04 +0900 Subject: [PATCH] Settings for empty fields Signed-off-by: Daniel Kastl --- app/views/print_templates/_settings.html.erb | 8 +++++++- config/locales/en.yml | 3 +++ config/locales/ja.yml | 3 +++ init.rb | 4 +++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/views/print_templates/_settings.html.erb b/app/views/print_templates/_settings.html.erb index b6cc42e..02c108c 100644 --- a/app/views/print_templates/_settings.html.erb +++ b/app/views/print_templates/_settings.html.erb @@ -1,7 +1,13 @@

<%= l(:general_print_templates_settings) %>

-

TBD

+

+ <%= content_tag(:label, l(:print_templates_settings_general_placeholder_empty)) %> + <%= text_field_tag('settings[default_placeholder_empty]', + @settings['default_placeholder_empty'], + :size => 40) %> +
<%= content_tag(:small, l(:print_templates_settings_general_placeholder_note)) %> +

diff --git a/config/locales/en.yml b/config/locales/en.yml index d0e26d8..540dfa7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -28,6 +28,9 @@ en: label_print_template_font_name: "Font name" button_print_template_font_upload: "Upload font" + print_templates_settings_general_placeholder_empty: "Empty field placeholder text" + print_templates_settings_general_placeholder_note: "Enter text to display in empty fields, or leave this blank to keep fields empty." + # javascript: confirm_delete_font: "Are you sure you want to delete this font?" error_uploading_font: "Error during font upload." diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 5df0c1b..a285d97 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -28,6 +28,9 @@ ja: label_print_template_font_name: "Font name" button_print_template_font_upload: "Upload font" + print_templates_settings_general_placeholder_empty: "Empty field placeholder text" + print_templates_settings_general_placeholder_note: "Enter text to display in empty fields, or leave this blank to keep fields empty." + # javascript: confirm_delete_font: "Are you sure you want to delete this font?" error_uploading_font: "Error during font upload." diff --git a/init.rb b/init.rb index 8267a81..d5a52bf 100644 --- a/init.rb +++ b/init.rb @@ -12,7 +12,9 @@ requires_redmine :version_or_higher => '5.0.0' settings( - default: {}, + default: { + 'default_placeholder_empty' => '', + }, partial: 'print_templates/settings' )