doop 0.0.3.1 → 0.0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/images/nino-icon.png +0 -0
  3. data/app/assets/images/passport-icon.png +0 -0
  4. data/app/assets/images/time-icon.png +0 -0
  5. data/app/helpers/doop_helper.rb +14 -7
  6. data/doop.gemspec +4 -2
  7. data/lib/doop-rspec.rb +82 -0
  8. data/lib/doop.rb +3 -1
  9. data/lib/doop/version.rb +1 -1
  10. data/lib/doop_controller.rb +14 -9
  11. data/lib/generators/doopgovuk/doopgovuk_generator.rb +3 -0
  12. data/lib/generators/doopgovuk/templates/app/assets/javascripts/demo.js.coffee +7 -0
  13. data/lib/generators/doopgovuk/templates/app/assets/javascripts/demo/application.js +2 -0
  14. data/lib/generators/doopgovuk/templates/app/assets/stylesheets/demo.css.scss +50 -8
  15. data/lib/generators/doopgovuk/templates/app/assets/stylesheets/demo/application.css +3 -0
  16. data/lib/generators/doopgovuk/templates/app/controllers/demo_controller.rb +202 -68
  17. data/lib/generators/doopgovuk/templates/app/views/demo/_about_you.html.erb +84 -0
  18. data/lib/generators/doopgovuk/templates/app/views/demo/_before_you_begin.html.erb +56 -0
  19. data/lib/generators/doopgovuk/templates/app/views/demo/_children.html.erb +64 -0
  20. data/lib/generators/doopgovuk/templates/app/views/demo/_declaration.html.erb +32 -0
  21. data/lib/generators/doopgovuk/templates/app/views/demo/_preamble.html.erb +36 -27
  22. data/lib/generators/doopgovuk/templates/app/views/demo/harness.html.erb +1 -1
  23. data/lib/generators/doopgovuk/templates/app/views/demo/index.html.erb +6 -0
  24. data/lib/generators/doopgovuk/templates/app/views/demo/index.js.erb +1 -1
  25. data/lib/generators/doopgovuk/templates/app/views/doop/_change_answer_tooltip.html.erb +1 -1
  26. data/lib/generators/doopgovuk/templates/app/views/doop/_debug.html.erb +4 -0
  27. data/lib/generators/doopgovuk/templates/app/views/doop/_error.html.erb +1 -3
  28. data/lib/generators/doopgovuk/templates/app/views/doop/_navbar.html.erb +4 -3
  29. data/lib/generators/doopgovuk/templates/app/views/doop/_question.html.erb +11 -7
  30. data/lib/generators/doopgovuk/templates/app/views/doop/_question_form.html.erb +5 -6
  31. data/lib/generators/doopgovuk/templates/app/views/doop/_textfield.html.erb +14 -0
  32. data/lib/generators/doopgovuk/templates/app/views/doop/_tooltip.html.erb +1 -1
  33. data/lib/generators/doopgovuk/templates/spec/features/demo_spec.rb +121 -48
  34. data/lib/generators/doopgovuk/templates/spec/rails_helper.rb +4 -73
  35. data/spec/doop_spec.rb +47 -0
  36. metadata +22 -12
  37. data/lib/generators/doopgovuk/templates/app/views/demo/_summary.html.erb +0 -10
  38. data/lib/generators/doopgovuk/templates/app/views/demo/_your_details.html.erb +0 -55
