-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹 add a collection local for batch_checkbox
We will run translations in a separate ticket. ref: #487
- Loading branch information
1 parent
3df7cad
commit ede6910
Showing
3 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
app/views/hyrax/dashboard/collections/_list_collections.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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<% #OVERRIDE Hyrax 3.5.0 to update batch checkbox local %> | ||
<% # used by All and Managed Collections tabs %> | ||
<% id = collection_presenter.id %> | ||
<tr id="document_<%= id %>" | ||
data-id="<%= id %>" | ||
data-colls-hash="<%= available_parent_collections_data(collection: collection_presenter) %>" | ||
data-post-url="<%= hyrax.dashboard_create_nest_collection_within_path(id) %>" | ||
data-post-delete-url="<%= is_admin_set ? hyrax.admin_admin_set_path(id) : hyrax.dashboard_collection_path(id) %>"> | ||
<td> | ||
<label class="sr-only" for="batch_document_<%= id %>"><%= t('hyrax.dashboard.my.sr.collections_batch_checkbox') %></label> | ||
<% if collection_presenter.allow_batch? %> | ||
<input type="checkbox" name="batch_document_ids[]" id="batch_document_<%= id %>" value="<%= id %>" class="batch_document_selector" | ||
data-hasaccess="<%= (can?(:edit, collection_presenter.solr_document)) %>" /> | ||
<% else %> | ||
<input type="checkbox" class="disabled" disabled=true /> | ||
<% end %> | ||
</td> | ||
<td> | ||
<div class="thumbnail-title-wrapper"> | ||
<div class="thumbnail-wrapper"> | ||
<% if (collection_presenter.thumbnail_path == nil) %> | ||
<span class="<%= Hyrax::ModelIcon.css_class_for(::Collection) %> collection-icon-small"></span> | ||
<% else %> | ||
<%= image_tag(collection_presenter.thumbnail_path, alt: "#{collection_presenter.title_or_label} #{t('hyrax.dashboard.my.sr.thumbnail')}") %> | ||
<% end %> | ||
</div> | ||
<%= link_to collection_presenter.show_path do %> | ||
<span class="sr-only"><%= t("hyrax.dashboard.my.sr.show_label") %> </span> | ||
<%= collection_presenter.title_or_label %> | ||
<% end %> | ||
<%# Expand arrow %> | ||
<a href="#" class="small show-more" title="Click for more details"> | ||
<i id="expand_<%= id %>" class="glyphicon glyphicon-chevron-right" aria-hidden="true"></i> | ||
<span class="sr-only"> <%= "#{t("hyrax.dashboard.my.sr.detail_label")} #{collection_presenter.title_or_label}" %></span> | ||
</a> | ||
</div> | ||
<%# Collection details %> | ||
<div id="detail_<%= id %>"> | ||
<div class="expanded-details"> | ||
<p> | ||
<strong><%= t("hyrax.dashboard.my.collection_list.description") %></strong> | ||
<br /><%= collection_presenter.description&.first %> | ||
</p> | ||
<p> | ||
<strong><%= t("hyrax.dashboard.my.collection_list.edit_access") %></strong> | ||
<br /> | ||
<% if collection_presenter.edit_groups.present? %> | ||
<%= t("hyrax.dashboard.my.collection_list.groups") %> <%= collection_presenter.edit_groups.join(', ') %> | ||
<br /> | ||
<% end %> | ||
<%= t("hyrax.dashboard.my.collection_list.users") %> <%= collection_presenter.edit_people.join(', ') %> | ||
</p> | ||
</div> | ||
</div> | ||
</td> | ||
<% if !current_ability.admin? %> | ||
<td><%= collection_presenter.managed_access %></td> | ||
<% end %> | ||
<td class="collection_type"> | ||
<%= collection_presenter.collection_type_badge %> | ||
</td> | ||
<td class="date"><%= collection_presenter.modified_date %></td> | ||
<td><%= collection_presenter.total_viewable_items %></td> | ||
<td><%= collection_presenter.permission_badge %> </td> | ||
<td> | ||
<% if collection_presenter.solr_document.admin_set? %> | ||
<%= render '/hyrax/my/admin_set_action_menu', admin_set_presenter: collection_presenter %> | ||
<% else %> | ||
<%= render '/hyrax/my/collection_action_menu', collection_presenter: collection_presenter %> | ||
<% end %> | ||
</td> | ||
</tr> |
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,74 @@ | ||
<% #OVERRIDE Hyrax 3.5.0 to update batch checkbox local %> | ||
<% # used by Your Collections tab %> | ||
<% id = collection_presenter.id %> | ||
<%# Data attributes referenced by the javascript for submitting nested forms. %> | ||
<tr id="document_<%= id %>" | ||
data-source="my" | ||
data-id="<%= id %>" | ||
data-colls-hash="<%= available_parent_collections_data(collection: collection_presenter) %>" | ||
data-post-url="<%= hyrax.dashboard_create_nest_collection_within_path(id) %>" | ||
data-post-delete-url="<%= is_admin_set ? hyrax.admin_admin_set_path(id) : hyrax.dashboard_collection_path(id) %>"> | ||
<td> | ||
<label class="sr-only" for="batch_document_<%= id %>"><%= t('hyrax.dashboard.my.sr.collections_batch_checkbox') %></label> | ||
<% if collection_presenter.allow_batch? %> | ||
<input type="checkbox" name="batch_document_ids[]" id="batch_document_<%= id %>" value="<%= id %>" class="batch_document_selector" | ||
data-hasaccess="<%= (can?(:edit, collection_presenter.solr_document)) %>" /> | ||
<% else %> | ||
<input type="checkbox" class="disabled" disabled=true /> | ||
<% end %> | ||
</td> | ||
<td> | ||
<div class="thumbnail-title-wrapper"> | ||
<div class="thumbnail-wrapper"> | ||
<% if (collection_presenter.thumbnail_path == nil) %> | ||
<span class="<%= Hyrax::ModelIcon.css_class_for(::Collection) %> collection-icon-small"></span> | ||
<% else %> | ||
<%= image_tag(collection_presenter.thumbnail_path, alt: "#{collection_presenter.title_or_label} #{t('hyrax.dashboard.my.sr.thumbnail')}") %> | ||
<% end %> | ||
</div> | ||
<%= link_to collection_presenter.show_path, id: "src_copy_link#{id}" do %> | ||
<span class="sr-only"><%= t("hyrax.dashboard.my.sr.show_label") %></span> | ||
<%= collection_presenter.title_or_label %> | ||
<% end %> | ||
<%# Expand arrow %> | ||
<a href="#" class="small show-more" title="Click for more details"> | ||
<i id="expand_<%= id %>" class="glyphicon glyphicon-chevron-right" aria-hidden="true"></i> | ||
<span class="sr-only"> <%= "#{t("hyrax.dashboard.my.sr.detail_label")} #{collection_presenter.title_or_label}" %></span> | ||
</a> | ||
</div> | ||
<%# Collection details %> | ||
<div id="detail_<%= id %>"> | ||
<div class="expanded-details"> | ||
<p> | ||
<strong><%= t("hyrax.dashboard.my.collection_list.description") %></strong> | ||
<br /><%= collection_presenter.description&.first %> | ||
</p> | ||
<p> | ||
<strong><%= t("hyrax.dashboard.my.collection_list.edit_access") %></strong> | ||
<br /> | ||
<% if collection_presenter.edit_groups.present? %> | ||
<%= t("hyrax.dashboard.my.collection_list.groups") %> <%= collection_presenter.edit_groups.join(', ') %> | ||
<br /> | ||
<% end %> | ||
<%= t("hyrax.dashboard.my.collection_list.users") %> <%= collection_presenter.edit_people.join(', ') %> | ||
</p> | ||
</div> | ||
</div> | ||
</td> | ||
<td class="collection_type"> | ||
<%= collection_presenter.collection_type_badge %> | ||
</td> | ||
<td class="date"><%= collection_presenter.modified_date %> </td> | ||
<td><%= collection_presenter.total_viewable_items %></td> | ||
<td><%= collection_presenter.permission_badge %></td> | ||
<td> | ||
<% if collection_presenter.solr_document.admin_set? %> | ||
<%= render '/hyrax/my/admin_set_action_menu', admin_set_presenter: collection_presenter %> | ||
<% else %> | ||
<%= render 'hyrax/my/collection_action_menu', collection_presenter: collection_presenter %> | ||
<% end %> | ||
</td> | ||
</tr> |
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