Skip to content

Commit

Permalink
Pull in file_manager from curation_concerns, fixes #2321
Browse files Browse the repository at this point in the history
  • Loading branch information
hackartisan committed Aug 19, 2016
1 parent 3d4335c commit eecb442
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/assets/javascripts/sufia.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//= require jquery-ui/position
//= require jquery-ui/effect
//= require jquery-ui/effect-highlight
//= require jquery-ui/sortable

//= require bootstrap/alert
//= require bootstrap/button
Expand Down Expand Up @@ -61,6 +62,10 @@
//= require curation_concerns/collections
//= require hydra-editor/hydra-editor
//= require nestable
//= require curation_concerns/file_manager/sorting
//= require curation_concerns/file_manager/save_manager
//= require curation_concerns/file_manager/member
//= require curation_concerns/file_manager

// this needs to be after batch_select so that the form ids get setup correctly
//= require sufia/batch_edit
9 changes: 8 additions & 1 deletion app/assets/javascripts/sufia/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Sufia = {
this.notifications();
this.transfers();
this.relationships_table();
this.file_manager_init();
},

autocomplete: function () {
Expand Down Expand Up @@ -66,7 +67,13 @@ Sufia = {
$('table.relationships-ajax-enabled').each(function () {
new rel.RelationshipsTable($(this));
});
}
},

file_manager_init: function () {
var fm = require('curation_concerns/file_manager');
var file_manager = new fm
},

};

Blacklight.onLoad(function () {
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/sufia/_sufia.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import 'hydra-editor/multi_value_fields';
@import 'curation_concerns/modules/forms';
@import 'curation_concerns/modules/file_manager';
@import 'sufia/file_sets';
@import 'sufia/settings', 'sufia/header', 'sufia/styles', 'sufia/file-listing',
'sufia/browse_everything_overrides', 'sufia/nestable',
Expand Down
3 changes: 3 additions & 0 deletions app/views/curation_concerns/base/_show_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<% if presenter.editor? %>
<%= link_to "Edit", edit_polymorphic_path([main_app, presenter]), class: 'btn btn-default' %>
<%= link_to "Delete", [main_app, presenter], class: 'btn btn-danger', data: { confirm: "Delete this #{presenter.human_readable_type}?" }, method: :delete %>
<% if presenter.member_presenters.present? %>
<%= link_to t("file_manager.link_text"), polymorphic_path([main_app, :file_manager, presenter]), class: 'btn btn-default' %>
<% end %>
<% end %>
<% if presenter.display_feature_link? %>
<%= link_to "Feature", sufia.featured_work_path(presenter, format: :json),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
allow(presenter).to receive(:member_presenters).and_return([])
render 'curation_concerns/base/show_actions.html.erb', presenter: presenter
end
it "shows file manager link" do
it "does not show file manager link" do
expect(rendered).not_to have_link 'File Manager'
end
it "shows edit / delete links" do
Expand All @@ -60,7 +60,6 @@
allow(presenter).to receive(:member_presenters).and_return([member])
render 'curation_concerns/base/show_actions.html.erb', presenter: presenter
end
before { allow(presenter).to receive(:member_presenters).and_return([member]) }
it "shows file manager link" do
expect(rendered).to have_link 'File Manager'
end
Expand Down

0 comments on commit eecb442

Please sign in to comment.