Sha256: 1814f5bae638b1fafb298f03477d630f029d788e40fca7940eb0dd2a51b3c358

Contents?: true

Size: 740 Bytes

Versions: 44

Compression:

Stored size: 740 Bytes

Contents

require File.join(__FILE__, '../../base')

module Alchemy
  module Generators
    class SiteLayoutsGenerator < Base
      desc "This generator generates your site layouts view partials."
      source_root File.expand_path('templates', File.dirname(__FILE__))

      def create_directory
        @site_layouts_dir = "#{Rails.root}/app/views/alchemy/site_layouts"
        empty_directory @site_layouts_dir
      end

      def create_partials
        @sites = Alchemy::Site.all
        @sites.each do |site|
          @site_name = site.name.parameterize.underscore
          conditional_template "layout.html.#{template_engine}", "#{@site_layouts_dir}/_#{@site_name}.html.#{template_engine}"
        end if @sites
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
alchemy_cms-3.3.3 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.3.2 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.3.1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.3.0 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.3.0.rc2 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.3.0.rc1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.2.1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.1.3 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
lc_alchemy_cms-3.2.1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
lc_alchemy_cms-3.2.0 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.2.0 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.2.0.rc1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.2.0.beta lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-2.9.1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.1.1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.0.4 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.1.0 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.1.0.rc3 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.1.0.rc2 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.1.0.rc1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb