summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-10-15 11:10:31 -0700
committerjessib <jessib@riseup.net>2013-10-15 11:10:31 -0700
commita6f196d0bfe632408db7350829507478b825b1a8 (patch)
treeba2de17a08c11619a74a0be6cf4c3939a2b9f223 /app/helpers
parent0acbf6a158f149c1f4273bde0cfca47547e080f8 (diff)
parent8e5aa5093ab6e67db4f603a44bb7027245b91a21 (diff)
Merge pull request #99 from azul/feature/os-detection
detect os in browser and show proper download link
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb23
1 files changed, 15 insertions, 8 deletions
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)
+ "<i class=\"icon-#{name} #{color_class(color)}\"></i> ".html_safe
+ end
+
+ def big_icon(name, color=nil)
+ "<i class=\"big-icon-#{name} #{color_class(color)}\"></i> ".html_safe
+ end
+
+ def huge_icon(name, color=nil)
+ "<i class=\"huge-icon-#{name} #{color_class(color)}\"></i> ".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
- "<i class=\"icon-#{name} #{color_class}\"></i> ".html_safe
- end
-
- def big_icon(name, color=nil)
- "<i class=\"big-icon-#{name}\"></i> ".html_safe
end
def format_flash(msg)