Skip to content

Commit

Permalink
Settings for empty fields
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kastl <[email protected]>
  • Loading branch information
dkastl committed Dec 1, 2023
1 parent 91057fc commit ad89469
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/views/print_templates/_settings.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<div class="box tabular settings">
<h3><%= l(:general_print_templates_settings) %></h3>

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

</div>

Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
3 changes: 3 additions & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
4 changes: 3 additions & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
requires_redmine :version_or_higher => '5.0.0'

settings(
default: {},
default: {
'default_placeholder_empty' => '',
},
partial: 'print_templates/settings'
)

Expand Down

0 comments on commit ad89469

Please sign in to comment.