enju_trunk_subject 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +36 -0
- data/app/controllers/classification_types_controller.rb +13 -0
- data/app/controllers/classifications_controller.rb +114 -0
- data/app/controllers/subject_has_classifications_controller.rb +97 -0
- data/app/controllers/subject_heading_type_has_subjects_controller.rb +80 -0
- data/app/controllers/subject_heading_types_controller.rb +13 -0
- data/app/controllers/subject_types_controller.rb +13 -0
- data/app/controllers/subjects_controller.rb +216 -0
- data/app/controllers/work_has_subjects_controller.rb +107 -0
- data/app/models/classification.rb +89 -0
- data/app/models/classification_type.rb +20 -0
- data/app/models/enju_subject/ability.rb +55 -0
- data/app/models/subject.rb +100 -0
- data/app/models/subject_has_classification.rb +37 -0
- data/app/models/subject_heading_type.rb +21 -0
- data/app/models/subject_heading_type_has_subject.rb +22 -0
- data/app/models/subject_type.rb +20 -0
- data/app/models/work_has_subject.rb +35 -0
- data/app/views/classification_types/_form.html.erb +19 -0
- data/app/views/classification_types/edit.html.erb +13 -0
- data/app/views/classification_types/index.html.erb +45 -0
- data/app/views/classification_types/new.html.erb +12 -0
- data/app/views/classification_types/show.html.erb +30 -0
- data/app/views/classifications/_form.html.erb +27 -0
- data/app/views/classifications/edit.html.erb +13 -0
- data/app/views/classifications/index.html.erb +54 -0
- data/app/views/classifications/new.html.erb +12 -0
- data/app/views/classifications/show.html.erb +34 -0
- data/app/views/manifestations/_classification_detail.html.erb +14 -0
- data/app/views/manifestations/_subject_detail.html.erb +14 -0
- data/app/views/manifestations/_subject_facet.html.erb +18 -0
- data/app/views/manifestations/_subject_form.html.erb +21 -0
- data/app/views/subject_has_classifications/edit.html.erb +30 -0
- data/app/views/subject_has_classifications/index.html.erb +38 -0
- data/app/views/subject_has_classifications/new.html.erb +32 -0
- data/app/views/subject_has_classifications/show.html.erb +22 -0
- data/app/views/subject_heading_type_has_subjects/edit.html.erb +28 -0
- data/app/views/subject_heading_type_has_subjects/index.html.erb +30 -0
- data/app/views/subject_heading_type_has_subjects/new.html.erb +27 -0
- data/app/views/subject_heading_type_has_subjects/show.html.erb +23 -0
- data/app/views/subject_heading_types/_form.html.erb +19 -0
- data/app/views/subject_heading_types/edit.html.erb +13 -0
- data/app/views/subject_heading_types/index.html.erb +43 -0
- data/app/views/subject_heading_types/new.html.erb +12 -0
- data/app/views/subject_heading_types/show.html.erb +27 -0
- data/app/views/subject_types/_form.html.erb +19 -0
- data/app/views/subject_types/edit.html.erb +13 -0
- data/app/views/subject_types/index.html.erb +43 -0
- data/app/views/subject_types/new.html.erb +12 -0
- data/app/views/subject_types/show.html.erb +29 -0
- data/app/views/subjects/_form.html.erb +42 -0
- data/app/views/subjects/_index.html.erb +48 -0
- data/app/views/subjects/_index_classification.html.erb +57 -0
- data/app/views/subjects/_index_work.html.erb +60 -0
- data/app/views/subjects/_show_work_list.html.erb +15 -0
- data/app/views/subjects/edit.html.erb +13 -0
- data/app/views/subjects/index.atom.builder +10 -0
- data/app/views/subjects/index.html.erb +7 -0
- data/app/views/subjects/index.rss.builder +29 -0
- data/app/views/subjects/new.html.erb +12 -0
- data/app/views/subjects/show.html.erb +69 -0
- data/app/views/subjects/show.js.erb +1 -0
- data/app/views/work_has_subjects/_form.html.erb +24 -0
- data/app/views/work_has_subjects/edit.html.erb +29 -0
- data/app/views/work_has_subjects/index.html.erb +31 -0
- data/app/views/work_has_subjects/new.html.erb +42 -0
- data/app/views/work_has_subjects/show.html.erb +25 -0
- data/config/locales/translation_en.yml +35 -0
- data/config/locales/translation_ja.yml +39 -0
- data/config/routes.rb +7 -0
- data/db/fixtures/classification_types.yml +7 -0
- data/db/fixtures/subject_types.yml +28 -0
- data/db/migrate/029_create_subjects.rb +28 -0
- data/db/migrate/142_create_classifications.rb +19 -0
- data/db/migrate/144_create_classification_types.rb +16 -0
- data/db/migrate/145_create_subject_heading_types.rb +16 -0
- data/db/migrate/146_create_subject_types.rb +16 -0
- data/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
- data/db/migrate/20140427142354_add_classifiation_identifier_to_classification.rb +6 -0
- data/lib/enju_subject.rb +33 -0
- data/lib/enju_subject/engine.rb +8 -0
- data/lib/enju_subject/manifestation.rb +31 -0
- data/lib/enju_subject/master_model.rb +41 -0
- data/lib/enju_subject/version.rb +3 -0
- data/lib/generators/enju_subject/setup/USAGE +8 -0
- data/lib/generators/enju_subject/setup/setup_generator.rb +10 -0
- data/lib/generators/enju_subject/setup/templates/db/fixtures/classification_types.yml +13 -0
- data/lib/generators/enju_subject/setup/templates/db/fixtures/subject_heading_types.yml +39 -0
- data/lib/generators/enju_subject/setup/templates/db/fixtures/subject_types.yml +28 -0
- data/lib/tasks/enju_subject_tasks.rake +19 -0
- data/spec/controllers/classification_types_controller_spec.rb +445 -0
- data/spec/controllers/classifications_controller_spec.rb +441 -0
- data/spec/controllers/subject_heading_types_controller_spec.rb +445 -0
- data/spec/controllers/subject_types_controller_spec.rb +447 -0
- data/spec/controllers/subjects_controller_spec.rb +437 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +47 -0
- data/spec/dummy/app/helpers/application_helper.rb +21 -0
- data/spec/dummy/app/models/ability.rb +59 -0
- data/spec/dummy/app/models/setting.rb +4 -0
- data/spec/dummy/app/models/user.rb +43 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +46 -0
- data/spec/dummy/config/application.yml +38 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +207 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/devise.en.yml +57 -0
- data/spec/dummy/config/locales/en.yml +18 -0
- data/spec/dummy/config/locales/ja.yml +18 -0
- data/spec/dummy/config/routes.rb +60 -0
- data/spec/dummy/db/fixtures/roles.yml +25 -0
- data/spec/dummy/db/migrate/001_create_agents.rb +53 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +56 -0
- data/spec/dummy/db/migrate/006_create_items.rb +24 -0
- data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
- data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
- data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +28 -0
- data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
- data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
- data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +18 -0
- data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
- data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
- data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
- data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
- data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +13 -0
- data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +12 -0
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
- data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +22 -0
- data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
- data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
- data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
- data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
- data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +15 -0
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
- data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
- data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
- data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
- data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
- data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
- data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +9 -0
- data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
- data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +9 -0
- data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
- data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +13 -0
- data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +13 -0
- data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
- data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
- data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
- data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
- data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
- data/spec/dummy/db/migrate/20111201155456_create_users.rb +8 -0
- data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +49 -0
- data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +14 -0
- data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
- data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +26 -0
- data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
- data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
- data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +12 -0
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +15 -0
- data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
- data/spec/dummy/db/schema.rb +901 -0
- data/spec/dummy/db/seeds.rb +32 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/fixtures/subjects.yml +72 -0
- data/spec/dummy/test/fixtures/user_groups.yml +13 -0
- data/spec/dummy/test/fixtures/user_has_roles.yml +9 -0
- data/spec/dummy/test/fixtures/users.yml +11 -0
- data/spec/dummy/test/unit/user_group_test.rb +7 -0
- data/spec/dummy/test/unit/user_has_role_test.rb +7 -0
- data/spec/dummy/test/unit/user_test.rb +7 -0
- data/spec/factories/classification.rb +6 -0
- data/spec/factories/classification_type.rb +5 -0
- data/spec/factories/manifestation.rb +6 -0
- data/spec/factories/subject.rb +7 -0
- data/spec/factories/subject_heading_type.rb +5 -0
- data/spec/factories/subject_heading_type_has_subject.rb +6 -0
- data/spec/factories/subject_type.rb +5 -0
- data/spec/factories/user.rb +34 -0
- data/spec/fixtures/agent_types.yml +35 -0
- data/spec/fixtures/agents.yml +143 -0
- data/spec/fixtures/carrier_types.yml +51 -0
- data/spec/fixtures/classification_types.yml +188 -0
- data/spec/fixtures/classifications.yml +118 -0
- data/spec/fixtures/languages.yml +1901 -0
- data/spec/fixtures/library_groups.yml +33 -0
- data/spec/fixtures/manifestations.yml +22 -0
- data/spec/fixtures/roles.yml +21 -0
- data/spec/fixtures/shtsv.tsv +3 -0
- data/spec/fixtures/subject_heading_types.yml +39 -0
- data/spec/fixtures/subject_types.yml +42 -0
- data/spec/fixtures/subjects.yml +80 -0
- data/spec/fixtures/user_groups.yml +25 -0
- data/spec/fixtures/user_has_roles.yml +41 -0
- data/spec/fixtures/users.yml +69 -0
- data/spec/models/classification_spec.rb +46 -0
- data/spec/models/classification_type_spec.rb +21 -0
- data/spec/models/subject_heading_type_spec.rb +21 -0
- data/spec/models/subject_spec.rb +33 -0
- data/spec/models/subject_type_spec.rb +21 -0
- data/spec/requests/subjects_spec.rb +9 -0
- data/spec/routing/subject_heading_types_routing_spec.rb +35 -0
- data/spec/routing/subject_types_routing_spec.rb +35 -0
- data/spec/routing/subjects_routing_spec.rb +35 -0
- data/spec/spec_helper.rb +45 -0
- data/spec/support/controller_macros.rb +48 -0
- data/spec/support/devise.rb +3 -0
- metadata +675 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
class SubjectType < ActiveRecord::Base
|
2
|
+
attr_accessible :name, :display_name, :note
|
3
|
+
include MasterModel
|
4
|
+
default_scope :order => "position"
|
5
|
+
has_many :subjects
|
6
|
+
end
|
7
|
+
|
8
|
+
# == Schema Information
|
9
|
+
#
|
10
|
+
# Table name: subject_types
|
11
|
+
#
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string(255) not null
|
14
|
+
# display_name :text
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
#
|
20
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class WorkHasSubject < ActiveRecord::Base
|
2
|
+
attr_accessible :subject_id, :work_id, :position
|
3
|
+
|
4
|
+
has_paper_trail
|
5
|
+
|
6
|
+
belongs_to :subject
|
7
|
+
belongs_to :work, :class_name => 'Manifestation'
|
8
|
+
|
9
|
+
validates_presence_of :work, :subject #, :subject_type
|
10
|
+
validates_associated :work, :subject
|
11
|
+
validates_uniqueness_of :subject_id, :scope => :work_id
|
12
|
+
after_save :reindex
|
13
|
+
after_destroy :reindex
|
14
|
+
|
15
|
+
acts_as_list :scope => :work_id
|
16
|
+
|
17
|
+
def reindex
|
18
|
+
work.try(:index)
|
19
|
+
subject.try(:index)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# == Schema Information
|
24
|
+
#
|
25
|
+
# Table name: work_has_subjects
|
26
|
+
#
|
27
|
+
# id :integer not null, primary key
|
28
|
+
# subject_id :integer
|
29
|
+
# subject_type :string(255)
|
30
|
+
# work_id :integer
|
31
|
+
# position :integer
|
32
|
+
# created_at :datetime
|
33
|
+
# updated_at :datetime
|
34
|
+
#
|
35
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= form_for(@classification_type) do |f| %>
|
2
|
+
<%= f.error_messages %>
|
3
|
+
|
4
|
+
<div class="field">
|
5
|
+
<%= f.label :name %><br />
|
6
|
+
<%= f.text_field :name, :class => 'short_name' %>
|
7
|
+
</div>
|
8
|
+
<div class="field">
|
9
|
+
<%= f.label :display_name %><br />
|
10
|
+
<%= f.text_area :display_name, :class => 'resource_textarea' %>
|
11
|
+
</div>
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :note %><br />
|
14
|
+
<%= f.text_area :note, :class => 'resource_textarea' %>
|
15
|
+
</div>
|
16
|
+
<div class="actions">
|
17
|
+
<%= f.submit %>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.classification_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<%= render 'form' %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="submenu" class="ui-corner-all">
|
9
|
+
<ul>
|
10
|
+
<li><%= link_to t('page.show'), @classification_type -%></li>
|
11
|
+
<li><%= link_to t('page.back'), classification_types_path -%></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.classification_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<table class="table table-striped index">
|
6
|
+
<tr>
|
7
|
+
<th id="position"></th>
|
8
|
+
<th><%= t('activerecord.attributes.classification_type.name') -%></th>
|
9
|
+
<th><%= t('activerecord.attributes.classification_type.display_name') -%></th>
|
10
|
+
<th><%= t('activerecord.attributes.classification_type.note') -%></th>
|
11
|
+
<th></th>
|
12
|
+
</tr>
|
13
|
+
|
14
|
+
<%- @classification_types.each do |classification_type| -%>
|
15
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
16
|
+
<td>
|
17
|
+
<%- if can? :update, classification_type -%>
|
18
|
+
<%= move_position(classification_type) -%>
|
19
|
+
<%- end -%>
|
20
|
+
</td>
|
21
|
+
<td><%= link_to classification_type.name, classification_type -%></td>
|
22
|
+
<td><%= link_to classification_type.display_name.localize, classification_type -%></td>
|
23
|
+
<td><%= classification_type.note -%></td>
|
24
|
+
<td>
|
25
|
+
<%- if can? :update, classification_type -%>
|
26
|
+
<%= link_to t('page.edit'), edit_classification_type_path(classification_type) -%>
|
27
|
+
<% end %>
|
28
|
+
<%- if can? :destroy, classification_type -%>
|
29
|
+
<%= link_to t('page.destroy'), classification_type, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
30
|
+
<%- end -%>
|
31
|
+
</td>
|
32
|
+
</tr>
|
33
|
+
<%- end -%>
|
34
|
+
</table>
|
35
|
+
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="submenu" class="ui-corner-all">
|
40
|
+
<ul>
|
41
|
+
<%- if can? :create, ClassificationType -%>
|
42
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.classification_type')), new_classification_type_path -%></li>
|
43
|
+
<%- end -%>
|
44
|
+
</ul>
|
45
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.new', :model => t('activerecord.models.classification_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<%= render 'form' %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="submenu" class="ui-corner-all">
|
9
|
+
<ul>
|
10
|
+
<li><%= link_to t('page.back'), classification_types_path -%></li>
|
11
|
+
</ul>
|
12
|
+
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.classification_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong><%= t('activerecord.attributes.classification_type.name') -%>:</strong>
|
8
|
+
<%= @classification_type.name -%>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong><%= t('activerecord.attributes.classification_type.display_name') -%>:</strong>
|
13
|
+
<%= @classification_type.display_name.localize -%>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<strong><%= t('activerecord.attributes.classification_type.note') -%>:</strong>
|
18
|
+
<%= @classification_type.note -%>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div id="submenu" class="ui-corner-all">
|
25
|
+
<ul>
|
26
|
+
<li><%= link_to t('page.listing', :model => t('activerecord.models.classification')), classification_type_classifications_path(@classification_type) -%></li>
|
27
|
+
<li><%= link_to t('page.edit'), edit_classification_type_path(@classification_type) -%></li>
|
28
|
+
<li><%= back_to_index(flash[:page_info]) -%></li>
|
29
|
+
</ul>
|
30
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= form_for(@classification) do |f| -%>
|
2
|
+
<%= f.error_messages -%>
|
3
|
+
|
4
|
+
<div class="field">
|
5
|
+
<%= f.label :classifiation_identifier -%><br />
|
6
|
+
<%= f.text_field :classifiation_identifier, :autofocus => true -%>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="field">
|
10
|
+
<%= f.label :category -%><br />
|
11
|
+
<%= f.text_field :category -%>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :note -%><br />
|
16
|
+
<%= f.text_area :note, :class => 'resource_textarea' -%>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label t('activerecord.models.classification_type') -%><br />
|
21
|
+
<%= f.select(:classification_type_id, @classification_types.collect{|c| [c.display_name, c.id]}) -%>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="actions">
|
25
|
+
<%= f.submit -%>
|
26
|
+
</div>
|
27
|
+
<%- end -%>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.classification')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<%= render 'form' %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="submenu" class="ui-corner-all">
|
9
|
+
<ul>
|
10
|
+
<li><%= link_to t('page.show'), @classification -%></li>
|
11
|
+
<li><%= link_to t('page.back'), classifications_path -%></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.classification')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<div class="search_form">
|
6
|
+
<%= form_for :classifications, :url => classifications_path, :html => {:method => 'get'} do -%>
|
7
|
+
<p>
|
8
|
+
<%= t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
|
9
|
+
<%= submit_tag t('page.search') -%>
|
10
|
+
</p>
|
11
|
+
<%- end -%>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<table class="table table-striped index">
|
15
|
+
<tr>
|
16
|
+
<th><%= t('activerecord.attributes.classification.category') -%></th>
|
17
|
+
<th><%= t('activerecord.attributes.classification.note') -%></th>
|
18
|
+
<th><%= t('activerecord.attributes.classification.classifiation_identifier') -%></th>
|
19
|
+
<th><%= t('activerecord.models.classification_type') -%></th>
|
20
|
+
<th></th>
|
21
|
+
</tr>
|
22
|
+
|
23
|
+
<%- @classifications.each do |classification| -%>
|
24
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
25
|
+
<td><%= link_to classification.category, classification -%></td>
|
26
|
+
<td><%= classification.note -%></td>
|
27
|
+
<td><%= classification.classifiation_identifier -%></td>
|
28
|
+
<td><%= link_to classification.classification_type.display_name.localize, classification.classification_type -%></td>
|
29
|
+
<td>
|
30
|
+
<%- if can? :delete, classification -%>
|
31
|
+
<%= link_to t('page.edit'), edit_classification_path(classification) -%>
|
32
|
+
<%= link_to t('page.destroy'), classification, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
33
|
+
<%- end -%>
|
34
|
+
</td>
|
35
|
+
</tr>
|
36
|
+
<%- end -%>
|
37
|
+
</table>
|
38
|
+
|
39
|
+
<%= paginate(@classifications) -%>
|
40
|
+
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="submenu" class="ui-corner-all">
|
45
|
+
<ul>
|
46
|
+
<%- if can? :create, Classification -%>
|
47
|
+
<%- if @classification_type -%>
|
48
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.classification')), new_classification_type_classification_path(@classification_type) -%></li>
|
49
|
+
<%- else -%>
|
50
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.classification')), new_classification_path -%></li>
|
51
|
+
<%- end -%>
|
52
|
+
<%- end -%>
|
53
|
+
</ul>
|
54
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.new', :model => t('activerecord.models.classification')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<%= render 'form' %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="submenu" class="ui-corner-all">
|
9
|
+
<ul>
|
10
|
+
<li><%= link_to t('page.back'), :back -%></li>
|
11
|
+
</ul>
|
12
|
+
</div>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.classification')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong><%= t('activerecord.attributes.classification.classifiation_identifier') -%>:</strong>
|
8
|
+
<%= @classification.classifiation_identifier %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong><%= t('activerecord.attributes.classification.category') -%>:</strong>
|
13
|
+
<%= @classification.category %>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<strong><%= t('activerecord.attributes.classification.note') -%>:</strong>
|
18
|
+
<%= @classification.note %>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
<p>
|
22
|
+
<strong><%= t('activerecord.models.classification_type') -%>:</strong>
|
23
|
+
<%= link_to @classification.classification_type.display_name.localize, @classification.classification_type %>
|
24
|
+
</p>
|
25
|
+
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div id="submenu" class="ui-corner-all">
|
30
|
+
<ul>
|
31
|
+
<li><%= link_to t('page.edit'), edit_classification_path(@classification) %></li>
|
32
|
+
<li><%= back_to_index(flash[:page_info]) -%></li>
|
33
|
+
</ul>
|
34
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<tr>
|
2
|
+
<td><%= t('activerecord.models.classification') -%>:</td>
|
3
|
+
<td>
|
4
|
+
<%- if manifestation.classifications.exists? -%>
|
5
|
+
<ul>
|
6
|
+
<%- manifestation.classifications.each do |classification| -%>
|
7
|
+
<li>
|
8
|
+
<%= link_to "#{classification.classification_type.display_name.localize}: #{classification.category}", manifestations_path(:query => "classification_sm:#{classification.category}") -%>
|
9
|
+
</li>
|
10
|
+
<%- end -%>
|
11
|
+
</ul>
|
12
|
+
<%- end -%>
|
13
|
+
</td>
|
14
|
+
</tr>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<tr>
|
2
|
+
<td><%= t('activerecord.models.subject') -%>:</td>
|
3
|
+
<td>
|
4
|
+
<%- if manifestation.subjects.exists? -%>
|
5
|
+
<ul>
|
6
|
+
<%- manifestation.subjects.each do |subject| -%>
|
7
|
+
<li>
|
8
|
+
<%= link_to "#{subject.subject_heading_type.display_name.localize}: #{subject.term}", manifestations_path(:query => "subject_sm:\"#{subject.term}\"") -%>
|
9
|
+
</li>
|
10
|
+
<%- end -%>
|
11
|
+
</ul>
|
12
|
+
<%- end -%>
|
13
|
+
</td>
|
14
|
+
</tr>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<h4><%= t('activerecord.models.subject') -%></h4>
|
2
|
+
<%- unless @subject_facet.blank? -%>
|
3
|
+
<ul>
|
4
|
+
<%- @subject_facet[0..19].each do |facet| -%>
|
5
|
+
<%- subject = Subject.where(:id => facet.value).first -%>
|
6
|
+
<%- if subject -%>
|
7
|
+
<li>
|
8
|
+
<%= link_to "#{subject.term} (#{facet.count})", url_for(params.merge(:page => nil, :subject => subject.term, :view => nil, :only_path => true)) -%>
|
9
|
+
</li>
|
10
|
+
<%- end -%>
|
11
|
+
<%- end -%>
|
12
|
+
<%- if @subject_by_term -%>
|
13
|
+
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(:subject => nil, :page => nil, :view => nil, :only_path => true)) -%></li>
|
14
|
+
<%- end -%>
|
15
|
+
</ul>
|
16
|
+
<%- else -%>
|
17
|
+
<p><%= t('page.no_subject') -%></p>
|
18
|
+
<%- end -%>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="field">
|
2
|
+
<%= f.label :subject -%><br />
|
3
|
+
<%= f.fields_for :subjects do |subject_form| %>
|
4
|
+
<%= subject_form.select(:subject_heading_type_id, @subject_heading_types.collect{|s| [s.display_name.localize, s.id]}) %>
|
5
|
+
<%= subject_form.text_field :term %>
|
6
|
+
<%= subject_form.select(:subject_type_id, @subject_types.collect{|s| [s.display_name.localize, s.id]}) %>
|
7
|
+
<%= subject_form.link_to_remove t('page.remove'), :confirm => t('page.are_you_sure') %>
|
8
|
+
<% end %>
|
9
|
+
<p><%= f.link_to_add t('page.add'), :subjects %></p>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :classification -%><br />
|
14
|
+
<%= f.fields_for :classifications do |classification_form| %>
|
15
|
+
<%= classification_form.select(:classification_type_id, @classification_types.collect{|c| [c.display_name.localize, c.id]}) %>
|
16
|
+
<%= classification_form.text_field :category %>
|
17
|
+
<%= classification_form.link_to_remove t('page.remove'), :confirm => t('page.are_you_sure') %>
|
18
|
+
<% end %>
|
19
|
+
<p><%= f.link_to_add t('page.add'), :classifications %></p>
|
20
|
+
</div>
|
21
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.subject_has_classification')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<%= form_for(@subject_has_classification) do |f| -%>
|
6
|
+
<%= f.error_messages -%>
|
7
|
+
<div class="field">
|
8
|
+
<%= f.label t('activerecord.models.subject') -%><br />
|
9
|
+
<%= f.text_field :subject_id -%>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label t('activerecord.models.classification') -%><br />
|
14
|
+
<%= f.text_field :classification_id -%>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="actions">
|
18
|
+
<%= f.submit %>
|
19
|
+
</div>
|
20
|
+
<%- end -%>
|
21
|
+
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div id="submenu" class="ui-corner-all">
|
26
|
+
<ul>
|
27
|
+
<li><%= link_to t('page.show'), @subject_has_classification -%></li>
|
28
|
+
<li><%= link_to t('page.back'), subject_has_classifications_path -%></li>
|
29
|
+
</ul>
|
30
|
+
</div>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.subject_has_classification')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<table class="table table-striped index">
|
6
|
+
<tr>
|
7
|
+
<th><%= t('activerecord.models.subject') -%></th>
|
8
|
+
<th><%= t('activerecord.models.classification') -%></th>
|
9
|
+
<th></th>
|
10
|
+
<th></th>
|
11
|
+
</tr>
|
12
|
+
|
13
|
+
<%- @subject_has_classifications.each do |subject_has_classification| -%>
|
14
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
15
|
+
<td><%= link_to subject_has_classification.subject.term, subject_has_classification.subject -%></td>
|
16
|
+
<td><%= link_to subject_has_classification.classification.category, subject_has_classification.classification -%></td>
|
17
|
+
<td><%= link_to t('page.show'), subject_has_classification -%></td>
|
18
|
+
<td>
|
19
|
+
<% if can? :destroy, subject_has_classification %>
|
20
|
+
<%= link_to t('page.edit'), edit_subject_has_classification_path(subject_has_classification) -%>
|
21
|
+
<%= link_to t('page.destroy'), subject_has_classification, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
22
|
+
<% end %>
|
23
|
+
</td>
|
24
|
+
</tr>
|
25
|
+
<%- end -%>
|
26
|
+
</table>
|
27
|
+
|
28
|
+
<%= paginate(@subject_has_classifications) -%>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div id="submenu" class="ui-corner-all">
|
33
|
+
<!--
|
34
|
+
<ul>
|
35
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.subject_has_classification')), new_subject_has_classification_path -%></li>
|
36
|
+
</ul>
|
37
|
+
-->
|
38
|
+
</div>
|