diff --git a/app/views/branded/answers/_new_edit.html.erb b/app/views/branded/answers/_new_edit.html.erb new file mode 100644 index 0000000..bfa10cd --- /dev/null +++ b/app/views/branded/answers/_new_edit.html.erb @@ -0,0 +1,83 @@ +<%# locals: { template, question, answer, readonly, locking } %> + + +<% q_format = question.question_format %> +<% if q_format.rda_metadata? %> +

+ <%= raw question.text %> +

+ <% answer_hash = answer.answer_hash %> +
+
<%=_("Your Selected Standards:")%>
+ +
<%=_("Please select a subject")%>
+ +
+
<%=_("Please select a sub-subject")%>
+ +
+
+
+ + <%=_("Browse Standards") %> + + +
+

+ <%=_("Please wait, Standards are loading")%> +

+
+
+ Standard not listed? Add your own. + +
+
+
+<% end %> + +<%= form_for answer, url: {controller: :answers, action: :create_or_update}, html: {method: :post, 'data-autosave': question.id, class: 'form-answer' } do |f| %> + <% if !readonly %> + <%= f.hidden_field :plan_id %> + <%= f.hidden_field :question_id %> + <%= f.hidden_field :lock_version %> + <% if q_format.rda_metadata? %> + <%= hidden_field_tag :standards, answer_hash['standards'].to_json %> + <% end %> + <% end %> +
> + <% if question.option_based? || question.question_format.rda_metadata? %> + <%= render(partial: 'questions/new_edit_question_option_based', locals: { f: f, question: question, answer: answer }) %> + <% elsif question.question_format.textfield?%> + <%= render(partial: 'questions/new_edit_question_textfield', locals: { f: f, question: question, answer: answer }) %> + <% elsif question.question_format.date? %> + <%= render(partial: 'questions/new_edit_question_datefield', locals: { f: f, question: question, answer: answer }) %> + <% elsif question.question_format.textarea? %> + <%= render(partial: 'questions/new_edit_question_textarea', locals: { f: f, question: question, answer: answer, locking: locking }) %> + <% end %> + <%= f.button(_('Save'), class: "btn btn-default", type: "submit") %> +
+ + <% if template.present? && template.org.present? %> + <% question.get_example_answers([base_template_org.id, template.org.id]).each do |annotation| %> + <% if annotation.present? && annotation.org.present? && annotation.text.present? %> +
+ + <%="#{annotation.org.abbreviation} "%> <%=_('example answer')%> + +
+ <%= raw annotation.text %> +
+
+ <% end %> + <% end %> + <% end %> +<% end %> diff --git a/app/views/branded/questions/_new_edit_question_datefield.html.erb b/app/views/branded/questions/_new_edit_question_datefield.html.erb new file mode 100644 index 0000000..631f38e --- /dev/null +++ b/app/views/branded/questions/_new_edit_question_datefield.html.erb @@ -0,0 +1,5 @@ +<%# locals: { f, question, answer } %> +
+ <%= f.label(:text, raw(question.text), class: 'control-label') %> + <%= date_field_tag('answer[text]', strip_tags(answer.text || question.default_value), class: 'form-control') %> +
\ No newline at end of file