enju_library 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b53b9a80c2a2174f387021fb298c3e1baf6e36af488e4a926be0ebb5f9c433ba
4
- data.tar.gz: 43e382458c63aaf670026c2acb592301c374da6762c5750084afe42e0f4292f1
3
+ metadata.gz: 4802d463a39344f22ebe0ee2c4b1450a2331eef57c580e30ea6d95591ee1dfb9
4
+ data.tar.gz: 60f7c600d830f4d00904a229499084ff9c5a4b2569bb6573219326aaa91d8952
5
5
  SHA512:
6
- metadata.gz: 613890cb1966bf5a47144da01dc5abd51a9a586f7725dfa00eaef08923e444537f957c0b6cd86df6f0af1cb4c40034b9a206c68af6149ee065b04a4ef71e1914
7
- data.tar.gz: 034e25b560b858a295a1371b3516d99611ca242bf9a7f328da80bb9be2b639e9503adeaee3fc850137802c6bab3251493e36c4288a5f04ae2290257baefcf300
6
+ metadata.gz: f165c06c251c2d2ec85647e7182c413604983d1016042195f72e2535f320788f7abd5c71d851c3f15bab49e6855614f3299820eefe83ed802b4f4597ca93e170
7
+ data.tar.gz: 0d8f350edd67f0bfa842c241dcac23cf90b0ef4f57af3797e3f9ebb6be2855067183888e0259c913af3f0c167d255f1b57da50f64a81707b5dfdd08cd4b3df09
data/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # EnjuLibrary
2
+ [![Travis CI](https://travis-ci.com/next-l/enju_library.svg?branch=1.3)](https://travis-ci.com/next-l/enju_library)
3
+ [![Coverage Status](https://coveralls.io/repos/github/next-l/enju_library/badge.svg?branch=1.3)](https://coveralls.io/github/next-l/enju_library?branch=1.3)
4
+ [![security](https://hakiri.io/github/next-l/enju_library/1.3.svg)](https://hakiri.io/github/next-l/enju_library/1.3)
5
+
6
+ This project rocks and uses MIT-LICENSE.
7
+
8
+ ## 製作者・貢献者 (Authors and contributors)
9
+ * [TANABE, Kosuke](https://github.com/nabeta) ([@nabeta](https://twitter.com/nabeta))
10
+ * [Project Next-L](https://www.next-l.jp) ([@ProjectNextL](https://twitter.com/ProjectNextL))
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
16
16
  rdoc.rdoc_dir = 'rdoc'
17
17
  rdoc.title = 'EnjuLibrary'
18
18
  rdoc.options << '--line-numbers'
19
- rdoc.rdoc_files.include('README.rdoc')
19
+ rdoc.rdoc_files.include('README.md')
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
21
21
  end
22
22
 
@@ -7,16 +7,10 @@ class Withdraw < ApplicationRecord
7
7
  uniqueness: true, #{ message: I18n.t('withdraw.already_withdrawn', locale: I18n.default_locale) },
8
8
  presence: true #, { message: I18n.translate('withdraw.item_not_found', locale: I18n.default_locale) }
9
9
  validates_presence_of :basket_id
10
- validate :check_item
11
10
 
12
11
  attr_accessor :item_identifier
13
12
 
14
13
  paginates_per 10
15
-
16
- def check_item
17
- errors.add(:item) if item.try(:rent?)
18
- errors.add(:item) if item.try(:reserved?)
19
- end
20
14
  end
21
15
 
22
16
  # == Schema Information
@@ -17,7 +17,7 @@ class ShelfPolicy < ApplicationPolicy
17
17
 
18
18
  def destroy?
19
19
  if user.try(:has_role?, 'Administrator')
20
- true if record.items.empty? && !record.web_shelf?
20
+ true if record.items.count == 0 && !record.web_shelf?
21
21
  end
22
22
  end
23
23
  end
@@ -1,4 +1,9 @@
1
1
  <h2><%= t('activerecord.models.user_import_result') %></h2>
2
+ <p>
3
+ <%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), user_import_results_path(user_import_file_id: @user_import_file.id, format: :txt, locale: @locale.to_s)) -%>
4
+ (<%= link_to 'TSV', user_import_results_path(user_import_file_id: @user_import_file.id, format: :txt, locale: @locale.to_s) -%>)
5
+ </p>
6
+
2
7
  <table class="table table-striped index">
3
8
  <tr>
4
9
  <th><%= t('activerecord.attributes.user_import_result.lineno') %></th>
@@ -11,15 +11,4 @@
11
11
  </div>
12
12
 
13
13
  <div id="submenu" class="ui-corner-all ui-widget-content">
14
- <ul>
15
- <li>
16
- <% if @user_import_file %>
17
- <%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), user_import_results_path(user_import_file_id: @user_import_file.id, format: :txt, locale: @locale.to_s)) -%>
18
- (<%= link_to 'TSV', user_import_results_path(user_import_file_id: @user_import_file.id, format: :txt, locale: @locale.to_s) -%>)
19
- <% else %>
20
- <%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), user_import_results_path(format: :txt, locale: @locale.to_s)) -%>
21
- (<%= link_to 'TSV', user_import_results_path(format: :txt, locale: @locale.to_s) -%>)
22
- <% end %>
23
- </li>
24
- </ul>
25
14
  </div>
@@ -1,3 +1,3 @@
1
1
  module EnjuLibrary
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
@@ -0,0 +1,5 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
4
+ //= link icons/arrow_up.png
5
+ //= link icons/arrow_down.png
@@ -0,0 +1,5 @@
1
+ class AddMemoToManifestation < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :manifestations, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddMemoToItem < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :items, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCustomProperties < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :custom_properties do |t|
4
+ t.integer :resource_id, null: false
5
+ t.string :resource_type, null: false
6
+ t.text :label, null: false
7
+ t.text :value
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2018_01_07_162048) do
13
+ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
14
14
 
15
15
  create_table "accepts", force: :cascade do |t|
16
16
  t.integer "basket_id"
@@ -433,6 +433,15 @@ ActiveRecord::Schema.define(version: 2018_01_07_162048) do
433
433
  t.index ["work_id"], name: "index_creates_on_work_id"
434
434
  end
435
435
 
436
+ create_table "custom_properties", force: :cascade do |t|
437
+ t.integer "resource_id", null: false
438
+ t.string "resource_type", null: false
439
+ t.text "label", null: false
440
+ t.text "value"
441
+ t.datetime "created_at", null: false
442
+ t.datetime "updated_at", null: false
443
+ end
444
+
436
445
  create_table "demands", force: :cascade do |t|
437
446
  t.integer "user_id"
438
447
  t.integer "item_id"
@@ -669,6 +678,7 @@ ActiveRecord::Schema.define(version: 2018_01_07_162048) do
669
678
  t.string "binding_call_number"
670
679
  t.datetime "binded_at"
671
680
  t.integer "manifestation_id", null: false
681
+ t.text "memo"
672
682
  t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
673
683
  t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
674
684
  t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
@@ -919,6 +929,7 @@ ActiveRecord::Schema.define(version: 2018_01_07_162048) do
919
929
  t.text "publication_place"
920
930
  t.text "extent"
921
931
  t.text "dimensions"
932
+ t.text "memo"
922
933
  t.index ["access_address"], name: "index_manifestations_on_access_address"
923
934
  t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
924
935
  t.index ["doi"], name: "index_manifestations_on_doi"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2019-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_seed
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.3.4
131
+ version: 0.3.7
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.3.4
138
+ version: 0.3.7
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: enju_manifestation_viewer
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.3.2
187
+ version: 0.3.5
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.3.2
194
+ version: 0.3.5
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: sqlite3
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -416,7 +416,7 @@ extensions: []
416
416
  extra_rdoc_files: []
417
417
  files:
418
418
  - MIT-LICENSE
419
- - README.rdoc
419
+ - README.md
420
420
  - Rakefile
421
421
  - app/assets/config/enju_library_manifest.js
422
422
  - app/controllers/accepts_controller.rb
@@ -685,6 +685,7 @@ files:
685
685
  - spec/controllers/withdraws_controller_spec.rb
686
686
  - spec/dummy/README.rdoc
687
687
  - spec/dummy/Rakefile
688
+ - spec/dummy/app/assets/config/manifest.js
688
689
  - spec/dummy/app/assets/javascripts/application.js
689
690
  - spec/dummy/app/assets/stylesheets/application.css
690
691
  - spec/dummy/app/controllers/application_controller.rb
@@ -945,6 +946,9 @@ files:
945
946
  - spec/dummy/db/migrate/20180107162009_add_constraints_to_most_recent_for_user_reserve_stat_transitions.rb
946
947
  - spec/dummy/db/migrate/20180107162029_add_constraints_to_most_recent_for_manifestation_checkout_stat_transitions.rb
947
948
  - spec/dummy/db/migrate/20180107162048_add_constraints_to_most_recent_for_manifestation_reserve_stat_transitions.rb
949
+ - spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb
950
+ - spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb
951
+ - spec/dummy/db/migrate/20191219122214_create_custom_properties.rb
948
952
  - spec/dummy/db/schema.rb
949
953
  - spec/dummy/public/404.html
950
954
  - spec/dummy/public/422.html
@@ -1023,7 +1027,6 @@ files:
1023
1027
  - spec/fixtures/user_reserve_stats.yml
1024
1028
  - spec/fixtures/users.yml
1025
1029
  - spec/fixtures/withdraws.yml
1026
- - spec/libraries_spec.rb
1027
1030
  - spec/mailers/previews/user_export_preview.rb
1028
1031
  - spec/mailers/previews/user_import_preview.rb
1029
1032
  - spec/mailers/user_export_spec.rb
@@ -1051,7 +1054,6 @@ files:
1051
1054
  - spec/routing/budget_types_routing_spec.rb
1052
1055
  - spec/routing/libraries_routing_spec.rb
1053
1056
  - spec/routing/withdraws_routing_spec.rb
1054
- - spec/shelves_spec.rb
1055
1057
  - spec/spec_helper.rb
1056
1058
  - spec/support/controller_macros.rb
1057
1059
  - spec/support/devise.rb
@@ -1103,6 +1105,7 @@ test_files:
1103
1105
  - spec/dummy/app/jobs/application_job.rb
1104
1106
  - spec/dummy/app/controllers/application_controller.rb
1105
1107
  - spec/dummy/app/views/layouts/application.html.erb
1108
+ - spec/dummy/app/assets/config/manifest.js
1106
1109
  - spec/dummy/app/assets/javascripts/application.js
1107
1110
  - spec/dummy/app/assets/stylesheets/application.css
1108
1111
  - spec/dummy/app/helpers/application_helper.rb
@@ -1248,6 +1251,7 @@ test_files:
1248
1251
  - spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb
1249
1252
  - spec/dummy/db/migrate/20100129142347_create_import_requests.rb
1250
1253
  - spec/dummy/db/migrate/125_create_donates.rb
1254
+ - spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb
1251
1255
  - spec/dummy/db/migrate/20180107162029_add_constraints_to_most_recent_for_manifestation_checkout_stat_transitions.rb
1252
1256
  - spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb
1253
1257
  - spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb
@@ -1305,6 +1309,7 @@ test_files:
1305
1309
  - spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb
1306
1310
  - spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb
1307
1311
  - spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb
1312
+ - spec/dummy/db/migrate/20191219122214_create_custom_properties.rb
1308
1313
  - spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb
1309
1314
  - spec/dummy/db/migrate/117_create_form_of_works.rb
1310
1315
  - spec/dummy/db/migrate/20080819181903_create_message_requests.rb
@@ -1349,6 +1354,7 @@ test_files:
1349
1354
  - spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb
1350
1355
  - spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb
1351
1356
  - spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb
1357
+ - spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb
1352
1358
  - spec/dummy/db/migrate/145_create_subject_heading_types.rb
1353
1359
  - spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb
1354
1360
  - spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb
@@ -1365,7 +1371,6 @@ test_files:
1365
1371
  - spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb
1366
1372
  - spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb
1367
1373
  - spec/dummy/README.rdoc
1368
- - spec/libraries_spec.rb
1369
1374
  - spec/mailers/user_export_spec.rb
1370
1375
  - spec/mailers/user_import_spec.rb
1371
1376
  - spec/mailers/previews/user_import_preview.rb
@@ -1387,7 +1392,6 @@ test_files:
1387
1392
  - spec/models/subscribe_spec.rb
1388
1393
  - spec/models/accept_spec.rb
1389
1394
  - spec/models/basket_spec.rb
1390
- - spec/shelves_spec.rb
1391
1395
  - spec/system/libraries_spec.rb
1392
1396
  - spec/system/shelves_spec.rb
1393
1397
  - spec/support/controller_macros.rb
data/README.rdoc DELETED
@@ -1,10 +0,0 @@
1
- = EnjuLibrary
2
- {<img src="https://travis-ci.org/next-l/enju_library.svg?branch=1.3" alt="Build Status" />}[https://travis-ci.org/next-l/enju_library]
3
- {<img src="https://coveralls.io/repos/next-l/enju_library/badge.svg?branch=1.3&service=github" alt="Coverage Status" />}[https://coveralls.io/github/next-l/enju_library?branch=1.3]
4
- {<img src="https://hakiri.io/github/next-l/enju_library/1.3.svg" alt="security" />}[https://hakiri.io/github/next-l/enju_library/1.3]
5
-
6
- This project rocks and uses MIT-LICENSE.
7
-
8
- == 製作者・貢献者 (Authors and contributors)
9
- * {TANABE, Kosuke}[https://github.com/nabeta] ({@nabeta}[https://twitter.com/nabeta])
10
- * {Project Next-L}[https://www.next-l.jp] ({@ProjectNextL}[https://twitter.com/ProjectNextL])
@@ -1,46 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe 'Libraries', type: :system do
4
- include Devise::Test::IntegrationHelpers
5
- fixtures :all
6
-
7
- describe 'When logged in as Administrator' do
8
- before do
9
- sign_in users(:admin)
10
- end
11
-
12
- it 'should show library config' do
13
- visit library_path(libraries(:library_00002).id, locale: :ja)
14
- expect(page).to have_content '設定'
15
- end
16
- end
17
-
18
- describe 'When logged in as Librarian' do
19
- before do
20
- sign_in users(:librarian1)
21
- end
22
-
23
- it 'should not show library config' do
24
- visit library_path(libraries(:library_00002).id, locale: :ja)
25
- expect(page).not_to have_content '設定'
26
- end
27
- end
28
-
29
- describe 'When logged in as User' do
30
- before do
31
- sign_in users(:user1)
32
- end
33
-
34
- it 'should not show library config' do
35
- visit library_path(libraries(:library_00002).id, locale: :ja)
36
- expect(page).not_to have_content '設定'
37
- end
38
- end
39
-
40
- describe 'When not logged in' do
41
- it 'should not show library config' do
42
- visit library_path(libraries(:library_00002).id, locale: :ja)
43
- expect(page).not_to have_content '設定'
44
- end
45
- end
46
- end
data/spec/shelves_spec.rb DELETED
@@ -1,46 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe 'Shelves', type: :system do
4
- include Devise::Test::IntegrationHelpers
5
- fixtures :all
6
-
7
- describe 'When logged in as Administrator' do
8
- before do
9
- sign_in users(:admin)
10
- end
11
-
12
- it 'should show shelf config' do
13
- visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
14
- expect(page).to have_content '新規作成'
15
- end
16
- end
17
-
18
- describe 'When logged in as Librarian' do
19
- before do
20
- sign_in users(:librarian1)
21
- end
22
-
23
- it 'should not show shelf config' do
24
- visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
25
- expect(page).not_to have_content '新規作成'
26
- end
27
- end
28
-
29
- describe 'When logged in as User' do
30
- before do
31
- sign_in users(:user1)
32
- end
33
-
34
- it 'should not show shelf config' do
35
- visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
36
- expect(page).not_to have_content '新規作成'
37
- end
38
- end
39
-
40
- describe 'When not logged in' do
41
- it 'should not show shelf config' do
42
- visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
43
- expect(page).not_to have_content '新規作成'
44
- end
45
- end
46
- end