enju_event 0.0.27 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. data/MIT-LICENSE +1 -1
  2. data/Rakefile +1 -11
  3. data/app/controllers/calendar_controller.rb +1 -1
  4. data/app/controllers/event_categories_controller.rb +1 -1
  5. data/app/controllers/event_import_files_controller.rb +15 -15
  6. data/app/controllers/event_import_results_controller.rb +1 -1
  7. data/app/controllers/events_controller.rb +16 -16
  8. data/app/controllers/participates_controller.rb +3 -3
  9. data/app/models/event.rb +2 -4
  10. data/app/models/event_category.rb +0 -1
  11. data/app/models/event_import_file.rb +33 -106
  12. data/app/models/event_import_result.rb +0 -1
  13. data/app/models/participate.rb +0 -1
  14. data/app/views/event_categories/index.html.erb +2 -2
  15. data/app/views/event_import_files/index.html.erb +4 -4
  16. data/app/views/event_import_files/new.html.erb +2 -0
  17. data/app/views/event_import_files/show.html.erb +3 -8
  18. data/app/views/event_import_results/index.html.erb +2 -2
  19. data/app/views/events/_form.html.erb +1 -1
  20. data/app/views/events/index.html.erb +8 -8
  21. data/app/views/events/index.mobile.erb +6 -6
  22. data/app/views/events/index.rss.builder +2 -2
  23. data/app/views/participates/index.html.erb +2 -2
  24. data/config/locales/translation_en.yml +1 -2
  25. data/config/locales/translation_ja.yml +1 -2
  26. data/config/routes.rb +0 -3
  27. data/db/migrate/20120413051535_add_event_fingerprint_to_event_import_file.rb +5 -0
  28. data/lib/enju_event.rb +0 -17
  29. data/lib/enju_event/engine.rb +9 -2
  30. data/lib/enju_event/version.rb +1 -1
  31. data/spec/dummy/app/models/country.rb +44 -0
  32. data/spec/dummy/app/models/language.rb +4 -0
  33. data/spec/dummy/app/models/library.rb +128 -0
  34. data/spec/dummy/app/models/library_group.rb +86 -0
  35. data/spec/dummy/app/models/patron.rb +163 -0
  36. data/spec/dummy/app/models/patron_type.rb +19 -0
  37. data/spec/dummy/app/models/role.rb +1 -39
  38. data/spec/dummy/app/models/shelf.rb +54 -0
  39. data/spec/dummy/app/models/user.rb +10 -61
  40. data/spec/dummy/app/models/user_group.rb +0 -38
  41. data/spec/dummy/app/models/user_has_role.rb +0 -1
  42. data/spec/dummy/config/application.rb +1 -3
  43. data/spec/dummy/config/initializers/devise.rb +4 -0
  44. data/spec/dummy/config/initializers/mime_types.rb +1 -0
  45. data/spec/dummy/db/development.sqlite3 +0 -0
  46. data/spec/dummy/db/migrate/001_create_patrons.rb +10 -1
  47. data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +5 -1
  48. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +5 -1
  49. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +10 -31
  50. data/spec/dummy/db/schema.rb +20 -494
  51. data/spec/dummy/db/test.sqlite3 +0 -0
  52. data/spec/dummy/lib/enju_leaf.rb +4 -0
  53. data/spec/dummy/lib/enju_leaf/import_file.rb +13 -0
  54. data/spec/dummy/lib/enju_leaf/localized_name.rb +13 -0
  55. data/spec/dummy/lib/enju_leaf/master_model.rb +41 -0
  56. data/spec/dummy/lib/enju_leaf/url_validator.rb +10 -0
  57. data/spec/dummy/private/system/event_import_files/event_imports/000/000/004/original/event_import_file_sample1.tsv +1 -1
  58. data/spec/dummy/private/system/event_import_files/event_imports/000/000/004/original/event_import_file_sample2.tsv +1 -1
  59. data/spec/dummy/private/system/event_imports/4/original/event_import_file_sample1.tsv +1 -1
  60. data/spec/dummy/private/system/event_imports/4/original/event_import_file_sample2.tsv +1 -1
  61. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  62. data/spec/dummy/solr/data/test/index/segments_1 +0 -0
  63. data/spec/fixtures/event_import_files.yml +4 -6
  64. data/spec/models/event_import_file_spec.rb +4 -38
  65. metadata +123 -329
  66. data/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +0 -5
  67. data/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +0 -5
  68. data/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +0 -9
  69. data/spec/controllers/calendar_controller_spec.rb +0 -57
  70. data/spec/dummy/db/migrate/005_create_manifestations.rb +0 -56
  71. data/spec/dummy/db/migrate/006_create_items.rb +0 -28
  72. data/spec/dummy/db/migrate/012_create_owns.rb +0 -12
  73. data/spec/dummy/db/migrate/015_create_creates.rb +0 -12
  74. data/spec/dummy/db/migrate/047_create_produces.rb +0 -12
  75. data/spec/dummy/db/migrate/073_create_carrier_types.rb +0 -11
  76. data/spec/dummy/db/migrate/112_create_frequencies.rb +0 -12
  77. data/spec/dummy/db/migrate/117_create_form_of_works.rb +0 -12
  78. data/spec/dummy/db/migrate/125_create_donates.rb +0 -12
  79. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +0 -13
  80. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +0 -13
  81. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +0 -15
  82. data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
  83. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +0 -22
  84. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +0 -15
  85. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +0 -15
  86. data/spec/dummy/db/migrate/20090719201843_create_extents.rb +0 -12
  87. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +0 -12
  88. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +0 -12
  89. data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +0 -12
  90. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +0 -27
  91. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +0 -12
  92. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
  93. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +0 -13
  94. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +0 -15
  95. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +0 -13
  96. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +0 -10
  97. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +0 -13
  98. data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
  99. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +0 -12
  100. data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
  101. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +0 -15
  102. data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
  103. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +0 -9
  104. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +0 -9
  105. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
  106. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +0 -9
  107. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +0 -9
  108. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +0 -9
  109. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +0 -11
  110. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +0 -9
  111. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +0 -12
  112. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +0 -13
  113. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
  114. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +0 -13
  115. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +0 -10
  116. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +0 -13
  117. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +0 -9
  118. data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +0 -9
  119. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +0 -12
  120. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +0 -12
  121. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +0 -12
  122. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +0 -7
  123. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +0 -6
  124. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +0 -6
  125. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +0 -6
  126. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +0 -5
  127. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +0 -5
  128. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +0 -5
  129. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +0 -5
  130. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
  131. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +0 -5
  132. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
  133. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
  134. data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
  135. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +0 -5
  136. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +0 -5
  137. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
  138. data/spec/dummy/private/system/event_import_files/event_imports/000/000/004/original/event_destroy_file.tsv +0 -4
  139. data/spec/dummy/private/system/event_import_files/event_imports/000/000/004/original/event_update_file.tsv +0 -4
  140. data/spec/dummy/private/system/event_imports/4/original/event_destroy_file.tsv +0 -4
  141. data/spec/dummy/private/system/event_imports/4/original/event_update_file.tsv +0 -4
  142. data/spec/dummy/solr/data/test/index/_5l.fdt +0 -0
  143. data/spec/dummy/solr/data/test/index/_5l.fdx +0 -0
  144. data/spec/dummy/solr/data/test/index/_5l.fnm +0 -4
  145. data/spec/dummy/solr/data/test/index/_5l.frq +0 -0
  146. data/spec/dummy/solr/data/test/index/_5l.nrm +0 -1
  147. data/spec/dummy/solr/data/test/index/_5l.prx +0 -0
  148. data/spec/dummy/solr/data/test/index/_5l.tii +0 -0
  149. data/spec/dummy/solr/data/test/index/_5l.tis +0 -0
  150. data/spec/dummy/solr/data/test/index/_5l_1.del +0 -0
  151. data/spec/dummy/solr/data/test/index/_5m.fdt +0 -0
  152. data/spec/dummy/solr/data/test/index/_5m.fdx +0 -0
  153. data/spec/dummy/solr/data/test/index/_5m.fnm +0 -4
  154. data/spec/dummy/solr/data/test/index/_5m.frq +0 -0
  155. data/spec/dummy/solr/data/test/index/_5m.nrm +0 -1
  156. data/spec/dummy/solr/data/test/index/_5m.prx +0 -0
  157. data/spec/dummy/solr/data/test/index/_5m.tii +0 -0
  158. data/spec/dummy/solr/data/test/index/_5m.tis +0 -0
  159. data/spec/dummy/solr/data/test/index/_5m_1.del +0 -0
  160. data/spec/dummy/solr/data/test/index/_5n.fdt +0 -0
  161. data/spec/dummy/solr/data/test/index/_5n.fdx +0 -0
  162. data/spec/dummy/solr/data/test/index/_5n.fnm +0 -4
  163. data/spec/dummy/solr/data/test/index/_5n.frq +0 -0
  164. data/spec/dummy/solr/data/test/index/_5n.nrm +0 -1
  165. data/spec/dummy/solr/data/test/index/_5n.prx +0 -0
  166. data/spec/dummy/solr/data/test/index/_5n.tii +0 -0
  167. data/spec/dummy/solr/data/test/index/_5n.tis +0 -0
  168. data/spec/dummy/solr/data/test/index/segments_6l +0 -0
