enju_question 0.1.0.pre11 → 0.1.0.pre12

Sign up to get free protection for your applications and to get access to all the features.
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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ae5ecf6b5d7c744216cc19d1f8a08922e125dc7
4
- data.tar.gz: 736fbeaa3c33d0209916045ba95e8d286cc7242a
3
+ metadata.gz: e9bfa05a0add606a0ac41ce620c5c8d90aeb16db
4
+ data.tar.gz: c06de63d0fe30b4e3c3dbba3fa07c2f2c0793b42
5
5
  SHA512:
6
- metadata.gz: 918e131260467456addb99f840bad845eb770c5924ee93f58acb9c16bc330fb108693e5d7b6099ed51589e9f65423000654c06f7eb6a9beea4b94cec02309572
7
- data.tar.gz: fc493900650fb08c4f68587d3108198b4e078ce77def5771741a6e83b59bacf81d3ebf0cc89e1301c3c5168fc355431f253d01591e8a13541a0b0740cac8b449
6
+ metadata.gz: c85ceeb84b0750bd5378471143e6120a38145e50d46c4dcb101929ac25568263b591c22f2690cb22096e89232930ccfc7b542c4d3b12d1d005718e0f62a16089
7
+ data.tar.gz: 34229ed11ecaa06ee192bee85ec2ba8f57df80d4b2c50282edd137c032a36366f190c73330bae3cf6e735cef6f6dfbaf2e3ea6ae764691f9b819149ee2574814
@@ -1,11 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class AnswersController < ApplicationController
3
- load_and_authorize_resource :except => :index
4
- authorize_resource :only => :index
5
- before_filter :store_location, :only => [:index, :show, :new, :edit]
6
- before_filter :get_user, :except => [:edit]
3
+ load_and_authorize_resource except: :index
4
+ authorize_resource only: :index
5
+ before_filter :store_location, only: [:index, :show, :new, :edit]
6
+ before_filter :get_user, except: [:edit]
7
7
  before_filter :get_question
8
- cache_sweeper :question_sweeper, :only => [:create, :update, :destroy]
9
8
 
10
9
  # GET /answers
11
10
  # GET /answers.json
@@ -59,8 +58,8 @@ class AnswersController < ApplicationController
59
58
 
60
59
  respond_to do |format|
61
60
  format.html # index.html.erb
62
- format.json { render :json => @answers.to_json }
63
- format.rss { render :layout => false }
61
+ format.json { render json: @answers.to_json }
62
+ format.rss { render layout: false }
64
63
  format.atom
65
64
  end
66
65
  end
@@ -70,7 +69,7 @@ class AnswersController < ApplicationController
70
69
  def show
71
70
  respond_to do |format|
72
71
  format.html # show.html.erb
73
- format.json { render :json => @answer.to_json }
72
+ format.json { render json: @answer.to_json }
74
73
  end
75
74
  end
76
75
 
@@ -101,14 +100,14 @@ class AnswersController < ApplicationController
101
100
 
102
101
  respond_to do |format|
103
102
  if @answer.save
104
- flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.answer'))
103
+ flash[:notice] = t('controller.successfully_created', model: t('activerecord.models.answer'))
105
104
  format.html { redirect_to @answer }
106
- format.json { render :json => @answer, :status => :created, :location => answer_url(@answer) }
105
+ format.json { render json: @answer, status: :created, location: answer_url(@answer) }
107
106
  format.mobile { redirect_to question_url(@answer.question) }
108
107
  else
109
- format.html { render :action => "new" }
110
- format.json { render :json => @answer.errors, :status => :unprocessable_entity }
111
- format.mobile { render :action => "new" }
108
+ format.html { render action: "new" }
109
+ format.json { render json: @answer.errors, status: :unprocessable_entity }
110
+ format.mobile { render action: "new" }
112
111
  end
113
112
  end
114
113
  end
@@ -118,12 +117,12 @@ class AnswersController < ApplicationController
118
117
  def update
119
118
  respond_to do |format|
120
119
  if @answer.update_attributes(params[:answer])
