forked from gorenje/surveyor
/
edit.html.haml
28 lines (27 loc) · 1.41 KB
/
edit.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#surveyor
- form_tag(update_my_survey_path, :method => :put, :id => "survey_form", :class => @survey.custom_class) do
= hidden_field_tag :current_section_id, @section.id
- unless @sections.size < 3
#menu
= t('surveyor.sections')
%ul
- @sections.each do |s|
%li{:class => ("active" if s == @section)}= menu_button_for(s)
#header
.title= @survey.title
.previous_section= previous_section
- unless @dependents.empty?
#dependents
.title Follow-up questions from your answers on the previous page
-# @dependents.each_with_index do |question, index|
= dependency_explanation_helper(question, @response_set)
= render(:partial => question.custom_renderer || "/partials/question", :locals => {:question => question, :response_set => @response_set, :number => "D#{index+1}"})
-# cache section if there are no responses for that section in th current response_set
- if @response_set.no_responses_for_section?(@section)
- cache("section_#{@section.id}") do
-# cache
= render(:partial => "/partials/section", :locals => {:section => @section, :questions => @questions, :response_set => @response_set})
- else
-# no cache
= render(:partial => "/partials/section", :locals => {:section => @section, :questions => @questions, :response_set => @response_set})
.next_section= next_section