Sha256: 6f62e81e42f51b9a1b744ce2243aa66703bd57f3757b135573d607ebd239354e

Contents?: true

Size: 968 Bytes

Versions: 2

Compression:

Stored size: 968 Bytes

Contents

module Precious
  module Views
    class Page < Layout
      attr_reader :content, :page, :footer

      def title
        @page.title
      end

      def format
        @page.format.to_s
      end

      def author
        @page.version.author.name
      end

      def date
        @page.version.authored_date.strftime("%Y-%m-%d %H:%M:%S")
      end
      
      def editable
        @editable
      end

      def has_footer
        @footer = (@page.footer || false) if @footer.nil?
        !!@footer
      end

      def footer_content
        has_footer && @footer.formatted_data
      end

      def footer_format
        has_footer && @footer.format.to_s
      end

      def has_sidebar
        @sidebar = (@page.sidebar || false) if @sidebar.nil?
        !!@sidebar
      end

      def sidebar_content
        has_sidebar && @sidebar.formatted_data
      end

      def sidebar_format
        has_sidebar && @sidebar.format.to_s
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
gollum-1.3.1 lib/gollum/frontend/views/page.rb
jugyo-gollum-1.3.1 lib/gollum/frontend/views/page.rb