121
- flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.answer'))
120
+ flash[:notice] = t('controller.successfully_updated', model: t('activerecord.models.answer'))
122
121
  format.html { redirect_to @answer }
123
122
  format.json { head :no_content }
124
123
  else
125
- format.html { render :action => "edit" }
126
- format.json { render :json => @answer.errors, :status => :unprocessable_entity }
124
+ format.html { render action: "edit" }
125
+ format.json { render json: @answer.errors, status: :unprocessable_entity }
127
126
  end
128
127
  end
129
128
  end
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class QuestionsController < ApplicationController
3
- before_filter :store_location, :only => [:index, :show, :new, :edit]
3
+ before_filter :store_location, only: [:index, :show, :new, :edit]
4
4
  load_and_authorize_resource
5
- before_filter :get_user, :except => [:edit]
6
- after_filter :solr_commit, :only => [:create, :update, :destroy]
5
+ before_filter :get_user, except: [:edit]
6
+ after_filter :solr_commit, only: [:create, :update, :destroy]
7
7
 
8
8
  # GET /questions
9
9
  # GET /questions.json
@@ -85,16 +85,16 @@ class QuestionsController < ApplicationController
85
85
 
86
86
  respond_to do |format|
87
87
  format.html # index.html.erb
88
- format.json { render :json => @questions }
88
+ format.json { render json: @questions }
89
89
  format.xml {
90
90
  if params[:mode] == 'crd'
91
- render :template => 'questions/index_crd'
91
+ render template: 'questions/index_crd'
92
92
  convert_charset
93
93
  else
94
94
  render :xml => @questions
95
95
  end
96
96
  }
97
- format.rss { render :layout => false }
97
+ format.rss { render layout: false }
98
98
  format.atom
99
99
  format.js
100
100
  end
@@ -105,10 +105,10 @@ class QuestionsController < ApplicationController
105
105
  def show
106
106
  respond_to do |format|
107
107
  format.html # show.html.erb
