summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/application.rb3
-rw-r--r--config/initializers/add_controller_methods.rb1
-rw-r--r--config/initializers/i18n.rb4
-rw-r--r--config/locales/en.yml46
-rw-r--r--config/locales/errors.en.yml11
-rw-r--r--config/locales/flash.en.yml10
-rw-r--r--config/locales/footer.en.yml7
-rw-r--r--config/locales/generic.en.yml25
-rw-r--r--config/locales/home.en.yml8
-rw-r--r--config/locales/simple_form.en.yml4
-rw-r--r--config/locales/users.en.yml20
-rw-r--r--config/routes.rb10
12 files changed, 90 insertions, 59 deletions
diff --git a/config/application.rb b/config/application.rb
index 2c9c55a..8555f48 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -91,5 +91,8 @@ module LeapWeb
## see initializers/customization.rb
##
config.paths['app/views'].unshift "config/customization/views"
+
+ # handle http errors ourselves
+ config.exceptions_app = self.routes
end
end
diff --git a/config/initializers/add_controller_methods.rb b/config/initializers/add_controller_methods.rb
index f572ecb..03e8393 100644
--- a/config/initializers/add_controller_methods.rb
+++ b/config/initializers/add_controller_methods.rb
@@ -1,4 +1,5 @@
ActiveSupport.on_load(:application_controller) do
include ControllerExtension::Authentication
include ControllerExtension::TokenAuthentication
+ include ControllerExtension::Flash
end
diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb
index c277a22..b209d00 100644
--- a/config/initializers/i18n.rb
+++ b/config/initializers/i18n.rb
@@ -8,3 +8,7 @@ MATCH_LOCALE = /(#{I18n.available_locales.join('|')})/
# I18n.available_locales is always an array of symbols, but for comparison with
# params we need it to be an array of strings.
LOCALES_STRING = I18n.available_locales.map(&:to_s)
+
+# enable using the cascade option
+# see svenfuchs.com/2011/2/11/organizing-translations-with-i18n-cascade-and-i18n-missingtranslations
+I18n::Backend::Simple.send(:include, I18n::Backend::Cascade)
diff --git a/config/locales/en.yml b/config/locales/en.yml
deleted file mode 100644
index cebf075..0000000
--- a/config/locales/en.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-en:
- privacy_policy: Privacy Policy
- terms_of_service: Terms of Service
- pricing: Pricing
- about: About Us
- contact: Contact
- no_such_thing: "No such %{thing}."
- thing_was_successfully_created: "%{thing} was successfully created."
- create_thing: "Create %{thing}"
-
- overview: "Overview"
- user_control_panel: "user control panel"
-
- created: "Created"
- created_by_on: "Created by %{user} on %{time}"
- updated: "Updated"
-
- none: "None"
- unknown: "Unknown"
- admin: "Admin"
- anonymous: "Anonymous"
- save: "Save"
- add: "Add"
- remove: "Remove"
- changes_saved: "Changes saved successfully."
- are_you_sure: "Are you sure? This change cannot be undone."
-
- download_client: "Download Bitmask"
- client_info: "The Bitmask application allows you to use %{provider} services."
- all_downloads_info: "It is available for %{clients}."
- other_downloads_info: "Bitmask is also available for %{clients}."
- login_info: "Log in to change your account settings, create support tickets, and manage payments."
- signup_info: "Get a user account via this website. We recommend registering via the Bitmask application instead unless you are only using Bitmask for Android."
- welcome: "Welcome to %{provider}."
- get_help: "Get Help"
- help_info: "Can't login? Create a new support ticket anonymously."
- example_email: 'user@domain.org'
- os:
- linux32: "Linux (32 bit)"
- linux64: "Linux (64 bit)"
- linux: "GNU/Linux"
- windows: "Windows"
- android: "Android"
- osx: "Mac OS"
- other: "(not available for your OS)"
-
diff --git a/config/locales/errors.en.yml b/config/locales/errors.en.yml
new file mode 100644
index 0000000..93feab1
--- /dev/null
+++ b/config/locales/errors.en.yml
@@ -0,0 +1,11 @@
+en:
+ errors:
+ title:
+ not_found: Page not found.
+ server_error: Ouch!
+ subtitle:
+ not_found: "The page you were looking for doesn't exist."
+ server_error: We ran into a server error.
+ text:
+ not_found: "You may have mistyped the address or the page may have moved."
+ server_error: The problem has been logged and we will look into it.
diff --git a/config/locales/flash.en.yml b/config/locales/flash.en.yml
new file mode 100644
index 0000000..7ad28f8
--- /dev/null
+++ b/config/locales/flash.en.yml
@@ -0,0 +1,10 @@
+en:
+ flash:
+ success: "%{resource} was successfully saved."
+ error: "%{resource} could not be saved."
+ create:
+ success: "%{resource} was successfully created."
+ error: "%{resource} could not be created."
+ update:
+ success: "%{resource} was successfully updated."
+ error: "%{resource} could not be updated."
diff --git a/config/locales/footer.en.yml b/config/locales/footer.en.yml
new file mode 100644
index 0000000..65f8ab2
--- /dev/null
+++ b/config/locales/footer.en.yml
@@ -0,0 +1,7 @@
+en:
+ # layout/footer
+ privacy_policy: Privacy Policy
+ terms_of_service: Terms of Service
+ pricing: Pricing
+ about: About Us
+ contact: Contact
diff --git a/config/locales/generic.en.yml b/config/locales/generic.en.yml
new file mode 100644
index 0000000..14dafac
--- /dev/null
+++ b/config/locales/generic.en.yml
@@ -0,0 +1,25 @@
+en:
+ signup: "Sign Up"
+ login: "Log In"
+ logout: "Log Out"
+
+ cancel: "Cancel"
+
+ created: "Created"
+ created_by_on: "Created by %{user} on %{time}"
+ updated: "Updated"
+
+ none: "None"
+ unknown: "Unknown"
+ admin: "Admin"
+ anonymous: "Anonymous"
+ save: "Save"
+ add: "Add"
+ remove: "Remove"
+ changes_saved: "Changes saved successfully."
+ are_you_sure: "Are you sure? This change cannot be undone."
+
+ example_email: 'user@domain.org'
+
+ no_such_thing: "No such %{thing}."
+ create_thing: "Create %{thing}"
diff --git a/config/locales/home.en.yml b/config/locales/home.en.yml
new file mode 100644
index 0000000..c3cdfb1
--- /dev/null
+++ b/config/locales/home.en.yml
@@ -0,0 +1,8 @@
+en:
+ home: Home
+ welcome: "Welcome to %{provider}."
+ download_bitmask: "Download Bitmask"
+
+ login_info: "Log in to change your account settings, create support tickets, and manage payments."
+ signup_info: "Get a user account via this website. We recommend registering via the Bitmask application instead unless you are only using Bitmask for Android."
+ support_info: "Can't login? Create a new support ticket anonymously."
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
index 5d0c675..4b35883 100644
--- a/config/locales/simple_form.en.yml
+++ b/config/locales/simple_form.en.yml
@@ -29,8 +29,8 @@ en:
helpers:
submit:
user:
- create: "Sign up"
+ create: "Sign Up"
update: "Save"
session:
- create: "Log in"
+ create: "Log In"
diff --git a/config/locales/users.en.yml b/config/locales/users.en.yml
index 0ca5a73..f0fcb3d 100644
--- a/config/locales/users.en.yml
+++ b/config/locales/users.en.yml
@@ -1,10 +1,8 @@
en:
+ layouts:
+ users: "Users"
+ user_control_panel: "user control panel"
account_settings: "Account Settings"
- logout: "Logout"
- none: "None"
- signup: "Sign Up"
- cancel: "Cancel"
- login: "Log In"
username: "Username"
password: "Password"
change_password: "Change Password"
@@ -42,11 +40,13 @@ en:
#
# overview
#
- overview_welcome: "Welcome %{username}."
- overview_intro: "From this user control panel, you can:"
- overview_tickets: "Create and check support tickets."
- overview_email: "Modify email settings."
- overview_account: "Destroy your account."
+ users:
+ overview:
+ welcome: "Welcome %{username}."
+ intro: "From this user control panel, you can:"
+ tickets: "Create and check support tickets."
+ email: "Modify email settings."
+ account: "Destroy your account."
#
# rails
diff --git a/config/routes.rb b/config/routes.rb
index 745b97d..4ccfe62 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,6 +6,13 @@ LeapWeb::Application.routes.draw do
root :to => "home#index"
get '(:locale)' => 'home#index', :locale => MATCH_LOCALE, :as => 'home'
+ #
+ # HTTP Error Handling
+ # instead of the default error pages use the errors controller and views
+ #
+ match '/404' => 'errors#not_found'
+ match '/500' => 'errors#server_error'
+
scope "(:locale)", :locale => MATCH_LOCALE, :controller => 'pages', :action => 'show' do
get 'privacy-policy', :as => 'privacy_policy'
get 'terms-of-service', :as => 'terms_of_service'
@@ -25,7 +32,8 @@ LeapWeb::Application.routes.draw do
delete "logout" => "sessions#destroy", :as => "logout"
resources :users, :only => [:create, :update, :destroy, :index]
resources :messages, :only => [:index, :update]
- resource :cert, :only => [:show]
+ resource :cert, :only => [:show, :create]
+ resource :smtp_cert, :only => [:create]
resource :service, :only => [:show]
end