.row
  .col-md-12
    .page-header
      %h1
        Survey: #{@survey.title}
        = link_to 'Edit Survey', edit_admin_conference_survey_path(@conference.short_title, @survey), class: 'btn btn-primary pull-right'
      %p.text-muted
        From:
        = @survey.start_date
        to
        = @survey.end_date
.row
  .col-md-12
    .tabbable
      %ul.nav.nav-tabs
        %li.active
          = link_to 'Questions' , '#questions-content', 'data-toggle' => 'tab'
        %li
          = link_to 'Replies' , '#replies-content', 'data-toggle' => 'tab'
        %li
          = link_to 'Stats' , '#stats-content', 'data-toggle' => 'tab'
      .tab-content
        .tab-pane.active#questions-content
          = semantic_form_for 'survey_submission', url: '#' do |f|
            - @survey.survey_questions.each.with_index(1) do |survey_question, question_index|
              .row
                .col-md-12
                  - survey_reply = survey_question.survey_replies.new(survey_question_id: survey_question.id, user_id: current_user.id)
                  = render partial: 'survey_question', locals:  { survey_question: survey_question, question_index: question_index, survey_reply: survey_reply }
          = link_to 'Add Question', new_admin_conference_survey_survey_question_path(@conference.short_title, @survey), class: 'btn btn-success pull-right'
        .tab-pane#replies-content
          = render partial: 'survey_replies'
        .tab-pane#stats-content
          = render partial: 'survey_stats'
