Skip to content
Snippets Groups Projects
Commit 8f3d2be6 authored by Gyan Gupta's avatar Gyan Gupta
Browse files

fixes for importer filters and entry respective links

parent 0bd11db0
No related branches found
No related tags found
2 merge requests!384fixes for importer filters and entry respective links,!346Draft: Hyrax 5 - Upgrade hyrax to v5
Pipeline #20696 failed
......@@ -2,4 +2,10 @@
.table-responsive {
overflow-x: auto;
}
}
#importer-show-table_filter, #importers-table_filter {
#status-filter, #entry-filter {
margin-bottom: 10px;
}
}
\ No newline at end of file
<p id="notice"><%= notice %></p>
<div class="panel panel-default">
<div class="panel-body">
<div class="panel card panel-default">
<div class="panel-body card-body">
<p class='bulkrax-p-align'>
<strong>Identifier:</strong>
<strong><%= t('bulkrax.importer.labels.identifier') %>:</strong>
<%= @entry.identifier %>
</p>
<p class='bulkrax-p-align'>
<strong>Entry ID:</strong>
<strong><%= t('bulkrax.importer.labels.entry_id') %>:</strong>
<%= @entry.id %>
</p>
<p class='bulkrax-p-align'>
<strong>Type:</strong>
<strong><%= t('bulkrax.importer.labels.type') %>:</strong>
<%= @entry.factory_class || 'Unknown' %>
</p>
<%= render partial: 'raw_metadata'%>
......@@ -23,29 +23,32 @@
<p class="bulkrax-p-align">
<% if @importer.present? %>
<strong>Importer:</strong>
<strong><%= t('bulkrax.importer.labels.importer') %>:</strong>
<%= link_to @importer.name, importer_path(@importer) %>
<% elsif @exporter.present? %>
<strong>Exporter:</strong>
<strong><%= t('bulkrax.importer.labels.exporter') %>:</strong>
<%= link_to @exporter.name, exporter_path(@exporter) %>
<% end %>
</p>
<p class='bulkrax-p-align'>
<% if @importer.present? %>
<% factory_record = @entry.factory.find %>
<%# TODO Consider how to account for Bulkrax.collection_model_class %>
<% custom_entries = ["Bulkrax::CrcFolderComplexSubjectEntry", "Bulkrax::CrcFolderComplexSessionEntry", "Bulkrax::CrcFolderComplexModalityEntry"] %>
<% factory_record = custom_entries.include?(@entry.class.name) ? get_custom_entry_record(@entry) : @entry.factory.find %>
<% if factory_record.present? && @entry.factory_class %>
<strong><%= @entry.factory_class.to_s %> Link:</strong>
<% if @entry.factory_class.to_s == 'Collection' %>
<%= link_to @entry.factory_class.to_s, hyrax.polymorphic_path(factory_record) %>
<% elsif @entry.factory_class.to_s == 'ComplexSubject' %>
<%= link_to @entry.factory_class.to_s, hyrax.crc1280_experiment_complex_subject_path(factory_record.crc1280_experiment, factory_record) %>
<% elsif @entry.factory_class.to_s == 'ComplexSession' %>
<%= link_to @entry.factory_class.to_s, hyrax.crc1280_experiment_complex_session_path(factory_record.crc1280_experiment, factory_record) %>
<% elsif @entry.factory_class.to_s == 'ComplexModality' %>
<%= link_to @entry.factory_class.to_s, hyrax.crc1280_experiment_complex_modality_path(factory_record.crc1280_experiment, factory_record) %>
<% entry_model_name = @entry.factory_class.model_name.human %>
<strong><%= entry_model_name %> Link:</strong>
<% if entry_model_name == 'Collection' %>
<%= link_to entry_model_name, hyrax.polymorphic_path(factory_record) %>
<% elsif entry_model_name == 'Complex subject' %>
<%= link_to entry_model_name, hyrax.crc1280_experiment_complex_subject_path(factory_record.crc1280_experiment.id, factory_record) %>
<% elsif entry_model_name == 'Complex session' %>
<%= link_to entry_model_name, hyrax.crc1280_experiment_complex_session_path(factory_record.crc1280_experiment.id, factory_record) %>
<% elsif entry_model_name == 'Complex modality' %>
<%= link_to entry_model_name, hyrax.crc1280_experiment_complex_modality_path(factory_record.crc1280_experiment.id, factory_record) %>
<% else %>
<%= link_to @entry.factory_class.to_s, hyrax.dashboard_collection_path(factory_record) %>
<%= link_to entry_model_name, main_app.polymorphic_path(factory_record) %>
<% end %>
<% else %>
<strong>Item Link:</strong> Item has not yet been imported successfully
......@@ -53,11 +56,11 @@
<% else %>
<% record = @entry&.hyrax_record %>
<% if record.present? && @entry.factory_class %>
<strong><%= record.class.to_s %> Link:</strong>
<% if record.is_a?(Collection) %>
<%= link_to record.class.to_s, hyrax.polymorphic_path(record) %>
<strong><%= record.model_name.human %> Link:</strong>
<% if defined?(Hyrax) && record.model_name.human == "Collection" %>
<%= link_to record.model_name.human, hyrax.polymorphic_path(record) %>
<% else %>
<%= link_to record.class.to_s, main_app.polymorphic_path(record) %>
<%= link_to record.model_name.human, main_app.polymorphic_path(record) %>
<% end %>
<% else %>
<strong>Item Link:</strong> No item associated with this entry or class unknown
......
<div class="tab-pane bulkrax-nav-tab-table-left-align" >
<table id='importer-show-table' class='table table-striped'>
<thead>
<tr>
<th><%= t('bulkrax.table_header.labels.identifier') %></th>
<th><%= t('bulkrax.table_header.labels.entry_id') %></th>
<th><%= t('bulkrax.table_header.labels.status') %></th>
<th><%= t('bulkrax.table_header.labels.type') %></th>
<th><%= t('bulkrax.table_header.labels.updated_at') %></th>
<th><%= t('bulkrax.table_header.labels.errors') %></th>
<th><%= t('bulkrax.table_header.labels.actions') %></th>
</tr>
</thead>
</table>
<% additional_entry_filters = item.parser.is_a?(Bulkrax::CrcFolderParser) ? [item.parser.complex_subject_entry_class.to_s, item.parser.complex_session_entry_class.to_s, item.parser.complex_modality_entry_class.to_s] : [] %>
<div id='importer-entry-classes' class='hidden d-none'><%= ([item.parser.entry_class.to_s, item.parser.collection_entry_class.to_s, item.parser.file_set_entry_class.to_s] + additional_entry_filters ).compact.join('|') %></div>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment