-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy path_project_details.html.erb
More file actions
211 lines (199 loc) · 8.91 KB
/
_project_details.html.erb
File metadata and controls
211 lines (199 loc) · 8.91 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
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
<%# locals: form, plan, research_domains %>
<%
project_title_tooltip = _('If applying for funding, state the name exactly as in the grant proposal.')
project_abstract_tooltip = _("Briefly summarise your research project to help others understand the purposes for which the data are being collected or created.")
id_tooltip = _('A pertinent ID as determined by the funder and/or organisation.')
ethics_tooltip = _("Whether there are any potential ethical issues related to data that this DMP describes")
ethics_description_tooltip = _("Description of the ethical issues")
ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics commitee")
%>
<div class="form-control mb-3"><!-- title -->
<div class="col-lg-8">
<em class="sr-only"><%= project_title_tooltip %></em>
<%= form.label(:title, _('Project title'), class: 'form-label') %>
<%= form.text_field(:title, class: "form-control", "aria-required": true,
'data-toggle': 'tooltip', spellcheck: true,
title: project_title_tooltip) %>
</div>
<div class="col-lg-8">
<div class="form-check">
<%= form.hidden_field :visibility %>
<%= form.label(:is_test, class: 'form-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-control mb-3"><!-- description -->
<div class="col-lg-12">
<%= form.label(:description, _('Project abstract'), class: 'form-label', id: 'project-description-label') %>
</div>
<div class="col-lg-8" data-toggle="tooltip" title="<%= project_abstract_tooltip %>">
<em class="sr-only"><%= project_abstract_tooltip %></em>
<%= form.text_area :description, rows: 6, class: 'form-control tinymce',
spellcheck: true, aria: { required: false, labelledby: 'project-description-label' } %>
</div>
</div>
<% if Rails.configuration.x.madmp.enable_research_domain %>
<div class="form-control mb-3">
<div class="col-lg-8">
<%= form.label(:research_domain_id, _("Research domain"), class: "form-label") %>
<% options = research_domains.map { |rd| [rd.label, rd.id] } %>
<%= form.select :research_domain_id, options_for_select(options, form.object.research_domain_id),
{
include_blank: _("- Please select one -"),
selected: form.object.research_domain_id
},
{ class: "form-select" } %>
</div>
</div>
<% end %>
<div class="form-control mb-3"><!-- start / end dates -->
<div class="col-lg-4">
<%= form.label(:start_date, _("Project Start"), class: "form-label") %>
<%= form.date_field :start_date, class: "form-control",
data: { toggle: "tooltip" },
title: _("The estimated date on which you will begin this project.") %>
</div>
<div class="col-lg-4">
<%= form.label(:end_date, _("Project End"), class: "form-label") %>
<%= form.date_field :end_date, class: "form-control",
data: { toggle: "tooltip" },
title: _("The estimated date on which you will complete this project.") %>
</div>
</div>
<%# if DOI minting is enabled %>
<% landing_page = plan.landing_page %>
<% if Rails.configuration.x.doi&.active && landing_page.present? %>
<div class="form-control mb-3"><!-- identifier -->
<div class="col-lg-12">
<%= form.label(:identifier, _('Landing page'), class: 'form-label') %>
</div>
<div class="col-lg-8">
<% if landing_page.value.starts_with?("http") %>
<%= link_to landing_page.value, landing_page.value %>
<% else %>
<%= landing_page.value %>
<% end %>
</div>
</div>
<% else %>
<div class="form-control mb-3">
<div class="col-lg-12">
<%= form.label :id, _("ID"), class: "form-label" %>
</div>
<div class="col-lg-8">
<em class="sr-only"><%= id_tooltip %></em>
<%= form.text_field :identifier,
class: "form-control",
aria: { required: false },
data: { toggle: "tooltip" },
spellcheck: true,
title: id_tooltip %>
</div>
</div>
<% end %>
<% ethical_issues_block = capture do %>
<conditional>
<div class="form-control mb-3">
<div class="col-lg-8">
<div class="form-check">
<%= form.label(:ethical_issues, class: 'form-label', title: ethics_tooltip) do %>
<%= form.check_box(:ethical_issues) %>
<%= _('Research outputs may have ethical concerns') %>
<% end %>
</div>
</div>
</div>
<div class="form-control mb-3 toggleable-field">
<div class="col-lg-12">
<%= form.label(:ethical_issues_description, _('Describe any ethical concerns'), class: 'form-label', id: 'plan-ethical-description') %>
</div>
<div class="col-lg-8" data-toggle="tooltip" title="<%= ethics_description_tooltip %>">
<em class="sr-only"><%= ethics_description_tooltip %></em>
<%= form.text_area :ethical_issues_description,
rows: 6,
class: 'form-control tinymce',
spellcheck: true,
aria: { required: false, labelledby: 'plan-ethical-description' } %>
</div>
</div>
<div class="form-control mb-3 toggleable-field">
<div class="col-lg-12">
<%= form.label(:ethical_issues_report, _('Ethical protocols'), class: 'form-label') %>
</div>
<div class="col-lg-8">
<em class="sr-only"><%= ethics_report_tooltip %></em>
<%= form.url_field(:ethical_issues_report,
class: "form-control",
"aria-required": false,
'data-toggle': 'tooltip',
title: ethics_report_tooltip) %>
</div>
</div>
</conditional>
<% end %>
<% if Rails.configuration.x.madmp.enable_ethical_issues %>
<% if plan.ethical_issues == true %>
<%= ethical_issues_block %>
<% else %>
<% if current_user.org.add_ro_ethical_concerns? %>
<%= ethical_issues_block %>
<% end %>
<% end %>
<% end %>
<conditional>
<div id="funder-org-controls" class="form-control mb-3">
<div class="col-lg-8">
<%= form.fields_for :funder, Org.new do |funder_fields| %>
<%= render partial: "shared/org_selectors/local_only",
locals: {
form: funder_fields,
id_field: :id,
label: _("Funder"),
default_org: plan.funder,
orgs: @funders,
required: false
} %>
<% end %>
</div>
</div>
<div class="form-control mb-3 toggleable-field">
<div class="col-lg-12">
<%= form.label(:funding_status, _("Funding status"), class: "form-label") %>
</div>
<div class="col-lg-8">
<% funding_statuses = Plan::FUNDING_STATUS.map { |status| [_(status[0].to_s.capitalize), _(status[0].to_s)] } %>
<%= form.select :funding_status, options_for_select(funding_statuses, form.object.funding_status),
{
include_blank: _("- Please select one -"),
selected: form.object.funding_status
},
{ class: "form-select" } %>
</div>
<%= form.fields_for :grant, plan.grant do |grant_fields| %>
<div class="col-lg-12">
<%= grant_fields.label(:value, _("Grant number/url"), class: "form-label") %>
</div>
<div class="col-lg-8">
<%# If the OpenAire grant typeahead if enabled use it %>
<% if Rails.configuration.x.open_aire.active %>
<!-- Using the research_project.json source for typeahead -->
<%= grant_fields.text_field :name,
value: plan.grant&.value,
class: "form-control grant-id-typeahead",
spellcheck: true,
autocomplete: "off",
aria: { required: false } %>
<%= grant_fields.hidden_field :value %>
<span class="text-muted" id="grant_number_info"><%= _("Grant number:") -%> <%= plan.grant&.value %></span>
<% else %>
<%= grant_fields.text_field(:value, class: "form-control",
data: { toggle: "tooltip" },
title: _("Provide a URL to the award's landing page if possible, if not please provide the award/grant number.")) %>
<% end %>
</div>
<% end %>
</div>
</conditional>