Sha256: cfc6445c1ebc9fcf58718fcf7260915eae5b7093a0020d4f0a2db24a3ca6aaf5

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

module TaggableAdminUI

 def self.included(base)
   base.class_eval do

      attr_accessor :tag
      alias_method :tags, :tag

      def load_default_regions_with_tags
        load_default_regions_without_tags
        @tag = load_default_tag_regions
      end

      alias_method_chain :load_default_regions, :tags

      protected

        def load_default_tag_regions
          returning OpenStruct.new do |tag|
            tag.edit = Radiant::AdminUI::RegionSet.new do |edit|
              edit.main.concat %w{edit_header edit_form}
              edit.form.concat %w{edit_name edit_role edit_description}
              edit.form_bottom.concat %w{edit_timestamp edit_buttons}
            end
            tag.show = Radiant::AdminUI::RegionSet.new do |show|
              show.main.concat %w{show_header show_pages}
            end
            tag.index = Radiant::AdminUI::RegionSet.new do |index|
              index.thead.concat %w{title_header link_header description_header usage_header modify_header}
              index.tbody.concat %w{title_cell link_cell description_cell usage_cell modify_cell}
              index.bottom.concat %w{new_button}
            end
            tag.remove = tag.index
            tag.new = tag.edit
          end
        end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
radiant-taggable-extension-1.2.5 lib/taggable_admin_ui.rb
radiant-taggable-extension-1.2.4 lib/taggable_admin_ui.rb