Skip to content

Commit c1ce784

Browse files
John Pintogjacob24
John Pinto
andcommitted
Adjust layout of dropdown and fieldset elements in download page.
Contributed by @gjacob24 of DCC DMPonline. Changes: - Adjusts the layout and displays the 'optional plan components' and 'select phase to download' side by side for multi-phase plans. Co-authored-by: gjacob24 <[email protected]>
1 parent 87ddbb0 commit c1ce784

File tree

2 files changed

+52
-47
lines changed

2 files changed

+52
-47
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
- Adjustments to style of select tags and plan download layout [#3509](https://github.com/DMPRoadmap/roadmap/pull/3509)
4+
35
## v5.0.0
46

57
- Updated app to Rails 7 [#3426](https://github.com/DMPRoadmap/roadmap/pull/3426), [#3496](https://github.com/DMPRoadmap/roadmap/pull/3496)

app/views/plans/_download_form.html.erb

+50-47
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,70 @@
22
download_coversheet_tickbox_checked = Rails.configuration.x.plans.download_coversheet_tickbox_checked || false
33
%>
44
<%= form_tag(plan_export_path(@plan), method: :get, target: '_blank', id: 'download_form') do |f| %>
5-
65
<h2><%= _('Format') %></h2>
76
<div class="row">
87
<div class="form-control mb-3 col-sm-2">
98
<%= select_tag :format, options_for_select(Settings::Template::VALID_FORMATS, :pdf),
109
class: 'form-select', "aria-labelledby": "format" %>
1110
</div>
1211
</div>
13-
1412
<div id="download-settings">
15-
<h2><%= _("Download settings") %></h2>
16-
<%= hidden_field_tag 'export[form]', true %>
17-
<% if @phase_options.length > 1 %>
18-
<div class="form-control mb-5">
19-
<%= label_tag(:phase_id, _("Select phase to download"), class: 'form-label') %>
20-
<%= select_tag(:phase_id, options_for_select(@phase_options, @phase_options[0]), class: 'form-select') %>
13+
<div class="row">
14+
<div class="col-12">
15+
<h2><%= _("Download settings") %></h2>
2116
</div>
22-
<% else %>
23-
<%= hidden_field_tag(:phase_id, @phase_options[0][1]) %>
24-
<% end %>
25-
<fieldset>
26-
<legend><%= _("Optional plan components") %></legend>
27-
<div class="form-check">
28-
<%= label_tag 'export[project_details]', class:'form-check-label' do %>
29-
<%= check_box_tag 'export[project_details]', true, download_coversheet_tickbox_checked %>
30-
<%= _('project details coversheet') %>
31-
<% end %>
32-
</div>
33-
<div class="form-check">
34-
<%= label_tag 'export[question_headings]', class:'form-check-label' do %>
35-
<%= check_box_tag 'export[question_headings]', true, true %>
36-
<%= _('question text and section headings') %>
37-
<% end %>
38-
</div>
39-
<div class="form-check">
40-
<%= label_tag 'export[unanswered_questions]', class:'form-check-label' do %>
41-
<%= check_box_tag 'export[unanswered_questions]', true, true %>
42-
<%= _('unanswered questions') %>
43-
<% end %>
44-
</div>
45-
<% if @plan.research_outputs.any? %>
46-
<div class="form-check">
47-
<%= label_tag 'export[research_outputs]', class:'form-check-label' do %>
48-
<%= check_box_tag 'export[research_outputs]', true, true %>
49-
<%= _('research outputs') %>
17+
</div>
18+
<div class="row">
19+
<div class="col-sm-12 col-lg-6">
20+
<fieldset>
21+
<legend><%= _("Optional plan components") %></legend>
22+
<div class="form-check">
23+
<%= label_tag 'export[project_details]', class:'form-check-label' do %>
24+
<%= check_box_tag 'export[project_details]', true, download_coversheet_tickbox_checked %>
25+
<%= _('project details coversheet') %>
26+
<% end %>
27+
</div>
28+
<div class="form-check">
29+
<%= label_tag 'export[question_headings]', class:'form-check-label' do %>
30+
<%= check_box_tag 'export[question_headings]', true, true %>
31+
<%= _('question text and section headings') %>
32+
<% end %>
33+
</div>
34+
<div class="form-check">
35+
<%= label_tag 'export[unanswered_questions]', class:'form-check-label' do %>
36+
<%= check_box_tag 'export[unanswered_questions]', true, true %>
37+
<%= _('unanswered questions') %>
38+
<% end %>
39+
</div>
40+
<% if @plan.research_outputs.any? %>
41+
<div class="form-check">
42+
<%= label_tag 'export[research_outputs]', class:'form-check-label' do %>
43+
<%= check_box_tag 'export[research_outputs]', true, true %>
44+
<%= _('research outputs') %>
45+
<% end %>
46+
</div>
5047
<% end %>
51-
</div>
52-
<% end %>
53-
<% if @plan.template.customization_of.present? %>
54-
<div class="form-check">
55-
<%= label_tag 'export[custom_sections]', class:'form-check-label' do %>
56-
<%= check_box_tag 'export[custom_sections]', true, false %>
57-
<%= _('supplementary section(s) not requested by funding organisation') %>
48+
<% if @plan.template.customization_of.present? %>
49+
<div class="form-check">
50+
<%= label_tag 'export[custom_sections]', class:'form-check-label' do %>
51+
<%= check_box_tag 'export[custom_sections]', true, false %>
52+
<%= _('supplementary section(s) not requested by funding organisation') %>
53+
<% end %>
54+
</div>
5855
<% end %>
56+
</fieldset>
57+
</div>
58+
<%= hidden_field_tag 'export[form]', true %>
59+
<% if @phase_options.length > 1 %>
60+
<div class="form-control col-sm-12 col-lg-6">
61+
<%= label_tag(:phase_id, _("Select phase to download"), class: 'form-label') %>
62+
<%= select_tag(:phase_id, options_for_select(@phase_options, @phase_options[0]), class: 'form-select') %>
5963
</div>
64+
<% else %>
65+
<%= hidden_field_tag(:phase_id, @phase_options[0][1]) %>
6066
<% end %>
61-
</fieldset>
67+
</div>
6268
</div>
63-
6469
<div id="pdf-formatting" class="py-3">
6570
<h2><%= _('PDF formatting') %></h2>
6671
<div class="d-flex flex-row">
@@ -87,7 +92,6 @@
8792
class: 'form-select',
8893
"data-default": @plan.template.settings(:export).formatting[:font_size] %>
8994
</div>
90-
9195
<div class="form-control mb-3 px-2 col-sm-1">
9296
<%= label_tag "export[formatting][margin][top]", _('Top'),
9397
class: 'form-label' %>
@@ -126,7 +130,6 @@
126130
</div>
127131
</div>
128132
</div>
129-
130133
<%= 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') },
131134
tags: %w{ span em }),
132135
class: "btn btn-primary has-new-window-popup-info",

0 commit comments

Comments
 (0)