Enable show_all for /pages
This commit is contained in:
@@ -13,6 +13,26 @@ module Gollum
|
||||
@path = nil
|
||||
end
|
||||
|
||||
# Public: The url path required to reach this page within the repo.
|
||||
#
|
||||
# Returns the String url_path
|
||||
def url_path
|
||||
path = if self.path.include?('/')
|
||||
self.path.sub(/\/[^\/]+$/, '/')
|
||||
else
|
||||
''
|
||||
end
|
||||
|
||||
path
|
||||
end
|
||||
|
||||
# Public: The url_path, but CGI escaped.
|
||||
#
|
||||
# Returns the String url_path
|
||||
def escaped_url_path
|
||||
CGI.escape(self.url_path).gsub('%2F','/')
|
||||
end
|
||||
|
||||
# Public: The on-disk filename of the file.
|
||||
#
|
||||
# Returns the String name.
|
||||
|
||||
@@ -7,7 +7,7 @@ module Gollum
|
||||
class FileView
|
||||
# common use cases:
|
||||
# set pages to wiki.pages and show_all to false
|
||||
# set pages to wiki.files and show_all to true
|
||||
# set pages to wiki.pages + wiki.files and show_all to true
|
||||
def initialize pages, show_all = false
|
||||
@pages = pages
|
||||
@show_all = show_all
|
||||
|
||||
@@ -323,6 +323,7 @@ module Precious
|
||||
wiki_options = settings.wiki_options.merge({ :page_file_dir => @path })
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
||||
@results = wiki.pages
|
||||
@results += wiki.files if settings.wiki_options[:show_all]
|
||||
@ref = wiki.ref
|
||||
mustache :pages
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user