@@ -0,0 +1,84 @@
1
+ <%=question_form doop, res do %>
2
+ <%=question "/page/about_you" do |root, answer| %>
3
+
4
+ <%=question "/page/about_you/your_name" do |root,answer| %>
5
+ <%=doop_textfield "title", answer, res, :label => "Title (eg. Mrs, Miss, Ms, Mr or Dr)" %>
6
+ <%=doop_textfield "firstname", answer, res, :label => "Firstname" %>
7
+ <%=doop_textfield "middlenames", answer, res, :label => "Middlename(s)" %>
8
+ <%=doop_textfield "surname", answer, res, :label => "Surname or family name" %>
9
+ <br/>
10
+ <button>Continue</button><br/>
11
+ <% end %>
12
+
13
+ <%=question "/page/about_you/known_by_other_name" do |root,answer| %>
14
+ <p>If you had a different maiden name, please answer Yes.</p>
15
+ <button name="b_answer" value="Yes">Yes, I have been known by another surname</button><br/>
16
+ <button name="b_answer" value="No">No, I have not been known by another surname</button>
17
+ <% end %>
18
+
19
+ <%=question "/page/about_you/previous_name" do |root,answer| %>
20
+ <%=doop_textfield "answer", answer, res %>
21
+ <button>Continue</button>
22
+ <% end %>
23
+
24
+ <%=question "/page/about_you/dob" do |root,answer| %>
25
+ <p>Please provide this in the format dd/mm/yyyy eg. 25/02/1977</p>
26
+ <%=doop_textfield "answer", answer, res %>
27
+ <button>Continue</button>
28
+ <% end %>
29
+
30
+ <%=question "/page/about_you/your_address" do |root,answer| %>
31
+
32
+ <%=doop_textfield "address1", answer, res, :label => "Address" %>
33
+ <%=doop_textfield "address2", answer, res %>
34
+ <%=doop_textfield "address3", answer, res %>
35
+ <%=doop_textfield "postcode", answer, res, :label => "Postcode" %>
36
+ <button>Continue</button>
37
+
38
+ <% end %>
39
+
40
+ <%=question "/page/about_you/lived_at_address_for_more_than_12_months" do |root,answer| %>
41
+ <button name="b_answer" value="Yes">Yes, I've lived at this address for more than 12 months</button><br/>
42
+ <button name="b_answer" value="No">No, I have not lived at this address for more than 12 months</button>
43
+ <% end %>
44
+
45
+ <%=question "/page/about_you/last_address" do |root,answer| %>
46
+ <%=doop_textfield "address1", answer, res, :label => "Address" %>
47
+ <%=doop_textfield "address2", answer, res %>
48
+ <%=doop_textfield "address3", answer, res %>
49
+ <%=doop_textfield "postcode", answer, res, :label => "Postcode" %>
50
+ <button>Continue</button>
51
+
52
+ <% end %>
53
+
54
+ <%=question "/page/about_you/your_phone_numbers" do |root,answer| %>
55
+
56
+ <div class="textfield">
57
+ <%=doop_textfield "daytime", answer, res, :label => "Daytime phone number" %>
58
+ <%=doop_textfield "evening", answer, res, :label => "Evening phone number" %>
59
+ <button>Continue</button>
60
+ <% end %>
61
+
62
+ <%=question "/page/about_you/have_nino" do |root,answer| %>
63
+ <%=info_box do %>
64
+ <p>This will be on:</p>
65
+ <li>a P60 certificate from your employer</li>
66
+ <li>a PAYE Coding Notice or a letter from us</li>
67
+ <li>a payslip from your employer</li>
68
+ <li>any letter from the Department for Work and Pensions or Jobcentre Plus</li>
69
+ <% end %>
70
+ <button name="b_answer" value="Yes">Yes, I have a national insurance number</button><br/>
71
+ <button name="b_answer" value="No">No, I don't have a national insurance number</button>
72
+ <% end %>
73
+
74
+ <%=question "/page/about_you/nino" do |root,answer| %>
75
+ <%=doop_textfield "answer", answer, res, :label => "Example of a National Insurance number is 00123456A" %>
76
+ <button>Continue</button>
77
+ <% end %>
78
+
79
+ <% when_answered "/page/about_you" do %>
80
+ <button>Continue and Save</button>
81
+ <% end %>
82
+ <% end %>
83
+
84
+ <% end %>
@@ -0,0 +1,56 @@
1
+ <%=question_form doop, res do %>
2
+ <%=question "/page/before_you_begin" do |root, answer| %>
3
+
4
+ <h2>Doop technology demo</h2>
5
+ <p>Doop is a rails ruby gem which provides a generator to get you quickly started converting govuk paper forms into online applications.
6
+
7
+ This is a demo of how a <strong><a href="https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/359765/ch2-flat.pdf">Child Benefit paper application form</a></strong> could be realized as an online questionnaire, where questions are progresively
8
+ asked and question flows altered based on responses. </p>
9
+
10
+ <button>Start the demo</button>
11
+ <br/>
12
+ <br/>
13
+ <br/>
14
+
15
+ <h2>The code</h2>
16
+ <p>As you progress through the questionnaire, you can follow along in the code:<br/><br/>
17
+ <%
18
+ view_url = "https://github.com/coder36/doop/tree/master/lib/generators/doopgovuk/templates/app/views/demo"
19
+ cont_url = "https://github.com/coder36/doop/tree/master/lib/generators/doopgovuk/templates/app/controllers"
20
+ rspec_url = "https://github.com/coder36/doop/blob/master/lib/generators/doopgovuk/templates/spec/features/demo_spec.rb"
21
+ %>
22
+
23
+ <strong><a href='<%="#{cont_url}/demo_controller.rb"%>'>demo_controller.rb</a></strong><br/>
24
+ <strong><a href='<%="#{view_url}/_before_you_begin.html.erb"%>'>_before_you_begin.html.erb</a></strong><br/>
25
+ <strong><a href='<%="#{view_url}/_preamble.html.erb"%>'>_preamble.html.erb</a></strong><br/>
26
+ <strong><a href='<%="#{view_url}/_about_you.html.erb"%>'>_about_you.html.erb</a></strong><br/>
27
+ <strong><a href='<%="#{view_url}/_children.html.erb"%>'>_children.html.erb</a></strong><br/>
28
+ <strong><a href='<%="#{view_url}/_declaration.html.erb"%>'>_declaration.html.erb</a></strong><br/>
29
+ <strong><a href='<%="#{rspec_url}"%>'>demo_spec.rb</a></strong><br/>
30
+ </p>
31
+
32
+
33
+ <h3>The YAML</h3>
34
+ <p>The question structure is described using YAML. As questions are answered, the YAML structure is updated to reflect the current state
35
+ of the questionnaire. The YAML structure is then sent back to the browser and stored in a hidden field. When the next question is answered
36
+ the submission include the hidden YAML, which is then updated to reflect the next answer... and so on. In production, the hidden field is
37
+ encrypted and signed, to guarentee its authenticity. Since the data is stored in the users browser, the application can be considered stateless
38
+ , which makes it very scalable.</p>
39
+
40
+ <h3>View the saved YAML</h3>
41
+ <p>For the demo, at any point you can view the current YAML by hitting <strong>Ctrl-Y</strong></p>
42
+
43
+ <h3>Testing with Rspec</h3>
44
+ <p>Doop defines a set of Rspec extensions, to make acceptance testing more natural. See <strong><a href='<%="#{rspec_url}"%>'>demo_spec.rb</a></strong> for the acceptance tests covering
45
+ the demo.</p>
46
+
47
+ <h3>Test Harness</h3>
48
+ <p>The demo includes a <strong><a href="harness">test harness</a></strong>, which allows you to directly render a YAML config. The quickest way
49
+ to try this put is to hit Ctrl-Y, copy the YAML, then paste it into the test harness.</p>
50
+
51
+
52
+
53
+
54
+ <% end %>
55
+
56
+ <% end %>
@@ -0,0 +1,64 @@
1
+ <%=question_form doop, res do %>
2
+
3
+ <%=question "/page/children" do |root,answer| %>
4
+ <p><strong>List the children you want to claim for.</strong></p>
5
+ <%=info_box do %>
6
+ <p>For each child in this claim we need to see their:</p>
7
+ <li>birth certificate (full or short version)</li>
8
+ <li>adoption certificate</li>
9
+ <p>If any child in this claim was born outside the UK we also need to see their passport(s) or their travel documents used to enter the UK.</p>
10
+
11
+ <p><strong>We will normally return your documents within 4 weeks.</strong></p>
12
+
13
+ <% end %>
14
+ <p>You don't need to tell us about any children you already get Child Benefit for.</p>
15
+
16
+ <%=question "/page/children/how_many_birth_certs" do |root,answer| %>
17
+ <p>We don't need to see a birth certificate for a child that has been claimed for by you or someone else in the past</p>
18
+ <%=doop_textfield "answer", answer, res %>
19
+ <button>Continue</button>
20
+ <% end %>
21
+
22
+ <% list "/page/children/child__(\\d+)" do |path,index| %>
23
+
24
+ <%=question "#{path}", :title => "Child #{index}" do |root,answer| %>
25
+
26
+ <%=question "#{path}/name" do |root,answer| %>
27
+ <%=doop_textfield "firstname", answer, res, :label => "Firstname" %>
28
+ <%=doop_textfield "middlenames", answer, res, :label => "Middlename(s)" %>
29
+ <%=doop_textfield "surname", answer, res, :label => "Surname or family name" %>
30
+ <button>Continue</button>
31
+ <% end %>
32
+
33
+ <%=question "#{path}/gender" do |root,answer| %>
34
+ <button name="b_answer" value="Male">Male</button><br/>
35
+ <button name="b_answer" value="Female">Female</button>
36
+ <% end %>
37
+
38
+ <%=question "#{path}/dob" do |root,answer| %>
39
+ <p>Please provide this in the format dd/mm/yyyy eg. 25/02/1977</p>
40
+ <%=doop_textfield "answer", answer, res %>
41
+ <button>Continue</button>
42
+ <% end %>
43
+
44
+ <%=question "#{path}/own_child" do |root,answer| %>
45
+ <button name="b_answer" value="Yes">Yes, this is my own child</button><br/>
46
+ <button name="b_answer" value="No">No, this is someone elses child</button>
47
+ <% end %>
48
+
49
+ <% when_answered path do %>
50
+ <% if index > 1 %>
51
+ <button class="button-secondary" name="remove_child">Remove child</button><br/>
52
+ <% end %>
53
+ <button>Continue</button>
54
+ <% end %>
55
+ <% end %>
56
+
57
+ <% end %>
58
+ <% when_answered "/page/children" do %>
59
+ <button name="add_child" class="button-secondary">Add another child</button><br/>
60
+ <button>Continue and save</button>
61
+ <% end %>
62
+
63
+ <% end %>
64
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <%=question_form doop, res do %>
2
+ <%=question "/page/declaration" do |root, answer| %>
3
+
4
+ <div class="summary_box">
5
+
6
+ <%
7
+ name = doop["/page/about_you/your_name/_summary"]
8
+ address = doop["/page/about_you/your_address/_summary"]
9
+ %>
10
+
11
+ <p>I, <strong><%=name%></strong> of <strong><%=address%></strong>, am applying for child benefit for:</p>
12
+
13
+ <%
14
+ list "/page/children/child__(\\d+)" do |path, index|
15
+ child = doop["#{path}/name/_summary"]
16
+ dob = doop["#{path}/dob/_summary"]
17
+ %>
18
+ <li><strong><%=child%></strong>, born <strong><%=dob%></strong></li>
19
+ <% end %>
20
+
21
+ <br/>
22
+
23
+ <p><strong>I declare that the information I have provided is correct and complete</strong>. If I give information which I know is not correct or complete, you may take action against me.</p>
24
+
25
+ <p><strong>I will send the birth certificate(s) or other documents that you need with this form.</strong> If you don't send the documents we need with this application, a decision on your claim will be delayed. Do not send photocopies</p>
26
+ </div>
27
+
28
+
29
+ <button>I declare that the information I have provided is correct and complete. Submit my application.</button>
30
+
31
+ <% end %>
32
+ <% end %>
@@ -1,42 +1,51 @@
1
1
  <%=question_form doop, res do %>
