diff --git a/app/views/plans/export.html.erb b/app/views/plans/export.html.erb index b854936..d982182 100644 --- a/app/views/plans/export.html.erb +++ b/app/views/plans/export.html.erb @@ -1,78 +1,78 @@
-

<%= @plan.title %>

-

<%= @plan.template.title %>

-
-
- <% details = @exported_plan.admin_details %> - <% if details.present? && @show_details %> -

<%= _('Admin Details') %>

- - - - - - - - - <% - details.each do |field| - value = @exported_plan.send(field) - %> - - - - - <% end %> - -
<%= _('Title')%><%= _('Description')%>

- <%= admin_field_t(field.to_s) -%>

<%= value.present? ? value : _('-') %>
- <% end %> - <% @sections.each do |section| %> -

<%= section.title %>

- - - +

<%= @plan.title %>

+

<%= @plan.template.title %>

+
+
+ <% details = @exported_plan.admin_details %> + <% if details.present? && @show_details %> +

<%= _('Admin Details') %>

+
+ + + + + + + + <% + details.each do |field| + value = @exported_plan.send(field) + %> + + + + + <% end %> + +
<%= _('Title')%><%= _('Description')%>

- <%= admin_field_t(field.to_s) -%>

<%= value.present? ? value : _('-') %>
+ <% end %> + <% @sections.each do |section| %> +

<%= section.title %>

+ + + <% if @question_headings %> - + <% end %> - - - - - <% section.questions.order(:number).each do |question| %> - + + + + + <% section.questions.order(:number).each do |question| %> + <% answer = @plan.answer(question.id, false) %> <% if !@unanswered_questions && answer.blank? next # skip unanswered questions end %> <% if @question_headings %> - + <% end %> - - - <% end %> - -
<%= _('Questions')%><%= _('Questions')%><%= _('Answers')%>
<%= _('Answers')%>
-

- <%= raw question.text %>

-
+

- <%= raw question.text %>

+
- <% if answer.nil? %> -

<%= _('Question not answered') %>

- <% else %> +
+ <% if answer.nil? %> +

<%= _('Question not answered') %>

+ <% else %> <% q_format = question.question_format %> - <% if q_format.option_based? %> -
    - <% answer.question_options.each do |option| %> -
  • <%= option.text %>
  • - <% end %> -
+ <% if q_format.option_based? %> +
    + <% answer.question_options.each do |option| %> +
  • <%= option.text %>
  • + <% end %> +
<% if question.option_comment_display == true %> <%= raw answer.text %> <% end %> - <% else%> + <% else%> <%= raw answer.text %> <% end%> - <% end %> -
- <% end %> -
-
+ <% end %> + + + <% end %> + + + <% end %> +
+ \ No newline at end of file diff --git a/app/views/settings/phases/_export_formatting_form.html.erb b/app/views/settings/phases/_export_formatting_form.html.erb index 91b1bb8..3633722 100644 --- a/app/views/settings/phases/_export_formatting_form.html.erb +++ b/app/views/settings/phases/_export_formatting_form.html.erb @@ -1,5 +1,5 @@ <% - + @export_settings ||= plan.settings(:export) admin_settings = @export_settings.fields[:admin] question_settings = @export_settings.fields[:questions] || :all filename = @export_settings.title.present? ? @export_settings.title : plan.title @@ -72,11 +72,43 @@ <% end %> - +
+

<%= _('PDF Formatting') %>

+
+ <%= _('Font') -%> +
+ <%= label_tag("export[formatting][font_face]", _('Face')) %> + <%= select_tag("export[formatting][font_face]", options_for_select(Settings::Template::VALID_FONT_FACES, @export_settings.formatting[:font_face]), { "data-default" => plan.template.settings(:export).formatting[:font_face] }) %> +
+
+ <%= label_tag("export[formatting][font_size]", _('Size') + " (pt)") %> + <%= select_tag("export[formatting][font_size]", options_for_select(Settings::Template::VALID_FONT_SIZE_RANGE.to_a, @export_settings.formatting[:font_size]), { "data-default" => plan.template.settings(:export).formatting[:font_size] }) %> +
+
+
+ <%= _('Margin') -%> (mm) +
+ <%= label_tag("export[formatting][margin][top]", _('Top')) %> + <%= select_tag("export[formatting][margin][top]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:top]), { "data-default" => plan.template.settings(:export).formatting[:margin][:top] }) %> +
+
+ <%= label_tag("export[formatting][margin][bottom]", _('Bottom')) %> + <%= select_tag("export[formatting][margin][bottom]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:bottom]), { "data-default" => plan.template.settings(:export).formatting[:margin][:bottom] }) %> +
+
+ <%= label_tag("export[formatting][margin][left]", _('Left')) %> + <%= select_tag("export[formatting][margin][left]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:left]), { "data-default" => plan.template.settings(:export).formatting[:margin][:left] }) %> +
+
+ <%= label_tag("export[formatting][margin][right]", _('Right')) %> + <%= select_tag("export[formatting][margin][right]", options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:right]), { "data-default" => plan.template.settings(:export).formatting[:margin][:rigth] }) %> +
+
+
<%= submit_tag(_('Reset'), class: "btn btn-primary", role:'button') %> <%= submit_tag(_('Save'), class: "btn btn-primary", "data-toggle" => "collapse", "data-target" => "#settings-accordion-plan-#{plan.template.id}", role:"button") %>
-<% end %> +<% end %> \ No newline at end of file