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
# add this to plugins/aspace-public-formats/backend/controllers/public_formats.rb and restart | |
module ExportHelpers | |
def generate_pdf_from_ead( ead ) | |
xml = "" | |
ead.each { |e| xml << e } | |
ASFop.new(xml).to_pdf | |
end | |
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
<div class="container navbar-branding"> | |
<%= image_tag "archivesspace/archivesspace.small.png", :class=>"img-responsive" %> | |
</div> | |
<script> | |
$(function() { |
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
# frontend/lib/tasks/rake_jruby_complete_patch.rake | |
# Icky to have to do this, but had trouble with the recursive calls to Rake | |
# running with jruby-complete.jar. | |
classpath = [File.join(Rails.root, "..", "common")] | |
classpath << Dir.glob(File.join(Rails.root, "..", "build", "jruby*complete*.jar")).first | |
$rake_cmd = ["java", | |
"-XX:MaxPermSize=128m", "-Xmx256m", |
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
# plugins/local/frontend/controllers/application_controller.rb | |
# Obviously, not a application controller, but we just name it this to follow a convention. | |
class ApplicationController < ActionController::Base | |
end | |
module ApplicationHelper | |
def include_theme_css | |
css = "" |
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
# put this file in | |
# plugins/local/backend/model/converter.rb | |
# and restart aspace. | |
class Converter | |
# forcibly remove files in the event of an interruption | |
def remove_files | |
@batch.each_open_file_path do |path| |
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
# add this plugin to plugins/local/backend/model/accession_converter.rb | |
# this plugin allows the CSV importer to have columns like date_3_label, date_3_expression, | |
# extent_2_type, extent_2_container_summary etc. | |
class AccessionConverter < Converter | |
# we alias the old configure method... | |
self.singleton_class.send(:alias_method,:old_configure, :configure) | |
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
class RacEADConverter < EADConverter | |
def self.import_types(show_hidden = false) | |
[ | |
{ | |
:name => "rac_ead_xml", | |
:description => "Import RAC EAD records from an XML file" | |
} |
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
# | |
# Add this file to plugins/local/frontend/controllers/form_fix_controller.rb | |
# Obviously not a controller, but the naming convention is used to make sure that | |
# it loads. | |
# | |
module AspaceFormHelper | |
class FormContext | |
def label_and_date(name, opts = {}) |
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
# | |
# Add this file to plugins/local/frontend/controllers/aspace_forms_helper.rb | |
module AspaceFormHelper | |
COMBOBOX_MIN_LIMIT = 50 # if a <select> has equal or more options than this value, output a combobox | |
class FormContext | |
def initialize(name, values_from, parent) |
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
# plugins/local/backend/controllers/reports.rb | |
class ArchivesSpaceService < Sinatra::Base | |
ReportManager.registered_reports.each do |uri_suffix, opts| | |
Endpoint.get("/repositories/:repo_id/reports/#{uri_suffix}") | |
.description(opts[:description]) | |
.params(*(opts[:params] << ReportHelper.report_formats << ["repo_id", :repo_id])) | |
.permissions([]) |