2
2
  <%=question "/page/preamble" do |root, answer| %>
3
3
 
4
- <%=question "/page/preamble/debug_on" do |root,answer| %>
5
- <button name="b_answer" value="Yes">Yes, turn debugging on</button><br/>
6
- <button name="b_answer" value="No">No, turn debugging off</button>
7
- <% end %>
4
+ <h2>To apply for Child Benefit, you'll need:</h2>
5
+ <ul class="before_you_begin">
8
6
 
9
- <% when_question :last_answered => "/page/preamble/debug_on" do |answer|%>
10
- <% if answer == "No" %>
11
- <%=tooltip do %>
12
- <p><strong>Are you sure ?</strong></p>
13
- <p>By selecting no, you will not be able to see the yaml which doop generates behind the scenes</p>
14
- <% end %>
15
- <% end %>
16
- <% end %>
7
+ <li class="nino">You and your partners national insurance numbers</li>
8
+
9
+ <li class="passport">Your childrens birth certificates</li>
10
+
11
+ <li class="time">15 mins</li>
12
+ </ul>
13
+
14
+ <h3>Your information</h3>
15
+ <p>By applying for child benefit online, you consent that we may process your personal data (including sensitive personal data) that we collect from you.</p>
17
16
 
18
- <% when_question :changed => "/page/preamble/enrolled_before" do |current_answer| %>
19
- <%=change_answer_tooltip do %>
17
+ <% when_question :changed => "/page/preamble/income_more_than_50000" do |current_answer, id| %>
18
+ <%=change_answer_tooltip id do %>
20
19
  <p>If you change this answer, additional questions may be asked</p>
