enju_biblio 0.1.0.pre36 → 0.1.0.pre37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/manifestations_controller.rb +18 -22
- data/app/controllers/series_statements_controller.rb +6 -35
- data/app/models/enju_biblio/ability.rb +2 -4
- data/app/models/manifestation.rb +75 -92
- data/app/models/series_statement.rb +13 -18
- data/app/views/manifestations/_edit_detail.html.erb +10 -0
- data/app/views/manifestations/_form.html.erb +49 -34
- data/app/views/manifestations/_manifestation.html.erb +2 -12
- data/app/views/manifestations/_show_detail_librarian.html.erb +3 -33
- data/app/views/manifestations/_show_detail_user.html.erb +3 -18
- data/app/views/manifestations/_show_parent.html.erb +0 -12
- data/app/views/manifestations/_show_series_detail.html.erb +26 -0
- data/app/views/manifestations/show.html.erb +1 -27
- data/app/views/series_statements/_form.html.erb +1 -1
- data/app/views/series_statements/_index.html.erb +3 -11
- data/app/views/series_statements/show.html.erb +22 -30
- data/config/locales/translation_en.yml +2 -0
- data/config/locales/translation_ja.yml +2 -0
- data/config/routes.rb +3 -7
- data/db/migrate/005_create_manifestations.rb +4 -3
- data/db/migrate/20081028083142_create_patron_import_files.rb +1 -1
- data/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
- data/lib/enju_biblio/biblio_helper.rb +1 -1
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/controllers/import_requests_controller_spec.rb +1 -1
- data/spec/controllers/manifestations_controller_spec.rb +0 -6
- data/spec/controllers/series_statements_controller_spec.rb +4 -4
- data/spec/dummy/app/controllers/application_controller.rb +1 -0
- data/spec/dummy/app/models/ability.rb +2 -4
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/029_create_subjects.rb +27 -0
- data/spec/dummy/db/migrate/142_create_classifications.rb +19 -0
- data/spec/dummy/db/migrate/144_create_classification_types.rb +16 -0
- data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +16 -0
- data/spec/dummy/db/migrate/146_create_subject_types.rb +16 -0
- data/spec/dummy/db/migrate/20080606052544_create_work_has_subjects.rb +18 -0
- data/spec/dummy/db/migrate/20090208044541_create_subject_heading_type_has_subjects.rb +16 -0
- data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
- data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +5 -0
- data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
- data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
- data/spec/dummy/db/schema.rb +92 -9
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_l8s +0 -0
- data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
- data/spec/fixtures/manifestations.yml +66 -70
- data/spec/fixtures/series_statements.yml +1 -1
- data/spec/fixtures/subject_types.yml +28 -0
- data/spec/models/import_request_spec.rb +2 -0
- data/spec/models/manifestation_spec.rb +66 -70
- data/spec/models/series_statement_spec.rb +1 -0
- metadata +35 -37
- data/app/controllers/series_statement_relationships_controller.rb +0 -20
- data/app/models/series_statement_relationship.rb +0 -30
- data/app/views/series_statement_relationships/_form.html.erb +0 -27
- data/app/views/series_statement_relationships/edit.html.erb +0 -15
- data/app/views/series_statement_relationships/index.html.erb +0 -34
- data/app/views/series_statement_relationships/new.html.erb +0 -14
- data/app/views/series_statement_relationships/show.html.erb +0 -24
- data/app/views/series_statements/_index_parent.html.erb +0 -53
- data/app/views/series_statements/_manifestation_list.html.erb +0 -17
- data/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
- data/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
- data/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
- data/db/migrate/20120728204337_create_series_statement_relationships.rb +0 -11
- data/spec/controllers/series_statement_relationships_controller_spec.rb +0 -179
- data/spec/dummy/solr/data/test/index/segments_iwe +0 -0
- data/spec/models/series_statement_relationship_spec.rb +0 -17
- data/spec/requests/series_statement_relationships_spec.rb +0 -11
- data/spec/routing/series_statement_relationships_routing_spec.rb +0 -35
- data/spec/views/series_statement_relationships/edit.html.erb_spec.rb +0 -20
- data/spec/views/series_statement_relationships/index.html.erb_spec.rb +0 -23
- data/spec/views/series_statement_relationships/new.html.erb_spec.rb +0 -20
- data/spec/views/series_statement_relationships/show.html.erb_spec.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41a6675a780e68eea3ee082220ebb165f09b927b
|
4
|
+
data.tar.gz: af7fbb006e722aacad738bca1f303755629a317e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f73678cf486d992ce16bab6427e91982fe5be32e87986dc5c1caec236154b8d14c6609a6808eb5c3c13d0f80fc77bbf7a727922af6be211c0f406c4af2868ebb
|
7
|
+
data.tar.gz: e296e9fa6733baffa7363734cfc2b63f2b8a15be0269edb60a94231e88ea5a0a163c684cff8e9cfeb72bf931bccaa196727213fca04064a1e7c12c78a00ed77a
|
@@ -0,0 +1,56 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
div.field, div.actions {
|
20
|
+
margin-bottom: 10px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#notice {
|
24
|
+
color: green;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors {
|
28
|
+
padding: 2px;
|
29
|
+
background-color: red;
|
30
|
+
display: table;
|
31
|
+
}
|
32
|
+
|
33
|
+
#error_explanation {
|
34
|
+
width: 450px;
|
35
|
+
border: 2px solid red;
|
36
|
+
padding: 7px;
|
37
|
+
padding-bottom: 0;
|
38
|
+
margin-bottom: 20px;
|
39
|
+
background-color: #f0f0f0;
|
40
|
+
}
|
41
|
+
|
42
|
+
#error_explanation h2 {
|
43
|
+
text-align: left;
|
44
|
+
font-weight: bold;
|
45
|
+
padding: 5px 5px 5px 15px;
|
46
|
+
font-size: 12px;
|
47
|
+
margin: -7px;
|
48
|
+
margin-bottom: 0px;
|
49
|
+
background-color: #c00;
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
#error_explanation ul li {
|
54
|
+
font-size: 12px;
|
55
|
+
list-style: square;
|
56
|
+
}
|
@@ -125,7 +125,6 @@ class ManifestationsController < ApplicationController
|
|
125
125
|
with(:creator_ids).equal_to patron[:creator].id if patron[:creator]
|
126
126
|
with(:contributor_ids).equal_to patron[:contributor].id if patron[:contributor]
|
127
127
|
with(:publisher_ids).equal_to patron[:publisher].id if patron[:publisher]
|
128
|
-
with(:original_manifestation_ids).equal_to manifestation.id if manifestation
|
129
128
|
with(:series_statement_ids).equal_to series_statement.id if series_statement
|
130
129
|
with(:parent_ids).equal_to parent.id if parent
|
131
130
|
end
|
@@ -153,7 +152,7 @@ class ManifestationsController < ApplicationController
|
|
153
152
|
#end
|
154
153
|
else
|
155
154
|
if mode != 'add'
|
156
|
-
with(:
|
155
|
+
with(:resource_master).equal_to true
|
157
156
|
end
|
158
157
|
end
|
159
158
|
end
|
@@ -182,7 +181,8 @@ class ManifestationsController < ApplicationController
|
|
182
181
|
:issue_number,
|
183
182
|
:serial_number,
|
184
183
|
:edition_string,
|
185
|
-
:edition
|
184
|
+
:edition,
|
185
|
+
:periodical
|
186
186
|
] if params[:format] == 'html' or params[:format].nil?
|
187
187
|
all_result = search.execute
|
188
188
|
@count[:query_result] = all_result.total
|
@@ -447,7 +447,6 @@ class ManifestationsController < ApplicationController
|
|
447
447
|
@manifestation.original_title = parent.original_title
|
448
448
|
@manifestation.title_transcription = parent.title_transcription
|
449
449
|
@manifestation.periodical = true if parent.periodical
|
450
|
-
@manifestation.series_statements.new(:original_title => parent.root_series_statement.original_title)
|
451
450
|
end
|
452
451
|
|
453
452
|
respond_to do |format|
|
@@ -463,9 +462,6 @@ class ManifestationsController < ApplicationController
|
|
463
462
|
access_denied; return
|
464
463
|
end
|
465
464
|
end
|
466
|
-
if defined?(EnjuSubject)
|
467
|
-
@classification_types = ClassificationType.select(:display_name)
|
468
|
-
end
|
469
465
|
if defined?(EnjuBookmark)
|
470
466
|
if params[:mode] == 'tag_edit'
|
471
467
|
@bookmark = current_user.bookmarks.where(:manifestation_id => @manifestation.id).first if @manifestation rescue nil
|
@@ -485,9 +481,12 @@ class ManifestationsController < ApplicationController
|
|
485
481
|
end
|
486
482
|
|
487
483
|
respond_to do |format|
|
488
|
-
set_patrons
|
489
484
|
if @manifestation.save
|
490
|
-
|
485
|
+
if parent
|
486
|
+
parent.derived_manifestations << @manifestation
|
487
|
+
parent.index
|
488
|
+
@manifestation.index
|
489
|
+
end
|
491
490
|
Sunspot.commit
|
492
491
|
|
493
492
|
format.html { redirect_to @manifestation, :notice => t('controller.successfully_created', :model => t('activerecord.models.manifestation')) }
|
@@ -505,7 +504,6 @@ class ManifestationsController < ApplicationController
|
|
505
504
|
def update
|
506
505
|
respond_to do |format|
|
507
506
|
if @manifestation.update_attributes(params[:manifestation])
|
508
|
-
set_patrons
|
509
507
|
Sunspot.commit
|
510
508
|
format.html { redirect_to @manifestation, :notice => t('controller.successfully_updated', :model => t('activerecord.models.manifestation')) }
|
511
509
|
format.json { head :no_content }
|
@@ -676,12 +674,16 @@ class ManifestationsController < ApplicationController
|
|
676
674
|
end
|
677
675
|
|
678
676
|
def prepare_options
|
679
|
-
@carrier_types = CarrierType.
|
680
|
-
@content_types = ContentType.
|
681
|
-
@roles = Role.
|
682
|
-
@languages = Language.
|
683
|
-
@frequencies = Frequency.
|
684
|
-
@nii_types = NiiType.
|
677
|
+
@carrier_types = CarrierType.select([:id, :display_name, :position])
|
678
|
+
@content_types = ContentType.select([:id, :display_name, :position])
|
679
|
+
@roles = Role.select([:id, :display_name, :position])
|
680
|
+
@languages = Language.select([:id, :display_name, :position])
|
681
|
+
@frequencies = Frequency.select([:id, :display_name, :position])
|
682
|
+
@nii_types = NiiType.select([:id, :display_name, :position]) if defined?(EnjuNii)
|
683
|
+
if defined?(EnjuSubject)
|
684
|
+
@subject_types = SubjectType.select([:id, :display_name, :position])
|
685
|
+
@classification_types = ClassificationType.select([:id, :display_name, :position])
|
686
|
+
end
|
685
687
|
end
|
686
688
|
|
687
689
|
def get_index_patron
|
@@ -769,10 +771,4 @@ class ManifestationsController < ApplicationController
|
|
769
771
|
end
|
770
772
|
query
|
771
773
|
end
|
772
|
-
|
773
|
-
def set_patrons
|
774
|
-
@manifestation.set_creators(@manifestation.creators)
|
775
|
-
@manifestation.set_contributors(@manifestation.contributors)
|
776
|
-
@manifestation.set_publishers(@manifestation.publishers)
|
777
|
-
end
|
778
774
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
class SeriesStatementsController < ApplicationController
|
3
3
|
load_and_authorize_resource
|
4
|
-
before_filter :
|
4
|
+
before_filter :get_manifestation, :except => [:create, :update, :destroy]
|
5
5
|
cache_sweeper :page_sweeper, :only => [:create, :update, :destroy]
|
6
6
|
after_filter :solr_commit, :only => [:create, :update, :destroy]
|
7
7
|
if defined?(EnjuResourceMerge)
|
@@ -26,21 +26,10 @@ class SeriesStatementsController < ApplicationController
|
|
26
26
|
end
|
27
27
|
#work = @work
|
28
28
|
manifestation = @manifestation
|
29
|
-
parent = @parent
|
30
|
-
child = @child
|
31
29
|
series_statement_merge_list = @series_statement_merge_list
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
with(:parent_ids).equal_to parent.id if parent
|
36
|
-
with(:child_ids).equal_to child.id if child
|
37
|
-
with(:manifestation_id).equal_to manifestation.id if manifestation
|
38
|
-
with(:series_statement_merge_list_ids).equal_to series_statement_merge_list.id if series_statement_merge_list
|
39
|
-
end
|
40
|
-
else
|
41
|
-
search.build do
|
42
|
-
without(:parent_ids, parent.id) if parent
|
43
|
-
end
|
30
|
+
search.build do
|
31
|
+
with(:manifestation_id).equal_to manifestation.id if manifestation
|
32
|
+
with(:series_statement_merge_list_ids).equal_to series_statement_merge_list.id if series_statement_merge_list
|
44
33
|
end
|
45
34
|
page = params[:page] || 1
|
46
35
|
search.query.paginate(page.to_i, SeriesStatement.default_per_page)
|
@@ -56,18 +45,11 @@ class SeriesStatementsController < ApplicationController
|
|
56
45
|
# GET /series_statements/1
|
57
46
|
# GET /series_statements/1.json
|
58
47
|
def show
|
59
|
-
#@manifestations = @series_statement.manifestations.order('date_of_publication DESC').page(params[:manifestation_page]).per(Manifestation.default_per_page)
|
60
|
-
#store_location
|
61
|
-
|
62
48
|
respond_to do |format|
|
63
|
-
format.html
|
64
|
-
redirect_to series_statement_manifestations_url(@series_statement)
|
65
|
-
}
|
49
|
+
format.html # show.html.erb
|
66
50
|
format.json { render :json => @series_statement }
|
67
51
|
#format.js
|
68
|
-
format.mobile
|
69
|
-
redirect_to series_statement_manifestations_url(@series_statement)
|
70
|
-
}
|
52
|
+
#format.mobile
|
71
53
|
end
|
72
54
|
end
|
73
55
|
|
@@ -75,8 +57,6 @@ class SeriesStatementsController < ApplicationController
|
|
75
57
|
# GET /series_statements/new.json
|
76
58
|
def new
|
77
59
|
@series_statement = SeriesStatement.new
|
78
|
-
@frequencies = Frequency.all
|
79
|
-
@series_statement.parent = @parent_series_statement if @parent_series_statement
|
80
60
|
|
81
61
|
respond_to do |format|
|
82
62
|
format.html # new.html.erb
|
@@ -86,9 +66,6 @@ class SeriesStatementsController < ApplicationController
|
|
86
66
|
|
87
67
|
# GET /series_statements/1/edit
|
88
68
|
def edit
|
89
|
-
@series_statement.work = @work if @work
|
90
|
-
@frequencies = Frequency.all
|
91
|
-
@series_statement.parent = @parent_series_statement if @parent_series_statement
|
92
69
|
end
|
93
70
|
|
94
71
|
# POST /series_statements
|
@@ -140,10 +117,4 @@ class SeriesStatementsController < ApplicationController
|
|
140
117
|
format.json { head :no_content }
|
141
118
|
end
|
142
119
|
end
|
143
|
-
|
144
|
-
private
|
145
|
-
def get_parent_and_child
|
146
|
-
@parent = SeriesStatement.find(params[:parent_id]) if params[:parent_id]
|
147
|
-
@child = SeriesStatement.find(params[:child_id]) if params[:child_id]
|
148
|
-
end
|
149
120
|
end
|
@@ -36,8 +36,7 @@ module EnjuBiblio
|
|
36
36
|
Realize,
|
37
37
|
RealizeType,
|
38
38
|
ResourceImportFile,
|
39
|
-
SeriesStatement
|
40
|
-
SeriesStatementRelationship
|
39
|
+
SeriesStatement
|
41
40
|
]
|
42
41
|
can :update, [
|
43
42
|
ContentType,
|
@@ -95,8 +94,7 @@ module EnjuBiblio
|
|
95
94
|
Produce,
|
96
95
|
Realize,
|
97
96
|
ResourceImportFile,
|
98
|
-
SeriesStatement
|
99
|
-
SeriesStatementRelationship
|
97
|
+
SeriesStatement
|
100
98
|
]
|
101
99
|
can :read, [
|
102
100
|
CarrierType,
|
data/app/models/manifestation.rb
CHANGED
@@ -513,35 +513,22 @@ class Manifestation < ActiveRecord::Base
|
|
513
513
|
}.compact
|
514
514
|
end
|
515
515
|
|
516
|
-
def set_creators(creators = [])
|
517
|
-
self.creators = set_patrons(creators)
|
518
|
-
end
|
519
|
-
|
520
|
-
def set_contributors(contributors = [])
|
521
|
-
self.contributors = set_patrons(contributors)
|
522
|
-
end
|
523
|
-
|
524
|
-
def set_publishers(publishers = [])
|
525
|
-
self.publishers = set_patrons(publishers)
|
526
|
-
end
|
527
|
-
|
528
516
|
def self.import_isbn(isbn)
|
529
517
|
manifestation = Manifestation.import_from_ndl_search(:isbn => isbn) if defined?(EnjuNdl)
|
530
518
|
#manifestation = Manifestation.import_from_cinii_books(:isbn => isbn) if defined?(EnjuNii)
|
531
519
|
manifestation
|
532
520
|
end
|
533
521
|
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
522
|
+
def latest_issue
|
523
|
+
if series_master?
|
524
|
+
derived_manifestations.where('date_of_publication IS NOT NULL').order('date_of_publication DESC').first
|
525
|
+
end
|
526
|
+
end
|
527
|
+
|
528
|
+
def first_issue
|
529
|
+
if series_master?
|
530
|
+
derived_manifestations.where('date_of_publication IS NOT NULL').order('date_of_publication DESC').first
|
543
531
|
end
|
544
|
-
new_patrons
|
545
532
|
end
|
546
533
|
end
|
547
534
|
|
@@ -549,75 +536,71 @@ end
|
|
549
536
|
#
|
550
537
|
# Table name: manifestations
|
551
538
|
#
|
552
|
-
# id
|
553
|
-
# original_title
|
554
|
-
# title_alternative
|
555
|
-
# title_transcription
|
556
|
-
# classification_number
|
557
|
-
# manifestation_identifier
|
558
|
-
# date_of_publication
|
559
|
-
# date_copyrighted
|
560
|
-
# created_at
|
561
|
-
# updated_at
|
562
|
-
# deleted_at
|
563
|
-
# access_address
|
564
|
-
# language_id
|
565
|
-
# carrier_type_id
|
566
|
-
# extent_id
|
567
|
-
# start_page
|
568
|
-
# end_page
|
569
|
-
# height
|
570
|
-
# width
|
571
|
-
# depth
|
572
|
-
# isbn
|
573
|
-
# isbn10
|
574
|
-
# wrong_isbn
|
575
|
-
# nbn
|
576
|
-
# lccn
|
577
|
-
# oclc_number
|
578
|
-
# issn
|
579
|
-
# price
|
580
|
-
# fulltext
|
581
|
-
# volume_number_string
|
582
|
-
# issue_number_string
|
583
|
-
# serial_number_string
|
584
|
-
# edition
|
585
|
-
# note
|
586
|
-
# repository_content
|
587
|
-
# lock_version
|
588
|
-
# required_role_id
|
589
|
-
# state
|
590
|
-
# required_score
|
591
|
-
# frequency_id
|
592
|
-
# subscription_master
|
593
|
-
# attachment_file_name
|
594
|
-
# attachment_content_type
|
595
|
-
# attachment_file_size
|
596
|
-
# attachment_updated_at
|
597
|
-
# title_alternative_transcription
|
598
|
-
# description
|
599
|
-
# abstract
|
600
|
-
# available_at
|
601
|
-
# valid_until
|
602
|
-
# date_submitted
|
603
|
-
# date_accepted
|
604
|
-
# date_caputured
|
605
|
-
# pub_date
|
606
|
-
# edition_string
|
607
|
-
# volume_number
|
608
|
-
# issue_number
|
609
|
-
# serial_number
|
610
|
-
# ndc
|
611
|
-
# content_type_id
|
612
|
-
# year_of_publication
|
613
|
-
# attachment_meta
|
614
|
-
# month_of_publication
|
615
|
-
# fulltext_content
|
616
|
-
# doi
|
617
|
-
# periodical
|
618
|
-
# series_original_title :text
|
619
|
-
# series_title_transcription :text
|
620
|
-
# series_title_creator_string :text
|
621
|
-
# series_title_volume_number_string :text
|
539
|
+
# id :integer not null, primary key
|
540
|
+
# original_title :text not null
|
541
|
+
# title_alternative :text
|
542
|
+
# title_transcription :text
|
543
|
+
# classification_number :string(255)
|
544
|
+
# manifestation_identifier :string(255)
|
545
|
+
# date_of_publication :datetime
|
546
|
+
# date_copyrighted :datetime
|
547
|
+
# created_at :datetime not null
|
548
|
+
# updated_at :datetime not null
|
549
|
+
# deleted_at :datetime
|
550
|
+
# access_address :string(255)
|
551
|
+
# language_id :integer default(1), not null
|
552
|
+
# carrier_type_id :integer default(1), not null
|
553
|
+
# extent_id :integer default(1), not null
|
554
|
+
# start_page :integer
|
555
|
+
# end_page :integer
|
556
|
+
# height :integer
|
557
|
+
# width :integer
|
558
|
+
# depth :integer
|
559
|
+
# isbn :string(255)
|
560
|
+
# isbn10 :string(255)
|
561
|
+
# wrong_isbn :string(255)
|
562
|
+
# nbn :string(255)
|
563
|
+
# lccn :string(255)
|
564
|
+
# oclc_number :string(255)
|
565
|
+
# issn :string(255)
|
566
|
+
# price :integer
|
567
|
+
# fulltext :text
|
568
|
+
# volume_number_string :string(255)
|
569
|
+
# issue_number_string :string(255)
|
570
|
+
# serial_number_string :string(255)
|
571
|
+
# edition :integer
|
572
|
+
# note :text
|
573
|
+
# repository_content :boolean default(FALSE), not null
|
574
|
+
# lock_version :integer default(0), not null
|
575
|
+
# required_role_id :integer default(1), not null
|
576
|
+
# state :string(255)
|
577
|
+
# required_score :integer default(0), not null
|
578
|
+
# frequency_id :integer default(1), not null
|
579
|
+
# subscription_master :boolean default(FALSE), not null
|
580
|
+
# attachment_file_name :string(255)
|
581
|
+
# attachment_content_type :string(255)
|
582
|
+
# attachment_file_size :integer
|
583
|
+
# attachment_updated_at :datetime
|
584
|
+
# title_alternative_transcription :text
|
585
|
+
# description :text
|
586
|
+
# abstract :text
|
587
|
+
# available_at :datetime
|
588
|
+
# valid_until :datetime
|
589
|
+
# date_submitted :datetime
|
590
|
+
# date_accepted :datetime
|
591
|
+
# date_caputured :datetime
|
592
|
+
# pub_date :string(255)
|
593
|
+
# edition_string :string(255)
|
594
|
+
# volume_number :integer
|
595
|
+
# issue_number :integer
|
596
|
+
# serial_number :integer
|
597
|
+
# ndc :string(255)
|
598
|
+
# content_type_id :integer default(1)
|
599
|
+
# year_of_publication :integer
|
600
|
+
# attachment_meta :text
|
601
|
+
# month_of_publication :integer
|
602
|
+
# fulltext_content :boolean
|
603
|
+
# doi :string(255)
|
604
|
+
# periodical :boolean
|
622
605
|
#
|
623
606
|
|
@@ -1,19 +1,15 @@
|
|
1
1
|
class SeriesStatement < ActiveRecord::Base
|
2
2
|
attr_accessible :original_title, :numbering, :title_subseries,
|
3
3
|
:numbering_subseries, :title_transcription, :title_alternative,
|
4
|
-
:series_statement_identifier, :note,
|
5
|
-
:root_manifestation_id,
|
4
|
+
:series_statement_identifier, :note,
|
5
|
+
:root_manifestation_id, :url,
|
6
6
|
:title_subseries_transcription, :creator_string, :volume_number_string
|
7
|
-
attr_accessible :
|
7
|
+
attr_accessible :series_master
|
8
8
|
|
9
9
|
belongs_to :manifestation
|
10
10
|
belongs_to :root_manifestation, :foreign_key => :root_manifestation_id, :class_name => 'Manifestation'
|
11
|
-
has_many :child_relationships, :foreign_key => 'parent_id', :class_name => 'SeriesStatementRelationship', :dependent => :destroy
|
12
|
-
has_many :parent_relationships, :foreign_key => 'child_id', :class_name => 'SeriesStatementRelationship', :dependent => :destroy
|
13
|
-
has_many :children, :through => :child_relationships, :source => :child
|
14
|
-
has_many :parents, :through => :parent_relationships, :source => :parent
|
15
|
-
belongs_to :frequency
|
16
11
|
validates_presence_of :original_title
|
12
|
+
before_save :create_root_series_statement
|
17
13
|
|
18
14
|
acts_as_list
|
19
15
|
searchable do
|
@@ -24,12 +20,6 @@ class SeriesStatement < ActiveRecord::Base
|
|
24
20
|
integer :manifestation_id
|
25
21
|
integer :position
|
26
22
|
integer :series_statement_merge_list_ids, :multiple => true if defined?(EnjuResourceMerge)
|
27
|
-
integer :parent_ids, :multiple => true do
|
28
|
-
parents.pluck('series_statements.id')
|
29
|
-
end
|
30
|
-
integer :child_ids, :multiple => true do
|
31
|
-
children.pluck('series_statements.id')
|
32
|
-
end
|
33
23
|
end
|
34
24
|
|
35
25
|
attr_accessor :selected
|
@@ -40,10 +30,14 @@ class SeriesStatement < ActiveRecord::Base
|
|
40
30
|
def titles
|
41
31
|
[
|
42
32
|
original_title,
|
43
|
-
title_transcription
|
44
|
-
|
45
|
-
|
46
|
-
|
33
|
+
title_transcription
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_root_series_statement
|
38
|
+
if series_master? and root_manifestation.nil?
|
39
|
+
self.root_manifestation = manifestation
|
40
|
+
end
|
47
41
|
end
|
48
42
|
|
49
43
|
if defined?(EnjuResourceMerge)
|
@@ -74,5 +68,6 @@ end
|
|
74
68
|
# volume_number_string :text
|
75
69
|
# volume_number_transcription_string :text
|
76
70
|
# series_master :boolean
|
71
|
+
# root_manifestation_id :integer
|
77
72
|
#
|
78
73
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<ul>
|
2
|
+
<li>
|
3
|
+
<%= link_to t('page.edit'), edit_manifestation_path(@manifestation) -%>
|
4
|
+
</li>
|
5
|
+
<li><%= link_to t('manifestation.edit_item'), manifestation_items_path(@manifestation) -%></li>
|
6
|
+
<li><%= link_to t('manifestation.add_derivation'), manifestations_path(:parent_id => @manifestation.id, :mode => 'add') -%></li>
|
7
|
+
<% if can? :delete, @manifestation %>
|
8
|
+
<li><%= link_to t('page.destroy'), @manifestation, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
@@ -16,16 +16,38 @@
|
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<div class="field">
|
19
|
-
<%= f.label :periodical
|
19
|
+
<%= f.label :periodical %>
|
20
20
|
<%= f.check_box :periodical %>
|
21
21
|
</div>
|
22
22
|
|
23
|
+
<div class="field">
|
24
|
+
<%= f.label :edition_string -%>
|
25
|
+
<%= f.text_field :edition_string %>
|
26
|
+
<%= f.label :edition -%>
|
27
|
+
<%= f.text_field :edition, :class => 'resource_integer' -%>
|
28
|
+
<br />
|
29
|
+
<%= f.label :volume_number_string -%>
|
30
|
+
<%= f.text_field :volume_number_string %>
|
31
|
+
<%= f.label :volume_number -%>
|
32
|
+
<%= f.text_field :volume_number, :class => 'resource_integer' -%>
|
33
|
+
<br />
|
34
|
+
<%= f.label :issue_number_string -%>
|
35
|
+
<%= f.text_field :issue_number_string %>
|
36
|
+
<%= f.label :issue_number -%>
|
37
|
+
<%= f.text_field :issue_number, :class => 'resource_integer' -%>
|
38
|
+
<br />
|
39
|
+
<%= f.label :serial_number -%>
|
40
|
+
<%= f.text_field :serial_number, :class => 'resource_integer' -%>
|
41
|
+
</div>
|
42
|
+
|
23
43
|
<div class="field">
|
24
44
|
<%= f.label :series_statement_string -%><br />
|
25
45
|
<%= f.fields_for :series_statements do |series_form| %>
|
26
46
|
<%= f.label :original_title %><br />
|
27
|
-
<%= series_form.text_field :original_title %>
|
47
|
+
<%= series_form.text_field :original_title, :class => 'resource_title' %>
|
28
48
|
<%= series_form.link_to_remove t('page.remove'), :confirm => t('page.are_you_sure') %><br />
|
49
|
+
<%= f.label :title_transcription %><br />
|
50
|
+
<%= series_form.text_field :title_transcription, :class => 'resource_title' %><br />
|
29
51
|
<%= f.label :volume_number_string %><br />
|
30
52
|
<%= series_form.text_field :volume_number_string %><br />
|
31
53
|
<%= f.label :creator_string %><br />
|
@@ -63,33 +85,20 @@
|
|
63
85
|
<p><%= f.link_to_add t('page.add'), :publishers %></p>
|
64
86
|
</div>
|
65
87
|
|
66
|
-
|
67
|
-
<%=
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<%= f.text_field :edition, :class => 'resource_integer' -%>
|
74
|
-
<br />
|
75
|
-
<%= f.label :volume_number_string -%>
|
76
|
-
<%= f.text_field :volume_number_string %>
|
77
|
-
<%= f.label :volume_number -%>
|
78
|
-
<%= f.text_field :volume_number, :class => 'resource_integer' -%>
|
79
|
-
</div>
|
80
|
-
<% end %>
|
81
|
-
|
82
|
-
<div class="field">
|
83
|
-
<%= f.label t('page.file') -%><br />
|
88
|
+
<div class="field">
|
89
|
+
<%= f.label :pub_date -%>
|
90
|
+
<%= f.text_field :pub_date, :class => 'date_field', :placeholder => "#{t('page.example')}: 2011, 2011-04-12"-%>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div class="field">
|
94
|
+
<%= f.label t('page.file') -%>
|
84
95
|
<%= f.file_field :attachment -%>
|
85
96
|
</div>
|
86
97
|
|
87
98
|
<div class="field">
|
88
99
|
<%= f.label t('activerecord.models.content_type') -%>
|
89
100
|
<%= f.select(:content_type_id, @content_types.collect{|c| [c.display_name.localize, c.id]}) -%>
|
90
|
-
</div>
|
91
101
|
|
92
|
-
<div class="field">
|
93
102
|
<%= f.label t('activerecord.models.carrier_type') -%>
|
94
103
|
<%= f.select(:carrier_type_id, @carrier_types.collect{|c| [c.display_name.localize, c.id]}) -%>
|
95
104
|
<!-- TODO: Formの切り替え時に入力項目をAjaxで書き換える -->
|
@@ -98,14 +107,7 @@
|
|
98
107
|
<div class="field">
|
99
108
|
<%= f.label t('activerecord.models.frequency') -%>
|
100
109
|
<%= f.select(:frequency_id, @frequencies.collect{|frequency| [frequency.display_name.localize, frequency.id]}) -%>
|
101
|
-
</div>
|
102
|
-
|
103
|
-
<div class="field">
|
104
|
-
<%= f.label :pub_date -%>
|
105
|
-
<%= f.text_field :pub_date, :class => 'date_field', :placeholder => "#{t('page.example')}: 2011, 2011-04-12"-%>
|
106
|
-
</div>
|
107
110
|
|
108
|
-
<div class="field">
|
109
111
|
<%= f.label t('activerecord.models.language') -%>
|
110
112
|
<%= f.select(:language_id, @languages.collect{|language| [language.display_name.localize, language.id]}) -%>
|
111
113
|
</div>
|
@@ -119,15 +121,28 @@
|
|
119
121
|
<div class="field">
|
120
122
|
<%= f.label :lccn -%>
|
121
123
|
<%= f.text_field :lccn, :class => 'resource_isbn_issn', :style => 'ime-mode: disabled' -%>
|
122
|
-
|
123
|
-
|
124
|
-
|
124
|
+
<%= f.label :issn -%>
|
125
|
+
<%= f.text_field :issn, :class => 'resource_isbn_issn', :style => 'ime-mode: disabled' -%>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div class="field">
|
129
|
+
<%= f.label :subject -%><br />
|
130
|
+
<%= f.fields_for :subjects do |subject_form| %>
|
131
|
+
<%= subject_form.text_field :term %>
|
132
|
+
<%= subject_form.select(:subject_type_id, @subject_types.collect{|s| [s.display_name.localize, s.id]}) %>
|
133
|
+
<%= subject_form.link_to_remove t('page.remove'), :confirm => t('page.are_you_sure') %>
|
125
134
|
<% end %>
|
135
|
+
<p><%= f.link_to_add t('page.add'), :subjects %></p>
|
126
136
|
</div>
|
127
137
|
|
128
138
|
<div class="field">
|
129
|
-
<%= f.label :
|
130
|
-
<%= f.
|
139
|
+
<%= f.label :classification -%><br />
|
140
|
+
<%= f.fields_for :classifications do |classification_form| %>
|
141
|
+
<%= classification_form.select(:classification_type_id, @classification_types.collect{|c| [c.display_name.localize, c.id]}) %>
|
142
|
+
<%= classification_form.text_field :category %>
|
143
|
+
<%= classification_form.link_to_remove t('page.remove'), :confirm => t('page.are_you_sure') %>
|
144
|
+
<% end %>
|
145
|
+
<p><%= f.link_to_add t('page.add'), :classifications %></p>
|
131
146
|
</div>
|
132
147
|
|
133
148
|
<div class="field">
|