Skip to content

Commit

Permalink
copy files from 1.3 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jul 9, 2019
1 parent 44ac3a7 commit 5be6839
Show file tree
Hide file tree
Showing 292 changed files with 1,528 additions and 2,105 deletions.
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ gem "enju_event", github: "next-l/enju_event"
gem "enju_manifestation_viewer", github: "next-l/enju_manifestation_viewer"
gem 'jquery-rails'
gem 'json_translate'
gem 'rspec_junit_formatter'
gem 'paper_trail'
gem 'jbuilder'
group :test do
gem 'rails-controller-testing'
gem 'rspec_junit_formatter'
end

# To use debugger
# gem 'debugger'
gem 'rails-controller-testing'
11 changes: 6 additions & 5 deletions app/models/inter_library_loan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ def self.initial_state
#
# Table name: inter_library_loans
#
# id :bigint not null, primary key
# item_id :bigint not null
# borrowing_library_id :bigint not null
# id :integer not null, primary key
# item_id :integer not null
# borrowing_library_id :integer not null
# requested_at :datetime
# shipped_at :datetime
# received_at :datetime
# return_shipped_at :datetime
# return_received_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# deleted_at :datetime
# created_at :datetime
# updated_at :datetime
#
6 changes: 3 additions & 3 deletions app/models/inter_library_loan_transition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class InterLibraryLoanTransition < ActiveRecord::Base
#
# Table name: inter_library_loan_transitions
#
# id :bigint not null, primary key
# id :integer not null, primary key
# to_state :string
# metadata :text default({})
# sort_key :integer
# inter_library_loan_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# created_at :datetime
# updated_at :datetime
# most_recent :boolean not null
#
4 changes: 2 additions & 2 deletions app/views/inter_library_loans/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<div class="field">
<%= f.label t('inter_library_loan.borrowing_library') -%><br />
<%= f.select(:borrowing_library_id, @libraries.collect{|l| [l.display_name, l.id]}) -%>
<%= f.select(:borrowing_library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}) -%>
</div>

<div class="field">
<%= f.label t('activerecord.models.item') -%><br />
<%= link_to @inter_library_loan.item.shelf.library.display_name, @inter_library_loan.item.shelf.library -%>
<%= link_to @inter_library_loan.item.shelf.library.display_name.localize, @inter_library_loan.item.shelf.library -%>
<%= link_to @inter_library_loan.item.item_identifier, @inter_library_loan.item -%>
(<%= link_to @inter_library_loan.item.manifestation.original_title, @inter_library_loan.item.manifestation -%>)
<%= f.hidden_field :item_id -%>
Expand Down
4 changes: 2 additions & 2 deletions app/views/inter_library_loans/index.atom.builder
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
atom_feed(url: inter_library_loans_url(format: :atom)) do |feed|
feed.title t('inter_library_loan.library_group_inter_library_loan', library_group_name: @library_group.display_name)
feed.title t('inter_library_loan.library_group_inter_library_loan', library_group_name: @library_group.display_name.localize)
feed.updated(@inter_library_loans.first ? @inter_library_loans.first.created_at : Time.zone.now)

