-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2476 from samvera/collections-#1678-collections_a…
…dmin_show_page_updated Updates to Collections show page UI/layout
- Loading branch information
Showing
20 changed files
with
291 additions
and
166 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
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
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
26 changes: 15 additions & 11 deletions
26
app/views/hyrax/dashboard/collections/_collection_title.erb
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<% presenter.title.each_with_index do |title, index| %> | ||
<% if index == 0 %> | ||
<span class="h2"><%= title %></span> | ||
|
||
<%= presenter.permission_badge %> | ||
<%= presenter.collection_type_badge %> | ||
|
||
<%= render 'show_actions', presenter: presenter %> | ||
<% else %> | ||
<div class="h2"><%= title %></div> | ||
<section class="collection-title-row-wrapper"> | ||
<% presenter.title.each_with_index do |title, index| %> | ||
<% if index == 0 %> | ||
<div class="collection-title-row-content"> | ||
<h3 class="collection-title"><%= title %></h3> | ||
<%= presenter.permission_badge %> | ||
<%= presenter.collection_type_badge %> | ||
</div> | ||
<div class="collection-title-row-content"> | ||
<%= render 'show_actions', presenter: presenter %> | ||
</div> | ||
<% else %> | ||
<h3><%= title %></h3> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</section> |
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
41 changes: 22 additions & 19 deletions
41
app/views/hyrax/dashboard/collections/_show_add_items_actions.html.erb
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 |
---|---|---|
@@ -1,22 +1,25 @@ | ||
<h2 class="sr-only"><%= t('hyrax.collection.actions.header') %></h2> | ||
<div class="actions-controls-collections"> | ||
<% if can? :edit, presenter.solr_document # TODO: Shouldn't this be :deposit -- dependency on participants %> | ||
<%= link_to t('hyrax.collection.actions.add_existing_works.label'), | ||
hyrax.my_works_path(add_works_to_collection: presenter.id), | ||
title: t('hyrax.collection.actions.add_existing_works.desc'), | ||
class: 'btn btn-default pull-right', | ||
data: { turbolinks: false } %> | ||
|
||
<% if @presenter.create_many_work_types? %> | ||
<%= link_to t('hyrax.collection.actions.add_new_work.label'), | ||
'#', | ||
title: t('hyrax.collection.actions.add_new_work.desc'), | ||
data: { behavior: "select-work", target: "#worktypes-to-create", 'create-type' => 'single', add_works_to_collection: presenter.id }, | ||
class: 'btn btn-default pull-right' %> | ||
<% else # simple link to the first work type %> | ||
<%= link_to t('hyrax.collection.actions.add_new_work.label'), | ||
new_polymorphic_path([main_app, @presenter.first_work_type], add_works_to_collection: presenter.id), | ||
class: 'btn btn-default pull-right' %> | ||
<% end %> | ||
<div class="text-right"> | ||
<% if can? :deposit, presenter.solr_document %> | ||
<div> | ||
<% if @presenter.create_many_work_types? %> | ||
<%= link_to t('hyrax.collection.actions.add_new_work.label'), | ||
'#', | ||
title: t('hyrax.collection.actions.add_new_work.desc'), | ||
data: { behavior: "select-work", target: "#worktypes-to-create", 'create-type' => 'single', add_works_to_collection: presenter.id }, | ||
class: 'btn btn-primary deposit-new-work-through-collection' %> | ||
<% else # simple link to the first work type %> | ||
<%= link_to t('hyrax.collection.actions.add_new_work.label'), | ||
new_polymorphic_path([main_app, @presenter.first_work_type], add_works_to_collection: presenter.id), | ||
class: 'btn btn-primary' %> | ||
<% end %> | ||
</div> | ||
<div> | ||
<%= link_to t('hyrax.collection.actions.add_existing_works.label'), | ||
hyrax.my_works_path(add_works_to_collection: presenter.id), | ||
title: t('hyrax.collection.actions.add_existing_works.desc'), | ||
class: 'btn btn-link side-arrows', | ||
data: { turbolinks: false } %> | ||
</div> | ||
<% end %> | ||
</div> |
7 changes: 4 additions & 3 deletions
7
app/views/hyrax/dashboard/collections/_show_document_list.html.erb
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
40 changes: 20 additions & 20 deletions
40
app/views/hyrax/dashboard/collections/_show_subcollection_actions.html.erb
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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
<% if presenter.collection_type_is_nestable? %> | ||
<!-- The user should have deposit access to the parent (the collection we are showing) and read access to the child --> | ||
<% if presenter.user_can_nest_collection? %> | ||
<div class="actions-controls-collections"> | ||
<div class="sr-only"><% t('hyrax.collection.actions.nest_collections.desc') %></div> | ||
<%= button_tag '', | ||
class: 'btn btn-default pull-right add-subcollection', | ||
onclick: "$('#add-subcollection-modal-#{presenter.id}').modal('show');", | ||
title: t('hyrax.collection.actions.nest_collections.desc'), | ||
type: 'button', | ||
data: { nestable: true, | ||
hasaccess: true } do %> | ||
<%= t('hyrax.collection.actions.nest_collections.button_label') %> | ||
<% end %> | ||
<!-- The user should must have the ability to create a new collection of parent's type --> | ||
<% if presenter.user_can_create_new_nest_collection? %> | ||
<div class="sr-only"><% t('hyrax.collection.actions.add_new_nested_collection.desc') %></div> | ||
<%= link_to t('hyrax.collection.actions.add_new_nested_collection.label'), | ||
hyrax.dashboard_create_subcollection_under_path(parent_id: presenter.id), | ||
title: t('hyrax.collection.actions.add_new_nested_collection.desc'), | ||
class: 'btn btn-default pull-right', | ||
data: { turbolinks: false } %> | ||
<% end %> | ||
<div class="text-right"> | ||
<div> | ||
<div class="sr-only"><% t('hyrax.collection.actions.nest_collections.desc') %></div> | ||
<%= button_tag t('hyrax.collection.actions.nest_collections.button_label'), | ||
class: 'btn btn-primary add-subcollection', | ||
title: t('hyrax.collection.actions.nest_collections.desc'), | ||
data: { nestable: true, | ||
hasaccess: true, | ||
presenter_id: presenter.id } %> | ||
</div> | ||
<div> | ||
<!-- The user should must have the ability to create a new collection of parent's type --> | ||
<% if presenter.user_can_create_new_nest_collection? %> | ||
<div class="sr-only"><% t('hyrax.collection.actions.add_new_nested_collection.desc') %></div> | ||
<%= link_to t('hyrax.collection.actions.add_new_nested_collection.label'), | ||
hyrax.dashboard_create_subcollection_under_path(parent_id: presenter.id), | ||
title: t('hyrax.collection.actions.add_new_nested_collection.desc'), | ||
class: 'btn btn-link side-arrows' %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> |
Oops, something went wrong.