enju_biblio 0.1.0.pre46 → 0.1.0.pre47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/resource_import_file.rb +21 -1
  3. data/app/views/agents/show.html.erb +1 -1
  4. data/app/views/import_requests/new.html.erb +1 -1
  5. data/app/views/manifestations/_show.mods.builder +3 -3
  6. data/app/views/manifestations/_show.rdf.builder +3 -3
  7. data/app/views/manifestations/_show_holding.html.erb +7 -2
  8. data/lib/enju_biblio/version.rb +1 -1
  9. data/spec/cassette_library/enju_ndl/manifestation.yml +964 -0
  10. data/spec/cassette_library/enju_ndl/ndl_search.yml +2142 -0
  11. data/spec/dummy/config/application.rb +0 -1
  12. data/spec/dummy/private/system/picture_files/pictures/000/000/005/medium/spinner.gif +0 -0
  13. data/spec/dummy/private/system/picture_files/pictures/000/000/005/thumb/spinner.gif +0 -0
  14. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +1 -1
  15. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample2.tsv +1 -1
  16. data/spec/dummy/solr/conf/schema.xml +14 -2
  17. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  18. data/spec/dummy/solr/data/test/index/segments_gf +0 -0
  19. data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
  20. data/spec/fixtures/classification_types.yml +63 -0
  21. data/spec/fixtures/classifications.yml +118 -0
  22. data/spec/models/resource_import_file_spec.rb +11 -8
  23. metadata +12 -37
  24. data/app/assets/javascripts/identifier_types.js +0 -2
  25. data/app/assets/javascripts/identifiers.js +0 -2
  26. data/app/assets/stylesheets/identifier_types.css +0 -4
  27. data/app/assets/stylesheets/identifiers.css +0 -4
  28. data/app/assets/stylesheets/scaffold.css +0 -56
  29. data/app/helpers/identifier_types_helper.rb +0 -2
  30. data/app/helpers/identifiers_helper.rb +0 -2
  31. data/spec/dummy/db/development.sqlite3 +0 -0
  32. data/spec/dummy/db/test.sqlite3 +0 -0
  33. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_delete_file.tsv +0 -8
  34. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample1.tsv +0 -5
  35. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample2.tsv +0 -8
  36. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample3.tsv +0 -5
  37. data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_update_file.tsv +0 -3
  38. data/spec/dummy/private/system/patron_import_files/patron_imports/000/000/004/original/patron_import_file_sample2.tsv +0 -8
  39. data/spec/dummy/public/system/picture_files/pictures/000/000/005/medium/spinner.gif +0 -0
  40. data/spec/dummy/public/system/picture_files/pictures/000/000/005/original/spinner.gif +0 -0
  41. data/spec/dummy/public/system/picture_files/pictures/000/000/005/thumb/spinner.gif +0 -0
  42. data/spec/dummy/solr/data/test/index/segments_qn2 +0 -0
  43. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  44. data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c9f724ae9bc949082a242108f0b9763eca797c1
4
- data.tar.gz: 0655a86c9ca4d9b17402c083cd2c36ffb5f2e90b
3
+ metadata.gz: 970476b1a332a001fdc9a9d03fde20c5c43a90bb
4
+ data.tar.gz: be0f519d6b1ce53fca5c3e160992ca57adad4bd8
5
5
  SHA512:
6
- metadata.gz: c1b83d9791c1147dccbbdd1e56e0b97aa771d0f8b323109f13211c5d3b79ce031796fa5146edeeebcb737ec32c1319fab791dc3192ce3903098776bec66f4bc3
7
- data.tar.gz: 215fa31378a4b9ec227c65c0aedfa70d8545f038c2688d26ca952ce4d2266cfa3128899f2ab3e2625759394f30468667f44c50fe3bfa3cb3f92c4d15bc6c16e8
6
+ metadata.gz: 29c997f432d291626f016647c2500c4b87496aabc19cb7424bc7371614cf4a5fd9af527e354b20c64c8a881ca4de97c8063487f25e3269bde7b5ec7b1b4f71eb
7
+ data.tar.gz: b60c74322468dfd9bd5eef82a90188a16d248df23b645bba1e3507620f256ab4a042bcfbf19f2e61f233e8a818a30b9d53a876c72d0131001a54651615d38b09
@@ -405,6 +405,20 @@ class ResourceImportFile < ActiveRecord::Base
405
405
  subjects
406
406
  end
407
407
 
408
+ def import_classification(row)
409
+ classifications = []
410
+ classification_number = YAML.load(row['classification'].to_s)
411
+ return nil unless classification_number
412
+ classification_number.map{|k, v|
413
+ classification_type = ClassificationType.where(:name => k.downcase).first
414
+ classification = Classification.new(:category => v.to_s)
415
+ classification.classification_type = classification_type
416
+ classification.save!
417
+ classifications << classification
418
+ }
419
+ classifications
420
+ end
421
+
408
422
  def create_item(row, manifestation)
