/
_edit_details.html.erb
213 lines (207 loc) · 9.16 KB
/
_edit_details.html.erb
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<div class="row">
<div class="col-md-8">
<%= form_for plan, html: {method: :put, class: 'form-horizontal edit_plan' } do |f| %>
<div class="form-group"><!-- title -->
<div class="col-md-12">
<%= f.label(:title, _('Project title'), class: 'control-label') %>
</div>
<div class="col-md-8">
<%= f.text_field(:title, class: "form-control", "aria-required": true, 'data-toggle': 'tooltip',
title: _('If applying for funding, state the name exactly as in the grant proposal.')) %>
<div class="checkbox">
<%= f.hidden_field :visibility %>
<%= f.label(:is_test, class: 'control-label') do %>
<%= check_box_tag(:is_test, 1, @plan.is_test?, "aria-label": "is_test") %>
<%= _('mock project for testing, practice, or educational purposes') %>
<% end %>
</div>
</div>
</div>
<div class="form-group"><!-- funder_name -->
<div class="col-md-12">
<%= f.label(:funder_name, _('Funder'), class: 'control-label') %>
</div>
<div class="col-md-8">
<%= f.text_field(
:funder_name,
class: "form-control",
"aria-required": false) %>
</div>
</div>
<div class="form-group"><!-- grant_number -->
<div class="col-md-12">
<%= label_tag(:plan_grant_number_name, _('Grant number'), class: 'control-label') %>
</div>
<div class="col-md-8">
<%= text_field_tag(:plan_grant_number_name, '',
class: "grant-id-typeahead form-control",
autocomplete: "off",
aria: { required: false }) %>
<%= f.hidden_field(:grant_number) %>
<span class="text-muted" id="grant_number_info">Grant number: <%= @plan.grant_number %></span>
</div>
</div>
<div class="form-group"><!-- description -->
<div class="col-md-12">
<%= f.label(:description, _('Project abstract'), class: 'control-label') %>
</div>
<div class="col-md-8" data-toggle="tooltip" title="<%= _("Briefly summarise your research project to help others understand the purposes for which the data are being collected or created.") %>">
<%= f.text_area(
:description, rows: 6,
class: 'form-control tinymce',
"aria-required": false) %>
</div>
</div>
<div class="form-group"><!-- identifier -->
<div class="col-md-12">
<%= f.label(:identifier, _('ID'), class: 'control-label') %>
</div>
<div class="col-md-8">
<%= f.text_field(:identifier, class: "form-control", "aria-required": false, 'data-toggle': "tooltip",
title: _('A pertinent ID as determined by the funder and/or organisation.')) %>
</div>
</div>
<fieldset class="project-details">
<legend class="project-details"><%= _("Principal Investigator") %></legend>
<div class="form-group"><!-- principal_investigator -->
<div class="col-md-12">
<%= f.label(:principal_investigator, _('Name'), class: 'control-label') %>
</div>
<div class="col-md-12">
<%= f.text_field(
:principal_investigator,
class: "form-control",
"aria-required": false) %>
</div>
</div>
<div class="form-group"><!-- principal_investigator_identifier -->
<div class="col-md-12">
<%= f.label(:principal_investigator_identifier, _('ORCID iD'), class: 'control-label') %>
</div>
<div class="col-md-12">
<%= f.text_field(
:principal_investigator_identifier,
class: "form-control",
"aria-required": false) %>
</div>
</div>
<div class="form-group"><!-- principal_investigator_email -->
<div class="col-md-12">
<%= f.label(:principal_investigator_email, _('Email'), class: 'control-label') %>
</div>
<div class="col-md-12">
<%= f.email_field(
:principal_investigator_email,
class: "form-control",
"aria-required": false) %>
</div>
</div>
<div class="form-group"><!-- principal_invesigator_phone -->
<div class="col-md-12">
<%= f.label(:principal_investigator_phone, _('Phone'), class: 'control-label') %>
</div>
<div class="col-md-12">
<%= f.phone_field(
:principal_investigator_phone,
class: "form-control",
"aria-required": false) %>
</div>
</div>
</fieldset>
<fieldset class="project-details">
<legend class="project-details"><%= _('Data contact person') %></legend>
<div class="checkbox">
<% checked = ((@plan.data_contact.present? || @plan.data_contact_phone.present? || @plan.data_contact_email.present?) ? 1 : 0) %>
<%= label_tag(:show_data_contact, class: 'control-label') do %>
<%= check_box_tag(:show_data_contact, checked, checked == 0) %>
<%= _('Same as Principal Investigator') %>
<% end %>
</div>
<div class="form-group data-contact"><!-- data_contact -->
<div class="col-md-12">
<%= f.label(:data_contact, _('Name'), class: 'control-label') %>
</div>
<div class="col-md-12">
<%= f.text_field(
:data_contact,
class: "form-control",
"aria-required": false) %>
</div>
</div>
<div class="form-group data-contact"><!-- data_contact_email -->
<div class="col-md-12">
<%= f.label(:data_contact_email, _('Email'), class: 'control-label') %>
</div>
<div class="col-md-12">
<%= f.email_field(
:data_contact_email,
class: "form-control",
"aria-required": false) %>
</div>
</div>
<div class="form-group data-contact"><!-- data_contact_phone -->
<div class="col-md-12">
<%= f.label(:data_contact_phone, _('Phone'), class: 'control-label') %>
</div>
<div class="col-md-12">
<%= f.phone_field(
:data_contact_phone,
class: "form-control",
"aria-required": false) %>
</div>
</div>
</fieldset>
<%= f.button(_('Save'), class: "btn btn-default", type: "submit") %>
</div>
<div class="col-md-4">
<h2><%= _('Select Guidance') %></h2>
<% if @all_guidance_groups.length > 0 %>
<p><%= _('To help you write your plan, %{application_name} can show you guidance from a variety of organisations.') %
{application_name: Rails.configuration.branding[:application][:name]} %>
</p>
<fieldset>
<p><%= _('Select up to 6 organisations to see their guidance.') %></p>
<ul id="priority-guidance-orgs">
<%= render partial: "guidance_choices",
locals: {choices: @important_ggs, form: f,
current_selections: @selected_guidance_groups} %>
</ul>
</fieldset>
<% if @all_guidance_groups.length > @important_ggs.length %>
<p><%= _('Find guidance from additional organisations below') %></p>
<%= link_to _('See the full list'), '#', 'data-toggle' => 'modal', 'data-target' => '#modal-full-guidances', class: 'modal-guidances-window' %>
<% end %>
<br>
<%= f.button(_('Save'), class: "btn btn-default", type: "submit") %>
<% else %>
<p><%= _("There is no additional guidance for this template.") %></p>
<% end %>
</div>
<% if @all_guidance_groups.length > @important_ggs.length %>
<div id="modal-full-guidances" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="sign-in">
<div class="modal-body">
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="<%= _('Cancel') %>">
<span class="fa fa-times" aria-hidden="true"> </span>
</button>
<h2><%= _('Select Guidance') %></h2>
<p>
<%= _('To help you write your plan, %{application_name} can show you guidance from a variety of organisations. Please choose up to 6 organisations of the following organisations who offer guidance relevant to your plan.') %
{application_name: Rails.configuration.branding[:application][:name]} %>
</p>
<p><strong><%= _("Don't forget to save your changes after making your selections.") %></strong></p>
<ul id="other-guidance-orgs">
<%= render partial: "guidance_choices",
locals: {choices: @all_ggs_grouped_by_org, form: f,
current_selections: @selected_guidance_groups} %>
</ul>
</div>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>