@@ -1,5 +1,4 @@
1
1
  class EventImportResult < ActiveRecord::Base
2
- attr_accessible :event_id, :event_import_file_id, :body, :as => :admin
3
2
  default_scope :order => 'event_import_results.id'
4
3
  scope :file_id, proc{|file_id| {:conditions => {:event_import_file_id => file_id}}}
5
4
  scope :failed, where(:event_id => nil)
@@ -1,5 +1,4 @@
1
1
  class Participate < ActiveRecord::Base
2
- attr_accessible :patron_id, :event_id
3
2
  belongs_to :patron
4
3
  belongs_to :event
5
4
 
@@ -2,7 +2,7 @@
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.event_category')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
- <table class="table table-striped index">
5
+ <table class="index">
6
6
  <tr>
7
7
  <th id="position"></th>
8
8
  <th><%= t('activerecord.attributes.event_category.name') -%></th>
@@ -26,7 +26,7 @@
26
26
  <%= link_to t('page.edit'), edit_event_category_path(event_category) -%>
27
27
  <% end %>
28
28
  <%- if can? :destroy, event_category -%>
29
- <%= link_to t('page.destroy'), event_category, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
29
+ <%= link_to t('page.destroy'), event_category, :confirm => t('page.are_you_sure'), :method => :delete -%>
30
30
  <%- end -%>
