Skip to content

Commit

Permalink
add page break to config screen
Browse files Browse the repository at this point in the history
  • Loading branch information
wvengen committed Sep 2, 2014
1 parent 771185e commit 5fcead4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/helpers/admin/configs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def config_input(form, key, options = {}, &block)
config_input_field_options form, key, options[:input_html]
config_input_tooltip_options form, key, options[:input_html]
if options[:as] == :boolean
options[:input_html][:checked] = 'checked' if options[:input_html].delete(:value)
options[:input_html][:checked] = 'checked' if v=options[:input_html].delete(:value) and v!='false'
options[:checked_value] = 'true' if options[:checked_value].nil?
options[:unchecked_value] = 'false' if options[:unchecked_value].nil?
elsif options[:collection] or options[:as] == :select
Expand Down Expand Up @@ -51,7 +51,7 @@ def config_input_field(form, key, options = {})
if options[:as] == :boolean
checked_value = options.delete(:checked_value) || 'true'
unchecked_value = options.delete(:unchecked_value) || 'false'
options[:checked] = 'checked' if options.delete(:value)
options[:checked] = 'checked' if v=options.delete(:value) and v!='false'
form.hidden_field(key, value: unchecked_value, as: :hidden) + form.check_box(key, options, checked_value, false)
else
form.input_field key, options
Expand Down
9 changes: 8 additions & 1 deletion app/views/admin/configs/_tab_layout.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@
.fold-line
= config_input form, :pdf_font_size, as: :integer, input_html: {class: 'input-mini'}
= config_input form, :pdf_page_size, input_html: {class: 'input-medium'}
= config_input form, :pdf_add_page_breaks, as: :boolean
= config_input form, :pdf_add_page_breaks do
= form.simple_fields_for :pdf_add_page_breaks do |fields|
%label
= config_input_field fields, :order_by_groups, as: :boolean
= t 'config.hints.pdf_add_page_breaks.order_by_groups'
%label
= config_input_field fields, :order_by_articles, as: :boolean
= t 'config.hints.pdf_add_page_breaks.order_by_articles'
4 changes: 3 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ en:
page_footer: 'Shown on each page at the bottom. Enter "blank" to disable the footer completely.'
pdf_font_size: Base font size for PDF documents (12 is standard).
pdf_page_size: 'Page size for PDF documents, typically "A4" or "letter".'
pdf_add_page_breaks: Add page breaks when starting a new section.
pdf_add_page_breaks:
order_by_articles: Put each article on a separate page.
order_by_groups: Put each ordergroup on a separate page.
tolerance_is_costly: "Order as much of the member tolerance as possible (compared to only as much needed to fill the last box). Enabling this also includes the tolerance in the total price of the open member order."
keys:
name: Name
Expand Down
4 changes: 3 additions & 1 deletion config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ nl:
page_footer: 'Wordt op iedere pagina getoond. Vul "blank" in om de voettekst helemaal weg te halen.'
pdf_font_size: Basis tekstgrootte voor PDF bestanden (standaard 12).
pdf_page_size: 'Paginaformaat voor PDF bestanden, meestal "A4" of "letter".'
pdf_add_page_breaks: Secties op een nieuwe pagina beginnen.
pdf_add_page_breaks:
order_by_articles: Ieder artikel op een nieuwe pagina.
order_by_groups: Ieder huishouden op een nieuwe pagina.
tolerance_is_costly: "Bestel zoveel artikelen als mogelijk in de tolerantie (in plaats van net genoeg om de laatste doos te vullen). Dit zorgt er ook voor dat de tolerantie in de prijs van open ledenbestellingen wordt meegenomen."
keys:
name: Naam
Expand Down

0 comments on commit 5fcead4

Please sign in to comment.