enju_question 0.1.0.pre11 → 0.1.0.pre12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/answers_controller.rb +15 -16
  3. data/app/controllers/questions_controller.rb +15 -15
  4. data/app/models/answer.rb +7 -7
  5. data/app/models/answer_has_item.rb +2 -2
  6. data/app/models/question.rb +4 -4
  7. data/app/views/answers/_form.html.erb +5 -5
  8. data/app/views/answers/edit.html.erb +3 -3
  9. data/app/views/answers/index.atom.builder +2 -2
  10. data/app/views/answers/index.html.erb +7 -7
  11. data/app/views/answers/index.rss.builder +3 -3
  12. data/app/views/answers/new.html.erb +3 -3
  13. data/app/views/answers/new.mobile.erb +6 -6
  14. data/app/views/answers/show.html.erb +6 -5
  15. data/app/views/manifestations/_question_list.html.erb +13 -0
  16. data/app/views/questions/_crd.html.erb +1 -1
  17. data/app/views/questions/_index.html.erb +6 -6
  18. data/app/views/questions/_index_user.html.erb +5 -5
  19. data/app/views/questions/_list.html.erb +9 -9
  20. data/app/views/questions/_solved_facet.html.erb +2 -2
  21. data/app/views/questions/edit.html.erb +6 -6
  22. data/app/views/questions/index.atom.builder +2 -2
  23. data/app/views/questions/index.mobile.erb +4 -4
  24. data/app/views/questions/index.rss.builder +6 -6
  25. data/app/views/questions/new.html.erb +6 -6
  26. data/app/views/questions/show.html.erb +7 -7
  27. data/app/views/questions/show.mobile.erb +3 -3
  28. data/lib/enju_question/version.rb +1 -1
  29. data/spec/controllers/questions_controller_spec.rb +1 -0
  30. data/spec/dummy/app/models/user.rb +5 -25
  31. data/spec/dummy/db/development.sqlite3 +0 -0
  32. data/spec/dummy/db/migrate/001_create_agents.rb +0 -1
  33. data/spec/dummy/db/migrate/002_devise_create_users.rb +46 -0
  34. data/spec/dummy/db/migrate/005_create_manifestations.rb +7 -19
  35. data/spec/dummy/db/migrate/006_create_items.rb +0 -3
  36. data/spec/dummy/db/migrate/041_create_roles.rb +13 -0
  37. data/spec/dummy/db/migrate/055_create_bookmarks.rb +22 -0
  38. data/spec/dummy/db/migrate/059_create_libraries.rb +28 -0
  39. data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
  40. data/spec/dummy/db/migrate/{20111201163342_create_user_groups.rb → 077_create_user_groups.rb} +2 -2
  41. data/spec/dummy/db/migrate/080_create_library_groups.rb +0 -1
  42. data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
  43. data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
  44. data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
  45. data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
  46. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
  47. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
  48. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
  49. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +0 -2
  50. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -3
  51. data/spec/dummy/db/migrate/20081212151614_create_bookmark_stats.rb +16 -0
  52. data/spec/dummy/db/migrate/20081212151820_create_bookmark_stat_has_manifestations.rb +13 -0
  53. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +0 -1
  54. data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +9 -0
  55. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +9 -0
  56. data/spec/dummy/db/migrate/{20111201163718_create_user_has_roles.rb → 20100606065209_create_user_has_roles.rb} +2 -0
  57. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
  58. data/spec/dummy/db/migrate/20111231145823_add_share_bookmarks_to_user.rb +5 -0
  59. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
  60. data/spec/dummy/db/migrate/{20111201121844_create_roles.rb → 20120129014038_create_budget_types.rb} +2 -2
  61. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +14 -0
  62. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
  63. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
  64. data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +6 -0
  65. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +16 -0
  66. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +6 -0
  67. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
  68. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
  69. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
  70. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
  71. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +12 -0
  72. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +15 -0
  73. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
  74. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +18 -0
  75. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +11 -0
  76. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +20 -0
  77. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
  78. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
  79. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
  80. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +14 -0
  81. data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +14 -0
  82. data/spec/dummy/db/migrate/20140524142813_add_taggings_count_to_tag.rb +5 -0
  83. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
  84. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
  85. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
  86. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
  87. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
  88. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
  89. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +11 -0
  90. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +14 -0
  91. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +8 -0
  92. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
  93. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
  94. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +5 -0
  95. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +6 -0
  96. data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +5 -0
  97. data/spec/dummy/db/migrate/20140812093836_add_share_bookmarks_to_profile.rb +5 -0
  98. data/spec/dummy/db/schema.rb +419 -72
  99. data/spec/dummy/db/test.sqlite3 +0 -0
  100. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  101. data/spec/dummy/solr/default/data/index/segments_1c8 +0 -0
  102. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001725 +0 -0
  103. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000001366 → tlog.0000000000000001726} +0 -0
  104. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001727 +0 -0
  105. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000001368 → tlog.0000000000000001728} +0 -0
  106. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001729 +0 -0
  107. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000001372 → tlog.0000000000000001730} +0 -0
  108. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001731 +0 -0
  109. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001732 +0 -0
  110. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001733 +0 -0
  111. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001734 +0 -0
  112. data/spec/factories/profile.rb +9 -0
  113. data/spec/factories/user.rb +21 -9
  114. data/spec/fixtures/libraries.yml +103 -0
  115. data/spec/fixtures/library_groups.yml +0 -2
  116. data/spec/fixtures/profiles.yml +98 -0
  117. data/spec/fixtures/user_groups.yml +3 -3
  118. data/spec/fixtures/users.yml +3 -21
  119. data/spec/models/question_spec.rb +1 -1
  120. data/spec/spec_helper.rb +5 -0
  121. metadata +191 -59
  122. data/app/models/question_sweeper.rb +0 -17
  123. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +0 -9
  124. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +0 -9
  125. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +0 -13
  126. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
  127. data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +0 -9
  128. data/spec/dummy/db/migrate/20111201155456_create_users.rb +0 -13
  129. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +0 -52
  130. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
  131. data/spec/dummy/solr/default/data/index/segments_128 +0 -0
  132. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001365 +0 -0
  133. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001367 +0 -0
  134. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001369 +0 -0
  135. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001370 +0 -0
  136. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001371 +0 -0
  137. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001373 +0 -0
  138. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001374 +0 -0