21
20
  <% end %>
21
+
22
22
  <% end %>
23
- <%=question "/page/preamble/enrolled_before" do |root,answer| %>
24
- <button name="b_answer" value="Yes">Yes, I've applied before</button><br/>
25
- <button name="b_answer" value="No">No, I haven't applied before</button>
23
+
24
+ <%=question "/page/preamble/income_more_than_50000" do |root,answer| %>
25
+ <button name="b_answer" value="Yes">Yes, myself or my partner have an individual income of more than £50,000 a year</button><br/>
26
+ <button name="b_answer" value="No">No, myself and or my partner both have incomes less than £50,000 a year</button>
26
27
  <% end %>
27
28
 
28
- <%=question "/page/preamble/year_last_applied" do |root,answer| %>
29
- <%=select_tag( "b_answer", "<option>2013</option><option>2012</option>".html_safe ) %>
30
- <br/>
31
- <button>Continue</button>
29
+ <% when_question :last_answered => "/page/preamble/income_more_than_50000" do |answer, id| %>
30
+ <% if answer == "No" %>
31
+ <%=tooltip id do %>
32
+ <p>If either you or your parnter have an individual income of more than £50,000 a year, then the higher earner, will be liable for
33
+ income tax on any child benefit received.</p>
34
+ <% end %>
35
+ <% end %>
32
36
  <% end %>
