diff options
author | azul <azul@riseup.net> | 2013-07-06 07:51:54 -0700 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-07-06 07:51:54 -0700 |
commit | a18efa42ddc1cf8692d55f76ca3e92792913f40d (patch) | |
tree | 00527737a38bdafcd2e175bb6caf5e30b3360de1 /app/helpers/application_helper.rb | |
parent | d03e82b4df5075f796f56fb9568992b0ba0d7c07 (diff) | |
parent | dc98ad8c6445182d60b3f1909e0260ace6fbfca5 (diff) |
Merge pull request #55 from elijh/feature/new-ui
Feature/new ui
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..1e79990 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,40 @@ module ApplicationHelper + + # + # determine title for the page + # + def html_title + if content_for?(:title) + yield(:title) + elsif @title + [@title, ' - ', APP_CONFIG[:domain]].join + else + APP_CONFIG[:domain] + end + end + + # + # markup for bootstrap icon + # + # http://twitter.github.io/bootstrap/base-css.html#icons + # + def icon(name, color=nil) + if color.nil? + color_class = nil + elsif color == :black + color_class = 'icon-black' + elsif color == :white + color_class = '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) + html_escape(msg).gsub('[b]', '<b>').gsub('[/b]', '</b>').html_safe + end + end |