31
31
  </td>
32
32
  </tr>
@@ -2,11 +2,11 @@
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.event_import_file')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
- <table class="table table-striped index">
5
+ <table class="index">
6
6
  <tr>
7
7
  <th>Id</th>
8
8
  <th><%= t('activerecord.attributes.event_import_file.event_import_file_name') -%></th>
9
- <th><%= t('activerecord.attributes.event_import_file.executed_at') -%></th>
9
+ <th><%= t('activerecord.attributes.event_import_file.imported_at') -%></th>
10
10
  <th><%= t('activerecord.models.user') -%></th>
11
11
  <th><%= t('activerecord.attributes.event_import_file.edit_mode') -%></th>
12
12
  <th><%= t('activerecord.attributes.event_import_file.state') -%></th>
@@ -17,13 +17,13 @@
17
17
  <tr class="line<%= cycle("0", "1") -%>">
18
18
  <td><%= link_to (event_import_file.id), event_import_file -%></td>
19
19
  <td><%= link_to event_import_file.event_import_file_name, event_import_file -%></td>
20
- <td><%= l(event_import_file.executed_at) if event_import_file.executed_at -%></td>
20
+ <td><%= l(event_import_file.imported_at) if event_import_file.imported_at -%></td>
21
21
  <td><%= link_to event_import_file.user.username, event_import_file.user -%></td>
