From 8e5aa5093ab6e67db4f603a44bb7027245b91a21 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 15 Oct 2013 14:31:52 +0200 Subject: detect os in browser and show proper download link We add a class to the html element based on the detected os and use that to pick which download link should be visible. If we detect an os that is not supported we display a deactivated download link instead with all alternatives. --- app/helpers/application_helper.rb | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1e79990..90e649a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -19,18 +19,25 @@ module ApplicationHelper # http://twitter.github.io/bootstrap/base-css.html#icons # def icon(name, color=nil) + " ".html_safe + end + + def big_icon(name, color=nil) + " ".html_safe + end + + def huge_icon(name, color=nil) + " ".html_safe + end + + def color_class(color) if color.nil? - color_class = nil + nil elsif color == :black - color_class = 'icon-black' + 'icon-black' elsif color == :white - color_class = 'icon-white' + 'icon-white' end - " ".html_safe - end - - def big_icon(name, color=nil) - " ".html_safe end def format_flash(msg) -- cgit v1.2.3