Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use declarative helper methods in all smart answers #4539

Merged
merged 5 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 4 additions & 4 deletions lib/marriage_abroad_outcome_flattener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def generate_and_add_partials_to_country_files
raise "Failed to load `#{route}`" unless app.get(route) == 200

body = app.response.body
template_path = "#{country_outcome_path(responses_path)}.govspeak.erb"
template_path = "#{country_outcome_path(responses_path)}.erb"

responses_directory = File.dirname(template_path)
FileUtils.mkdir_p(responses_directory) unless File.directory?(responses_directory)
Expand All @@ -51,7 +51,7 @@ def generate_and_add_partials_to_country_files
File.write(template_path, insert_payment_partials(lines.join("\n")) + "\n")
end

File.write("#{country_partials_dir}/_title.govspeak.erb", title_contents(titles))
File.write("#{country_partials_dir}/_title.erb", title_contents(titles))
end

# Strips the first two lines of the file (the title).
Expand All @@ -75,7 +75,7 @@ def replace_how_to_pay(text)
text.gsub(
/^\^?You can( only)? pay by.*?\n.*?^$/mi,
<<~HOW_TO_PAY.freeze,
<%= render partial: 'how_to_pay.govspeak.erb', locals: {calculator: calculator} %>
<%= render partial: 'how_to_pay.erb', locals: {calculator: calculator} %>
HOW_TO_PAY
)
end
Expand All @@ -84,7 +84,7 @@ def replace_fee_table(text)
text.gsub(
/^Service \| Fee\n.*?^$/mi,
<<~FEE_TABLE.freeze,
<%= render partial: 'consular_fees_table_items.govspeak.erb',
<%= render partial: 'consular_fees_table_items.erb',
collection: calculator.services,
as: :service,
locals: { calculator: calculator } %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% text_for :title do %>
Look up Meursing code
<% end %>

<% text_for :meta_description do %>
Look up the additional code (Meursing code) required for import or export of goods containing certain types of milk and sugars
<% end %>

<% govspeak_for :body do %>
Use this tool to look up the additional code (Meursing code) for import or export of goods containing certain types of milk and sugars covered Regulation (EC) No. 118/2010.
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<% text_for :title do %>
<% unless calculator.has_commodity_code? %>
The product composition you indicated is not possible.
<% else %>
The Meursing code for a product with this composition is 7<%= calculator.commodity_code %>.
<% end %>
<% end %>

<% govspeak_for :body do %>
<% if calculator.has_commodity_code? %>
Use these four digits together with the ten-digit commodity code from [Trade Tariff](/trade-tariff).
<% end %>
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<% text_for :title do %>
How much milk fat does the product contain?
<% end %>

<% options(
"0": "0 - 1.49",
"1": "1.5 - 2.99",
"3": "3 - 5.99",
"6": "6 - 8.99",
"9": "9 - 11.99",
"12": "12 - 17.99",
"18": "18 - 25.99",
"26": "26 - 39.99",
"40": "40 - 54.99",
"55": "55 - 69.99",
"70": "70 - 84.99",
"85": "85 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<% text_for :title do %>
How much milk proteins does the product contain?
<% end %>

<% options(
"0": "0 - 2.49",
"2": "2.5 - 5.99",
"6": "6 - 17.99",
"18": "18 - 29.99",
"30": "30 - 59.99",
"60": "60 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<% text_for :title do %>
How much milk proteins does the product contain?
<% end %>

<% options(
"0": "0-2.49",
"2": "2.5-11.99",
"12": "12 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<% text_for :title do %>
How much milk proteins does the product contain?
<% end %>

<% options(
"0": "0-3.99",
"4": "4-14.99",
"15": "15 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<% text_for :title do %>
How much milk proteins does the product contain?
<% end %>

<% options(
"0": "0-5.99",
"6": "6-17.99",
"18": "18 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% text_for :title do %>
How much milk proteins does the product contain?
<% end %>

<% options(
"0": "0-5.99",
"6": "6 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% text_for :title do %>
How much starch or glucose does the product contain?
<% end %>

<% options(
"0": "0 - 4.99",
"5": "5 - 24.99",
"25": "25 - 49.99",
"50": "50 - 74.99",
"75": "75 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% text_for :title do %>
How much sucrose, invert sugar or isoglucose does the product contain?
<% end %>

<% options(
"0": "0 - 4.99",
"5": "5 - 29.99",
"30": "30 - 49.99",
"50": "50 - 69.99",
"70": "70 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<% text_for :title do %>
How much sucrose, invert sugar or isoglucose does the product contain?
<% end %>

<% options(
"0": "0 - 4.99",
"5": "5 - 29.99",
"30": "30 - 49.99",
"50": "50 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<% text_for :title do %>
How much sucrose, invert sugar or isoglucose does the product contain?
<% end %>

<% options(
"0": "0 - 4.99",
"5": "5 - 29.99",
"30": "30 or more"
) %>

<% text_for :hint do %>
The values represent % by weight
<% end %>

This file was deleted.

Loading