-
Notifications
You must be signed in to change notification settings - Fork 14
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 #16 from hudmol/v2.0-dev
V2.0 dev
- Loading branch information
Showing
11 changed files
with
869 additions
and
100 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,33 @@ | ||
var WorkOrderToolbarAction = function() { | ||
this.setupButton(); | ||
}; | ||
|
||
|
||
WorkOrderToolbarAction.prototype.setupButton = function() { | ||
this.$button = $(AS.renderTemplate("workOrderButtonTemplate")); | ||
/* The past. Eventually this (and the conditional below) can go away. */ | ||
var setupButtonASpace15 = function() { | ||
$workOrder = $(AS.renderTemplate("workOrderButtonTemplate")); | ||
|
||
/* ArchivesSpace 1.5.x */ | ||
$workOrder.addClass("btn btn-xs btn-default"); | ||
var $btnGroup = $("<div>").addClass("btn-group"); | ||
|
||
this.$button.appendTo($btnGroup); | ||
$workOrder.appendTo($btnGroup); | ||
$btnGroup.appendTo($("#archives_tree_toolbar .btn-toolbar")); | ||
} | ||
}; | ||
|
||
/* The future! */ | ||
var setupButtonASpace2x = function() { | ||
$workOrder = $(AS.renderTemplate("workOrderButtonTemplate")); | ||
/* ArchivesSpace 2.x */ | ||
$('#other-dropdown .dropdown-menu').append($('<li />').append($workOrder)); | ||
$('#other-dropdown').show(); | ||
}; | ||
|
||
|
||
// if a resource tree page, setup the work order toolbar action | ||
// setup the work order toolbar action | ||
$(document).on("loadedrecordform.aspace", function(event, $container) { | ||
// are we dealing with a record with a tree? | ||
if ($(".archives-tree").data("read-only") || $container.is("#archives_tree_toolbar")) { | ||
// is the tree a resource tree? | ||
if (AS._tree && AS._tree.get_json()[0].type == "resource") { | ||
// hurray! add the button. | ||
new WorkOrderToolbarAction(); | ||
if (typeof(tree) === 'undefined') { | ||
if (window.location.pathname.indexOf("/resources/") >= 0) { | ||
setupButtonASpace15(); | ||
} | ||
} else { | ||
if (tree && tree.current().data('jsonmodel_type') == 'resource') { | ||
setupButtonASpace2x(); | ||
} | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
my_routes = [File.join(File.dirname(__FILE__), "routes.rb")] | ||
ArchivesSpace::Application.config.paths['config/routes'].concat(my_routes) | ||
if ArchivesSpace::Application.respond_to?(:extend_aspace_routes) | ||
# > v2.0 way of defining routes | ||
ArchivesSpace::Application.extend_aspace_routes(File.join(File.dirname(__FILE__), "routes.rb")) | ||
else | ||
# < v2.0 way of defining routes | ||
my_routes = [File.join(File.dirname(__FILE__), "routes.rb")] | ||
ArchivesSpace::Application.config.paths['config/routes'].concat(my_routes) | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<%= stylesheet_link_tag "#{AppConfig[:frontend_prefix]}assets/work_order.css" %> | ||
<%= javascript_include_tag "#{AppConfig[:frontend_prefix]}assets/work_order.js" %> | ||
<script type="text/template" id="workOrderButtonTemplate"> | ||
<%= link_to I18n.t("plugins.digitization_work_order.toolbar_button"), {:controller => :work_order, :action => :index, :resource => @resource ? @resource.uri : nil}, {:class => "btn btn-xs btn-default"} %> | ||
</script> | ||
<script type="text/template" id="workOrderLoadingTemplate"> | ||
<div class="modal-body" id="workOrderForm"> | ||
<%= I18n.t("plugins.digitization_work_order.loading") %> | ||
</div> | ||
</script> | ||
<% if @resource && controller_name == 'resources' && action_name == 'show' %> | ||
<%= stylesheet_link_tag "#{AppConfig[:frontend_prefix]}assets/work_order.css" %> | ||
<%= javascript_include_tag "#{AppConfig[:frontend_prefix]}assets/work_order.js" %> | ||
<script type="text/template" id="workOrderButtonTemplate"> | ||
<%= link_to I18n.t("plugins.digitization_work_order.toolbar_button"), {:controller => :work_order, :action => :index, :resource => @resource.uri} %> | ||
</script> | ||
<script type="text/template" id="workOrderLoadingTemplate"> | ||
<div class="modal-body" id="workOrderForm"> | ||
<%= I18n.t("plugins.digitization_work_order.loading") %> | ||
</div> | ||
</script> | ||
<% end %> |
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,62 @@ | ||
<div id='work_order_buttons'> | ||
<div class="form-group"> | ||
<form class="form-inline"> | ||
<fieldset class="form-group additional-options"> | ||
<legend><%= I18n.t("plugins.digitization_work_order.additional_options") %></legend> | ||
<label class="checkbox-inline" for="series"><input type="checkbox" id="series" name="series"> | ||
<%= I18n.t("plugins.digitization_work_order.series_title") %> | ||
</label> | ||
<label class="checkbox-inline" for="subseries"><input type="checkbox" id="subseries" name="subseries"> | ||
<%= I18n.t("plugins.digitization_work_order.subseries_title") %> | ||
</label> | ||
<label class="checkbox-inline" for="barcode"><input type="checkbox" id="barcode" name="barcode"> | ||
<%= I18n.t("plugins.digitization_work_order.barcode") %> | ||
</label> | ||
<label class="checkbox-inline" for="dates"><input type="checkbox" id="dates" name="dates"> | ||
<%= I18n.t("plugins.digitization_work_order.dates") %> | ||
</label> | ||
</fieldset> | ||
</form> | ||
</div> | ||
|
||
|
||
<p class="alert alert-info" role="alert">If you would like a report of metadata for these items without generating component unique identifiers (CUIDs) , select <strong>Download Report</strong>. If you would like to create a work order and generate CUIDs for archival objects currently lacking them, select <strong>Download Work Order</strong>.</p> | ||
|
||
<div class="form-group"> | ||
<button id="generateReport" class="btn btn-primary submit-btn" disabled> | ||
<%= I18n.t("plugins.digitization_work_order.download_report_button") %> | ||
</button> | ||
<button id="showWorkOrderModal" class="btn btn-primary submit-btn" disabled> | ||
<%= I18n.t("plugins.digitization_work_order.show_work_order_modal_button") %> | ||
</button> | ||
<%= link_to I18n.t("plugins.digitization_work_order.cancel_button"),:back, :class => "btn btn-default" %> | ||
</div> | ||
|
||
<%= form_tag({:controller => :work_order, :action => :generate_report}, {:method => 'post', :id => "work_order_form"}) do |form| %> | ||
<%= hidden_field_tag "resource", @uri %> | ||
<div class="report-fields"></div> | ||
|
||
<div class="modal_overlay"></div> | ||
|
||
<div class="work_order_modal"> | ||
<h3><%= I18n.t("plugins.digitization_work_order.modal.title") %></h3> | ||
<hr/> | ||
<p><strong><%= I18n.t("plugins.digitization_work_order.resource") %>: | ||
</strong> <%= @tree['title'] %> (<%= @tree['identifier'] %>) | ||
</p> | ||
<p><strong><%= I18n.t("plugins.digitization_work_order.records_selected") %>: | ||
</strong> <span id="selectedCountInModal"></span> | ||
</p> | ||
<hr/> | ||
<p><%= I18n.t("plugins.digitization_work_order.modal.message") %></p> | ||
<p><strong><%= I18n.t("plugins.digitization_work_order.modal.warning") %></strong></p> | ||
<hr/> | ||
<button id="downloadWorkOrder" class="btn btn-primary submit-btn"> | ||
<%= I18n.t("plugins.digitization_work_order.modal.download_button") %> | ||
</button> | ||
<button id="cancelWorkOrder" class="btn btn-default"> | ||
<%= I18n.t("plugins.digitization_work_order.cancel_button") %> | ||
</button> | ||
</div> | ||
|
||
<% end %> |
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,14 @@ | ||
|
||
<div class="form-group"> | ||
<button id="generateLadybirdExport" class="btn btn-primary submit-btn" disabled> | ||
<%= I18n.t("plugins.digitization_work_order.download_ladybird_export_button") %> | ||
</button> | ||
<%= link_to I18n.t("plugins.digitization_work_order.cancel_button"),:back, :class => "btn btn-default" %> | ||
</div> | ||
|
||
<%= form_tag({:controller => :work_order, :action => :generate_ladybird_export}, {:method => 'post', :id => "work_order_form"}) do |form| %> | ||
<%= hidden_field_tag "resource", @uri %> | ||
<div class="report-fields"></div> | ||
|
||
<% end %> | ||
|
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