@@ -1,10 +1,10 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.question')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.listing', model: t('activerecord.models.question')) -%></h1>
3
3
 
4
4
  <div id="content_list">
5
- <%= form_for :questions, :url => questions_path, :html => {:method => 'get'} do -%>
5
+ <%= form_for :questions, url: questions_path, :html => {method: 'get'} do -%>
6
6
  <p>
7
- <%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
7
+ <%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
8
8
  <%= submit_tag t('page.search') -%>
9
9
  </p>
10
10
  <%- end -%>
@@ -13,12 +13,12 @@
13
13
  </div>
14
14
  </div>
15
15
 
16
- <div id="submenu" class="ui-corner-all">
16
+ <div id="submenu" class="ui-corner-all ui-widget-content">
17
17
  <%= render 'solved_facet' -%>
18
18
  <ul>
19
19
  <%- if can? :create, Question -%>
20
20
  <li><%= link_to t('question.my'), user_questions_path(current_user) -%></li>
21
- <li><%= link_to t('page.new', :model => t('activerecord.models.question')), new_question_path -%></li>
21
+ <li><%= link_to t('page.new', model: t('activerecord.models.question')), new_question_path -%></li>
22
22
  <%- end -%>
23
23
  </ul>
24
24
  <%= render 'crd' -%>
@@ -1,9 +1,9 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.question')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.listing', model: t('activerecord.models.question')) -%></h1>
3
3
  <div id="content_list">
