Skip to content

Commit 4c1befb

Browse files
authored
Merge pull request #3509 from DMPRoadmap/gjacob24-contribution-of-style-of-select-tags-and-plan-download-layout
Adjustments to style of select tags and plan download layout
2 parents 3b44ec0 + 3277370 commit 4c1befb

File tree

16 files changed

+79
-75
lines changed

16 files changed

+79
-75
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Changelog
22

3+
- Adjustments to style of select tags and plan download layout [#3509](https://github.com/DMPRoadmap/roadmap/pull/3509)
34
- Fix failing eslint workflow / upgrade `actions/checkout` & `actions/setup-node` to v3 [#3503](https://github.com/DMPRoadmap/roadmap/pull/3503)
45
- Fix rendering of `confirm_merge` partial [#3515](https://github.com/DMPRoadmap/roadmap/pull/3515)
56
- Remove Auto-Generated TinyMCE Skins and Add `public/tinymce/skins/` to `.gitignore` [#3466](https://github.com/DMPRoadmap/roadmap/pull/3466)

app/views/devise/registrations/_personal_details.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
options_from_collection_for_select(departments, "id", "name", dept_id),
4646
include_blank: true,
4747
disabled: departments.count === 0,
48-
class: "form-control") %>
48+
class: "form-select") %>
4949
</div>
5050
<% end %>
5151

@@ -55,7 +55,7 @@
5555
<%= f.label(:language_id, _('Language'), class: 'form-label') %>
5656
<%= select_tag("user[language_id]",
5757
options_from_collection_for_select(@languages, "id", "name", lang_id),
58-
class: "form-control") %>
58+
class: "form-select") %>
5959
</div>
6060
<% end %>
6161

app/views/guidances/new_edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ end
3434
<%= f.label _('Guidance group'), for: :guidance_group_id, class: 'form-label' %>
3535
<%= f.collection_select(:guidance_group_id,
3636
GuidanceGroup.where(org_id: current_user.org_id).order("name ASC"),
37-
:id, :name, {prompt: false}, {multiple: false, 'data-toggle': 'tooltip', title: _('Select which group this guidance relates to.'), class: 'form-control', 'aria-required': true})%>
37+
:id, :name, {prompt: false}, {multiple: false, 'data-toggle': 'tooltip', title: _('Select which group this guidance relates to.'), class: 'form-select', 'aria-required': true})%>
3838
</div>
3939
<div class="form-check">
4040
<%= f.label :published do %>

app/views/layouts/modal_search/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Example definition of the :filters content:
138138
<%= select_tag :"research_output[subject_filter]",
139139
options_for_select(ResearchOutputPresenter.selectable_subjects),
140140
include_blank: _("- Select a subject area -"),
141-
class: "form-control",
141+
class: "form-select",
142142
title: by_subject_tooltip,
143143
data: { toggle: "tooltip", placement: "bottom" } %>
144144
</span>
@@ -147,7 +147,7 @@ Example definition of the :filters content:
147147
<%= select_tag :"research_output[type_filter]",
148148
options_for_select(ResearchOutputPresenter.selectable_repository_types),
149149
include_blank: _("- Select a repository type -"),
150-
class: "form-control",
150+
class: "form-select",
151151
title: by_type_tooltip,
152152
data: { toggle: "tooltip", placement: "bottom" } %>
153153
</span>

app/views/org_admin/questions/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
:title,
3333
question.question_format_id),
3434
{},
35-
class: "form-control question_format",
35+
class: "form-select question_format",
3636
'data-toggle': 'tooltip',
3737
'data-html': true,
3838
title: _("You can choose from:<ul><li>- text area (large box for paragraphs);</li> <li>- text field (for a short answer);</li> <li>- checkboxes where options are presented in a list and multiple values can be selected;</li> <li>- radio buttons where options are presented in a list but only one can be selected;</li> <li>- dropdown like this box - only one option can be selected;</li> <li>- multiple select box allows users to select several options from a scrollable list, using the CTRL key;</li></ul>")

app/views/org_admin/users/edit.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<%= select_tag(:department_id,
3333
options_from_collection_for_select(@departments, "id", "name", dept_id),
3434
include_blank: true,
35-
class: "form-control",
35+
class: "form-select",
3636
name: 'user[department_id]') %>
3737
</div>
3838
<% end %>
@@ -44,7 +44,7 @@
4444
<%= select_tag(:org_admin_user_language_id,
4545
options_from_collection_for_select(Language.sorted_by_abbreviation, "id", "name", lang_id),
4646
disabled: true,
47-
class: "form-control", name: 'org_admin_user[language_id]') %>
47+
class: "form-select", name: 'org_admin_user[language_id]') %>
4848
</div>
4949
<% end %>
5050

