-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_form.html.erb
More file actions
122 lines (117 loc) · 4.43 KB
/
Copy path_form.html.erb
File metadata and controls
122 lines (117 loc) · 4.43 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
<%# TODO: Form validation (cf. TIND) %>
<%
accept_mime_type = BerkeleyLibrary::Util::XLSX::Spreadsheet::MIME_TYPE_OOXML_WB
allow_immediate = user.framework_admin?
show_immediate = allow_immediate || location_request.immediate?
%>
<section id="location-request-form">
<% if location_request.errors.any? %>
<div class="alert alert-danger fade show" role="alert">
<h5 class="alert-heading">The following errors have been found. Please correct them before submitting the form again:</h5>
<table class="errors">
<% location_request.errors.each do |error| %>
<tr>
<th scope="row"><%= t("activerecord.attributes.location_request.#{error.attribute}") %></th>
<td><%= error.message %></td>
</tr>
<% end %>
</table>
</div>
<% end %>
<p class="required-note">Required</p>
<%= form_with(model: location_request) do |form| %>
<ul>
<li>
<div class="form-label form-group required">
<%= form.label :email, class: 'control-label' %>
</div>
<div class="form-input required">
<%= form.email_field :email, class: 'form-control add-required', aria: { required: true }, required: true %>
</div>
</li>
<li>
<div class="form-label form-group required">
<%= form.label :input_file, class: 'control-label' %>
</div>
<div class="form-input required">
<%= form.file_field :input_file, class: 'form-control add-required', accept: accept_mime_type, required: true %>
<p class="note">
<strong>Note:</strong>
Input files must be Microsoft Office Open XML Workbook (.xlsx) files,
without macros, and must include a column with the heading
“<%= BerkeleyLibrary::Location::Constants::OCLC_COL_HEADER %>”,
which must contain at least one OCLC number. Input files must not contain more than <%= LocationRequest::max_oclc_numbers %> rows.
</p>
</div>
</li>
<li>
<fieldset class="required">
<legend>Include</legend>
<ul class="form-input required">
<li>
<%= form.check_box :slf %>
<%= form.label :slf %>
<p class="option-note">
Checks OCLC for
<%= BerkeleyLibrary::Location::WorldCat::Symbols::SLFN.join('/') %>
and
<%= BerkeleyLibrary::Location::WorldCat::Symbols::SLFS.join('/') %>
holdings symbols
</p>
</li>
<li>
<%= form.check_box :uc %>
<%= form.label :uc %>
<p class="option-note">
Checks OCLC for UC campus holdings symbols and reports those found
</p>
</li>
<li>
<%= form.check_box :hathi %>
<%= form.label :hathi %>
<p class="option-note">
Checks HathiTrust for digital files and returns record-level URLs
</p>
</li>
<li>
<p class="note">
<strong>Note:</strong>
At least one of
<%=
[:slf, :uc, :hathi]
.map { |opt| t("activerecord.attributes.location_request.#{opt}") }
.to_sentence(last_word_connector: ', or ')
%>
must be selected.
</p>
</li>
</ul>
</fieldset>
</li>
<% if show_immediate %>
<li>
<fieldset>
<legend>Schedule request to run</legend>
<ul class="form-input">
<li>
<%= form.radio_button :immediate, false, value: false, disabled: !allow_immediate %>
<%= form.label :immediate, 'off hours', value: false %>
</li>
<li>
<%= form.radio_button :immediate, true, value: true, disabled: !allow_immediate %>
<%= form.label :immediate, 'immediately', value: true %>
</li>
</ul>
</fieldset>
</li>
<% end %>
<li>
<p class="note">
If you have any questions or problems using the tool, please
contact <%= mail_to('helpbox-library@berkeley.edu', subject: 'Location Requests') %>.
</p>
<%= form.submit(class: %w[btn btn-primary], disabled: false) %>
</li>
</ul>
<% end %>
</section>