Sha256: 396767553945e19b2f0b577eb294efa3649b6b61b7bebb6d38fa739b1cd3fead

Contents?: true

Size: 861 Bytes

Versions: 26

Compression:

Stored size: 861 Bytes

Contents

module Para
  module Admin
    module PageHelper
      def page_top_bar(options = {})
        content_tag(:div, class: 'page-title row') do
          content_tag(:h1, options[:title]) +

          if (actions = actions_for(options[:type]))
            actions.map(&method(:build_action)).join('').html_safe
          end
        end
      end

      def build_action(action)
        content_tag(:div, class: 'actions-control pull-right') do  
          link_to(action[:url], class: 'btn btn-default btn-shadow') do
            (
              (fa_icon(action[:icon], class: 'fa-fw') if action[:icon]) +
              action[:label]
            ).html_safe
          end
        end
      end

      def actions_for(type)
        Para.config.page_actions_for(type).map do |action|
          instance_eval(&action)
        end.compact
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
para-0.8.9 app/helpers/para/admin/page_helper.rb
para-0.8.8 app/helpers/para/admin/page_helper.rb
para-0.8.7 app/helpers/para/admin/page_helper.rb
para-0.8.5 app/helpers/para/admin/page_helper.rb
para-0.8.3.3 app/helpers/para/admin/page_helper.rb
para-0.8.3.2 app/helpers/para/admin/page_helper.rb
para-0.8.3.1 app/helpers/para/admin/page_helper.rb
para-0.8.3 app/helpers/para/admin/page_helper.rb
para-0.8.2.3 app/helpers/para/admin/page_helper.rb
para-0.8.2.2 app/helpers/para/admin/page_helper.rb
para-0.8.2.1 app/helpers/para/admin/page_helper.rb
para-0.8.2 app/helpers/para/admin/page_helper.rb
para-0.8.1 app/helpers/para/admin/page_helper.rb
para-0.8.0 app/helpers/para/admin/page_helper.rb
para-0.7.4.p1 app/helpers/para/admin/page_helper.rb
para-0.7.4 app/helpers/para/admin/page_helper.rb
para-0.7.3.p6 app/helpers/para/admin/page_helper.rb
para-0.7.3.p5 app/helpers/para/admin/page_helper.rb
para-0.7.3.p4 app/helpers/para/admin/page_helper.rb
para-0.7.3.p3 app/helpers/para/admin/page_helper.rb