diff --git a/app/views/branded/questions/_new_edit_question_option_based.html.erb b/app/views/branded/questions/_new_edit_question_option_based.html.erb new file mode 100644 index 0000000..85633d3 --- /dev/null +++ b/app/views/branded/questions/_new_edit_question_option_based.html.erb @@ -0,0 +1,45 @@ +<%# locals: { f, question, answer } %> +<% options = question.question_options.by_number %> +<% if question.question_format.checkbox? %> + <%= f.label(:question_option_ids, raw(question.text), class: 'control-label') %> + <% options.each do |op| %> +
+ +
+ <% end %> +<% elsif question.question_format.radiobuttons? %> + <%= f.label(:question_option_ids, raw(question.text), class: 'control-label') %> + <% options.each do |op| %> +
+ +
+ <% end %> +<% elsif question.question_format.dropdown? || question.question_format.multiselectbox? %> + <% + options_html = "" + options.each do |op| + options_html += answer.has_question_option(op.id) ? + "" : + "" + end + %> + <%= f.label(:question_option_ids, raw(question.text), class: 'control-label') %> + <%= select_tag('answer[question_option_ids]', + raw(options_html), + { multiple: question.question_format.multiselectbox?, + prompt: d_('dmpopidor', 'Select an answer'), + class: 'form-control' }) %> +<% end %> +
+<% if question.option_comment_display %> + <% text = question.question_format.rda_metadata? ? answer.answer_hash['text'] : answer.text %> + <%= label_tag('answer[text]', _('Additional Information'), class: 'control-label') %> + <%= text_area_tag('answer[text]', text, id: "answer-text-#{question.id}", class: "form-control tinymce_answer") %> +<% end %> +
diff --git a/config/locale/dmpopidor.pot b/config/locale/dmpopidor.pot index a1749e6..bf1826f 100644 --- a/config/locale/dmpopidor.pot +++ b/config/locale/dmpopidor.pot @@ -60,3 +60,6 @@ msgid "Tutorials" msgstr "" +msgid "Select an answer" +msgstr "" + diff --git a/config/locale/en_GB/dmpopidor.po b/config/locale/en_GB/dmpopidor.po index 83e87e2..544b063 100644 --- a/config/locale/en_GB/dmpopidor.po +++ b/config/locale/en_GB/dmpopidor.po @@ -56,4 +56,7 @@ msgstr "%{sender_name} has invited you to contribute to their Data Management Plan in %{tool_name}" msgid "Tutorials" -msgstr "Tutorials" \ No newline at end of file +msgstr "Tutorials" + +msgid "Select an answer" +msgstr "Select an answer" \ No newline at end of file diff --git a/config/locale/fr_FR/dmpopidor.po b/config/locale/fr_FR/dmpopidor.po index 8def50b..4cd1a5c 100644 --- a/config/locale/fr_FR/dmpopidor.po +++ b/config/locale/fr_FR/dmpopidor.po @@ -55,4 +55,7 @@ msgstr "%{sender_name} vous a invité à contribuer à son plan de gestion de données sur %{tool_name}" msgid "Tutorials" -msgstr "Tutoriels" \ No newline at end of file +msgstr "Tutoriels" + +msgid "Select an answer" +msgstr "Sélectionnez une réponse" \ No newline at end of file