Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulkrax feature branch (INTERN WORK) #162

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
38 changes: 38 additions & 0 deletions app/assets/stylesheets/bulkrax/import_export.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
div.importer_parser_fields_file_style span.radio {
display: inline;
margin-right: 20px;
}

div#file_upload,
div#file_path {
display: none;
}

div.hide-required-tag .required-tag {
display: none;
}

div#s2id_exporter_export_source_collection {
border: none;
padding: 0;
}

.bulkrax-nav-tab-top-margin {
margin-top: 20px !important;
}

.bulkrax-nav-tab-bottom-margin {
margin-bottom: 20px;
}

.bulkrax-nav-tab-table-left-align {
margin-left: 10px;
}

.bulkrax-p-align {
margin: 15px 0 10px 15px;
}

.bulkrax-clear-toggles {
clear: both;
}
16 changes: 9 additions & 7 deletions app/assets/stylesheets/hyku.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
.navbar-right {
margin-right: 10px;
}
}

.glyphicon {
display: none;
}
.glyphicon {
position: relative;
}

@media (min-width: $screen-sm-min) {
Expand All @@ -36,7 +36,7 @@
}

#banner.jumbotron {
background: image_url('white-cloud-background.jpg') no-repeat;
background: image_url("white-cloud-background.jpg") no-repeat;
background-color: $gray-lighter;
background-position: center;
border: 0;
Expand All @@ -60,7 +60,11 @@
}

.btn-sign-up {
@include button-variant($classic-white, $jumbotron-button-background-color, $jumbotron-button-background-color);
@include button-variant(
$classic-white,
$jumbotron-button-background-color,
$jumbotron-button-background-color
);
border-radius: 3px;
font-size: 0.7em;
margin-top: 15px;
Expand Down Expand Up @@ -319,7 +323,6 @@ footer.navbar {
padding: 0;
}


#users > .panel {
.panel-body {
padding-left: 0px;
Expand Down Expand Up @@ -394,4 +397,3 @@ a.restore-default-color {
}
}
}

67 changes: 67 additions & 0 deletions app/views/bulkrax/exporters/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<% provide :page_header do %>
<h1><span class="fa fa-cloud-download" aria-hidden="true"></span> Exporters</h1>
<div class="pull-right">
<%= link_to new_exporter_path, class: 'btn btn-primary' do %>
<span class="fa fa-edit" aria-hidden="true"></span> <%= t(:'helpers.action.exporter.new') %>
<% end %>
</div>
<% end %>

<div class="panel panel-default">
<div class="panel-body">
<% if @exporters.present? %>
<div class="table-responsive">
<table class="table table-striped datatable">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Status</th>
<th scope="col">Date Exported</th>
<th scope="col">Download</th>
<th scope="col">Info</th>
<th scope="col">Edit</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
<% @exporters.each do |exporter| %>
<tr>
<th scope="row"><%= link_to exporter.name, exporter_path(exporter) %></th>
<td><%= exporter.status %></td>
<td><%= exporter.created_at %></td>
<td>
<% if File.exist?(exporter.exporter_export_zip_path) %>
<%= link_to raw('<span class="glyphicon glyphicon-download"></span>'), exporter_download_path(exporter) %>
<% end%>
</td>
<td><%= link_to raw('<span class="glyphicon glyphicon-info-sign"></span>'), exporter_path(exporter) %></td>
<td><%= link_to raw('<span class="glyphicon glyphicon-pencil"></span>'), edit_exporter_path(exporter) %></td>
<td><%= link_to raw('<span class="glyphicon glyphicon-remove"></span>'), exporter, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% else %>
<p>No exporters have been created.</p>
<% end %>
</div>
</div>

<script>
$(function() {
$('#DataTables_Table_0').DataTable({
destroy: true, /* Reinitialize DataTable with config below */
'columnDefs': [
{ 'orderable': true, 'targets': [0, 1, 2] },
{ 'orderable': false, 'targets': [3, 4, 5, 6] }
],
'language': {
'info': 'Showing _START_ to _END_ of _TOTAL_ exporters',
'infoEmpty': 'No exporters to show',
'infoFiltered': '(filtered from _MAX_ total exporters)',
'lengthMenu': 'Show _MENU_ exporters'
}
})
})
</script>
78 changes: 78 additions & 0 deletions app/views/bulkrax/importers/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<% provide :page_header do %>
<h1><span class="fa fa-cloud-upload" aria-hidden="true"></span> Importers</h1>
<div class="pull-right">
<%= link_to new_importer_path, class: 'btn btn-primary' do %>
<span class="fa fa-edit" aria-hidden="true"></span> <%= t(:'helpers.action.importer.new') %>
<% end %>
</div>
<% end %>

<div class="panel panel-default">
<div class="panel-body">
<% if @importers.present? %>
<div class="table-responsive">
<table class="table table-striped datatable">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Status</th>
<th scope="col">Last Run</th>
<th scope="col">Next Run</th>
<th scope="col">Entries Enqueued</th>
<th scope="col">Entries Processed</th>
<th scope="col">Entries Failed</th>
<th scope="col">Entries Deleted Upstream</th>
<th scope="col">Total Collection Entries</th>
<th scope="col">Total Work Entries</th>
<th scope="col">Info</th>
<th scope="col">Edit</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
<% @importers.each do |importer| %>
<tr>
<th scope="row"><%= link_to importer.name, importer_path(importer) %></th>
<td><%= importer.status %></td>
<td><%= importer.last_imported_at.strftime("%b %d, %Y") if importer.last_imported_at %></td>
<td><%= importer.next_import_at.strftime("%b %d, %Y") if importer.next_import_at %></td>
<td><%= importer.importer_runs.last&.enqueued_records %></td>
<td><%= (importer.importer_runs.last&.processed_collections || 0) + (importer.importer_runs.last&.processed_records || 0) %></td>
<td><%= (importer.importer_runs.last&.failed_collections || 0) + (importer.importer_runs.last&.failed_records || 0) %></td>
<td><%= importer.importer_runs.last&.deleted_records %></td>
<td><%= importer.importer_runs.last&.total_collection_entries %></td>
<td><%= importer.importer_runs.last&.total_work_entries %></td>

<div class="tooltip">
<td title="info"><%= link_to raw('<span class="glyphicon glyphicon-info-sign"></span>'), importer_path(importer) %></td>
<td title="edit"><%= link_to raw('<span class="glyphicon glyphicon-pencil"></span>'), edit_importer_path(importer) %></td>
<td title="delete"><%= link_to raw('<span class="glyphicon glyphicon-remove"></span>'), importer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</div>
</tr>
<% end %>
</tbody>
</table>
</div>
<% else %>
<p>No importers have been created.</p>
<% end %>
</div>
</div>

<script>
$(function() {
$('#DataTables_Table_0').DataTable({
destroy: true, /* Reinitialize DataTable with config below */
'columnDefs': [
{ 'orderable': true, 'targets': [...Array(10).keys()] },
{ 'orderable': false, 'targets': [10, 11, 12] }
],
'language': {
'info': 'Showing _START_ to _END_ of _TOTAL_ importers',
'infoEmpty': 'No importers to show',
'infoFiltered': '(filtered from _MAX_ total importers)',
'lengthMenu': 'Show _MENU_ importers'
}
})
})
</script>