enju_leaf 1.1.0.rc1 → 1.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/enju_leaf.js +0 -1
  3. data/app/assets/javascripts/mobile.js +2 -1
  4. data/app/assets/stylesheets/enju.css +1 -1
  5. data/app/assets/stylesheets/enju_leaf.css +0 -1
  6. data/app/assets/stylesheets/mobile.css +1 -1
  7. data/app/controllers/user_groups_controller.rb +10 -0
  8. data/app/mailers/notifier.rb +0 -8
  9. data/app/models/user_group.rb +20 -19
  10. data/app/views/devise/sessions/new.html.erb +1 -1
  11. data/app/views/my_accounts/_edit_credential.html.erb +3 -3
  12. data/app/views/page/_menu.html.erb +1 -1
  13. data/app/views/page/configuration.html.erb +3 -1
  14. data/app/views/user_groups/_form.html.erb +6 -1
  15. data/config/locales/translation_ja.yml +2 -3
  16. data/config/routes.rb +10 -10
  17. data/lib/enju_leaf.rb +3 -5
  18. data/lib/enju_leaf/controller.rb +1 -1
  19. data/lib/enju_leaf/engine.rb +5 -1
  20. data/lib/enju_leaf/version.rb +1 -1
  21. data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +0 -1
  22. data/lib/generators/enju_leaf/setup/setup_generator.rb +20 -1
  23. data/lib/generators/enju_leaf/setup/templates/config/application.yml +2 -2
  24. data/spec/controllers/users_controller_spec.rb +0 -10
  25. data/spec/dummy/app/controllers/application_controller.rb +8 -5
  26. data/spec/dummy/db/development.sqlite3 +0 -0
  27. data/spec/dummy/db/schema.rb +2 -2
  28. data/spec/dummy/db/test.sqlite3 +0 -0
  29. data/spec/dummy/solr/data/test/index/{_3t.fdt → _6b.fdt} +0 -0
  30. data/spec/dummy/solr/data/test/index/{_3t.fdx → _6b.fdx} +0 -0
  31. data/spec/dummy/solr/data/test/index/{_3t.fnm → _6b.fnm} +0 -0
  32. data/spec/dummy/solr/data/test/index/{_3t.frq → _6b.frq} +0 -0
  33. data/spec/dummy/solr/data/test/index/{_3t.nrm → _6b.nrm} +0 -0
  34. data/spec/dummy/solr/data/test/index/{_3t.prx → _6b.prx} +0 -0
  35. data/spec/dummy/solr/data/test/index/{_3t.tii → _6b.tii} +0 -0
  36. data/spec/dummy/solr/data/test/index/{_3t.tis → _6b.tis} +0 -0
  37. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  38. data/spec/dummy/solr/data/test/index/{segments_7p → segments_cp} +0 -0
  39. data/spec/fixtures/user_groups.yml +20 -19
  40. data/spec/models/user_group_spec.rb +7 -7
  41. data/vendor/assets/javascripts/jquery.colorbox.js +108 -107
  42. data/vendor/assets/javascripts/{jquery.mobile-1.3.0.js → jquery.mobile-1.3.1.js} +3857 -3758
  43. data/vendor/assets/stylesheets/colorbox.css +4 -28
  44. data/vendor/assets/stylesheets/{jquery.mobile-1.3.0.css → jquery.mobile-1.3.1.css} +73 -64
  45. metadata +61 -35
  46. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e460dfb746a695bc7488df46411d278b325f1b0f
4
- data.tar.gz: 21c7e6d60ef5f7dbf40093ea0928612c4fc009c0
3
+ metadata.gz: cb475fbf4410550d3dc061f52c492e46c1be4865
4
+ data.tar.gz: e228f432f945a2a5df4262bda6500849575d6e4a
5
5
  SHA512:
6
- metadata.gz: 8f89f9d2ade2efcecccf7d7bc2d9a69f5e757e1ae10bea255d9b1220996b851014e4617ddd52f36974746f224f4a7db31be53b6fd61f218326a84ebc860a06ce
7
- data.tar.gz: 9e2b0c521f4e0d05a49674a84d916808104455017342d1bc5bd4ea0fd7fff72be70e5408e818deaa09018dcad3d857d7de644ad4671e5c38402b539d1d5e4d50
6
+ metadata.gz: a454d695e703abcffcda74a2e558dbee3a4c109d284f6a62918e41ec0d4c81f954a42f7b31eaefa15e1f4cd7f950efe6e1cc83a543be24461666b0219b052808
7
+ data.tar.gz: 40e9399a04f6adfff8b9c0956f973f5a7f37f31fe3212b05adbbf61cc770a62ef83e63563652a172284727c482f14f589482c98b1106d63abaaaed169c522afb
@@ -13,4 +13,3 @@
13
13
  //= require event_calendar
14
14
  //= require jquery.powertip
15
15
  //= require jquery_nested_form
16
- //= require jquery.modal
@@ -1,3 +1,4 @@
1
1
  //= require jquery
2
- //= require jquery.mobile-1.3.0
2
+ //= require jquery_ujs
3
+ //= require jquery.mobile-1.3.1
3
4
  //= require jquery.colorbox
@@ -383,7 +383,7 @@ input.date_field{
383
383
  }
384
384
 
385
385
  input.date_text_field{
386
- width: 80px;
386
+ width: 100px;
387
387
  }
388
388
 