22
22
  <td><%= event_import_file.edit_mode -%></td>
23
23
  <td><%= localized_state(event_import_file.state) -%></td>
24
24
  <td>
25
25
  <%= link_to t('page.show'), event_import_file -%>
26
- <%= link_to t('page.destroy'), event_import_file, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
26
+ <%= link_to t('page.destroy'), event_import_file, :confirm => t('page.are_you_sure'), :method => :delete -%>
27
27
  </td>
28
28
  </tr>
29
29
  <%- end -%>
@@ -10,6 +10,7 @@
10
10
  <%= f.file_field :event_import -%>
11
11
  </div>
12
12
 
13
+ <!--
13
14
  <div class="field">
14
15
  <%= f.label :edit_mode -%><br />
15
16
  <%= f.radio_button :edit_mode, 'create', :checked => 'checked' %>
@@ -19,6 +20,7 @@
19
20
  <%= f.radio_button :edit_mode, 'destroy' %>
20
21
  <%= f.label :edit_mode, t('page.destroy'), :value => 'destroy' %>
21
22
  </div>
23
+ -->
22
24
 
23
25
  <div class="actions">
24
26
  <%= f.submit %>
@@ -34,8 +34,8 @@
34
34
  </p>
35
35
 
36
36
  <p>
37
- <strong><%= t('activerecord.attributes.event_import_file.executed_at') -%>:</strong>
38
- <%= l(@event_import_file.executed_at) if @event_import_file.executed_at -%>
37
+ <strong><%= t('activerecord.attributes.event_import_file.imported_at') -%>:</strong>
38
+ <%= l(@event_import_file.imported_at) if @event_import_file.imported_at -%>
39
39
  </p>
40
40
 
41
41
  <p>
@@ -44,15 +44,10 @@
44
44
  </p>
45
45
 
46
46
  <p>
47
- <strong><%= t('activerecord.attributes.event_import_file.state') -%>:</strong>
47
+ <strong><%= t('activerecord.attributes.manifestation_import_file.state') -%>:</strong>
48
48
  <%= localized_state(@event_import_file.state) -%>
49
49
  </p>
50
50
 
51
- <p>
52
- <strong><%= t('activerecord.attributes.event_import_file.error_message') -%>:</strong>
53
- <%= @event_import_file.error_message -%>
54
- </p>
55
-
56
51
  <p>
57
52
  <strong><%= t('activerecord.models.user') -%>:</strong>
58
53
  <%= link_to @event_import_file.user.username, @event_import_file.user -%>
@@ -7,7 +7,7 @@
7
7
  </h2>
8
8
  <% end %>
9
9
 
10
- <table class="table table-striped index">
10
+ <table class="index">
11
11
  <tr>
12
12
  <th><%= t('activerecord.models.event_import_file') %></th>
13
13
  <th><%= t('activerecord.models.event') %></th>
@@ -24,7 +24,7 @@
24
24
  <td><%= link_to event_import_result.event.display_name.localize, event_import_result.event if event_import_result.event %></td>
25
25
  <td>
26
26
  <%= link_to t('page.show'), event_import_result %>
27
- <%= link_to t('page.destroy'), event_import_result, :data => {:confirm => t('page.are_you_sure')}, :method => :delete %>
27
+ <%= link_to t('page.destroy'), event_import_result, :confirm => t('page.are_you_sure'), :method => :delete %>
28
28
  </td>