4
- <%= form_for :questions, :url => user_questions_path(@user), :html => {:method => 'get'} do -%>
4
+ <%= form_for :questions, url: user_questions_path(@user), :html => {method: 'get'} do -%>
5
5
  <p>
6
- <%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
6
+ <%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
7
7
  <%= submit_tag t('page.search') -%>
8
8
  </p>
9
9
  <%- end -%>
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  </div>
14
14
 
15
- <div id="submenu" class="ui-corner-all">
15
+ <div id="submenu" class="ui-corner-all ui-widget-content">
16
16
  <%= render 'solved_facet' -%>
17
17
  <ul>
18
18
  <li><%= link_to t('question.all'), questions_path -%></li>
@@ -4,24 +4,24 @@
4
4
  <%- if params[:sort_by].blank? -%>
5
5
  <strong><%= t('question.last_answered_at') -%></strong>
6
6
  <%- else -%>
7
- <%= link_to t('question.last_answered_at'), url_for(params.merge(:sort_by => nil, :only_path => true)) -%>
7
+ <%= link_to t('question.last_answered_at'), url_for(params.merge(sort_by: nil, only_path: true)) -%>
8
8
  <%- end -%>
9
9
  <%- if params[:sort_by] == 'created_at' -%>
10
10
  <strong><%= t('question.created_at') -%></strong>
11
11
  <%- else -%>
12
- <%= link_to t('question.created_at'), url_for(params.merge(:sort_by => 'created_at', :only_path => true)) -%>
12
+ <%= link_to t('question.created_at'), url_for(params.merge(sort_by: 'created_at', only_path: true)) -%>
13
13
  <%- end -%>
14
14
  <%- if params[:sort_by] == 'answers_count' -%>
15
15
  <strong><%= t('activerecord.attributes.question.answers_count') -%></strong>
16
16
  <%- else -%>
17
- <%= link_to t('activerecord.attributes.question.answers_count'), url_for(params.merge(:sort_by => 'answers_count', :only_path => true)) -%>
17
+ <%= link_to t('activerecord.attributes.question.answers_count'), url_for(params.merge(sort_by: 'answers_count', only_path: true)) -%>
18
18
  <%- end -%>
19
19
  </p>
20
20
 
21
21
  <%- if @count[:query_result] > 0 -%>
22
22
  <table class="index">
23
23
  <tr>
24
- <th>ID</th>
24
+ <th>Id</th>
25
25
  <th><%= t('activerecord.models.question') -%></th>
26
26
  <th></th>
27
27
  <th></th>
@@ -31,8 +31,8 @@
31
31
  <tr class="line<%= cycle("0", "1") -%>">
32
32
  <td style="width: 30px"><%= question.id -%></td>
33
33
  <td>
34
- <%= link_to truncate(question.body, :length => 60), question -%>
35
- (<%= link_to question.user.username, question.user -%>)
34
+ <%= link_to truncate(question.body, length: 60), question -%>
35
+ (<%= link_to question.user.username, question.user.profile if question.user.try(:profile) -%>)
36
36
  <br />
37
37
  <!--
38
38
  <%= t('question.updated_at') %>: <%= l(question.updated_at) -%>
@@ -41,7 +41,7 @@
41
41
  <%= t('question.last_answered_at') %>: <%= l(question.answers.last.updated_at) if question.answers.last -%>
42
42
  </td>
43
43
  <td>
44
- <%= link_to image_tag('icons/comments.png', :alt => t('answer.count'), :size => '16x16'), question %>
44
+ <%= link_to image_tag('icons/comments.png', alt: t('answer.count'), size: '16x16'), question %>
45
45
  <%= link_to question.answers.size, question -%>
46
46
  <%- if question.solved %>
47
47
  <%= t('question.solved') %>
@@ -54,7 +54,7 @@
54
54
  <%= link_to t('page.edit'), edit_question_path(question) -%>
55
55
  <% end %>
56
56
  <%- if can? :delete, question -%>