389
389
  input.wide_date_text_field{
@@ -9,6 +9,5 @@
9
9
  *= require jquery.ui.tabs
10
10
  *= require jquery.ui.menu
11
11
  *= require jquery.ui.menubar
12
- *= require jquery.modal
13
12
  *= require portlets
14
13
  */
@@ -3,6 +3,6 @@
3
3
  * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
4
  * the top of the compiled file, but it's generally better to create a new file per style scope.
5
5
  *= require_self
6
- *= require jquery.mobile-1.3.0
6
+ *= require jquery.mobile-1.3.1
7
7
  *= require enju_mobile
8
8
  */
@@ -1,6 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class UserGroupsController < ApplicationController
3
3
  load_and_authorize_resource
4
+ before_filter :prepare_options, :only => [:new, :edit]
4
5
 
5
6
  # GET /user_groups
6
7
  # GET /user_groups.json
@@ -46,6 +47,7 @@ class UserGroupsController < ApplicationController
46
47
  format.html { redirect_to @user_group, :notice => t('controller.successfully_created', :model => t('activerecord.models.user_group')) }
47
48
  format.json { render :json => @user_group, :status => :created, :location => @user_group }
48
49
  else
50
+ prepare_options
49
51
  format.html { render :action => "new" }
50
52
  format.json { render :json => @user_group.errors, :status => :unprocessable_entity }
51
53
  end
@@ -65,6 +67,7 @@ class UserGroupsController < ApplicationController
65
67
  format.html { redirect_to @user_group, :notice => t('controller.successfully_updated', :model => t('activerecord.models.user_group')) }
66
68
  format.json { head :no_content }
67
69
  else
70
+ prepare_options
68
71
  format.html { render :action => "edit" }
69
72
  format.json { render :json => @user_group.errors, :status => :unprocessable_entity }
70
73
  end
@@ -81,4 +84,11 @@ class UserGroupsController < ApplicationController
81
84
  format.json { head :no_content }
82
85
  end
83
86
  end
87
+
88
+ private
89
+ def prepare_options
90
+ if defined?(EnjuCirculation)
91
+ @checkout_types = CheckoutType.select([:id, :display_name, :position])
92
+ end
93
+ end
84
94
  end
@@ -1,13 +1,5 @@
1
1
  class Notifier < ActionMailer::Base
2
2
  include Resque::Mailer
3
- if LibraryGroup.site_config.try(:url)
4
- uri = Addressable::URI.parse(LibraryGroup.site_config.url)
5
- default_url_options[:host] = uri.host
6
- default_url_options[:port] = uri.port if Setting.enju.web_port_number != 80
7
- else
8
- default_url_options[:host] = Setting.enju.web_hostname
9
- default_url_options[:port] = Setting.enju.web_port_number if Setting.enju.web_port_number != 80
10
- end
11
3
 
12
4
  def message_notification(message_id)
13
5
  message = Message.find(message_id)
@@ -1,22 +1,3 @@
1
- # == Schema Information
2
- #
3
- # Table name: user_groups
4
- #
5
- # id :integer not null, primary key
6
- # name :string(255)
7
- # display_name :text
8
- # note :text
9
- # position :integer
10
- # created_at :datetime not null
11
- # updated_at :datetime not null
12
- # deleted_at :datetime
13
- # valid_period_for_new_user :integer default(0), not null
14
- # expired_at :datetime
15
- # number_of_day_to_notify_overdue :integer default(1), not null
16
- # number_of_day_to_notify_due_date :integer default(7), not null
17
- # number_of_time_to_notify_overdue :integer default(3), not null
18
- #
19
-
20
1
  # -*- encoding: utf-8 -*-
21
2
  class UserGroup < ActiveRecord::Base
22
3
  attr_accessible :name, :display_name, :note, :valid_period_for_new_user,
@@ -37,3 +18,23 @@ class UserGroup < ActiveRecord::Base
37
18
 
38
19
  enju_circulation_user_group_model if defined?(EnjuCirculation)
39
20
  end
21
+
22
+ # == Schema Information
23
+ #
24
+ # Table name: user_groups
25
+ #
26
+ # id :integer not null, primary key
27
+ # name :string(255)
28
+ # display_name :text
29
+ # note :text
30
+ # position :integer
31
+ # created_at :datetime not null
32
+ # updated_at :datetime not null
33
+ # deleted_at :datetime
34
+ # valid_period_for_new_user :integer default(0), not null
35
+ # expired_at :datetime
36
+ # number_of_day_to_notify_overdue :integer default(1), not null
37
+ # number_of_day_to_notify_due_date :integer default(7), not null
38
+ # number_of_time_to_notify_overdue :integer default(3), not null
39
+ #
40
+
@@ -17,7 +17,7 @@
17
17
 
18
18
  <p>
19
19
  <%= f.label t('activerecord.attributes.user.password') %><br />
20
- <%= f.password_field :password, :class => 'login_password' %>
20
+ <%= f.password_field :password, :class => 'login_password', :autocomplete => 'off' %>
21
21
  </p>
22
22
 
23
23
  <p id="notice"><%= notice %></p>
@@ -12,15 +12,15 @@
12
12
  <div class="field">
13
13
  <abbr title="required"><%= t('simple_form.required.mark') %></abbr>
14
14
  <%= f.label :current_password -%><br />
15
- <%= f.password_field :current_password, :class => 'resource_email' -%>
15
+ <%= f.password_field :current_password, :class => 'resource_email', :autocomplete => 'off' -%>
16
16
  </div>
17
17
  <div class="field">
18
18
  <%= f.label :password -%><br />
19
- <%= f.password_field :password, :class => 'resource_email' -%>
19
+ <%= f.password_field :password, :class => 'resource_email', :autocomplete => 'off' -%>
20
20
  </div>
21
21
  <div class="field">
22
22
  <%= f.label :password_confirmation -%><br />
23
- <%= f.password_field :password_confirmation, :class => 'resource_email' -%>
23
+ <%= f.password_field :password_confirmation, :class => 'resource_email', :autocomplete => 'off' -%>
24
24
  </div>
25
25
 
26
26
  <div class="field">
@@ -41,7 +41,7 @@
41
41
  <li><%= link_to t('enju_ndl.import_from_ndl_search'), ndl_books_path -%></li>
42
42
  <% end %>
43
43
  <li><%= link_to t('page.add_manually'), new_manifestation_path -%></li>
44
- <li><%= link_to t('page.serial'), series_statements_path -%></li>
44
+ <li><%= link_to t('page.serial'), manifestations_path(:periodical => true) -%></li>
45
45
  <li><%= link_to t('page.import_from_file'), new_resource_import_file_path -%></li>
46
46
  <li><%= link_to t('activerecord.models.accept'), new_accept_path -%></li>
47
47
  <% if defined?(EnjuBookmark) %>
@@ -46,6 +46,7 @@
46
46
  <li><%= link_to t('item.all_item'), items_path %></li>
47
47
  </ul>
48
48
  </li>
49
+ <li><%= link_to t('activerecord.models.identifier_type'), identifier_types_path -%>
49
50
  <% if defined?(EnjuBookmark) %>
50
51
  <li><%= link_to t('activerecord.models.bookmark'), bookmarks_path -%></li>
51
52
  <% end %>
@@ -81,7 +82,6 @@
81
82
  <li><%= link_to t('activerecord.models.subject_heading_type'), subject_heading_types_path -%></li>
82
83
  <li><%= link_to t('activerecord.models.classification'), classifications_path -%></li>
83
84
  <li><%= link_to t('activerecord.models.classification_type'), classification_types_path -%></li>
84
- <li><%= link_to t('activerecord.models.subject_has_classification'), subject_has_classifications_path -%></li>
85
85
  </ul>
86
86
  </div>
87
87
  </div>
@@ -104,9 +104,11 @@
104
104
  <li><%= link_to t('activerecord.models.patron_relationship_type'), patron_relationship_types_path -%></li>
105
105
  <li><%= link_to t('activerecord.models.manifestation_relationship_type'), manifestation_relationship_types_path -%></li>
106
106
  <li><%= link_to t('activerecord.models.license'), licenses_path -%></li>
107
+ <!--
107
108
  <li><%= link_to t('activerecord.models.create_type'), create_types_path -%></li>
108
109
  <li><%= link_to t('activerecord.models.realize_type'), realize_types_path -%></li>
109
110
  <li><%= link_to t('activerecord.models.produce_type'), produce_types_path -%></li>
111
+ -->
110
112
  </ul>
111
113
  </div>
112
114
  </div>
@@ -1,4 +1,4 @@
1
- <%= simple_form_for(@user_group, :validate => true) do |f| %>
1
+ <%= simple_nested_form_for(@user_group) do |f| %>
2
2
  <%= f.error_notification -%>
3
3
 
4
4
  <div class="field">
@@ -25,6 +25,11 @@
25
25
  <%= f.label :number_of_time_to_notify_overdue %><br />
26
26
  <%= f.text_field :number_of_time_to_notify_overdue, :class => 'resource_integer' %>
27
27
  </div>
28
+
29
+ <% if defined?(EnjuCirculation) %>
30
+ <%= render 'user_groups/checkout_form', :f => f %>
31
+ <% end %>
32
+
28
33
  <div class="field">
29
34
  <%= f.label :note %><br />
30
35
  <%= f.text_area :note %>
@@ -239,9 +239,8 @@ ja:
239
239
  successfully_updated: "%{model}は正常に更新されました。"
240
240
  successfully_deleted: "%{model}は正常に削除されました。"
241
241
  advanced_search:
242
- from: "ここから"
243
- to: "ここまで"
244
- from_to: "から"
242
+ from: ""
243
+ to: "から"
245
244
  all_libraries: "全ての図書館"
246
245
  work:
247
246
  patron_work: "%{patron_name} の書いた資料"
data/config/routes.rb CHANGED
@@ -20,14 +20,14 @@ Rails.application.routes.draw do
20
20
 
21
21
  root :to => "page#index"
22
22
 
23
- match '/page/about' => 'page#about'
24
- match '/page/configuration' => 'page#configuration'
25
- match '/page/advanced_search' => 'page#advanced_search'
26
- match '/page/add_on' => 'page#add_on'
27
- match '/page/export' => 'page#export'
28
- match '/page/import' => 'page#import'
29
- match '/page/msie_acceralator' => 'page#msie_acceralator'
30
- match '/page/opensearch' => 'page#opensearch'
31
- match '/page/statistics' => 'page#statistics'
32
- match '/page/routing_error' => 'page#routing_error'
23
+ get '/page/about' => 'page#about'
24
+ get '/page/configuration' => 'page#configuration'
25
+ get '/page/advanced_search' => 'page#advanced_search'
26
+ get '/page/add_on' => 'page#add_on'
27
+ get '/page/export' => 'page#export'
28
+ get '/page/import' => 'page#import'
29
+ get '/page/msie_acceralator' => 'page#msie_acceralator'
30
+ get '/page/opensearch' => 'page#opensearch'
31
+ get '/page/statistics' => 'page#statistics'
32
+ get '/page/routing_error' => 'page#routing_error'
33
33
  end
data/lib/enju_leaf.rb CHANGED
@@ -54,7 +54,7 @@ module EnjuLeaf
54
54
 
55
55
  def render_404_invalid_format
56
56
  return if performed?
57
- render :file => "#{Rails.root}/public/404.html"
57
+ render :file => "#{Rails.root}/public/404", :formats => [:html]
58
58
  end
59
59
 
60
60
  def render_500
@@ -62,8 +62,8 @@ module EnjuLeaf
62
62
  return if performed?
63
63
  #flash[:notice] = t('page.connection_failed')
64
64
  respond_to do |format|
65
- format.html {render :file => "#{Rails.root.to_s}/public/500.html", :layout => false, :status => 500}
66
- format.mobile {render :file => "#{Rails.root.to_s}/public/500.html", :layout => false, :status => 500}
65
+ format.html {render :file => "#{Rails.root.to_s}/public/500", :layout => false, :status => 500}
66
+ format.mobile {render :file => "#{Rails.root.to_s}/public/500", :layout => false, :status => 500}
67
67
  format.xml {render :template => 'page/500', :status => 500}
68
68
  format.json { render :text => '{"error": "server_error"}' }
69
69
  end
@@ -272,8 +272,6 @@ module EnjuLeaf
272
272
  request.format = :html if request.format == :mobile
273
273
  end
274
274
  end
275
- #else
276
- # session[:mobylette_override] = nil
277
275
  end
278
276
  end
279
277
 
@@ -9,7 +9,7 @@ module EnjuLeaf
9
9
  private
10
10
  def set_error_template
11
11
  rescue_from CanCan::AccessDenied, :with => :render_403
12
- rescue_from ActiveRecord::RecordNotFound, :with => :render_404
12
+ #rescue_from ActiveRecord::RecordNotFound, :with => :render_404
13
13
  rescue_from Errno::ECONNREFUSED, :with => :render_500
14
14
  rescue_from ActionView::MissingTemplate, :with => :render_404_invalid_format
15
15
  end
@@ -3,8 +3,12 @@ require 'enju_library'
3
3
  require 'enju_manifestation_viewer'
4
4
  require 'redcarpet'
5
5
  require 'mobylette'
6
+ require 'rails_autolink'
7
+ require 'devise-encryptable'
8
+ require 'sitemap_generator'
9
+ require 'redis-rails'
10
+ require 'jquery-rails'
6
11
  require 'jquery-ui-rails'
7
- require 'jquery-modal-rails'
8
12
 
9
13
  module EnjuLeaf
10
14
  class Engine < ::Rails::Engine
@@ -1,3 +1,3 @@
1
1
  module EnjuLeaf
2
- VERSION = "1.1.0.rc1"
2
+ VERSION = "1.1.0.rc2"
3
3
  end
@@ -3,7 +3,6 @@ class EnjuLeaf::QuickInstallGenerator < Rails::Generators::Base
3
3
 
4
4
  def quick_install
5
5
  environment = ENV['ENJU_ENV'] || 'development'
6
- rake("db:create:all")
7
6
  rake("db:migrate", :env => environment)
8
7
  generate("enju_circulation:setup")
9
8
  generate("enju_subject:setup")
@@ -20,6 +20,12 @@ ActiveSupport::Inflector.inflections do |inflect|
20
20
  inflect.irregular 'reserve', 'reserves'
21
21
  end
22
22
  EOS
23
+ inject_into_file 'config/environments/development.rb',
24
+ " config.action_mailer.default_url_options = {:host => 'localhost:3000'}\n",
25
+ :after => "::Application.configure do\n"
26
+ inject_into_file 'config/environments/production.rb',
27
+ " config.action_mailer.default_url_options = {:host => 'localhost:3000'}\n",
28
+ :after => "::Application.configure do\n"
23
29
  generate("devise:install")
24
30
  generate("devise", "User")
25
31
  generate("enju_biblio:setup")
@@ -41,6 +47,16 @@ EOS
41
47
  enju_leaf
42
48
  enju_biblio
43
49
  enju_library
50
+
51
+ private
52
+ def mobylette_options
53
+ @mobylette_options ||= ApplicationController.send(:mobylette_options).merge(
54
+ {
55
+ :skip_xhr_requests => false
56
+ }
57
+ )
58
+ end
59
+
44
60
  EOS
45
61
  end
46
62
  #inject_into_class "app/models/user.rb", User, " enju_user_model\n"
@@ -48,7 +64,10 @@ EOS
48
64
  <<"EOS"
49
65
  include EnjuLeaf::EnjuLeafHelper
50
66
  include EnjuBiblio::BiblioHelper if defined?(EnjuBiblio)
51
- include EnjuManifestationViewer::ManifestationViewerHelper if defined?(EnjuManifestationViewer)
67
+ if defined?(EnjuManifestationViewer)
68
+ include EnjuManifestationViewer::BookJacketHelper
69
+ include EnjuManifestationViewer::ManifestationViewerHelper
70
+ end
52
71
  EOS
53
72
  end
54
73
  inject_into_file "app/assets/javascripts/application.js", :after => /\/\/= require jquery_ujs$\n/ do
@@ -1,8 +1,8 @@
1
1
  defaults: &defaults
2
2
  enju:
3
- web_hostname: localhost
4
- web_port_number: 3000
5
3
  erms_url:
4
+ skip_mobile_agents:
5
+ - ipad
6
6
 
7
7
  family_name_first: true
8
8
  max_number_of_results: 500
@@ -65,11 +65,6 @@ describe UsersController do
65
65
  get :show, :id => 'admin'
66
66
  assigns(:user).should eq(User.find('admin'))
67
67
  end
68
-
69
- it "should not show missing user" do
70
- get :show, :id => 'missing'
71
- response.should be_missing
72
- end
73
68
  end
74
69
 
75
70
  describe "When logged in as Librarian" do
@@ -157,11 +152,6 @@ describe UsersController do
157
152
  get :edit, :id => user.id
158
153
  assigns(:user).should eq(user)
159
154
  end
160
-
161
- it "should not edit missing user" do
162
- get :edit, :id => 'missing'
163
- response.should be_missing
164
- end
165
155
  end
166
156
 
167
157
  describe "When logged in as Librarian" do
@@ -4,9 +4,12 @@ class ApplicationController < ActionController::Base
4
4
  enju_biblio
5
5
  enju_library
6
6
 
7
- rescue_from CanCan::AccessDenied, :with => :render_403
8
- rescue_from ActiveRecord::RecordNotFound, :with => :render_404
9
- rescue_from Errno::ECONNREFUSED, :with => :render_500
10
- rescue_from ActionView::MissingTemplate, :with => :render_404_invalid_format
11
- #rescue_from ActionController::RoutingError, :with => :render_404
7
+ private
8
+ def mobylette_options
9
+ @mobylette_options ||= ApplicationController.send(:mobylette_options).merge(
10
+ {
11
+ :skip_xhr_requests => false
12
+ }
13
+ )
14
+ end
12
15
  end