29
29
  </tr>
30
30
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <%= simple_form_for(@event, :validate => true) do |f| -%>
2
- <%= f.error_messages %>
2
+ <%= f.error_notification %>
3
3
 
4
4
  <div class="field">
5
5
  <%= f.label t('activerecord.models.event_category') -%><br />
@@ -18,21 +18,21 @@
18
18
  <p>
19
19
  <%- case params[:mode]
20
20
  when 'upcoming' -%>
21
- <%= link_to t('event.all'), url_for(params.merge(:mode => nil, :only_path => true)) -%>
21
+ <%= link_to t('event.all'), params.merge(:mode => nil) -%>
22
22
  <strong><%= t('event.upcoming') -%></strong>
23
- <%= link_to t('event.past'), url_for(params.merge(:mode => 'past', :only_path => true)) -%>
23
+ <%= link_to t('event.past'), params.merge(:mode => 'past') -%>
24
24
  <%- when 'past' -%>
25
- <%= link_to t('event.all'), url_for(params.merge(:mode => nil, :only_path => true)) -%>
26
- <%= link_to t('event.upcoming'), url_for(params.merge(:mode => 'upcoming', :only_path => true)) -%>
25
+ <%= link_to t('event.all'), params.merge(:mode => nil) -%>
26
+ <%= link_to t('event.upcoming'), params.merge(:mode => 'upcoming') -%>
27
27
  <strong><%= t('event.past') -%></strong>
28
28
  <%- else -%>
29
29
  <strong><%= t('event.all') -%></strong>
30
- <%= link_to t('event.upcoming'), url_for(params.merge(:mode => 'upcoming', :only_path => true)) -%>
31
- <%= link_to t('event.past'), url_for(params.merge(:mode => 'past', :only_path => true)) -%>
30
+ <%= link_to t('event.upcoming'), params.merge(:mode => 'upcoming') -%>
31
+ <%= link_to t('event.past'), params.merge(:mode => 'past') -%>
32
32
  <%- end -%>
33
33
  </p>
34
34
 
35
- <table class="table table-striped index">
35
+ <table class="index">
36
36
  <tr>
37
37
  <th><%= t('activerecord.models.library') -%></th>
38
38
  <th><%= t('activerecord.attributes.event.name') -%></th>
@@ -56,7 +56,7 @@
56
56
  <td>
57
57
  <%- if can? :destroy, event -%>
58
58
  <%= link_to image_tag('icons/page_white_edit.png', :size => '16x16', :alt => t('page.edit')), edit_event_path(event) -%>
59
- <%= link_to image_tag('icons/delete.png', :size => '16x16', :alt => t('page.destroy')), event, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
59
+ <%= link_to image_tag('icons/delete.png', :size => '16x16', :alt => t('page.destroy')), event, :confirm => t('page.are_you_sure'), :method => :delete -%>
60
60
  <%- end -%>
61
61
  </td>
62
62
  </tr>
@@ -21,17 +21,17 @@
21
21
  <p>
22
22
  <%- case params[:mode]
23
23
  when 'upcoming' -%>
24
- <%= link_to t('event.all'), url_for(params.merge(:mode => nil, :only_path => true)) -%>
24
+ <%= link_to t('event.all'), params.merge(:mode => nil) -%>
25
25
  <strong><%= t('event.upcoming') -%></strong>
26
- <%= link_to t('event.past'), url_for(params.merge(:mode => 'past', :only_path => true)) -%>
26
+ <%= link_to t('event.past'), params.merge(:mode => 'past') -%>
27
27
  <%- when 'past' -%>
28
- <%= link_to t('event.all'), url_for(params.merge(:mode => nil, :only_path => true)) -%>
29
- <%= link_to t('event.upcoming'), url_for(params.merge(:mode => 'upcoming', :only_path => true)) -%>
28
+ <%= link_to t('event.all'), params.merge(:mode => nil) -%>
29
+ <%= link_to t('event.upcoming'), params.merge(:mode => 'upcoming') -%>
30
30
  <strong><%= t('event.past') -%></strong>
