Remove fileview from gollum and rely on /pages.
This commit is contained in:
@@ -147,12 +147,6 @@ MSG
|
|||||||
opts.on("--no-display-metadata", "Do not render metadata tables in pages.") do
|
opts.on("--no-display-metadata", "Do not render metadata tables in pages.") do
|
||||||
wiki_options[:display_metadata] = false
|
wiki_options[:display_metadata] = false
|
||||||
end
|
end
|
||||||
opts.on("--show-all", "Also show files in the file view. By default, only valid pages are shown.") do
|
|
||||||
wiki_options[:show_all] = true
|
|
||||||
end
|
|
||||||
opts.on("--collapse-tree", "Collapse the tree, when file view is opened. By default, the tree is expanded.") do
|
|
||||||
wiki_options[:collapse_tree] = true
|
|
||||||
end
|
|
||||||
opts.on("--user-icons [MODE]", [:gravatar, :identicon, :none], "Use specific user-icons for history view.",
|
opts.on("--user-icons [MODE]", [:gravatar, :identicon, :none], "Use specific user-icons for history view.",
|
||||||
"Can be set to 'gravatar', 'identicon' or 'none'. Default: 'none'.") do |mode|
|
"Can be set to 'gravatar', 'identicon' or 'none'. Default: 'none'.") do |mode|
|
||||||
wiki_options[:user_icons] = mode
|
wiki_options[:user_icons] = mode
|
||||||
|
|||||||
+1
-14
@@ -475,25 +475,12 @@ module Precious
|
|||||||
wiki_options = settings.wiki_options.merge({ :page_file_dir => @path })
|
wiki_options = settings.wiki_options.merge({ :page_file_dir => @path })
|
||||||
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
||||||
@results = wiki.pages
|
@results = wiki.pages
|
||||||
@results += wiki.files if settings.wiki_options[:show_all]
|
@results += wiki.files
|
||||||
@results = @results.sort_by { |p| p.name.downcase } # Sort Results alphabetically, fixes 922
|
@results = @results.sort_by { |p| p.name.downcase } # Sort Results alphabetically, fixes 922
|
||||||
@ref = wiki.ref
|
@ref = wiki.ref
|
||||||
mustache :pages
|
mustache :pages
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/fileview' do
|
|
||||||
wiki = wiki_new
|
|
||||||
options = settings.wiki_options
|
|
||||||
content = wiki.pages
|
|
||||||
# if showing all files include wiki.files
|
|
||||||
content += wiki.files if options[:show_all]
|
|
||||||
|
|
||||||
# must pass wiki_options to FileView
|
|
||||||
# --show-all and --collapse-tree can be set.
|
|
||||||
@results = Gollum::FileView.new(content, options).render_files
|
|
||||||
@ref = wiki.ref
|
|
||||||
mustache :file_view
|
|
||||||
end
|
|
||||||
|
|
||||||
get '/*' do
|
get '/*' do
|
||||||
show_page_or_file(params[:splat].first)
|
show_page_or_file(params[:splat].first)
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
{{#stylesheet_tag_mustache}}fileview media: :all{{/stylesheet_tag_mustache}}
|
|
||||||
|
|
||||||
<div id="wiki-wrapper" class="results">
|
|
||||||
<div id="head" style="border:none;">
|
|
||||||
<h1>{{title}}</h1>
|
|
||||||
<ul class="actions">
|
|
||||||
<li class="minibutton">
|
|
||||||
{{>searchbar}}
|
|
||||||
</li>
|
|
||||||
<li class="minibutton"><a href="{{base_url}}/"
|
|
||||||
class="action-home-page">Home</a></li>
|
|
||||||
{{#allow_editing}}
|
|
||||||
<li class="minibutton jaws">
|
|
||||||
<a href="#" id="minibutton-new-page">New</a></li>
|
|
||||||
{{/allow_editing}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="pages">
|
|
||||||
{{#has_results}}
|
|
||||||
<div id="results">
|
|
||||||
{{{results}}}<i class="fa fa-trash" aria-hidden="true"></i>
|
|
||||||
</div>
|
|
||||||
{{/has_results}}
|
|
||||||
|
|
||||||
{{#no_results}}
|
|
||||||
<p id="no-results">
|
|
||||||
There are no pages in <strong>{{ref}}</strong>.
|
|
||||||
</p>
|
|
||||||
{{/no_results}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="footer">
|
|
||||||
<ul class="actions">
|
|
||||||
<li class="minibutton"><a href="#">Back to Top</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -15,9 +15,7 @@ Mousetrap.bind(['e'], function( e ) {
|
|||||||
<li class="minibutton"><a href="{{base_url}}/"
|
<li class="minibutton"><a href="{{base_url}}/"
|
||||||
class="action-home-page">Home</a></li>
|
class="action-home-page">Home</a></li>
|
||||||
<li class="minibutton"><a href="{{base_url}}/pages"
|
<li class="minibutton"><a href="{{base_url}}/pages"
|
||||||
class="action-all-pages">All</a></li>
|
class="action-all-pages">Overview</a></li>
|
||||||
<li class="minibutton"><a href="{{base_url}}/fileview"
|
|
||||||
class="action-fileview">Files</a></li>
|
|
||||||
{{#allow_editing}}
|
{{#allow_editing}}
|
||||||
<li class="minibutton jaws">
|
<li class="minibutton jaws">
|
||||||
<a href="#" id="minibutton-new-page">New</a></li>
|
<a href="#" id="minibutton-new-page">New</a></li>
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
module Precious
|
|
||||||
module Views
|
|
||||||
class FileView < Layout
|
|
||||||
include Sprockets::Helpers
|
|
||||||
include Precious::Views::SprocketsHelpers
|
|
||||||
attr_reader :results, :ref, :allow_editing
|
|
||||||
|
|
||||||
def title
|
|
||||||
"File view of #{@ref}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def has_results
|
|
||||||
!@results.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def no_results
|
|
||||||
@results.empty?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user