Sha256: cc8f2174e1419800a655cfe7efa068f484b1aa17af0aed5831592b6e3c6bd09c

Contents?: true

Size: 1.04 KB

Versions: 13

Compression:

Stored size: 1.04 KB

Contents

module BiolaFrontend
  module Rails
    module FrontendToolkitHelper

      def show_environment
        unless ::Rails.env.match(/prod/i)
          content_tag :span, ::Rails.env, class: 'label label-danger'
        end
      end

      def yield_or(name, or_content=nil, &block)
        if content_for?(name)
          content_for(name)
        elsif or_content
          or_content
        elsif block_given?
          yield(block)
        else
          ''
        end
      end

      def app_dropdown_link(dropdown, &block)
        link_options = {'class'=>'dropdown-toggle'}
        link_options = {'class'=>'dropdown-toggle', 'area-hidden'=>'true', 'data-toggle'=>'dropdown'} if dropdown
        link_to (dropdown ? '#' : BiolaFrontendToolkit.config.relative_root), link_options do
          yield if block_given?
        end
      end

      def app_link(app)
        icon_string = app[:icon].present? ? "#{fa_icon(app[:icon])} " : ''
        link_to app[:url] do
          (icon_string + app[:title]).html_safe
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
biola_frontend_toolkit-0.4.6 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.4.5 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.4.4 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.4.3 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.4.2 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.4.1 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.4.0 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.3.1 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.3.0 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.2.0 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.1.0 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.0.2 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb
biola_frontend_toolkit-0.0.1 app/helpers/biola_frontend/rails/frontend_toolkit_helper.rb