@inter_library_loans.each do |inter_library_loan|
feed.entry(inter_library_loan) do |entry|
entry.title inter_library_loan.item.manifestation.original_title
entry.author(@library_group.display_name)
entry.author(@library_group.display_name.localize)
end
end
end
4 changes: 2 additions & 2 deletions app/views/inter_library_loans/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<br />
(<%= link_to inter_library_loan.item.manifestation.original_title, inter_library_loan.item.manifestation -%>)
</td>
<td><%= link_to inter_library_loan.item.shelf.library.display_name, inter_library_loan.item.shelf.library -%></td>
<td><%= link_to inter_library_loan.borrowing_library.display_name, inter_library_loan.borrowing_library -%></td>
<td><%= link_to inter_library_loan.item.shelf.library.display_name.localize, inter_library_loan.item.shelf.library -%></td>
<td><%= link_to inter_library_loan.borrowing_library.display_name.localize, inter_library_loan.borrowing_library -%></td>
<td>
<%= l(inter_library_loan.shipped_at) if inter_library_loan.shipped_at -%><br />
<%= l(inter_library_loan.received_at) if inter_library_loan.received_at -%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/inter_library_loans/index.rss.builder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ xml.rss('version' => "2.0",
'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
'xmlns:atom' => "http://www.w3.org/2005/Atom"){
xml.channel{
xml.title t('inter_library_loan.library_group_inter_library_loan', library_group_name: @library_group.display_name)
xml.title t('inter_library_loan.library_group_inter_library_loan', library_group_name: @library_group.display_name.localize)
xml.link inter_library_loans_url
xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
xml.language @locale.to_s
Expand Down
4 changes: 2 additions & 2 deletions app/views/inter_library_loans/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="field">
<%= f.label t('inter_library_loan.borrowing_library') -%><br />
<%= f.select(:borrowing_library_id, @libraries.collect{|l| [l.display_name, l.id]}) -%>
<%= f.select(:borrowing_library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}) -%>
</div>

<div class="field">
Expand All @@ -18,7 +18,7 @@
<div class="field">
<%= f.label t('activerecord.models.item') -%><br />
<%- if @item -%>
<%= link_to @item.shelf.library.display_name, @item.shelf.library -%>
<%= link_to @item.shelf.library.display_name.localize, @item.shelf.library -%>
<%= link_to @item.item_identifier, @item -%>
(<%= link_to @item.manifestation.original_title, @item.manifestation -%>)
<%= f.hidden_field :item_identifier, :value => @item.item_identifier -%>
Expand Down
4 changes: 2 additions & 2 deletions app/views/inter_library_loans/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

<p>
<strong><%= t('activerecord.models.library') -%>:</strong>
<%= link_to @inter_library_loan.item.shelf.library.display_name, @inter_library_loan.item.shelf.library -%>
<%= link_to @inter_library_loan.item.shelf.library.display_name.localize, @inter_library_loan.item.shelf.library -%>
</p>

<p>
<strong><%= t('inter_library_loan.borrowing_library') -%>:</strong>
<%= link_to @inter_library_loan.borrowing_library.display_name, @inter_library_loan.borrowing_library -%>
<%= link_to @inter_library_loan.borrowing_library.display_name.localize, @inter_library_loan.borrowing_library -%>
</p>

<p>
Expand Down
15 changes: 11 additions & 4 deletions db/migrate/148_create_inter_library_loans.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
class CreateInterLibraryLoans < ActiveRecord::Migration[5.2]
def change
class CreateInterLibraryLoans < ActiveRecord::Migration[4.2]
def self.up
create_table :inter_library_loans do |t|
t.references :item, foreign_key: true, null: false
t.references :borrowing_library, foreign_key: {to_table: :libraries}, null: false
t.integer :item_id, null: false
t.integer :borrowing_library_id, null: false
t.timestamp :requested_at
t.timestamp :shipped_at
t.timestamp :received_at
t.timestamp :return_shipped_at
t.timestamp :return_received_at
t.timestamp :deleted_at

t.timestamps
end
add_index :inter_library_loans, :item_id
add_index :inter_library_loans, :borrowing_library_id
end

def self.down
drop_table :inter_library_loans
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateInterLibraryLoanTransitions < ActiveRecord::Migration[5.2]
class CreateInterLibraryLoanTransitions < ActiveRecord::Migration[4.2]
def change
create_table :inter_library_loan_transitions do |t|
t.string :to_state
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddMostRecentToInterLibraryLoanTransitions < ActiveRecord::Migration[5.2]
class AddMostRecentToInterLibraryLoanTransitions < ActiveRecord::Migration[4.2]
def up
add_column :inter_library_loan_transitions, :most_recent, :boolean, null: true
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddConstraintsToMostRecentForInterLibraryLoanTransitions < ActiveRecord::Migration[5.2]
class AddConstraintsToMostRecentForInterLibraryLoanTransitions < ActiveRecord::Migration[4.2]
disable_ddl_transaction!

def up
Expand Down
3 changes: 2 additions & 1 deletion enju_inter_library_loan.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Gem::Specification.new do |s|
s.add_development_dependency "pg"
s.add_development_dependency "rspec-rails", "~> 3.8"
s.add_development_dependency "factory_bot_rails"
s.add_development_dependency "sunspot_solr", "~> 2.3"
s.add_development_dependency "sunspot_solr", "~> 2.4"
s.add_development_dependency "simplecov"
s.add_development_dependency "coveralls"
s.add_development_dependency "annotate"
end
2 changes: 1 addition & 1 deletion spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
config.load_defaults 5.1

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down
34 changes: 0 additions & 34 deletions spec/dummy/config/storage.yml

This file was deleted.

3 changes: 2 additions & 1 deletion spec/dummy/db/migrate/001_create_agents.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateAgents < ActiveRecord::Migration[5.2]
class CreateAgents < ActiveRecord::Migration[4.2]
def change
create_table :agents do |t|
t.string :last_name
Expand All @@ -13,6 +13,7 @@ def change
t.text :full_name_transcription
t.text :full_name_alternative
t.timestamps
t.datetime :deleted_at
t.string :zip_code_1
t.string :zip_code_2
t.text :address_1
Expand Down
17 changes: 13 additions & 4 deletions spec/dummy/db/migrate/005_create_manifestations.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
class CreateManifestations < ActiveRecord::Migration[5.2]
class CreateManifestations < ActiveRecord::Migration[4.2]
def change
create_table :manifestations do |t|
t.text :original_title, null: false
t.text :title_alternative
t.text :title_transcription
t.string :classification_number
t.string :manifestation_identifier, index: {unique: true}
t.datetime :date_of_publication, index: true
t.string :manifestation_identifier
t.datetime :date_of_publication
t.datetime :copyright_date
t.timestamps
t.string :access_address, index: true
t.datetime :deleted_at
t.string :access_address
t.integer :language_id, default: 1, null: false
t.integer :carrier_type_id, default: 1, null: false
t.integer :start_page
t.integer :end_page
t.integer :height
Expand All @@ -26,9 +28,16 @@ def change
t.boolean :repository_content, default: false, null: false
t.integer :lock_version, default: 0, null: false
t.integer :required_role_id, default: 1, null: false
t.integer :required_score, default: 0, null: false
t.integer :frequency_id, default: 1, null: false
t.boolean :subscription_master, default: false, null: false
end
#add_index :manifestations, :carrier_type_id
#add_index :manifestations, :required_role_id
add_index :manifestations, :access_address
#add_index :manifestations, :frequency_id
add_index :manifestations, :manifestation_identifier
add_index :manifestations, :updated_at
add_index :manifestations, :date_of_publication
end
end
11 changes: 8 additions & 3 deletions spec/dummy/db/migrate/006_create_items.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
class CreateItems < ActiveRecord::Migration[5.2]
class CreateItems < ActiveRecord::Migration[4.2]
def change
create_table :items do |t|
t.string :call_number
t.string :item_identifier, index: {unique: true}
t.string :item_identifier
t.timestamps
t.references :shelf
t.datetime :deleted_at
t.integer :shelf_id, default: 1, null: false
t.boolean :include_supplements, default: false, null: false
t.text :note
t.string :url
t.integer :price
t.integer :lock_version, default: 0, null: false
t.integer :required_role_id, default: 1, null: false
t.integer :required_score, default: 0, null: false
end
add_index :items, :shelf_id
add_index :items, :item_identifier
add_index :items, :required_role_id
end
end
4 changes: 3 additions & 1 deletion spec/dummy/db/migrate/012_create_owns.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
class CreateOwns < ActiveRecord::Migration[5.2]
class CreateOwns < ActiveRecord::Migration[4.2]
def change
create_table :owns do |t|
t.references :agent, null: false
t.references :item, null: false
t.integer :position
t.timestamps
end
add_index :owns, :agent_id
add_index :owns, :item_id
end
end
8 changes: 5 additions & 3 deletions spec/dummy/db/migrate/015_create_creates.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
class CreateCreates < ActiveRecord::Migration[5.2]
class CreateCreates < ActiveRecord::Migration[4.2]
def change
create_table :creates do |t|
t.references :agent, foreign_key: true, null: false
t.references :work, null: false, foreign_key: {to_table: :manifestations}
t.references :agent, null: false
t.references :work, null: false
t.integer :position
t.timestamps
end
add_index :creates, :agent_id
add_index :creates, :work_id
end
end
9 changes: 7 additions & 2 deletions spec/dummy/db/migrate/032_create_checkins.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
class CreateCheckins < ActiveRecord::Migration[5.2]
def change
class CreateCheckins < ActiveRecord::Migration[4.2]
def self.up
create_table :checkins do |t|
t.references :item, index: true, foreign_key: true, null: false
t.references :librarian, index: true
t.references :basket, index: true
t.timestamps
end
end

def self.down
drop_table :checkins
end
end
16 changes: 10 additions & 6 deletions spec/dummy/db/migrate/033_create_checkouts.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class CreateCheckouts < ActiveRecord::Migration[5.2]
def change
class CreateCheckouts < ActiveRecord::Migration[4.2]
def self.up
create_table :checkouts do |t|
t.references :user, foreign_key: true
t.references :item, foreign_key: true, null: false
t.references :checkin, foreign_key: true
t.references :librarian, foreign_key: {to_table: :users}
t.references :user, index: true, foreign_key: true
t.references :item, index: true, foreign_key: true, null: false
t.references :checkin, index: true, foreign_key: true
t.references :librarian, index: true
t.references :basket, index: true
t.datetime :due_date
t.integer :checkout_renewal_count, default: 0, null: false
Expand All @@ -13,4 +13,8 @@ def change
end
add_index :checkouts, [:item_id, :basket_id], unique: true
end

def self.down
drop_table :checkouts
end
end
Loading

0 comments on commit 5be6839

Please sign in to comment.