Module: UsersHelper
- Defined in:
- app/helpers/users_helper.rb
Instance Method Summary collapse
-
#available_color_themes ⇒ Object
Returns an array of the color themes available, as specified from AVAILABLE_COLOR_THEMES in config/initializers/color_themes.rb.
-
#current_color_theme ⇒ Object
Returns the path of the current color theme so that it can be loaded in app/views/layouts/application.html.haml and app/views/layouts/application.mobile.haml.
- #owner_image_link ⇒ Object
- #owner_image_tag(size = nil) ⇒ Object
Instance Method Details
#available_color_themes ⇒ Object
Returns an array of the color themes available, as specified from AVAILABLE_COLOR_THEMES in config/initializers/color_themes.rb.
39 40 41 42 43 44 45 |
# File 'app/helpers/users_helper.rb', line 39 def available_color_themes opts = [] AVAILABLE_COLOR_THEMES.map do |theme_code| opts << [I18n.t("color_themes.#{theme_code}"), theme_code] end opts end |
#current_color_theme ⇒ Object
Returns the path of the current color theme so that it can be loaded in app/views/layouts/application.html.haml and app/views/layouts/application.mobile.haml. If the user is not signed in or has not specified a color theme, the default (original) color theme is loaded.
24 25 26 27 28 29 30 |
# File 'app/helpers/users_helper.rb', line 24 def current_color_theme if user_signed_in? color_theme = current_user.color_theme end color_theme ||= AppConfig.settings.default_color_theme "color_themes/#{color_theme}" end |
#owner_image_link ⇒ Object
8 9 10 |
# File 'app/helpers/users_helper.rb', line 8 def owner_image_link person_image_link(current_user.person, :size => :thumb_small) end |
#owner_image_tag(size = nil) ⇒ Object
4 5 6 |
# File 'app/helpers/users_helper.rb', line 4 def owner_image_tag(size=nil) person_image_tag(current_user.person, size) end |