This repository has been archived by the owner on May 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding button to save and create another EphemeraFolder with pre-fill…
…ed values
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<aside id="form-progress" class="form-progress panel panel-default"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title"><%= t("hyrax.works.progress.header") %></h3> | ||
</div> | ||
<div class="list-group"> | ||
<div class="list-group-item"> | ||
<fieldset> | ||
<legend class="legend-save-work"><%= t('.requirements') %></legend> | ||
<ul class="requirements"> | ||
<li class="incomplete" id="required-metadata"><%= t('.required_descriptions') %></li> | ||
<% if Hyrax.config.work_requires_files? %> | ||
<li class="incomplete" id="required-files"><%= t('.required_files') %></li> | ||
<% end %> | ||
</ul> | ||
</fieldset> | ||
</div> | ||
|
||
<div class="set-access-controls list-group-item"> | ||
<%= render 'form_visibility_component', f: f %> | ||
</div> | ||
<% unless current_user.can_make_deposits_for.empty? %> | ||
<div class="list-group-item"> | ||
<%= f.input :on_behalf_of, collection: current_user.can_make_deposits_for.map(&:user_key), prompt: "Yourself" %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<div class="panel-footer text-center"> | ||
<br> | ||
<% if params[:action] == 'new' %> | ||
<%= link_to t(:'helpers.action.cancel'), main_app.hyrax_ephemera_box_path(params[:parent_id]), class: 'btn btn-default' %> | ||
<% else %> | ||
<%= link_to t(:'helpers.action.cancel'), polymorphic_path([main_app, curation_concern]), class: 'btn btn-default' %> | ||
<% end %> | ||
<%= f.input Hyrax::Actors::OptimisticLockValidator.version_field, as: :hidden if f.object.persisted? %> | ||
<%= f.submit class: 'btn btn-primary', id: "with_files_submit", name: "save_with_files" %> | ||
<%= f.submit "Save and Create Another", class: 'btn btn-primary', id: "save_and_create_another", name: "save_and_create_another" %> | ||
</div> | ||
</aside> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.feature 'EphemeraFoldersController', type: :feature, admin_set: true do | ||
let(:user) { FactoryGirl.create(:ephemera_editor) } | ||
let(:box) { FactoryGirl.create(:ephemera_box) } | ||
let(:folder) { FactoryGirl.create(:ephemera_folder, language: ['Spanish']) } | ||
|
||
before(:each) do | ||
sign_in user | ||
end | ||
|
||
scenario 'creating a new folder and then creating another' do | ||
puts "/concern/parent/#{box.id}/ephemera_folders/new?create_another=#{folder.id}" | ||
visit "/concern/parent/#{box.id}/ephemera_folders/new?create_another=#{folder.id}" | ||
expect(find_field('Barcode').value).to eq(nil) | ||
expect(find_field('Folder number').value).to eq(nil) | ||
expect(find_field('Title').value).to have_content('Example Folder') | ||
expect(find_field('Language').value).to have_content('Spanish') | ||
end | ||
end |