108
- format.json { render :json => @question }
108
+ format.json { render json: @question }
109
109
  format.xml {
110
110
  if params[:mode] == 'crd'
111
- render :template => 'questions/show_crd'
111
+ render template: 'questions/show_crd'
112
112
  convert_charset
113
113
  else
114
114
  render :xml => @question
@@ -134,12 +134,12 @@ class QuestionsController < ApplicationController
134
134
 
135
135
  respond_to do |format|
136
136
  if @question.save
137
- flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.question'))
137
+ flash[:notice] = t('controller.successfully_created', model: t('activerecord.models.question'))
138
138
  format.html { redirect_to @question }
139
- format.json { render :json => @question, :status => :created, :location => @question }
139
+ format.json { render json: @question, status: :created, location: @question }
140
140
  else
141
- format.html { render :action => "new" }
142
- format.json { render :json => @question.errors, :status => :unprocessable_entity }
141
+ format.html { render action: "new" }
142
+ format.json { render json: @question.errors, status: :unprocessable_entity }
143
143
  end
144
144
  end
145
145
  end
@@ -149,12 +149,12 @@ class QuestionsController < ApplicationController
149
149
  def update
150
150
  respond_to do |format|
151
151
  if @question.update_attributes(params[:question])
152
- flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.question'))
152
+ flash[:notice] = t('controller.successfully_updated', model: t('activerecord.models.question'))
153
153
  format.html { redirect_to @question }
154
154
  format.json { head :no_content }
155
155
  else
156
- format.html { render :action => "edit" }
157
- format.json { render :json => @question.errors, :status => :unprocessable_entity }
156
+ format.html { render action: "edit" }
157
+ format.json { render json: @question.errors, status: :unprocessable_entity }
158
158
  end
159
159
  end
160
160
  end
@@ -1,13 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class Answer < ActiveRecord::Base
3
3
  attr_accessible :question_id, :body, :item_identifier_list, :url_list
4
- default_scope :order => 'answers.id ASC'
4
+ default_scope order: 'answers.id ASC'
5
5
  #scope :public_answers, where(:shared => true)
6
6
  #scope :private_answers, where(:shared => false)
7
- belongs_to :user, :validate => true
8
- belongs_to :question, :validate => true
9
- has_many :answer_has_items, :dependent => :destroy
10
- has_many :items, :through => :answer_has_items
7
+ belongs_to :user, validate: true
8
+ belongs_to :question, validate: true
9
+ has_many :answer_has_items, dependent: :destroy
10
+ has_many :items, through: :answer_has_items
11
11
 
12
12
  after_save :save_questions
13
13
  before_save :add_items
@@ -19,11 +19,11 @@ class Answer < ActiveRecord::Base
19
19
  paginates_per 10
20
20
 
21
21
  def save_questions
22
- self.question.save
22
+ question.save
23
23
  end
24
24
 
25
25
  def add_items
26
- item_list = item_identifier_list.to_s.strip.split.map{|i| Item.where(:item_identifier => i).first}.compact.uniq
26
+ item_list = item_identifier_list.to_s.strip.split.map{|i| Item.where(item_identifier: i).first}.compact.uniq
27
27
  url_list = add_urls
28
28
  self.items = item_list + url_list
29
29
  end
@@ -3,8 +3,8 @@ class AnswerHasItem < ActiveRecord::Base
3
3
  belongs_to :answer
4
4
  belongs_to :item
5
5
 
6
- validates_uniqueness_of :item_id, :scope => :answer_id
7
- acts_as_list :scope => :answer_id
6
+ validates_uniqueness_of :item_id, scope: :answer_id
7
+ acts_as_list scope: :answer_id
8
8
  end
9
9
 
10
10
  # == Schema Information
@@ -1,13 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class Question < ActiveRecord::Base
3
3
  attr_accessible :body, :shared, :solved, :note
4
- default_scope :order => 'id DESC'
4
+ default_scope order: 'id DESC'
5
5
  scope :public_questions, where(:shared => true)
6
6
  scope :private_questions, where(:shared => false)
7
7
  scope :solved, where(:solved => true)
8
8
  scope :unsolved, where(:solved => false)
9
- belongs_to :user, :validate => true
10
- has_many :answers, :dependent => :destroy
9
+ belongs_to :user, validate: true
10
+ has_many :answers, dependent: :destroy
11
11
 
12
12
  validates_associated :user
13
13
  validates_presence_of :user, :body
@@ -22,7 +22,7 @@ class Question < ActiveRecord::Base
22
22
  boolean :shared
23
23
  boolean :solved
24
24
  integer :answers_count
25
- integer :manifestation_id, :multiple => true do
25
+ integer :manifestation_id, multiple: true do
26
26
  answers.collect(&:items).flatten.collect{|i| i.manifestation.id}
27
27
  end
28
28
  end
@@ -1,10 +1,10 @@
1
- <%= simple_form_for(@answer, :validate => true) do |f| %>
1
+ <%= simple_form_for(@answer, validate: true) do |f| %>
2
2
  <%= f.error_notification %>
3
3
  <%= f.hidden_field :question_id %>
4
4
 
5
5
  <div class="field">
6
6
  <%= f.label t('activerecord.models.user') %><br />
7
- <%= link_to @answer.user.username, @answer.user %>
7
+ <%= link_to @answer.user.username, @answer.user.profile if @answer.user.try(:profile) %>
8
8
  </div>
9
9
 
10
10
  <div class="field">
@@ -14,17 +14,17 @@
14
14
 
15
15
  <div class="field">
16
16
  <%= f.label :body %><br />
17
- <%= f.text_area :body, :class => 'resource_textarea' %>
17
+ <%= f.text_area :body, class: 'resource_textarea' %>
18
18
  </div>
19
19
 
20
20
  <div class="field">
21
21
  <%= f.label :item_identifier_list %><br />
22
- <%= f.text_area :item_identifier_list, :class => 'resource_textarea' %>
22
+ <%= f.text_area :item_identifier_list, class: 'resource_textarea' %>
23
23
  </div>
24
24
 
25
25
  <div class="field">
26
26
  <%= f.label :url_list %><br />
27
- <%= f.text_area :url_list, :class => 'resource_textarea' %>
27
+ <%= f.text_area :url_list, class: 'resource_textarea' %>
28
28
  </div>
29
29
 
30
30
  <div class="actions">
@@ -1,11 +1,11 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.answer')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.editing', model: t('activerecord.models.answer')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'form' %>
5
5
  </div>
6
6
  </div>
7
7
 
8
- <div id="submenu" class="ui-corner-all">
8
+ <div id="submenu" class="ui-corner-all ui-widget-content">
9
9
  <ul>
10
10
  <li><%= link_to t('page.show'), @answer -%></li>
11
11
  <li><%= link_to t('page.back'), question_answers_path(@answer.question) -%></li>
@@ -1,8 +1,8 @@
1
- atom_feed(:url => answers_url(:format => :atom)) do |feed|
1
+ atom_feed(url: answers_url(format: :atom)) do |feed|
2
2
  if @user
3
3
  feed.title t('answer.user_answer', :login_name => @user.username)
4
4
  else
5
- feed.title t('answer.library_group_answer', :library_group_name => @library_group.display_name.localize)
5
+ feed.title t('answer.library_group_answer', library_group_name: @library_group.display_name.localize)
6
6
  end
7
7
  feed.updated(@answers.first ? @answers.first.created_at : Time.zone.now)
8
8
 
@@ -1,5 +1,5 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.answer')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.listing', model: t('activerecord.models.answer')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
5
  <%- if @question -%>
@@ -17,14 +17,14 @@
17
17
 
18
18
  <%- @answers.each_with_index do |answer, i| -%>
19
19
  <tr class="line<%= cycle("0", "1") -%>">
20
- <td><%= link_to answer.user.username, answer.user -%></td>
21
- <td><%= link_to truncate(answer.body, :length => 20), answer -%></td>
20
+ <td><%= link_to answer.user.username, answer.user.profile if answer.user.try(:profile) -%></td>
21
+ <td><%= link_to truncate(answer.body, length: 20), answer -%></td>
22
22
  <td><%= l(answer.created_at) -%></td>
23
23
  <td><%= l(answer.updated_at) -%></td>
24
24
  <td>
25
25
  <%- if can? :delete, answer -%>
26
26
  <%= link_to t('page.edit'), edit_answer_path(answer) -%>
27
- <%= link_to t('page.destroy'), answer, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
27
+ <%= link_to t('page.destroy'), answer, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
28
28
  <%- end -%>
29
29
  </td>
30
30
  </tr>
@@ -35,10 +35,10 @@
35
35
  </div>
36
36
  </div>
37
37
 
38
- <div id="submenu" class="ui-corner-all">
38
+ <div id="submenu" class="ui-corner-all ui-widget-content">
39
39
  <%- if @question -%>
40
40
  <ul>
41
- <li><%= link_to t('page.new', :model => t('activerecord.models.answer')), new_question_answer_path(@question) -%></li>
41
+ <li><%= link_to t('page.new', model: t('activerecord.models.answer')), new_question_answer_path(@question) -%></li>
42
42
  </ul>
43
43
  <%- end -%>
44
44
  </div>
@@ -8,9 +8,9 @@ xml.rss('version' => "2.0",
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))}"
12
- xml.tag! "atom:link", :rel => 'alternate', :href => "#{request.protocol}#{request.host_with_port}"
13
- #xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port}/page/opensearch"
11
+ xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: :rss, only_path: true))}"
12
+ xml.tag! "atom:link", rel: 'alternate', href: "#{request.protocol}#{request.host_with_port}"
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?
15
15
  xml.tag! "opensearch:totalResults", @count[:query_result]
