Skip to content

Commit

Permalink
Merge pull request #530 from mlibrary/BLUEDOC-603-restrict-new-file-v…
Browse files Browse the repository at this point in the history
…ersions-to-have-same-mime-type

BLUEDOC-603 - Restrict new file versions to have the same mime type a…
  • Loading branch information
blancoj authored Dec 12, 2019
2 parents 2e796a8 + 6ed20f8 commit 97f89cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/views/hyrax/file_sets/_versioning.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<div id="versioning_display" class="tab-pane">
<h2><%= t('.header') %></h2>
<%= t( 'simple_form.hints.file_set.select_new_version_note', mime_type: curation_concern.mime_type ) %>
<%= simple_form_for [main_app, curation_concern], html: { multipart: true } do |f| %>
<%= hidden_field_tag('redirect_tab', 'versions') %>
<h3><%= t('.upload') %></h3>
<%= f.input :files, as: :multifile, wrapper: :vertical_file_input, required: true %>
<% if curation_concern.mime_type.present? %>
<%= f.input :files,
as: :multifile,
wrapper: :vertical_file_input,
input_html: { accept: curation_concern.mime_type },
required: true %>
<% else %>
<%= f.input :files, as: :multifile, wrapper: :vertical_file_input, required: true %>
<% end %>
<%= f.button :button,
name: "update_versioning",
id: "upload_submit",
Expand Down
3 changes: 3 additions & 0 deletions config/locales/deepblue.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ en:
hints:
file_set:
save_version_note: 'You must click "Save Revision" to revert a previous version of this file'
select_new_version_note: >
When replacing the current version of a file with a new version, you may only select files that match the
mime type of the original file. The original mime type is: %{mime_type}
generic_work:
describe_work: >
Please provide information about your data set (referred to as a "work") in the following fields, keeping in
Expand Down

0 comments on commit 97f89cd

Please sign in to comment.