From a0d9fbc4bcbd2f37e8d86d99c2e01753eecb14d7 Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 26 Mar 2016 18:02:20 +0100 Subject: upgrade bootstrap3 icons work now import bootstrap-sprockets; before importing bootstrap in the scss. bootstrap now uses glyphicons which are based on fonts. So we always should use a span. Not sure what to do with big and huge icons yet. --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6de5e1b..23b2752 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -19,7 +19,7 @@ module ApplicationHelper # http://twitter.github.io/bootstrap/base-css.html#icons # def icon(name, color=nil) - " ".html_safe + " ".html_safe end def big_icon(name, color=nil) -- cgit v1.2.3 From 65f67e1829666a65a3b354d4d95f9d38aa15a81e Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 26 Mar 2016 18:17:55 +0100 Subject: upgrade: fix buttons for bootstrap3 bootstrap3 now requires btn-default if no other btn option is present. download button on home page was too small in german translation --- app/helpers/link_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/helpers') 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) -- cgit v1.2.3 From 500fa2db1d593131d7cebd127c941a44bf174223 Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 26 Mar 2016 18:42:36 +0100 Subject: use icon helper from navigation helper and use content_tag inside the icon helper... html_safe is evil. --- app/helpers/application_helper.rb | 3 ++- app/helpers/navigation_helper.rb | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 23b2752..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) - " ".html_safe + content_tag :span, '', + class: "glyphicon glyphicon-#{name} #{color_class(color)}" end def big_icon(name, color=nil) 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 -- cgit v1.2.3