summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorazul <azul@leap.se>2014-05-22 14:59:27 +0200
committerazul <azul@leap.se>2014-05-22 14:59:27 +0200
commit0f686b1256b4190522bcb101ba06cd2c7406eb36 (patch)
tree0179b6c413069da86b6a8b910fd266bc698c0308
parent0c995deeb434237aa71e3a45f9f5a51f7c79116a (diff)
parentd2f4bd40342675717c6681e4ce845c316468c8b1 (diff)
Merge pull request #166 from elijh/feature/footer
better detection if price link should be shown in the footer
-rw-r--r--app/helpers/core_helper.rb7
-rw-r--r--app/views/layouts/_footer.html.haml2
2 files changed, 8 insertions, 1 deletions
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/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