class Precious::Views::History

Constants

DATE_FORMAT

Attributes

allow_editing[R]
page[R]

Public Instance Methods

editable() click to toggle source
# File lib/gollum/views/history.rb, line 42
def editable
  @editable
end
title() click to toggle source
# File lib/gollum/views/history.rb, line 14
def title
  @page.title
end
versions() click to toggle source
# File lib/gollum/views/history.rb, line 18
def versions
  i = @versions.size + 1
  @versions.map do |v|
    i -= 1
    filename = path_for_version(v.tracked_pathname)
    authored_date = v.authored_date
    { :id          => v.id,
      :id7         => v.id[0..6],
      :href        => page_route("gollum/commit/#{v.id}"),
      :href_page   => page_route("#{filename}/#{v.id}"),
      :num         => i,
      :selected    => @page.version.id == v.id,
      :author      => v.author.name.respond_to?(:force_encoding) ? v.author.name.force_encoding('UTF-8') : v.author.name,
      :message     => v.message.respond_to?(:force_encoding) ? v.message.force_encoding('UTF-8') : v.message,
      :date_full   => authored_date,
      :date        => authored_date.strftime(DATE_FORMAT),
      :datetime    => authored_date.utc.iso8601,
      :date_format => DATE_FORMAT,
      :user_icon   => self.user_icon_code(v.author.email),
      :filename    => filename
    }
  end
end

Private Instance Methods

path_for_version(pathname) click to toggle source
# File lib/gollum/views/history.rb, line 48
def path_for_version(pathname)
  @preview_page ||= Gollum::PreviewPage.new(@wiki, '', '', nil)
  @preview_page.path = pathname ? pathname : @name
  @preview_page.escaped_url_path
end