31
31
  <%- else -%>
32
32
  <strong><%= t('event.all') -%></strong>
33
- <%= link_to t('event.upcoming'), url_for(params.merge(:mode => 'upcoming', :only_path => true)) -%>
34
- <%= link_to t('event.past'), url_for(params.merge(:mode => 'past', :only_path => true)) -%>
33
+ <%= link_to t('event.upcoming'), params.merge(:mode => 'upcoming') -%>
34
+ <%= link_to t('event.past'), params.merge(:mode => 'past') -%>
35
35
  <%- end -%>
36
36
  </p>
37
37
  </div>
@@ -4,11 +4,11 @@ xml.rss('version' => "2.0",
4
4
  'xmlns:atom' => "http://www.w3.org/2005/Atom"){
5
5
  xml.channel{
6
6
  xml.title t('event.library_group_event', :library_group_name => @library_group.display_name.localize)
7
- xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(:format => nil, :only_path => true))}"
7
+ xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(:format => nil))}"
8
8
  xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
9
9
  xml.language @locale.to_s
10
10
  xml.ttl "60"
11
- xml.tag! "atom:link", :rel => 'self', :href => "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(:format => :rss, :only_path => true))}"
11
+ xml.tag! "atom:link", :rel => 'self', :href => "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(:format => :rss))}"
12
12
  xml.tag! "atom:link", :rel => 'alternate', :href => events_url
13
13
  #xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port}/page/opensearch"
14
14
  unless params[:query].blank?
@@ -2,7 +2,7 @@
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.participate')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
- <table class="table table-striped index">
5
+ <table class="index">
6
6
  <tr>
7
7
  <th><%= t('activerecord.models.patron') -%></th>
8
8
  <th><%= t('activerecord.models.event') -%></th>
@@ -14,7 +14,7 @@
14
14
  <td><%= link_to participate.event.display_name.localize, participate.event %>
15
15
  <td><%= link_to t('page.show'), participate %></td>
16
16
  <td><%= link_to t('page.edit'), edit_participate_path(participate) %></td>
17
- <td><%= link_to t('page.destroy'), participate, :data => {:confirm => t('page.are_you_sure')}, :method => :delete %></td>
17
+ <td><%= link_to t('page.destroy'), participate, :confirm => t('page.are_you_sure'), :method => :delete %></td>
18
18
  </tr>
19
19
  <%- end %>
20
20
  </table>
@@ -26,11 +26,10 @@ en:
26
26
  event_import_file_size: Size
27
27
  event_import_fingerprint: File hash
28
28
  note: Note
29
- executed_at: Executed at
29
+ imported_at: Imported at
30
30
  event_import_updated_at: Updated at
31
31
  state: State
32
32
  edit_mode: Edit mode
33
- error_message: Error message
34
33
  event_import_result:
35
34
  body: Body
36
35
 
@@ -26,11 +26,10 @@ ja:
26
26
  event_import_file_size: ファイルサイズ
27
27
  event_import_fingerprint: ファイルのハッシュ
28
28
  note: 注記
29
- executed_at: 実行時刻
29
+ imported_at: インポート時刻
30
30
  event_import_updated_at: 更新時刻
31
31
  state: 状態
32
32
  edit_mode: 編集モード
33
- error_message: エラーメッセージ
34
33
  event_import_result:
35
34
  body: 本文
36
35
 
@@ -11,7 +11,4 @@ Rails.application.routes.draw do
11
11
  end
12
12
  resources :event_import_results, :only => [:index, :show, :destroy]
13
13
  resources :participates
14
-
15
- match '/calendar(/:year(/:month))' => 'calendar#index', :as => :calendar, :constraints => {:year => /\d{4}/, :month => /\d{1,2}/}
16
- match "/calendar/:year/:month/:day" => "calendar#show"
17
14
  end