57
- <%= link_to t('page.destroy'), question, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
57
+ <%= link_to t('page.destroy'), question, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
58
58
  <%- end -%>
59
59
  </td>
60
60
  </tr>
@@ -64,6 +64,6 @@
64
64
  <p><%= t('question.no_record_found') -%></p>
65
65
  <%- end -%>
66
66
 
67
- <%= paginate(@questions, :remote => true) -%>
67
+ <%= paginate(@questions, remote: true) -%>
68
68
 
69
69
  </div>
@@ -4,12 +4,12 @@
4
4
  <% facet.value ? facet_solved = true : facet_solved = false %>
5
5
  <li>
6
6
  <%- if @solved == facet_solved -%><strong><%- end -%>
7
- <%= link_to localized_boolean(facet.value), url_for(params.merge(:page => nil, :solved => facet.value.to_s, :view => nil, :only_path => true)) -%>
7
+ <%= link_to localized_boolean(facet.value), url_for(params.merge(page: nil, :solved => facet.value.to_s, view: nil, only_path: true)) -%>
8
8
  (<%= facet.count -%>)
9
9
  <%- if @solved == facet_solved -%></strong><%- end -%>
10
10
  </li>
11
11
  <%- end -%>
12
12
  <%- if @solved -%>
13
- <li><%= link_to t('page.remove_this_facet'), url_for(params.merge(:solved => nil, :page => nil, :view => nil, :only_path => true)) -%></li>
13
+ <li><%= link_to t('page.remove_this_facet'), url_for(params.merge(:solved => nil, page: nil, view: nil, only_path: true)) -%></li>
14
14
  <%- end -%>
15
15
  </ul>
@@ -1,18 +1,18 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.question')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.editing', model: t('activerecord.models.question')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
- <%= simple_form_for(@question, :validate => true) do |f| -%>
5
+ <%= simple_form_for(@question, validate: true) do |f| -%>
6
6
  <%= f.error_notification -%>
7
7
 
8
8
  <div class="field">
9
9
  <%= f.label t('activerecord.models.user') -%><br />
10
- <%= link_to @question.user.username, @question.user -%>
10
+ <%= link_to @question.user.username, @question.user.profile if @question.user.try(:profile) -%>
11
11
  </div>
12
12
 
13
13
  <div class="field">
14
14
  <%= f.label :body -%><br />
15
- <%= f.text_area :body, :class => 'resource_textarea' -%>
15
+ <%= f.text_area :body, class: 'resource_textarea' -%>
16
16
  </div>
17
17
 
18
18
  <div class="field">
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
  </div>
38
38
 
39
- <div id="submenu" class="ui-corner-all">
39
+ <div id="submenu" class="ui-corner-all ui-widget-content">
40
40
  <ul>
41
41
  <li><%= link_to t('page.show'), @question -%></li>
42
42
  <li><%= link_to t('page.back'), user_questions_path(@question.user) -%></li>
@@ -1,8 +1,8 @@
1
- atom_feed(:url => questions_url(:format => :atom)) do |feed|
1
+ atom_feed(url: questions_url(format: :atom)) do |feed|
2
2
  if @user
3
3
  feed.title t('question.user_question', :login_name => @user.username)
4
4
  else
5
- feed.title t('question.library_group_question', :library_group_name => @library_group.display_name.localize)
5
+ feed.title t('question.library_group_question', library_group_name: @library_group.display_name.localize)
6
6
  end
7
7
  feed.updated(@questions.first ? @questions.first.created_at : Time.zone.now)
8
8
 
@@ -1,12 +1,12 @@
1
1
  <div data-role="header">
2
- <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.question')) -%></h1>
2
+ <h1 class="title"><%= t('page.listing', model: t('activerecord.models.question')) -%></h1>
3
3
  </div>
4
4
 
5
5
  <div data-role="content">
6
6
  <div data-role="fieldcontain">