33
37
 
34
- <%=question "/page/preamble/reason_for_applying" do |root,answer| %>
35
- <p>Why are you applying this year? Please be as specific as possible, and give examples</p>
36
- <%=error res, :reason_for_applying_error %>
37
- <%=text_area_tag "b_answer", answer, rows: 10, cols: 100 %>
38
- <br/>
39
- <button>Continue</button>
38
+ <%=question "/page/preamble/do_you_still_want_to_apply" do |root,answer| %>
39
+
40
+ <%=info_box do %>
41
+ <p>If either you or your partner have an individual income of more than £50,000 a year (income from all
42
+ sources before personal allowances and tax is taken off, less any pension and gift aid contributions), then the partner with the
43
+ higher income will have to pay a High Income Child Benefit Charge on some, or all, of the Child Benefit you receive.<p>
44
+ <p><strong>If these changes apply to you or your partner, you should jointly decide whether to stop getting Child Benefit payments,
45
+ and not have to pay a tax charge, or continue getting Child Benefit payments and declare them for tax purposes.</strong><p>
46
+ <% end %>
47
+
48
+ <button name="b_answer" value="Yes">Yes, I still want to apply for child benefit</button><br/>
40
49
  <% end %>
41
50
 
42
51
  <% when_answered "/page/preamble" do %>
@@ -2,5 +2,5 @@
2
2
  <%=form_tag( {action: "index"}, :authenticity_token => true, :remote => false ) do %>
3
3
  <textarea cols="140" rows="40" name="doop_data" id="doop_data"></textarea>
4
4
  <br/>
5
- <button id="render" >Render</button>
5
+ <button id="render" name="harness">Render</button>
6
6
  <% end %>
@@ -1,3 +1,9 @@
1
1
  <div id="question_section">
2
2
  <%= render res[:page], :doop => doop, :res => res %>
3
3
  </div>
4
+ <div style="display: none;">
5
+ <div id="doop_debug" title="Doop debug">
6
+ <%= render "doop/debug", :doop => doop, :res => res %>
7
+ </div>
8
+ </div>
9
+
@@ -1,4 +1,4 @@
1
1
  $("#question_section").html( "<%= escape_javascript( render res[:page], :doop => doop, :res => res ) %>" )
2
+ $("#doop_debug").html( "<%= escape_javascript( render 'doop/debug', :doop => doop, :res => res ) %>" )
2
3
  $("#nav_path").val("")
3
4
  $("#back_a_page").val("")
4
- $("#change_answer").val("")
@@ -1,3 +1,3 @@
1
- <div class="change_answer_tooltip">
1
+ <div class="change_answer_tooltip" id="<%=id%>-change-answer-tooltip">
2
2
  <% content.call %>
3
3
  </div>
@@ -0,0 +1,4 @@
1
+ <h3>Yaml</h3>
2
+ <textarea cols="80" rows="30"><%=doop.dump%></textarea>
3
+ <h3>Res</h3>
4
+ <textarea cols="80" rows="20"><%=res.to_yaml%></textarea>
@@ -1,3 +1 @@
1
- <div class="error">
2
- <span><%= msg %></span>
3
- </div>
1
+ <span class="error"><%= msg %></span>
@@ -6,13 +6,14 @@
6
6
  page_path = res[:page_path]
7
7
  pages.each do |p|
8
8
  nav_name = doop[p]["_nav_name"]
9
+ id = doop[p]["_page"]
9
10
 