@@ -0,0 +1,5 @@
1
+ class AddEventFingerprintToEventImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :event_import_files, :event_fingerprint, :string
4
+ end
5
+ end
@@ -2,21 +2,4 @@ require "enju_event/engine"
2
2
  require 'event_calendar'
3
3
 
4
4
  module EnjuEvent
5
- def self.included(base)
6
- base.extend(ClassMethods)
7
- end
8
-
9
- module ClassMethods
10
- def enju_event
11
- include EnjuEvent::InstanceMethods
12
- end
13
- end
14
-
15
- module InstanceMethods
16
- def get_event
17
- @event = Event.find(params[:event_id]) if params[:event_id]
18
- end
19
- end
20
5
  end
21
-
22
- ActionController::Base.send(:include, EnjuEvent)
@@ -1,13 +1,20 @@
1
- require "enju_core"
1
+ require "devise"
2
+ require "cancan"
3
+ require "attribute_normalizer"
2
4
  require "inherited_resources"
5
+ require "friendly_id"
6
+ require "will_paginate"
7
+ require "sunspot_rails"
3
8
  require "has_scope"
4
9
  require "configatron"
5
10
  require "paperclip"
6
11
  require "state_machine"
12
+ require "addressable/uri"
7
13
  require "csv"
8
14
  require "nkf"
15
+ require "acts_as_list"
9
16
 
10
17
  module EnjuEvent
11
- class Engine < ::Rails::Engine
18
+ class Engine < Rails::Engine
12
19
  end
13
20
  end
@@ -1,3 +1,3 @@
1
1
  module EnjuEvent