16
16
  xml.tag! "opensearch:startIndex", @answers.offset_value + 1
@@ -1,11 +1,11 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.new', :model => t('activerecord.models.answer')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.new', model: t('activerecord.models.answer')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'form' %>
5
5
  </div>
6
6
  </div>
7
7
 
8
- <div id="submenu" class="ui-corner-all">
8
+ <div id="submenu" class="ui-corner-all ui-widget-content">
9
9
  <ul>
10
10
  <%- if @answer.question -%>
11
11
  <li><%= link_to t('page.back'), question_answers_path(@answer.question) -%></li>
@@ -1,30 +1,30 @@
1
1
  <div data-role="header">
2
- <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.answer')) -%></h1>
2
+ <h1 class="title"><%= t('page.showing', model: t('activerecord.models.answer')) -%></h1>
3
3
  </div>
4
4
  <div data-role="content">
5
5
  <div id="detail">
6
6
 
7
- <%= form_for(@answer, :url => question_answers_path(@answer.question)) do |f| -%>
7
+ <%= form_for(@answer, url: question_answers_path(@answer.question)) do |f| -%>
8
8
  <%= f.error_messages -%>
9
9
  <div class="field">
10
10
  <%= f.label t('activerecord.models.question') -%><br />
11
11
  <%= @answer.question.body -%>