app/views/plans/_download_form.html.erb

Lines changed: 57 additions & 54 deletions
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),
10-
class: 'form-control', "aria-labelledby": "format" %>
9+
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])) %>
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="form-control col-sm-12 col-lg-6">
20+
<fieldset>
21+
<legend class="col-form-label"><%= _("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: 'col-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">
@@ -77,24 +82,23 @@
7782
<%= select_tag "export[formatting][font_face]",
7883
options_for_select(Settings::Template::VALID_FONT_FACES,
7984
@export_settings.formatting[:font_face]),
80-
class: 'form-control',
85+
class: 'form-select',
8186
"data-default": @plan.template.settings(:export).formatting[:font_face] %>
8287
</div>
8388
<div class="form-control mb-3 px-2 col-sm-2">
8489
<%= label_tag "export[formatting][font_size]", _('Size') + " (pt)", class: 'form-label' %>
8590
<%= select_tag "export[formatting][font_size]",
8691
options_for_select(Settings::Template::VALID_FONT_SIZE_RANGE.to_a, @export_settings.formatting[:font_size]),
87-
class: 'form-control',
92+
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' %>
9498
<%= select_tag "export[formatting][margin][top]",
9599
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
96100
@export_settings.formatting[:margin][:top]),
97-
class: 'form-control',
101+
class: 'form-select',
98102
"data-default": @plan.template.settings(:export).formatting[:margin][:top] %>
99103
</div>
100104
<div class="form-control mb-3 px-2 col-sm-1">
@@ -103,7 +107,7 @@
103107
<%= select_tag "export[formatting][margin][bottom]",
104108
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
105109
@export_settings.formatting[:margin][:bottom]),
106-
class: 'form-control',
110+
class: 'form-select',
107111
"data-default": @plan.template.settings(:export).formatting[:margin][:bottom] %>
108112
</div>
109113
<div class="form-control mb-3 px-2 col-sm-1">
@@ -112,7 +116,7 @@
112116
<%= select_tag "export[formatting][margin][left]",
113117
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
114118
@export_settings.formatting[:margin][:left]),
115-
class: 'form-control',
119+
class: 'form-select',
116120
"data-default": @plan.template.settings(:export).formatting[:margin][:left] %>
117121
</div>
118122
<div class="form-control mb-3 px-2 col-sm-1">
@@ -121,12 +125,11 @@
121125
<%= select_tag "export[formatting][margin][right]",
122126
options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a,
123127
@export_settings.formatting[:margin][:right]),
124-
class: 'form-control',
128+
class: 'form-select',
125129
"data-default": @plan.template.settings(:export).formatting[:margin][:right] %>
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",

app/views/plans/_project_details.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics comm
5050
include_blank: _("- Please select one -"),
5151
selected: form.object.research_domain_id
5252
},
53-
{ class: "form-control" } %>
53+
{ class: "form-select" } %>
5454
</div>
5555
</div>
5656
<% end %>
@@ -171,7 +171,7 @@ ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics comm
171171
include_blank: _("- Please select one -"),
172172
selected: form.object.funding_status
173173
},
174-
{ class: "form-control" } %>
174+
{ class: "form-select" } %>
175175
</div>
176176
<%= form.fields_for :grant, plan.grant do |grant_fields| %>
177177
<div class="col-lg-12">

app/views/plans/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<div class="form-control mb-3 row">
108108
<div class="col-md-6">
109109
<%= select_tag(:plan_template_id, "<option value=\"\">#{_('Please select a template')}</option>", name: 'plan[template_id]',
110-
class: 'form-control', 'aria-labelledby': 'template-selection') %>
110+
class: 'form-select', 'aria-labelledby': 'template-selection') %>
111111
</div>
112112
<div class="col-md-6">
113113
<span id="multiple-templates">

app/views/questions/_new_edit_question_option_based.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
options_html.html_safe,
3535
{ multiple: question.question_format.multiselectbox?,
3636
include_blank: question.question_format.dropdown?,
37-
class: 'form-control' }) %>
37+
class: 'form-select' }) %>
3838
<% end %>
3939
<div class="form-control mb-3">
4040
<% if question.option_comment_display %><!-- Comment text area for option_based questions -->

0 commit comments

Comments
 (0)