2
- VERSION = "0.0.27"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,44 @@
1
+ class Country < ActiveRecord::Base
2
+ include MasterModel
3
+ default_scope :order => "position"
4
+ has_many :patrons
5
+ #has_many :people
6
+ #has_many :corporate_bodies
7
+ #has_many :families
8
+ has_many :libraries
9
+ has_one :library_group
10
+
11
+ # If you wish to change the field names for brevity, feel free to enable/modify these.
12
+ # alias_attribute :iso, :alpha_2
13
+ # alias_attribute :iso3, :alpha_3
14
+ # alias_attribute :numeric, :numeric_3
15
+
16
+ # Validations
17
+ validates_presence_of :alpha_2, :alpha_3, :numeric_3
18
+
19
+ after_save :clear_all_cache
20
+ after_destroy :clear_all_cache
21
+
22
+ def self.all_cache
23
+ Rails.cache.fetch('country_all'){Country.all}
24
+ end
25
+
26
+ def clear_all_cache
27
+ Rails.cache.delete('country_all')
28
+ end
29
+ end
30
+
31
+ # == Schema Information
32
+ #
33
+ # Table name: countries
34
+ #
35
+ # id :integer not null, primary key
36
+ # name :string(255) not null
37
+ # display_name :text
38
+ # alpha_2 :string(255)
39
+ # alpha_3 :string(255)
40
+ # numeric_3 :string(255)
41
+ # note :text
42
+ # position :integer
43
+ #
44
+
@@ -0,0 +1,4 @@
1
+ class Language < ActiveRecord::Base
2
+ has_many :manifestations
3
+ has_many :patrons
4
+ end
@@ -0,0 +1,128 @@
1
+ # -*- encoding: utf-8 -*-
2
+ class Library < ActiveRecord::Base
3
+ include MasterModel
4
+ default_scope :order => 'libraries.position'
5
+ scope :real, where('id != 1')
6
+ has_many :shelves, :order => 'shelves.position'
7
+ belongs_to :library_group, :validate => true
8
+ has_many :events, :include => :event_category
9
+ #belongs_to :holding_patron, :polymorphic => true, :validate => true
10
+ belongs_to :patron #, :validate => true
11
+ has_many :inter_library_loans, :foreign_key => 'borrowing_library_id'
12
+ has_many :users
13
+ belongs_to :country
14
+
15
+ extend FriendlyId
16
+ friendly_id :name
17
+ #geocoded_by :address
18
+
19
+ searchable do
20
+ text :name, :display_name, :note, :address
21
+ time :created_at
22
+ time :updated_at
23
+ integer :position
24
+ end
25
+
26
+ #validates_associated :library_group, :holding_patron
27
+ validates_associated :library_group, :patron
28
+ validates_presence_of :short_display_name, :library_group, :patron
29
+ validates_uniqueness_of :short_display_name, :case_sensitive => false
30
+ validates :display_name, :uniqueness => true
31
+ validates :name, :format => {:with => /^[a-z][0-9a-z]{2,254}$/}
32
+ before_validation :set_patron, :on => :create
33
+ #before_save :set_calil_neighborhood_library
34
+ after_validation :geocode, :if => :address_changed?
35
+ after_create :create_shelf
36
+ after_save :clear_all_cache
37
+ after_destroy :clear_all_cache
38
+
39
+ def self.per_page
40
+ 10
41
+ end
42
+
43
+ def self.all_cache
44
+ if Rails.env == 'production'
45
+ Rails.cache.fetch('library_all'){Library.all}
46
+ else
47
+ Library.all
48
+ end
49
+ end
50
+
51
+ def clear_all_cache
52
+ Rails.cache.delete('library_all')
53
+ end
54
+
55
+ def set_patron
56
+ self.patron = Patron.new(
57
+ :full_name => self.name
58
+ )
59
+ end
60
+
61
+ def create_shelf
62
+ Shelf.create!(:name => "#{self.name}_default", :library => self)
63
+ end
64
+
65
+ def closed?(date)
66
+ events.closing_days.collect{|c| c.start_at.beginning_of_day}.include?(date.beginning_of_day)
67
+ end
68
+
69
+ def web?
70
+ return true if self.id == 1
71
+ false
72
+ end
73
+
74
+ def self.web
75
+ Library.find(1)
76
+ end
77
+
78
+ def address(locale = I18n.locale)
79
+ case locale.to_sym
80
+ when :ja
81
+ "#{self.region.to_s.localize(locale)}#{self.locality.to_s.localize(locale)}#{self.street.to_s.localize(locale)}"
82
+ else
83
+ "#{self.street.to_s.localize(locale)} #{self.locality.to_s.localize(locale)} #{self.region.to_s.localize(locale)}"
84
+ end
85
+ rescue
86
+ nil
87
+ end
88
+
89
+ def address_changed?
90
+ return true if region_changed? or locality_changed? or street_changed?
91
+ false
92
+ end
93
+ end
94
+
95
+ # == Schema Information
96
+ #
97
+ # Table name: libraries
98
+ #
99
+ # id :integer not null, primary key
100
+ # patron_id :integer
101
+ # patron_type :string(255)
102
+ # name :string(255) not null
103
+ # display_name :text
104
+ # short_display_name :string(255) not null
105
+ # zip_code :string(255)
106
+ # street :text
107
+ # locality :text
108
+ # region :text
109
+ # telephone_number_1 :string(255)
110
+ # telephone_number_2 :string(255)
111
+ # fax_number :string(255)
112
+ # note :text
113
+ # call_number_rows :integer default(1), not null
114
+ # call_number_delimiter :string(255) default("|"), not null
115
+ # library_group_id :integer default(1), not null
116
+ # users_count :integer default(0), not null
117
+ # position :integer
118
+ # country_id :integer
119
+ # created_at :datetime
120
+ # updated_at :datetime
121
+ # deleted_at :datetime
122
+ # opening_hour :text
123
+ # latitude :float
124
+ # longitude :float
125
+ # calil_systemid :string(255)
126
+ # calil_neighborhood_systemid :text
127
+ #
128
+