Files
nairobi/app/helpers/signature_sheets_helper.rb
Javi Martín db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00

51 lines
1.4 KiB
Ruby

module SignatureSheetsHelper
def signable_options
[[t("activerecord.models.proposal", count: 1), Proposal],
[t("activerecord.models.budget/investment", count: 1), Budget::Investment]]
end
def required_fields_to_verify_text_help
if Setting["feature.remote_census"].present?
date_of_birth_and_postal_code_text_help
else
t("admin.signature_sheets.new.document_numbers_note")
end
end
def date_of_birth_and_postal_code_text_help
text_help = t("admin.signature_sheets.new.text_help.required_fields_note")
if Setting.force_presence_date_of_birth?
text_help += t("admin.signature_sheets.new.text_help.date_of_birth_note")
end
if Setting.force_presence_postal_code?
text_help += t("admin.signature_sheets.new.text_help.postal_code_note")
end
text_help += tag(:br)
text_help += t("admin.signature_sheets.new.text_help.required_fields_structure_note")
return text_help
end
def example_text_help
text_example = t("admin.signature_sheets.new.text_help.example_text")
example_1 = "12345678Z"
example_2 = "87654321Y"
if Setting.force_presence_date_of_birth?
example_1 += ", 01/01/1980"
example_2 += ", 01/02/1990"
end
if Setting.force_presence_postal_code?
example_1 += ", 28001"
example_2 += ", 28002"
end
text_example += "#{example_1}; #{example_2}"
return text_example
end
end