409
423
  shelf = Shelf.where(:name => row['shelf'].to_s.strip).first || Shelf.web
410
424
  bookstore = Bookstore.where(:name => row['bookstore'].to_s.strip).first
@@ -520,7 +534,6 @@ class ResourceImportFile < ActiveRecord::Base
520
534
  creator_agents = Agent.import_agents(creators_list)
521
535
  contributor_agents = Agent.import_agents(contributors_list)
522
536
  publisher_agents = Agent.import_agents(publishers_list)
523
- #classification = Classification.where(:category => row['classification'].to_s.strip).first
524
537
  subjects = import_subject(row) if defined?(EnjuSubject)
525
538
  case options[:edit_mode]
526
539
  when 'create'
@@ -614,6 +627,13 @@ class ResourceImportFile < ActiveRecord::Base
614
627
  end
615
628
  end
616
629
 
630
+ if defined?(EnjuSubject)
631
+ classifications = import_classification(row)
632
+ if classifications.present?
633
+ manifestation.classifications << classifications
634
+ end
635
+ end
636
+
617
637
  manifestation.save!
618
638
 
619
639
  if options[:edit_mode] == 'create'
@@ -118,6 +118,6 @@
118
118
  <%- end -%>
119
119
  </ul>
120
120
  <ul>
121
- <li><%= link_to t('page.listing', :model => t('activerecord.models.manifestation')), manifestations_path(:query => @agent.full_name) -%></li>
121
+ <li><%= link_to t('page.listing', :model => t('activerecord.models.manifestation')), manifestations_path(:query => "\"#{@agent.full_name}\"") -%></li>
122
122
  </ul>
123
123
  </div>
@@ -7,7 +7,7 @@
7
7
  <%= f.error_messages -%>
8
8
  <div class="field">
9
9
  <%= f.label :isbn -%><br />
10
- <%= f.text_field :isbn, :class => 'resource_isbn_issn' -%>
10
+ <%= f.search_field :isbn, :class => 'resource_isbn_issn' -%>
11
11
 
12
12
  <%= f.submit 'data-disable-with' => t('page.saving') %>
13
13
  </div>
@@ -71,16 +71,16 @@
71
71
  xml.topic subject.term
72
72
  end
73
73
  }
74
- manifestation.subjects.collect(&:classifications).flatten.each do |classification|
74
+ manifestation.classifications.each do |classification|
75
75
  xml.classification classification.category, 'authority' => classification.classification_type.name
76
76
  end
77
77
  end
78
78
  xml.abstract manifestation.description
79
79
  xml.note manifestation.note
80
- manifestation.identifier_content(:isbn).each do |i|
80
+ manifestation.identifier_contents(:isbn).each do |i|
81
81
  xml.identifier i, :type => 'isbn'
82
82
  end
83
- manifestation.identifier_content(:lccn).each do |l|
83
+ manifestation.identifier_contents(:lccn).each do |l|
84
84
  xml.identifier l, :type => 'lccn'
85
85
  end
86
86
  xml.recordInfo{
@@ -71,16 +71,16 @@
71
71
  xml.topic subject.term
72
72
  end
73
73
  }
74
- manifestation.subjects.collect(&:classifications).flatten.each do |classification|
74
+ manifestation.classifications.each do |classification|
75
75
  xml.classification classification.category, 'authority' => classification.classification_type.name
76
76
  end
77
77
  end
78
78
  xml.abstract manifestation.description
79
79
  xml.note manifestation.note
80
- manifestation.identifier_content(:isbn).each do |i|
80
+ manifestation.identifier_contents(:isbn).each do |i|
81
81
  xml.identifier i, :type => 'isbn'
82
82
  end
83
- manifestation.identifier_content(:lccn).each do |l|
83
+ manifestation.identifier_contents(:lccn).each do |l|
84
84
  xml.identifier l, :type => 'lccn'
85
85
  end
86
86
  xml.recordInfo{
@@ -31,12 +31,17 @@
31
31
  <% if defined?(EnjuCirculation) %>
32
32
  <td>
33
33
  <%= item.circulation_status.display_name.localize if item.circulation_status -%>
34
- <%- if item.rent? -%>
34
+ <% if item.retained? %>
35
+ <br />
36
+ <%= t('reserve.retained') %>
37
+ <% end %>
38
+ <% if item.rent? %>
39
+ <br />
35
40
  (
36
41
  <%= t('activerecord.attributes.checkout.due_date') -%>:
37
42
  <%= l(item.checkouts.first.due_date, :format => :short) -%>
38
43
  )
39
- <%- end -%>
44
+ <% end %>
40
45
  </td>
41
46
  <% end %>
42
47
  </tr>
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.1.0.pre46"
2
+ VERSION = "0.1.0.pre47"
3
3
  end