aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--install.rb2
-rw-r--r--lib/config/custom-routes.rb11
-rw-r--r--lib/controller_patches.rb7
-rw-r--r--lib/gettext_setup.rb3
-rw-r--r--lib/model_patches.rb3
-rw-r--r--lib/patch_mailer_paths.rb5
-rw-r--r--lib/views/general/_before_head_end.html.erb (renamed from lib/views/general/_before_head_end.rhtml)0
-rw-r--r--lib/views/general/_frontpage_intro_sentence.html.erb (renamed from lib/views/general/_frontpage_intro_sentence.rhtml)0
-rw-r--r--lib/views/general/_orglink.html.erb (renamed from lib/views/general/_orglink.rhtml)0
-rw-r--r--lib/views/general/_popup_banner.html.erb (renamed from lib/views/general/_popup_banner.rhtml)0
-rw-r--r--lib/views/general/mycontroller.html.erb (renamed from lib/views/general/mycontroller.rhtml)0
-rw-r--r--lib/views/help/_sidebar.html.erb (renamed from lib/views/help/_sidebar.rhtml)0
-rw-r--r--lib/views/help/about.es.html.erb (renamed from lib/views/help/about.es.rhtml)0
-rw-r--r--lib/views/help/about.html.erb (renamed from lib/views/help/about.rhtml)0
-rw-r--r--lib/views/help/api.html.erb (renamed from lib/views/help/api.rhtml)0
-rw-r--r--lib/views/help/credits.html.erb (renamed from lib/views/help/credits.rhtml)0
-rw-r--r--lib/views/help/help_out.html.erb (renamed from lib/views/help/help_out.rhtml)0
-rw-r--r--lib/views/help/officers.html.erb (renamed from lib/views/help/officers.rhtml)2
-rw-r--r--lib/views/help/privacy.html.erb (renamed from lib/views/help/privacy.rhtml)2
-rw-r--r--lib/views/help/requesting.html.erb (renamed from lib/views/help/requesting.rhtml)0
-rw-r--r--lib/views/outgoing_mailer/initial_request.text.erb (renamed from lib/views/outgoing_mailer/initial_request.rhtml)0
-rw-r--r--uninstall.rb2
22 files changed, 16 insertions, 21 deletions
diff --git a/install.rb b/install.rb
index fa9dcdf..4aee9f7 100644
--- a/install.rb
+++ b/install.rb
@@ -1,7 +1,7 @@
# Install hook code here
plugin_path = File.expand_path(File.join(File.dirname(__FILE__), "public"))
-main_app_path = File.join(RAILS_ROOT, 'public', 'alavetelitheme')
+main_app_path = Rails.root.join('public', 'alavetelitheme')
# If the symlink to be created exists, warn the user and do nothing
if File.exists?(main_app_path)
diff --git a/lib/config/custom-routes.rb b/lib/config/custom-routes.rb
index 4184d10..5aeb7c2 100644
--- a/lib/config/custom-routes.rb
+++ b/lib/config/custom-routes.rb
@@ -1,13 +1,8 @@
# Here you can override or add to the pages in the core website
-ActionController::Routing::Routes.draw do |map|
+Rails.application.routes.draw do
# brand new controller example
- map.with_options :controller => 'general' do |general|
- general.mycontroller '/mycontroller', :action => 'mycontroller'
- end
-
+ match '/mycontroller' => 'general#mycontroller'
# Additional help page example
- map.with_options :controller => 'help' do |help|
- help.help_out '/help/help_out', :action => 'help_out'
- end
+ match '/help/help_out' => 'help#help_out'
end
diff --git a/lib/controller_patches.rb b/lib/controller_patches.rb
index 11b5722..9959f86 100644
--- a/lib/controller_patches.rb
+++ b/lib/controller_patches.rb
@@ -4,12 +4,15 @@
# classes are reloaded, but initialization is not run each time.
# See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode
#
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
# Example adding an instance variable to the frontpage controller
GeneralController.class_eval do
def mycontroller
@say_something = "Greetings friend"
end
end
+ HelpController.class_eval do
+ def help_out
+ end
+ end
end
diff --git a/lib/gettext_setup.rb b/lib/gettext_setup.rb
index 5b7a455..879bf57 100644
--- a/lib/gettext_setup.rb
+++ b/lib/gettext_setup.rb
@@ -1,7 +1,6 @@
# Add a callback - to be executed before each request in development,
# and at startup in production - to plug in theme locale strings.
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
repos = [
FastGettext::TranslationRepository.build('app', :path=>File.join(File.dirname(__FILE__), '..', 'locale-theme'), :type => :po),
FastGettext::TranslationRepository.build('app', :path=>'locale', :type => :po)
diff --git a/lib/model_patches.rb b/lib/model_patches.rb
index 694f54d..8abd4e8 100644
--- a/lib/model_patches.rb
+++ b/lib/model_patches.rb
@@ -4,8 +4,7 @@
# classes are reloaded, but initialization is not run each time.
# See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode
#
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
OutgoingMessage.class_eval do
# Add intro paragraph to new request template
def default_letter
diff --git a/lib/patch_mailer_paths.rb b/lib/patch_mailer_paths.rb
index d0a0b23..7a524fa 100644
--- a/lib/patch_mailer_paths.rb
+++ b/lib/patch_mailer_paths.rb
@@ -2,10 +2,9 @@
# and at startup in production - to patch existing app classes.
# See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode
#
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
# Override mailer templates with theme ones. Note doing this in a before_filter,
# as we do with the controller paths, doesn't seem to have any effect when
# running in production
- ActionMailer::Base.view_paths.unshift File.join(File.dirname(__FILE__), "views")
+ ActionMailer::Base.prepend_view_path File.join(File.dirname(__FILE__), "views")
end
diff --git a/lib/views/general/_before_head_end.rhtml b/lib/views/general/_before_head_end.html.erb
index 1644299..1644299 100644
--- a/lib/views/general/_before_head_end.rhtml
+++ b/lib/views/general/_before_head_end.html.erb
diff --git a/lib/views/general/_frontpage_intro_sentence.rhtml b/lib/views/general/_frontpage_intro_sentence.html.erb
index cfba8f6..cfba8f6 100644
--- a/lib/views/general/_frontpage_intro_sentence.rhtml
+++ b/lib/views/general/_frontpage_intro_sentence.html.erb
diff --git a/lib/views/general/_orglink.rhtml b/lib/views/general/_orglink.html.erb
index 9535a79..9535a79 100644
--- a/lib/views/general/_orglink.rhtml
+++ b/lib/views/general/_orglink.html.erb
diff --git a/lib/views/general/_popup_banner.rhtml b/lib/views/general/_popup_banner.html.erb
index 49c9ec2..49c9ec2 100644
--- a/lib/views/general/_popup_banner.rhtml
+++ b/lib/views/general/_popup_banner.html.erb
diff --git a/lib/views/general/mycontroller.rhtml b/lib/views/general/mycontroller.html.erb
index ad642d3..ad642d3 100644
--- a/lib/views/general/mycontroller.rhtml
+++ b/lib/views/general/mycontroller.html.erb
diff --git a/lib/views/help/_sidebar.rhtml b/lib/views/help/_sidebar.html.erb
index e5d345c..e5d345c 100644
--- a/lib/views/help/_sidebar.rhtml
+++ b/lib/views/help/_sidebar.html.erb
diff --git a/lib/views/help/about.es.rhtml b/lib/views/help/about.es.html.erb
index 9588249..9588249 100644
--- a/lib/views/help/about.es.rhtml
+++ b/lib/views/help/about.es.html.erb
diff --git a/lib/views/help/about.rhtml b/lib/views/help/about.html.erb
index a2b5ef2..a2b5ef2 100644
--- a/lib/views/help/about.rhtml
+++ b/lib/views/help/about.html.erb
diff --git a/lib/views/help/api.rhtml b/lib/views/help/api.html.erb
index 323bdb7..323bdb7 100644
--- a/lib/views/help/api.rhtml
+++ b/lib/views/help/api.html.erb
diff --git a/lib/views/help/credits.rhtml b/lib/views/help/credits.html.erb
index bc493bc..bc493bc 100644
--- a/lib/views/help/credits.rhtml
+++ b/lib/views/help/credits.html.erb
diff --git a/lib/views/help/help_out.rhtml b/lib/views/help/help_out.html.erb
index 6fadca4..6fadca4 100644
--- a/lib/views/help/help_out.rhtml
+++ b/lib/views/help/help_out.html.erb
diff --git a/lib/views/help/officers.rhtml b/lib/views/help/officers.html.erb
index 6636fef..0a7d208 100644
--- a/lib/views/help/officers.rhtml
+++ b/lib/views/help/officers.html.erb
@@ -80,7 +80,7 @@ use.</p>
<p>Requests are sometimes not delivered because they are quietly removed by
"spam filters" in the IT department of the authority. Authorities can make
sure this doesn't happen by asking their IT departments to "whitelist"
-any email from <strong>@<%= Configuration::incoming_email_domain %></strong>.
+any email from <strong>@<%= AlaveteliConfiguration::incoming_email_domain %></strong>.
If you <a href="/help/contact">ask us</a> we will resend any request,
and/or give technical details of delivery so an IT department can chase
up what happened to the message.
diff --git a/lib/views/help/privacy.rhtml b/lib/views/help/privacy.html.erb
index 7102fc8..6f190ee 100644
--- a/lib/views/help/privacy.rhtml
+++ b/lib/views/help/privacy.html.erb
@@ -12,7 +12,7 @@
<dd><p>We will not disclose your email address to anyone unless we are obliged to by law,
or you ask us to. This includes the public authority that you are sending a
request to. They only get to see an email address
-@<%= Configuration::incoming_email_domain %> which is specific to that request. </p>
+@<%= AlaveteliConfiguration::incoming_email_domain %> which is specific to that request. </p>
<p>If you send a message to another user on the site, then it will reveal your
email address to them. You will be told that this is going to happen.</p>
</dd>
diff --git a/lib/views/help/requesting.rhtml b/lib/views/help/requesting.html.erb
index 7787d15..7787d15 100644
--- a/lib/views/help/requesting.rhtml
+++ b/lib/views/help/requesting.html.erb
diff --git a/lib/views/outgoing_mailer/initial_request.rhtml b/lib/views/outgoing_mailer/initial_request.text.erb
index a172b41..a172b41 100644
--- a/lib/views/outgoing_mailer/initial_request.rhtml
+++ b/lib/views/outgoing_mailer/initial_request.text.erb
diff --git a/uninstall.rb b/uninstall.rb
index 82d9571..871647c 100644
--- a/uninstall.rb
+++ b/uninstall.rb
@@ -1,6 +1,6 @@
# Uninstall hook code here
-main_app_path = File.join(RAILS_ROOT, 'public', 'alavetelitheme')
+main_app_path = Rails.root.join('public', 'alavetelitheme')
if File.exists?(main_app_path) && File.symlink?(main_app_path)
print "Deleting symbolic link at #{main_app_path}... "
File.delete(main_app_path)