diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/errors_controller.rb | 10 | ||||
-rw-r--r-- | app/helpers/core_helper.rb | 7 | ||||
-rw-r--r-- | app/views/errors/not_found.html.haml | 7 | ||||
-rw-r--r-- | app/views/errors/server_error.html.haml | 7 | ||||
-rw-r--r-- | app/views/layouts/_footer.html.haml | 2 |
5 files changed, 32 insertions, 1 deletions
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb new file mode 100644 index 0000000..6c659e6 --- /dev/null +++ b/app/controllers/errors_controller.rb @@ -0,0 +1,10 @@ +# We render http errors ourselves so we can customize them +class ErrorsController < ApplicationController + # 404 + def not_found + end + + # 500 + def server_error + end +end diff --git a/app/helpers/core_helper.rb b/app/helpers/core_helper.rb index 4126906..46e8fa4 100644 --- a/app/helpers/core_helper.rb +++ b/app/helpers/core_helper.rb @@ -10,4 +10,11 @@ module CoreHelper render 'common/home_page_buttons' end + # + # returns true if the configured service levels contain a level with a price attached + # + def paid_service_level? + APP_CONFIG[:service_levels].present? && APP_CONFIG[:service_levels].detect{|k,v| v['rate'].present?} + end + end diff --git a/app/views/errors/not_found.html.haml b/app/views/errors/not_found.html.haml new file mode 100644 index 0000000..75cb889 --- /dev/null +++ b/app/views/errors/not_found.html.haml @@ -0,0 +1,7 @@ +.hero-unit + %h1=t :not_found_title + %h2=t :not_found_subtitle + %p.lead=t :not_found_lead + %a.btn.btn-primary.btn-large{href:'/'} + %i.icon-home.icon-white + =t :home diff --git a/app/views/errors/server_error.html.haml b/app/views/errors/server_error.html.haml new file mode 100644 index 0000000..68baf20 --- /dev/null +++ b/app/views/errors/server_error.html.haml @@ -0,0 +1,7 @@ +.hero-unit + %h1=t :server_error_title + %h2=t :server_error_subtitle + %p.lead=t :server_error_lead + %a.btn.btn-primary.btn-large{href:'/'} + %i.icon-home.icon-white + =t :home diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index 340d36c..de53667 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -6,5 +6,5 @@ = link_to icon('info-sign') + t(:about), about_path - if lookup_context.exists?('pages/contact') = link_to icon('comment') + t(:contact), contact_path - - if APP_CONFIG[:service_levels].present? + - if paid_service_level? = link_to icon('shopping-cart') + t(:pricing), pricing_path |