-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy path_download_form.html.erb
More file actions
137 lines (137 loc) · 6.54 KB
/
_download_form.html.erb
File metadata and controls
137 lines (137 loc) · 6.54 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<%
download_coversheet_tickbox_checked = Rails.configuration.x.plans.download_coversheet_tickbox_checked || false
%>
<%= form_tag(plan_export_path(@plan), method: :get, target: '_blank', id: 'download_form') do |f| %>
<h2><%= _('Format') %></h2>
<div class="row">
<div class="form-control mb-3 col-sm-2">
<%= select_tag :format, options_for_select(Settings::Template::VALID_FORMATS, :pdf),
class: 'form-select', "aria-labelledby": "format" %>
</div>
</div>
<div id="download-settings">
<div class="row">
<div class="col-12">
<h2><%= _("Download settings") %></h2>
</div>
</div>
<div class="row">
<div class="form-control col-sm-12 col-lg-6">
<fieldset>
<%= label_tag('', _("Optional plan components"), class: 'form-label') %>
<div class="form-check">
<%= label_tag 'export[project_details]', class:'form-check-label' do %>
<%= check_box_tag 'export[project_details]', true, download_coversheet_tickbox_checked %>
<%= _('project details coversheet') %>
<% end %>
</div>
<div class="form-check">
<%= label_tag 'export[question_headings]', class:'form-check-label' do %>
<%= check_box_tag 'export[question_headings]', true, true %>
<%= _('question text and section headings') %>
<% end %>
</div>
<div class="form-check">
<%= label_tag 'export[unanswered_questions]', class:'form-check-label' do %>
<%= check_box_tag 'export[unanswered_questions]', true, true %>
<%= _('unanswered questions') %>
<% end %>
</div>
<% if @plan.research_outputs.any? %>
<div class="form-check">
<%= label_tag 'export[research_outputs]', class:'form-check-label' do %>
<%= check_box_tag 'export[research_outputs]', true, true %>
<%= _('research outputs') %>
<% end %>
</div>
<% end %>
<% if @plan.template.customization_of.present? %>
<div class="form-check">
<%= label_tag 'export[custom_sections]', class:'form-check-label' do %>
<%= check_box_tag 'export[custom_sections]', true, false %>
<%= _('supplementary section(s) not requested by funding organisation') %>
<% end %>
</div>
<% end %>
</fieldset>
</div>
<%= hidden_field_tag 'export[form]', true %>
<% if @phase_options.length > 1 %>
<div class="form-control col-sm-12 col-lg-6">
<%= label_tag(:phase_id, _("Select phase to download"), class: 'form-label') %>
<%= select_tag(:phase_id, options_for_select(@phase_options, @phase_options[0]), class: 'form-select') %>
</div>
<% else %>
<%= hidden_field_tag(:phase_id, @phase_options[0][1]) %>
<% end %>
</div>
</div>
<div id="pdf-formatting" class="py-3">
<h2><%= _('PDF formatting') %></h2>
<div class="d-flex flex-row">
<div class="col-sm-6">
<h4><%= _('Font') %></h4>
</div>
<div class="col-sm-6 px-2">
<h4><%= _('Margin (mm)') %></h4>
</div>
</div>
<div class="d-flex flex-row">
<div class="form-control mb-3 col-sm-4">
<%= label_tag "export[formatting][font_face]", _('Face'), class: 'form-label' %>
<%= select_tag "export[formatting][font_face]",
options_for_select(Settings::Template::VALID_FONT_FACES,
@export_settings.formatting[:font_face]),
class: 'form-select',
"data-default": @plan.template.settings(:export).formatting[:font_face] %>
</div>
<div class="form-control mb-3 px-2 col-sm-2">
<%= label_tag "export[formatting][font_size]", _('Size') + " (pt)", class: 'form-label' %>
<%= select_tag "export[formatting][font_size]",
options_for_select(Settings::Template::VALID_FONT_SIZE_RANGE.to_a, @export_settings.formatting[:font_size]),
class: 'form-select',
"data-default": @plan.template.settings(:export).formatting[:font_size] %>
</div>
<div class="form-control mb-3 px-2 col-sm-1">
<%= label_tag "export[formatting][margin][top]", _('Top'),
class: 'form-label' %>
<%= select_tag "export[formatting][margin][top]",
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
@export_settings.formatting[:margin][:top]),
class: 'form-select',
"data-default": @plan.template.settings(:export).formatting[:margin][:top] %>
</div>
<div class="form-control mb-3 px-2 col-sm-1">
<%= label_tag "export[formatting][margin][bottom]", _('Bottom'),
class: 'form-label' %>
<%= select_tag "export[formatting][margin][bottom]",
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
@export_settings.formatting[:margin][:bottom]),
class: 'form-select',
"data-default": @plan.template.settings(:export).formatting[:margin][:bottom] %>
</div>
<div class="form-control mb-3 px-2 col-sm-1">
<%= label_tag "export[formatting][margin][left]", _('Left'),
class: 'form-label' %>
<%= select_tag "export[formatting][margin][left]",
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
@export_settings.formatting[:margin][:left]),
class: 'form-select',
"data-default": @plan.template.settings(:export).formatting[:margin][:left] %>
</div>
<div class="form-control mb-3 px-2 col-sm-1">
<%= label_tag "export[formatting][margin][right]", _('Right'),
class: 'form-label' %>
<%= select_tag "export[formatting][margin][right]",
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
@export_settings.formatting[:margin][:right]),
class: 'form-select',
"data-default": @plan.template.settings(:export).formatting[:margin][:right] %>
</div>
</div>
</div>
<%= button_tag(sanitize(_("Download Plan <em class=\"sr-only\">(new window)</em><span class=\"new-window-popup-info\">%{open_in_new_window_text}</span>") % { open_in_new_window_text: _('Opens in new window') },
tags: %w{ span em }),
class: "btn btn-primary has-new-window-popup-info",
type: "submit") %>
<% end %>