Sha256: 5c801e58ddf3a835db69738d9204129f81b1eed0d169100e3bf114029a030638

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# -*- encoding : utf-8 -*-
module RademadeAdmin
  class TemplateService

    def initialize(root_dir)
      @root_dir = root_dir
    end

    def template_path(*directories)
      "#{@root_dir}/#{directories.join('/')}"
    end

    def inner_layout
      layout_path 'inner'
    end

    def inner_form_layout
      layout_path 'inner/form'
    end

    def form_control_block
      block_path 'form/control'
    end

    def form_lang_panel
      block_path 'form/lang_panel'
    end

    def pagination_block
      block_path 'pagination'
    end

    def on_page_select_block
      block_path 'on_page_select'
    end

    def header_block
      block_path 'header'
    end

    def menu_block
      block_path 'menu'
    end

    def sub_menu_block
      block_path 'sub_menu'
    end

    def sub_menu_link_block
      block_path 'sub_menu/link'
    end

    def table_head_block
      block_path 'table/head'
    end

    private

    def layout_path(layout)
      template_path '_layouts', layout
    end

    def block_path(block)
      template_path '_blocks', block
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rademade_admin-0.1.3 app/services/template_service.rb
rademade_admin-0.1.2 app/services/template_service.rb
rademade_admin-0.1.1 app/services/template_service.rb
rademade_admin-0.1.0 app/services/template_service.rb