12
- <%= f.hidden_field :question_id, :value => @answer.question.id -%>
12
+ <%= f.hidden_field :question_id, value: @answer.question.id -%>
13
13
  </div>
14
14
 
15
15
  <div class="field">
16
16
  <%= f.label :body -%><br />
17
- <%= f.text_area :body, :class => 'resource_textarea' -%>
17
+ <%= f.text_area :body, class: 'resource_textarea' -%>
18
18
  </div>
19
19
 
20
20
  <div class="field">
21
21
  <%= f.label :item_identifier_list -%><br />
22
- <%= f.text_area :item_identifier_list, :class => 'resource_textarea' -%>
22
+ <%= f.text_area :item_identifier_list, class: 'resource_textarea' -%>
23
23
  </div>
24
24
 
25
25
  <div class="field">
26
26
  <%= f.label :url_list -%><br />
27
- <%= f.text_area :url_list, :class => 'resource_textarea' -%>
27
+ <%= f.text_area :url_list, class: 'resource_textarea' -%>
28
28
  </div>
29
29
 
30
30
  <div class="actions">
@@ -1,16 +1,17 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.answer')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.showing', model: t('activerecord.models.answer')) -%></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 @answer.user.username, @answer.user -%>
8
+ <%= link_to @answer.user.username, @answer.user.profile if @answer.user.try(:profile) -%>
9
9
  </p>
10
10
 
11
11
  <p>
12
12
  <strong><%= t('activerecord.models.question') -%>:</strong>
13
- <%= link_to @answer.question.user.username, @answer.question.user -%>: <%= link_to @answer.question.body, @answer.question -%>
13
+ <%= link_to @answer.question.user.username, @answer.question.user.profile if @answer.question.user.try(:profile) -%>:
14
+ <%= link_to @answer.question.body, @answer.question -%>
14
15
  </p>
15
16
 
16
17
  <p>
@@ -44,7 +45,7 @@
44
45
  </div>
45
46
  </div>
46
47
 
47
- <div id="submenu" class="ui-corner-all">
48
+ <div id="submenu" class="ui-corner-all ui-widget-content">
48
49
  <ul>
49
50
  <%- if can? :update, @answer -%>
50
51
  <li><%= link_to t('page.edit'), edit_answer_path(@answer) -%></li>
@@ -0,0 +1,13 @@
1
+ <div id="question">
2
+ <div id="question_list">
3
+ <ul>
4
+ <% @questions.each do |question| %>
5
+ <li>
6
+ <%= link_to question.body, question %>
7
+ (<%= t('page.last_updated') %>: <%=l question.updated_at %>)
8
+ </li>
9
+ <% end %>
10
+ </ul>
11
+ <%= paginate(@questions, param_name: :question_page, remote: true) -%>
12
+ </div>
13
+ </div>
@@ -7,7 +7,7 @@
7
7
  <li><%= link_to h(truncate(result[:question])), result[:url] -%></li>
8
8
  <%- end -%>
9
9
  </ul>
10
- <%= paginate(@crd_results, :param_name => :crd_page, :remote => true, :window => 1) -%>
10
+ <%= paginate(@crd_results, param_name: :crd_page, remote: true, :window => 1) -%>
11
11
  <%- else -%>
12
12
  <p><%= link_to t('question.you_can_search_crd'), "http://crd.ndl.go.jp/" -%></p>
13
13
  <%- end -%>