Sha256: d2793df393e6f7a54d6cc48f2699209bb402c934bace9218f0c41343f66d56e5

Contents?: true

Size: 1.28 KB

Versions: 13

Compression:

Stored size: 1.28 KB

Contents

module Precious
  module Views
    class Edit < Layout
      include Editable
      include HasPage

      attr_reader :page, :content

      # return path set in app.rb not @page.path
      def path
        @path
      end

      def title
        "#{@page.title}"
      end

      def page_name
        @name.gsub('-', ' ')
      end

      def header
        if @header.nil?
          if page = @page.header
            @header = page.text_data
          else
            @header = false
          end
        end
        @header
      end

      def footer
        if @footer.nil?
          if page = @page.footer
            @footer = page.text_data
          else
            @footer = false
          end
        end
        @footer
      end

      def sidebar
        if @sidebar.nil?
          if page = @page.sidebar
            @sidebar = page.text_data
          else
            @sidebar = false
          end
        end
        @sidebar
      end

      def is_create_page
        false
      end

      def is_edit_page
        true
      end

      def allow_uploads
        @allow_uploads
      end

      def upload_dest
        @upload_dest
      end

      def format
        @format = (@page.format || false) if @format.nil?
        @format.to_s.downcase
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
gollum-4.1.4 lib/gollum/views/edit.rb
gollum-4.1.3 lib/gollum/views/edit.rb
inc_gollum-4.1.2d lib/gollum/views/edit.rb
inc_gollum-4.1.2c lib/gollum/views/edit.rb
gollum-4.1.2 lib/gollum/views/edit.rb
gollum-4.1.1 lib/gollum/views/edit.rb
gollum-4.1.0 lib/gollum/views/edit.rb
gollum-4.0.1 lib/gollum/views/edit.rb
gollum-4.0.0 lib/gollum/views/edit.rb
gollum-3.1.3 lib/gollum/views/edit.rb
gollum-3.1.2 lib/gollum/views/edit.rb
gollum-3.1.1 lib/gollum/views/edit.rb
gollum-3.1.0 lib/gollum/views/edit.rb