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

Allow questions to use ERB templates #2103

Merged
merged 36 commits into from
Nov 18, 2015
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
95327c6
Accept an options hash for all question types
floehopper Nov 11, 2015
761fd25
Extract QuestionPresenter#error_message_for method
floehopper Nov 11, 2015
632c191
Use real question instance instead of mock in unit test
floehopper Nov 12, 2015
b69142f
Treat error key consistently as a String
floehopper Nov 13, 2015
d6a603e
Extract QuestionPresenter#render_option method
floehopper Nov 16, 2015
1423618
Add option to render questions using ERB template vs I18n
floehopper Nov 12, 2015
9e88008
Use filesystem-friendly name for question ERB templates
floehopper Nov 13, 2015
138c4e4
Extract Flow#add_question method to reduce duplication
floehopper Nov 13, 2015
d26c7be
Add option to set default renderer for all questions in flow
floehopper Nov 13, 2015
226aabb
Add a hacky script to convert question i18n YAML to ERB templates
floehopper Nov 13, 2015
2904db8
Make names of fixture i18n YAML files consistent
floehopper Nov 13, 2015
83e1947
Convert bridge-of-death to use question ERB templates
floehopper Nov 13, 2015
19eaf27
Convert checkbox-sample to use question ERB templates
floehopper Nov 13, 2015
8103e11
Convert country-and-date-sample to use question ERB templates
floehopper Nov 13, 2015
3735e94
Convert country-legacy-sample to use question ERB templates
floehopper Nov 13, 2015
ebdffec
Convert custom-errors-sample to use question ERB templates
floehopper Nov 13, 2015
269629e
Convert data-partial-sample to use question ERB templates
floehopper Nov 13, 2015
2f3e8a8
Convert postcode-sample to use question ERB templates
floehopper Nov 13, 2015
b289da1
Convert precalculation-sample to use question ERB templates
floehopper Nov 13, 2015
4c80c35
Convert value-sample to use question ERB templates
floehopper Nov 13, 2015
8d8f8b7
Convert money-and-salary-sample to use question ERB templates
floehopper Nov 14, 2015
e4b0eda
Convert smart-answers-controller-sample-with-date-question to use que…
floehopper Nov 16, 2015
f902e6c
Convert smart-answers-controller-sample-with-value-question to use qu…
floehopper Nov 16, 2015
3d1c71d
Convert smart-answers-controller-sample-with-money-question to use qu…
floehopper Nov 16, 2015
470713b
Convert smart-answers-controller-sample-with-salary-question to use q…
floehopper Nov 16, 2015
800aba6
Convert smart-answers-controller-sample-with-multiple-choice-question…
floehopper Nov 16, 2015
93be591
Convert smart-answers-controller-sample to use question ERB templates
floehopper Nov 16, 2015
e9c7ef0
Add coverage for Q title with interpolation in GraphPresenterTest
floehopper Nov 17, 2015
0aa41b2
Remove unused GraphPresenter#translate_option method
floehopper Nov 17, 2015
e6b973c
Convert graph flow to use question ERB templates
floehopper Nov 17, 2015
58a572e
Remove unused i18n-related methods from GraphPresenter
floehopper Nov 17, 2015
fcdc4a7
Handle arbitrary levels of interpolation in GraphPresenter#labels
floehopper Nov 17, 2015
e2b9a4c
Extract MethodMissingObject
floehopper Nov 17, 2015
819a514
Convert flow-sample to use question ERB templates
floehopper Nov 16, 2015
ddb7429
Consistent naming for fixture flow
floehopper Nov 17, 2015
6994b3e
Rubocop fixes
floehopper Nov 17, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert country-and-date-sample to use question ERB templates
I ran the following command:

    $ rails r script/convert-question-i18-yaml-to-erb-templates.rb test/fixtures/smart_answer_flows/country-and-date-sample
floehopper committed Nov 18, 2015
commit 8103e11ce203255d11365399abb10672196c8692
2 changes: 2 additions & 0 deletions test/fixtures/smart_answer_flows/country-and-date-sample.rb
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ def define
name 'country-and-date-sample'
status :draft

use_erb_templates_for_questions

country_select :which_country_do_you_live_in?, exclude_countries: %w(afghanistan united-kingdom) do
save_input_as :country
next_node :what_date_did_you_move_there?
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% content_for :title do %>
What date did you move there?
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% content_for :title do %>
Which country do you live in?
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% content_for :title do %>
Which country were you born in?
<% end %>

This file was deleted.