7
- <%= form_for :questions, :html => {:method => 'get'} do -%>
7
+ <%= form_for :questions, :html => {method: 'get'} do -%>
8
8
  <%= label_tag :search_form_top, t('page.search_term') -%>:
9
- <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
9
+ <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
10
10
  <%= submit_tag t('page.search') -%>
11
11
  <% end %>
12
12
  </div>
@@ -14,7 +14,7 @@
14
14
 
15
15
  <ul data-role="listview">
16
16
  <% @questions.each do |question| %>
17
- <li><%= link_to truncate(question.body, :length => 60), question -%></li>
17
+ <li><%= link_to truncate(question.body, length: 60), question -%></li>
18
18
  <% end %>
19
19
  </ul>
20
20
 
@@ -7,20 +7,20 @@ xml.rss('version' => "2.0",
7
7
  xml.title t('question.user_question', :login_name => @user.username)
8
8
  xml.link user_questions_url(@user)
9
9
  else
10
- xml.title t('question.library_group_question', :library_group_name => @library_group.display_name.localize)
10
+ xml.title t('question.library_group_question', library_group_name: @library_group.display_name.localize)
11
11
  xml.link questions_url
12
12
  end
13
13
  xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
14
14
  xml.language @locale.to_s
15
15
  xml.ttl "60"
16
16
  if @user
17
- xml.tag! "atom:link", :rel => 'self', :href => user_questions_url(@user, :format => :rss)
18
- xml.tag! "atom:link", :rel => 'alternate', :href => user_questions_url(@user)
17
+ xml.tag! "atom:link", rel: 'self', href: user_questions_url(@user, format: :rss)
18
+ xml.tag! "atom:link", rel: 'alternate', href: user_questions_url(@user)
19
19
  else
20
- xml.tag! "atom:link", :rel => 'self', :href => questions_url(:format => :rss)
21
- xml.tag! "atom:link", :rel => 'alternate', :href => questions_url
20
+ xml.tag! "atom:link", rel: 'self', href: questions_url(format: :rss)
21
+ xml.tag! "atom:link", rel: 'alternate', href: questions_url
22
22
  end
23
- #xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port}/page/opensearch"
23
+ #xml.tag! "atom:link", rel: 'search', :type => 'application/opensearchdescription+xml', href: "http://#{request.host_with_port}/page/opensearch"
24
24
  unless params[:query].blank?
25
25
  xml.tag! "opensearch:totalResults", @count[:query_result]
26
26
  xml.tag! "opensearch:startIndex", @questions.offset + 1
@@ -1,18 +1,18 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.new', :model => t('activerecord.models.question')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.new', model: t('activerecord.models.question')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
- <%= simple_form_for(@question, :validate => true) do |f| -%>
5
+ <%= simple_form_for(@question, validate: true) do |f| -%>
6
6
  <%= f.error_notification -%>
7
7
 
8
8
  <div class="field">
9
9
  <%= f.label t('activerecord.models.user') -%><br />
10
- <%= link_to @question.user.username, @question.user -%>
10
+ <%= link_to @question.user.username, @question.user.profile if @question.user.try(:profile) -%>
11
11
  </div>
12
12
 
13
13
  <div class="field">
14
14
  <%= f.label :body -%><br />
15
- <%= f.text_area :body, :class => 'resource_textarea' -%>
15
+ <%= f.text_area :body, class: 'resource_textarea' -%>
16
16
  </div>
17
17
 
18
18
  <div class="field">
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
  </div>
30
30
 
31
- <div id="submenu" class="ui-corner-all">
31
+ <div id="submenu" class="ui-corner-all ui-widget-content">
32
32
  <ul>
33
33
  <li><%= link_to t('page.back'), user_questions_path(@question.user) -%></li>
34
34
  </ul>
@@ -1,11 +1,11 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.question')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.showing', model: t('activerecord.models.question')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
5
5
 
6
6
  <p>
7
7
  <strong><%= t('activerecord.models.user') -%>:</strong>
8
- <%= link_to @question.user.username, @question.user -%>
8
+ <%= link_to @question.user.username, @question.user.profile if @question.user.try(:profile) -%>
9
9
  </p>
10
10
 
11
11
  <p>
@@ -28,12 +28,12 @@
28
28
  </p>
29
29
 
30
30
  <p>
31
- <strong><%= link_to t('activerecord.models.answer'), question_answers_path(@question) -%>:</strong>
31
+ <strong><%= link_to t('activerecord.models.answer'), answers_path(question_id: @question.id) -%>:</strong>
32
32
  </p>
33
33
 
34
34
  <ul>
35
35
  <%- @question.answers.each do |answer| -%>
36
- <li><%= link_to answer.user.username, answer.user -%>
36
+ <li><%= link_to answer.user.username, answer.user.profile if answer.user.try(:profile) -%>
37
37
  (<%=l answer.updated_at %>)<br />
38
38
  <%= raw auto_link(textilize(h(answer.body))) -%><br />
39
39
  <% unless answer.items.empty? %>
@@ -50,13 +50,13 @@
50
50
  </div>
51
51
  </div>
52
52
 
53
- <div id="submenu" class="ui-corner-all">
53
+ <div id="submenu" class="ui-corner-all ui-widget-content">
54
54
  <ul>
55
55
  <li><%= link_to t('question.answer_question'), new_question_answer_path(@question) -%></li>
56
56
  <%- if can? :update, @question -%>
57
57
  <li><%= link_to t('page.edit'), edit_question_path(@question) -%></li>
58
58
  <%- end -%>
59
59
  <li><%= back_to_index(flash[:page_info]) -%></li>
60
- <li><%= link_to 'レファレンス協同データベース用XMLファイル', question_path(@question, :mode => 'crd', :format => 'xml') -%></li>
60
+ <li><%= link_to 'レファレンス協同データベース用XMLファイル', question_path(@question, mode: 'crd', format: 'xml') -%></li>
61
61
  </ul>
62
62
  </div>
@@ -1,5 +1,5 @@
1
1
  <div data-role="header">
2
- <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.question')) -%></h1>
2
+ <h1 class="title"><%= t('page.showing', model: t('activerecord.models.question')) -%></h1>
3
3
  </div>
4
4
  <div data-role="content">
5
5
  <div id="detail">
@@ -11,7 +11,7 @@
11
11
 
12
12
  <p>
13
13
  <strong><%= t('activerecord.models.user') -%>:</strong>
14
- <%= link_to @question.user.username, @question.user -%>
14
+ <%= link_to @question.user.username, @question.user.profile if @question.user.try(:profile) -%>
15
15
  <strong><%= t('activerecord.attributes.question.shared') -%>:</strong>
16
16
  <%= localized_boolean(@question.shared) -%>
17
17
  <strong><%= t('activerecord.attributes.question.solved') -%>:</strong>
@@ -27,7 +27,7 @@
27
27
 
28
28
  <ul>
29
29
  <%- @question.answers.each do |answer| -%>
30
- <li><%= link_to answer.user.username, answer.user -%>
30
+ <li><%= link_to answer.user.username, answer.user.profile if answer.user.try(:profile) -%>
31
31
  (<%=l answer.updated_at %>)<br />
32
32
  <%= raw auto_link(textilize(h(answer.body))) -%><br />
33
33
  <% unless answer.items.empty? %>
@@ -1,3 +1,3 @@
1
1
  module EnjuQuestion
2
- VERSION = "0.1.0.pre11"
2
+ VERSION = "0.1.0.pre12"
3
3
  end
@@ -289,6 +289,7 @@ describe QuestionsController do
289
289
  describe "with valid params" do
290
290
  it "assigns a newly created question as @question" do
291
291
  post :create, :question => @attrs
292
+ assigns(:question).user.save!
292
293
  assigns(:question).should be_valid
293
294
  end
294
295
 
@@ -1,29 +1,9 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  class User < ActiveRecord::Base
2
- # Include default devise modules. Others available are:
3
- # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
4
- devise :database_authenticatable, :registerable,
5
- :recoverable, :rememberable, :trackable, :validatable
6
-
7
- # Setup accessible (or protected) attributes for your model
8
- attr_accessible :email, :password, :password_confirmation, :remember_me
9
-
10
- has_one :user_has_role
11
- has_one :role, :through => :user_has_role
12
- belongs_to :user_group
13
- belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id'
3
+ devise :database_authenticatable, #:registerable,
4
+ :recoverable, :rememberable, :trackable, #, :validatable
5
+ :lockable, :lock_strategy => :none, :unlock_strategy => :none
14
6
 
7
+ enju_leaf_user_model
15
8
  enju_question_user_model
16
-
17
- def has_role?(role_in_question)
18
- return false unless role
19
- return true if role.name == role_in_question
20
- case role.name
21
- when 'Administrator'
22
- return true
23
- when 'Librarian'
24
- return true if role_in_question == 'User'
25
- else
26
- false
27
- end
28
- end
29
9
  end
@@ -40,7 +40,6 @@ class CreateAgents < ActiveRecord::Migration
40
40
  t.text :note
41
41
  t.integer :required_role_id, :default => 1, :null => false
42
42
  t.integer :required_score, :default => 0, :null => false
43
- t.string :state
44
43
  t.text :email
45
44
  t.text :url
46
45
  end
@@ -0,0 +1,46 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+ ## Token authenticatable
34
+ # t.string :authentication_token
35
+
36
+
37
+ t.timestamps
38
+ end
39
+
40
+ add_index :users, :email, :unique => true
41
+ add_index :users, :reset_password_token, :unique => true
42
+ # add_index :users, :confirmation_token, :unique => true
43
+ # add_index :users, :unlock_token, :unique => true
44
+ # add_index :users, :authentication_token, :unique => true
45
+ end
46
+ end
@@ -19,38 +19,26 @@ class CreateManifestations < ActiveRecord::Migration
19
19
  t.integer :height
20
20
  t.integer :width
21
21
  t.integer :depth
22
- t.string :isbn
23
- t.string :isbn10
24
- t.string :wrong_isbn
25
- t.string :nbn
26
- t.string :lccn
27
- t.string :oclc_number
28
- t.string :issn
29
22
  t.integer :price # TODO: 通貨単位
30
23
  t.text :fulltext
31
- t.string :volume_number_list
32
- t.string :issue_number_list
33
- t.string :serial_number_list
24
+ t.string :volume_number_string
25
+ t.string :issue_number_string
26
+ t.string :serial_number_string
34
27
  t.integer :edition
35
28
  t.text :note
36
29
  t.boolean :repository_content, :default => false, :null => false
37
30
  t.integer :lock_version, :default => 0, :null => false
38
31
  t.integer :required_role_id, :default => 1, :null => false
39
- t.string :state
40
32
  t.integer :required_score, :default => 0, :null => false
41
33
  t.integer :frequency_id, :default => 1, :null => false
42
34
  t.boolean :subscription_master, :default => false, :null => false
43
35
  end
44
- add_index :manifestations, :carrier_type_id
45
- add_index :manifestations, :required_role_id
46
- add_index :manifestations, :isbn
47
- add_index :manifestations, :nbn
48
- add_index :manifestations, :lccn
49
- add_index :manifestations, :oclc_number
50
- add_index :manifestations, :issn
36
+ #add_index :manifestations, :carrier_type_id
37
+ #add_index :manifestations, :required_role_id
51
38
  add_index :manifestations, :access_address
52
- add_index :manifestations, :frequency_id
39
+ #add_index :manifestations, :frequency_id
53
40
  add_index :manifestations, :manifestation_identifier
54
41
  add_index :manifestations, :updated_at
42
+ add_index :manifestations, :date_of_publication
55
43
  end
56
44
  end