summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb3
-rw-r--r--app/helpers/link_helper.rb4
-rw-r--r--app/helpers/navigation_helper.rb6
3 files changed, 9 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 6de5e1b..920186d 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -19,7 +19,8 @@ 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
+ content_tag :span, '',
+ class: "glyphicon glyphicon-#{name} #{color_class(color)}"
end
def big_icon(name, color=nil)
diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb
index ddb063e..b74e1d7 100644
--- a/app/helpers/link_helper.rb
+++ b/app/helpers/link_helper.rb
@@ -39,6 +39,10 @@ module LinkHelper
def btn(*args, &block)
html_options = extract_html_options!(args, &block)
type = Array(html_options.delete(:type))
+ btn_opts = [:default, :primary, :success, :info, :warning, :danger, :link]
+ if (type & btn_opts).blank?
+ type << :default
+ end
type.map! {|t| "btn-#{t}"}
html_options[:class] = concat_classes(html_options[:class], 'btn', type)
args[0] = t(args[0]) if args[0].is_a?(Symbol)
diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb
index 2639246..1df840c 100644
--- a/app/helpers/navigation_helper.rb
+++ b/app/helpers/navigation_helper.rb
@@ -66,9 +66,9 @@ module NavigationHelper
end
def extract_icon!(options)
- icon = options.delete(:icon)
- if icon.present?
- content_tag(:i, '', class: "icon-#{icon}")
+ name = options.delete(:icon)
+ if name.present?
+ icon name
else
""
end