Enable show_all for /pages

This commit is contained in:
bootstraponline
2012-10-22 19:10:40 -06:00
parent fbc0548b43
commit e08d2d3052
3 changed files with 22 additions and 1 deletions
+20
View File
@@ -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.
+1 -1
View File
@@ -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
+1
View File
@@ -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