10
11
  if p == page_path %>
11
- <li class="doing"><%="#{i}. #{nav_name}"%></li>
12
+ <li class="doing" id="<%=id%>-nav"><%="#{i}. #{nav_name}"%></li>
12
13
  <% elsif doop[p]["_answered"] %>
13
- <li class="done"><a href="#" onclick="$('#nav_path').val('<%=p %>').click(); return false"><%="#{i}. #{nav_name}" %></a></li>
14
+ <li class="done"><a href="#" id="<%=id%>-nav" onclick="$('#nav_path').val('<%=p %>').click(); return false"><%="#{i}. #{nav_name}" %></a></li>
14
15
  <% else %>
15
- <li class="todo"><%="#{i}. #{nav_name}"%></li>
16
+ <li class="todo" ><%="#{i}. #{nav_name}"%></li>
16
17
  <%
17
18
  end
18
19
  i +=1
@@ -1,18 +1,22 @@
1
1
  <% if root["_open"] %>
2
2
  <% if indent %><div class="indent"><% end %>
3
- <div class="question-open">
4
- <h2 class="question_title"><%=title != nil ? title : root["_question"]%></h2>
5
- <% content.call(root, answer) %>
3
+ <div id="<%=id%>">
4
+ <div class="question-open" id="<%=id%>-open">
5
+ <h2 class="question_title"><%=title != nil ? title : root["_question"]%></h2>
6
+ <% content.call(root, answer) %>
7
+ </div>
6
8
  </div>
7
9
  <% if indent %> </div"><% end %>
8
10
  <% end %>
9
11
 
10
12
  <% if !root["_open"] && root["_answered"] %>
11
13
  <% if indent %><div class="indent"><% end %>
12
- <div class="question-closed">
13
- <div class="title question_title"><%=title != nil ? title : root["_question"]%></div>
14
- <div class="answer">
15
- <a href="#" class="button" onclick="$('#change_answer_path').val('<%=path %>').click(); return false"><%=root['_summary']%></a>
14
+ <div id="<%=id%>">
15
+ <div class="question-closed" id="<%=id%>-closed">
16
+ <div class="title question_title" id="<%=id%>-rollup"><%=title != nil ? title : root["_question"]%></div>
17
+ <div class="answer">
18
+ <button id="<%=id%>-change" class="button-change-answer" value="<%=path%>" name="change_answer_path"><%=root['_summary']%></button>
19
+ </div>
16
20
  </div>
17
21
  </div>
18
22
  <% if indent %> </div"><% end %>
@@ -1,15 +1,14 @@
1
1
  <%=form_tag( {action: "answer"}, :authenticity_token => true, :remote => true ) do %>
2
- <div class="question_form">
2
+ <div class="question_form" id="<%=res[:page]%>-page">
3
3
  <%=render "doop/navbar", :res => res, :doop => doop %>
4
4
  <h1 id="page_title"><%=res[:page_title]%></h1>
5
5
  <% content.call %>
6
6
  </div>
7
7
 
8
- <% if res[:debug_on] %>
9
- <br/><br/><textarea cols="115" rows="20"><%= h(doop.dump)%></textarea>
10
- <% end %>
11
8
  <button id="nav_path" style="display: none;" name="nav_path"></button>
12
- <button id="back_a_page" name="back_a_page" style="display: none;"></button>
13
- <button id="change_answer_path" style="display: none;" name="change_answer_path"></button>
9
+ <button id="back_a_page" name="back_a_page" class="button-secondary" value="pressed">Go Back</button>
10
+ <script>
11
+ $("#back_a_page").css( "display", "none" )
12
+ </script>
14
13
  <input type="hidden" id="doop_data" name="doop_data" value="<%=request["doop_data"]%>"/>
15
14
  <% end %>
@@ -0,0 +1,14 @@
1
+ <%
2
+ val = name=="answer" ? answer : answer[name]
3
+ # if answer.is_a?Hash
4
+ # val = (answer.is_a?Hash) ? answer[ name ] : answer
5
+ # end
6
+ # val = (answer.is_a?Hash) ? answer[ name ] : answer
7
+ %>
8
+
9
+ <div class="textfield">
10
+ <% if !label.nil? %>
11
+ <label for="<%=name%>"><%=label%></label>
12
+ <% end %>
13
+ <input id="<%=name%>" name="b_<%=name%>" type="text" value="<%=val%>"/><%=error res, "#{name}_error".to_sym %>
14
+ </div>