Compare commits

..

2 Commits

Author SHA1 Message Date
Benjamin Willems 957a394d20 Change spacing behaviour of #wiki-sidebar
To make `#wiki-sidebar` and `#wiki-footer` more similar, we can make
sure `px-4` padding is applied to the `-content` container, rather than
the outer container.
2021-02-20 18:37:54 -08:00
Benjamin Willems de47f4ffab Change footer and footer container spacing
This commit:

  1. Removes the Primer `my-md-0` spacing from the `#wiki-footer`
     container.

     This gives it margins along the Y axis, spacing it out from
     the sidebar and main wiki content containers on `md` and larger
     screens.

  2. Adds `px-4` padding to the `#footer-content`. which makes the

     This makes the footer content inset the same way that sidebar
     content is. This makes the content look more uniform on mobile
     devices, when the sidebar and footer are presented one before
     the other.
2021-02-20 18:33:09 -08:00
31 changed files with 169 additions and 214 deletions
+1 -2
View File
@@ -1,8 +1,7 @@
rvm: rvm:
- 2.4.0 - 2.4.0
- 2.6.0 - 2.6.0
- 3.0.0 - jruby-9.2.9.0
- jruby-9.2.18.0
jdk: jdk:
- oraclejdk9 - oraclejdk9
before_install: before_install:
-2
View File
@@ -62,8 +62,6 @@ Pull Requests fixing bugs, implementing new features, or updating documentation
``` ```
bundle exec rake test bundle exec rake test
``` ```
To profile slow tests, you can use `bundle exec rake test TESTOPTS="--verbose"`.
### Working with test repositories ### Working with test repositories
+2 -1
View File
@@ -6,4 +6,5 @@ end
gemspec gemspec
gem 'rake', '~> 13.0' gem "rake", '~> 13.0'
-19
View File
@@ -1,22 +1,3 @@
# 5.2.3 2021-04-18
* Fix bug preventing page titles from being displayed
# 5.2.1 2021-02-25
* Fix include call to a missing asset (@benjaminwil). This caused slow first page loads on JRuby.
# 5.2 2021-02-24
* Improved styling and Primer upgrade (@benjaminwil)
* Add redirect to rename commit (@ViChyavIn)
* Updated dependencies
* Bugfixes
# 5.1.2
* Guard against malicious filenames in breadcrumbs
# 5.1 # 5.1
* Bugfixes * Bugfixes
+2
View File
@@ -6,6 +6,8 @@ gollum -- A git-based Wiki
[![Open Source Helpers](https://www.codetriage.com/gollum/gollum/badges/users.svg)](https://www.codetriage.com/gollum/gollum) [![Open Source Helpers](https://www.codetriage.com/gollum/gollum/badges/users.svg)](https://www.codetriage.com/gollum/gollum)
[![Cutting Edge Dependency Status](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum/svg 'Cutting Edge Dependency Status')](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum/info) [![Cutting Edge Dependency Status](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum/svg 'Cutting Edge Dependency Status')](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum/info)
**Please update to gollum 5.1.2 to counter a recent exploit. More info will follow after CVE is assigned.**
**Gollum version 5.0 is out!** See [here](https://github.com/gollum/gollum/wiki/5.0-release-notes) for a list of changes and new features compared to Gollum version 4.x, and see some [Screenshots](https://github.com/gollum/gollum/wiki/Screenshots) of Gollum's features. **Gollum version 5.0 is out!** See [here](https://github.com/gollum/gollum/wiki/5.0-release-notes) for a list of changes and new features compared to Gollum version 4.x, and see some [Screenshots](https://github.com/gollum/gollum/wiki/Screenshots) of Gollum's features.
## DESCRIPTION ## DESCRIPTION
+12 -14
View File
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 1.9' s.required_ruby_version = '>= 1.9'
s.name = 'gollum' s.name = 'gollum'
s.version = '5.2.3' s.version = '5.1.2'
s.date = '2021-04-18' s.date = '2021-01-03'
s.license = 'MIT' s.license = 'MIT'
s.summary = 'A simple, Git-powered wiki.' s.summary = 'A simple, Git-powered wiki.'
@@ -38,7 +38,6 @@ Gem::Specification.new do |s|
s.add_dependency 'sprockets-helpers', '~> 1.2' s.add_dependency 'sprockets-helpers', '~> 1.2'
s.add_dependency 'rss', '~> 0.2.9' s.add_dependency 'rss', '~> 0.2.9'
s.add_dependency 'therubyrhino', '~> 2.1.0' s.add_dependency 'therubyrhino', '~> 2.1.0'
s.add_dependency 'webrick', '~> 1.7'
s.add_development_dependency 'rack-test', '~> 0.6.3' s.add_development_dependency 'rack-test', '~> 0.6.3'
s.add_development_dependency 'shoulda', '~> 3.6.0' s.add_development_dependency 'shoulda', '~> 3.6.0'
@@ -46,6 +45,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'twitter_cldr', '~> 3.2.0' s.add_development_dependency 'twitter_cldr', '~> 3.2.0'
s.add_development_dependency 'mocha', '~> 1.8.0' s.add_development_dependency 'mocha', '~> 1.8.0'
s.add_development_dependency 'test-unit', '~> 3.3.0' s.add_development_dependency 'test-unit', '~> 3.3.0'
s.add_development_dependency 'webrick', '~> 1.4.2'
# = MANIFEST = # = MANIFEST =
s.files = %w[ s.files = %w[
@@ -59,7 +59,6 @@ Gem::Specification.new do |s|
bin/gollum-migrate-tags bin/gollum-migrate-tags
config.rb config.rb
config.ru config.ru
contrib/automation/gollum-post
contrib/openrc/conf.d/gollum contrib/openrc/conf.d/gollum
contrib/openrc/init.d/gollum contrib/openrc/init.d/gollum
contrib/systemd/gollum@.service contrib/systemd/gollum@.service
@@ -69,15 +68,15 @@ Gem::Specification.new do |s|
lib/gollum/app.rb lib/gollum/app.rb
lib/gollum/assets.rb lib/gollum/assets.rb
lib/gollum/helpers.rb lib/gollum/helpers.rb
lib/gollum/public/assets/.sprockets-manifest-de7bb79aec424e55af1acdcc4237b301.json lib/gollum/public/assets/.sprockets-manifest-35882cacf71c40928e0c2dc9b8acf8fe.json
lib/gollum/public/assets/app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js lib/gollum/public/assets/app-4215e58002a43c4b2e9f0f7caa05a81c7c09d22a918c6fe40cd8e423db3110b5.css
lib/gollum/public/assets/app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js.gz lib/gollum/public/assets/app-4215e58002a43c4b2e9f0f7caa05a81c7c09d22a918c6fe40cd8e423db3110b5.css.gz
lib/gollum/public/assets/app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css lib/gollum/public/assets/app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js
lib/gollum/public/assets/app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css.gz lib/gollum/public/assets/app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js.gz
lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css
lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css.gz lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css.gz
lib/gollum/public/assets/editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js lib/gollum/public/assets/editor-b621bfe2cb8823516fb3a96c32e82001b297f6754117b47bdad6e59db85a9d08.js
lib/gollum/public/assets/editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js.gz lib/gollum/public/assets/editor-b621bfe2cb8823516fb3a96c32e82001b297f6754117b47bdad6e59db85a9d08.js.gz
lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css
lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css.gz lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css.gz
lib/gollum/public/gollum/javascript/HOWTO_UPDATE_ACE.md lib/gollum/public/gollum/javascript/HOWTO_UPDATE_ACE.md
@@ -1175,18 +1174,18 @@ Gem::Specification.new do |s|
lib/gollum/public/gollum/javascript/jquery-1.7.2.min.js lib/gollum/public/gollum/javascript/jquery-1.7.2.min.js
lib/gollum/public/gollum/javascript/jquery.resize.js lib/gollum/public/gollum/javascript/jquery.resize.js
lib/gollum/public/gollum/javascript/mousetrap.min.js lib/gollum/public/gollum/javascript/mousetrap.min.js
lib/gollum/public/gollum/javascript/polyfills.js
lib/gollum/public/gollum/stylesheets/_base.scss lib/gollum/public/gollum/stylesheets/_base.scss
lib/gollum/public/gollum/stylesheets/_breakpoint.scss lib/gollum/public/gollum/stylesheets/_breakpoint.scss
lib/gollum/public/gollum/stylesheets/_component.scss lib/gollum/public/gollum/stylesheets/_component.scss
lib/gollum/public/gollum/stylesheets/_features.scss lib/gollum/public/gollum/stylesheets/_features.scss
lib/gollum/public/gollum/stylesheets/_layout.scss
lib/gollum/public/gollum/stylesheets/_spinners.scss lib/gollum/public/gollum/stylesheets/_spinners.scss
lib/gollum/public/gollum/stylesheets/app.scss lib/gollum/public/gollum/stylesheets/app.scss
lib/gollum/public/gollum/stylesheets/criticmarkup.scss lib/gollum/public/gollum/stylesheets/criticmarkup.scss
lib/gollum/public/gollum/stylesheets/dialog.scss lib/gollum/public/gollum/stylesheets/dialog.scss
lib/gollum/public/gollum/stylesheets/editor.scss lib/gollum/public/gollum/stylesheets/editor.scss
lib/gollum/public/gollum/stylesheets/emoji.scss lib/gollum/public/gollum/stylesheets/emoji.scss
lib/gollum/public/gollum/stylesheets/primer.css lib/gollum/public/gollum/stylesheets/primer.scss
lib/gollum/public/gollum/stylesheets/print.scss lib/gollum/public/gollum/stylesheets/print.scss
lib/gollum/public/gollum/stylesheets/spinner.scss lib/gollum/public/gollum/stylesheets/spinner.scss
lib/gollum/public/gollum/stylesheets/tables.scss lib/gollum/public/gollum/stylesheets/tables.scss
@@ -1203,7 +1202,6 @@ Gem::Specification.new do |s|
lib/gollum/templates/history_authors/none.mustache lib/gollum/templates/history_authors/none.mustache
lib/gollum/templates/latest_changes.mustache lib/gollum/templates/latest_changes.mustache
lib/gollum/templates/layout.mustache lib/gollum/templates/layout.mustache
lib/gollum/templates/mobilenav.mustache
lib/gollum/templates/navbar.mustache lib/gollum/templates/navbar.mustache
lib/gollum/templates/overview.mustache lib/gollum/templates/overview.mustache
lib/gollum/templates/page.mustache lib/gollum/templates/page.mustache
+17 -1
View File
@@ -12,11 +12,27 @@ require 'rhino' if RUBY_PLATFORM == 'java'
require File.expand_path('../gollum/uri_encode_component', __FILE__) require File.expand_path('../gollum/uri_encode_component', __FILE__)
module Gollum module Gollum
VERSION = '5.2.3' VERSION = '5.1.2'
def self.assets_path def self.assets_path
::File.expand_path('gollum/public', ::File.dirname(__FILE__)) ::File.expand_path('gollum/public', ::File.dirname(__FILE__))
end end
class Error < StandardError;
end
class DuplicatePageError < Error
attr_accessor :dir
attr_accessor :existing_path
attr_accessor :attempted_path
def initialize(dir, existing, attempted, message = nil)
@dir = dir
@existing_path = existing
@attempted_path = attempted
super(message || "Cannot write #{@dir}/#{@attempted_path}, found #{@dir}/#{@existing_path}.")
end
end
class TemplateFilter class TemplateFilter
@@filters = {} @@filters = {}
+14 -17
View File
@@ -1,5 +1,4 @@
# encoding: UTF-8 # ~*~ encoding: utf-8 ~*~
require 'cgi' require 'cgi'
require 'sinatra' require 'sinatra'
require 'sinatra/namespace' require 'sinatra/namespace'
@@ -41,7 +40,7 @@ Gollum::set_git_max_filesize(190 * 10**6)
# See the wiki.rb file for more details on wiki options # See the wiki.rb file for more details on wiki options
module Precious module Precious
# For use with the --base-path option. # For use with the --base-path option.
class MapGollum class MapGollum
def initialize(base_path) def initialize(base_path)
@@ -64,14 +63,12 @@ module Precious
@mg.call(env) @mg.call(env)
end end
end end
class App < Sinatra::Base class App < Sinatra::Base
register Mustache::Sinatra register Mustache::Sinatra
register Sinatra::Namespace register Sinatra::Namespace
include Precious::Helpers include Precious::Helpers
Encoding.default_external = "UTF-8"
dir = File.dirname(File.expand_path(__FILE__)) dir = File.dirname(File.expand_path(__FILE__))
set :sprockets, ::Precious::Assets.sprockets(dir) set :sprockets, ::Precious::Assets.sprockets(dir)
@@ -105,7 +102,7 @@ module Precious
@critic_markup = settings.wiki_options[:critic_markup] @critic_markup = settings.wiki_options[:critic_markup]
@redirects_enabled = settings.wiki_options.fetch(:redirects_enabled, true) @redirects_enabled = settings.wiki_options.fetch(:redirects_enabled, true)
@per_page_uploads = settings.wiki_options[:per_page_uploads] @per_page_uploads = settings.wiki_options[:per_page_uploads]
@wiki_title = settings.wiki_options.fetch(:title, 'Gollum Wiki') @wiki_title = settings.wiki_options.fetch(:title, 'Gollum Wiki')
forbid unless @allow_editing || request.request_method == 'GET' forbid unless @allow_editing || request.request_method == 'GET'
@@ -120,10 +117,10 @@ module Precious
@js = settings.wiki_options[:js] @js = settings.wiki_options[:js]
@mathjax_config = settings.wiki_options[:mathjax_config] @mathjax_config = settings.wiki_options[:mathjax_config]
@use_static_assets = settings.wiki_options.fetch(:static, settings.environment != :development) @use_static_assets = settings.wiki_options.fetch(:static, settings.environment == :production || settings.environment == :staging)
@static_assets_path = settings.wiki_options.fetch(:static_assets_path, ::File.join(File.dirname(__FILE__), 'public/assets')) @static_assets_path = settings.wiki_options.fetch(:static_assets_path, ::File.join(File.dirname(__FILE__), 'public/assets'))
@mathjax_path = ::File.join(File.dirname(__FILE__), 'public/gollum/javascript/MathJax') @mathjax_path = ::File.join(File.dirname(__FILE__), 'public/gollum/javascript/MathJax')
Sprockets::Helpers.configure do |config| Sprockets::Helpers.configure do |config|
config.environment = settings.sprockets config.environment = settings.sprockets
config.environment.context_class.class_variable_set(:@@base_url, @base_url) config.environment.context_class.class_variable_set(:@@base_url, @base_url)
@@ -222,7 +219,7 @@ module Precious
# AJAX calls only # AJAX calls only
post '/upload_file' do post '/upload_file' do
wiki = wiki_new wiki = wiki_new
halt 405 unless wiki.allow_uploads halt 405 unless wiki.allow_uploads
@@ -238,7 +235,7 @@ module Precious
dir.sub!(/^#{wiki.base_path}/, '') if wiki.base_path dir.sub!(/^#{wiki.base_path}/, '') if wiki.base_path
# remove base_url and gollum/* subpath if necessary # remove base_url and gollum/* subpath if necessary
dir.sub!(/^\/gollum\/[-\w]+\//, '') dir.sub!(/^\/gollum\/[-\w]+\//, '')
# remove file extension # remove file extension
dir.sub!(/#{::File.extname(dir)}$/, '') dir.sub!(/#{::File.extname(dir)}$/, '')
# revert escaped whitespaces # revert escaped whitespaces
dir.gsub!(/%20/, ' ') dir.gsub!(/%20/, ' ')
@@ -320,7 +317,7 @@ module Precious
end end
post '/edit/*' do post '/edit/*' do
etag = params[:etag] etag = params[:etag]
path = "/#{clean_url(sanitize_empty_params(params[:path]))}" path = "/#{clean_url(sanitize_empty_params(params[:path]))}"
wiki = wiki_new wiki = wiki_new
page = wiki.page(::File.join(path, params[:page])) page = wiki.page(::File.join(path, params[:page]))
@@ -330,7 +327,7 @@ module Precious
# Signal edit collision and return the page's most recent version # Signal edit collision and return the page's most recent version
halt 412, {etag: page.sha, text_data: page.text_data}.to_json halt 412, {etag: page.sha, text_data: page.text_data}.to_json
end end
committer = Gollum::Committer.new(wiki, commit_message) committer = Gollum::Committer.new(wiki, commit_message)
commit = { :committer => committer } commit = { :committer => committer }
@@ -351,7 +348,7 @@ module Precious
commit[:message] = "Deleted #{filepath}" commit[:message] = "Deleted #{filepath}"
wiki.delete_file(filepath, commit) wiki.delete_file(filepath, commit)
end end
end end
get '/create/*' do get '/create/*' do
forbid unless @allow_editing forbid unless @allow_editing
@@ -628,7 +625,7 @@ module Precious
end end
end end
end end
def show_file(file) def show_file(file)
return unless file return unless file
if file.on_disk? if file.on_disk?
@@ -686,4 +683,4 @@ module Precious
end end
end end
end end
@@ -1 +0,0 @@
{"files":{"app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js":{"logical_path":"app.js","mtime":"2021-03-23T08:40:11-07:00","size":136020,"digest":"0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838","integrity":"sha256-D9Io4mv75v4xotomjrDpjngMEZHBqRit84M3eUbpyDg="},"editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js":{"logical_path":"editor.js","mtime":"2021-02-24T23:16:14-08:00","size":744866,"digest":"db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf","integrity":"sha256-2xDINRMG6S8ZJroiXQzZyOiGSCs7mCCoWCXsOrq18c8="},"app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css":{"logical_path":"app.css","mtime":"2021-03-23T08:40:11-07:00","size":396615,"digest":"ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2","integrity":"sha256-rUPKZLKV2ERLEPIu6GjxhCkmivSY8bxRVDSHi2kON6I="},"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css":{"logical_path":"criticmarkup.css","mtime":"2021-02-24T23:16:14-08:00","size":646,"digest":"31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4","integrity":"sha256-Ma5dMoK7uOe3w8mRfp+2jjMVprSnXabOxI0huIRpBcQ="},"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css":{"logical_path":"print.css","mtime":"2021-02-24T23:16:14-08:00","size":75,"digest":"512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb","integrity":"sha256-USSYw2i+DT+xuhBd+oQomuSDgOyfy++Ui9TiOwsJW/s="}},"assets":{"app.js":"app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js","editor.js":"editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js","app.css":"app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css","criticmarkup.css":"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css","print.css":"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css"}}
@@ -0,0 +1 @@
{"files":{"app-7a4bd115f4bc7ece39bc8073ca0ffad7c5e55cc5837b1464a12dead4905cefb2.js":{"logical_path":"app.js","mtime":"2021-02-19T21:46:58-08:00","size":135925,"digest":"7a4bd115f4bc7ece39bc8073ca0ffad7c5e55cc5837b1464a12dead4905cefb2","integrity":"sha256-ekvRFfS8fs45vIBzyg/618XlXMWDexRkoS3q1JBc77I="},"editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js":{"logical_path":"editor.js","mtime":"2021-02-17T20:47:49-08:00","size":744866,"digest":"db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf","integrity":"sha256-2xDINRMG6S8ZJroiXQzZyOiGSCs7mCCoWCXsOrq18c8="},"app-7a0bbff2e8bad3033e7c17e0e0f886f336a9d23d3b912dcd2ae389c48b4b63e6.css":{"logical_path":"app.css","mtime":"2021-02-19T21:46:58-08:00","size":396661,"digest":"7a0bbff2e8bad3033e7c17e0e0f886f336a9d23d3b912dcd2ae389c48b4b63e6","integrity":"sha256-egu/8ui60wM+fBfg4PiG8zap0j07kS3NKuOJxItLY+Y="},"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css":{"logical_path":"criticmarkup.css","mtime":"2021-02-17T20:47:49-08:00","size":646,"digest":"31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4","integrity":"sha256-Ma5dMoK7uOe3w8mRfp+2jjMVprSnXabOxI0huIRpBcQ="},"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css":{"logical_path":"print.css","mtime":"2021-02-17T20:47:49-08:00","size":75,"digest":"512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb","integrity":"sha256-USSYw2i+DT+xuhBd+oQomuSDgOyfy++Ui9TiOwsJW/s="}},"assets":{"app.js":"app-7a4bd115f4bc7ece39bc8073ca0ffad7c5e55cc5837b1464a12dead4905cefb2.js","editor.js":"editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js","app.css":"app-7a0bbff2e8bad3033e7c17e0e0f886f336a9d23d3b912dcd2ae389c48b4b63e6.css","criticmarkup.css":"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css","print.css":"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css"}}
@@ -380,12 +380,8 @@ $(document).ready(function() {
active_tab = '#edit.tabnav-tab'; active_tab = '#edit.tabnav-tab';
} }
$('.tabnav-tab.selected').removeAttr('aria-current');
$('.tabnav-tab.selected').removeClass('selected'); $('.tabnav-tab.selected').removeClass('selected');
$(active_tab).attr('aria-current', 'page');
$(active_tab).addClass('selected'); $(active_tab).addClass('selected');
$('.tabnav-div').hide(); $('.tabnav-div').hide();
$(active_div).show(); $(active_div).show();
} }
@@ -147,3 +147,7 @@
} }
} }
} }
#gollum-dialog-dialog-buttons {
overflow: hidden;
}
+7 -9
View File
@@ -4,15 +4,13 @@
<h1 class="py-4">Create New Page</h1> <h1 class="py-4">Create New Page</h1>
</div> </div>
<div id="wiki-content" class="create edit"> <div id="wiki-content" class="create edit">
<div class="tabnav"> <div class="tabnav">
<nav class="tabnav-tabs" aria-label="Toggle edit or preview mode"> <nav class="tabnav-tabs" aria-label="Foo bar">
<a href="#" id="edit" class="tabnav-tab selected" aria-current="page"> <a href="#" id="edit" class="tabnav-tab selected" aria-current="edit">Edit</a>
Edit <a href="#" id="preview" class="tabnav-tab" aria-current="preview">Preview</a>
</a> </nav>
<a href="#" id="preview" class="tabnav-tab">Preview</a> </div>
</nav>
</div>
<div class="has-sidebar tabnav-div" id="edit-content"> <div class="has-sidebar tabnav-div" id="edit-content">
{{>editor}} {{>editor}}
</div> </div>
+2 -4
View File
@@ -5,10 +5,8 @@
</div> </div>
<div class="tabnav"> <div class="tabnav">
<nav class="tabnav-tabs"> <nav class="tabnav-tabs">
<a href="#" id="edit" class="tabnav-tab selected" aria-current="page"> <a href="#" id="edit" class="tabnav-tab selected" aria-current="edit">Edit</a>
Edit <a href="#" id="preview" class="tabnav-tab" aria-current="preview">Preview</a>
</a>
<a href="#" id="preview" class="tabnav-tab">Preview</a>
</nav> </nav>
</div> </div>
<div class="tabnav-div" id="edit-content">{{>editor}}</div> <div class="tabnav-div" id="edit-content">{{>editor}}</div>
+3 -3
View File
@@ -37,7 +37,7 @@
<button class="btn btn-sm function-button" id="function-h3" title="Heading 3">h3</button> <button class="btn btn-sm function-button" id="function-h3" title="Heading 3">h3</button>
<span class="pr-2"></span> <span class="pr-2"></span>
<button class="btn btn-sm function-button" id="function-link" title="Link">{{#octicon}}link{{/octicon}}</button> <button class="btn btn-sm function-button" id="function-link" title="Link">{{#octicon}}link{{/octicon}}</button>
<button class="btn btn-sm function-button" id="function-image" title="Image">{{#octicon}}image{{/octicon}}</button> <button class="btn btn-sm function-button" id="function-image" title="Image">{{#octicon}}file-media{{/octicon}}</button>
<span class="pr-2"></span> <span class="pr-2"></span>
{{#critic_markup}} {{#critic_markup}}
<button class="btn btn-sm function-button" id="function-critic-accept" title="Accept Selected CriticMarkup">{{#octicon}}plus{{/octicon}}</button> <button class="btn btn-sm function-button" id="function-critic-accept" title="Accept Selected CriticMarkup">{{#octicon}}plus{{/octicon}}</button>
@@ -50,13 +50,13 @@
<div id="gollum-editor-format-selector"> <div id="gollum-editor-format-selector">
<label for="format">Keybinding</label> <label for="format">Keybinding</label>
<select id="keybinding" name="keybinding" class="form-select input-sm"> <select id="keybinding" name="keybinding" class="form-select">
<option selected="selected">default</option> <option selected="selected">default</option>
<option>vim</option> <option>vim</option>
<option>emacs</option> <option>emacs</option>
</select> </select>
<label for="format">Markup</label> <label for="format">Markup</label>
<select id="wiki_format" name="format" class="form-select input-sm"> <select id="wiki_format" name="format" class="form-select">
{{#formats}} {{#formats}}
{{#enabled}} {{#enabled}}
<option {{#selected}}selected="selected" {{/selected}}value="{{id}}" data-ext="{{ext}}"> <option {{#selected}}selected="selected" {{/selected}}value="{{id}}" data-ext="{{ext}}">
+1 -1
View File
@@ -13,7 +13,7 @@
<li class="Box-row Box-row--hover-gray border-top d-flex flex-items-center"> <li class="Box-row Box-row--hover-gray border-top d-flex flex-items-center">
<span class="float-left col-2" id="user-icons">{{>author_template}}</span> <span class="float-left col-2" id="user-icons">{{>author_template}}</span>
<span class="flex-auto col-1 text-gray-light">{{date}}</span> <span class="flex-auto col-1 text-gray-light">{{date}}</span>
<span class="flex-auto col-5">{{message}}<br/> <span class="flex-auto col-7">{{message}}<br/>
{{#files}} {{#files}}
<span class="flex-auto col-2">{{#renamed}}{{renamed}} -> {{/renamed}}<a href="{{link}}">{{file}}</a></span><br/> <span class="flex-auto col-2">{{#renamed}}{{renamed}} -> {{/renamed}}<a href="{{link}}">{{file}}</a></span><br/>
{{/files}} {{/files}}
+1
View File
@@ -5,6 +5,7 @@
<meta name="MobileOptimized" content="width"> <meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true"> <meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
{{#sprockets_stylesheet_tag}}primer{{/sprockets_stylesheet_tag}}
{{#sprockets_stylesheet_tag}}app{{/sprockets_stylesheet_tag}} {{#sprockets_stylesheet_tag}}app{{/sprockets_stylesheet_tag}}
{{#sprockets_stylesheet_tag}}print print{{/sprockets_stylesheet_tag}} {{#sprockets_stylesheet_tag}}print print{{/sprockets_stylesheet_tag}}
+90 -88
View File
@@ -1,103 +1,105 @@
<nav class="TableObject actions pt-4 px-2 px-lg-0 overflow-x-scroll"> <nav class="actions pt-4 px-2 px-lg-0 overflow-x-scroll">
<div class="TableObject-item hide-lg hide-xl"> <div class="TableObject">
{{>mobilenav}} <div class="TableObject-item hide-lg hide-xl">
</div> {{>mobilenav}}
<div class="TableObject-item hide-sm hide-md">
<a class="btn btn-sm" id="minibutton-home" href="{{page_route}}">
Home
</a>
</div>
<div
class="TableObject-item TableObject-item--primary px-2"
{{^search}}style="visibility:hidden"{{/search}}
>
{{>searchbar}}
</div>
<div class="TableObject-item hide-sm hide-md">
<div class="BtnGroup d-flex">
{{#overview}}
<a
class="btn BtnGroup-item btn-sm"
href="{{overview_path}}"
id="minibutton-overview"
>
Overview
</a>
{{/overview}}
{{#latest_changes}}
<a
class="btn BtnGroup-item btn-sm"
href="{{latest_changes_path}}"
id="minibutton-latest-changes"
>
Latest Changes
</a>
{{/latest_changes}}
</div> </div>
</div>
<div class="TableObject-item px-2"> <div class="TableObject-item hide-sm hide-md">
<div class="BtnGroup d-flex"> <a class="btn btn-sm" id="minibutton-home" href="{{page_route}}">
{{#history}} Home
</a>
</div>
<div
class="TableObject-item TableObject-item--primary px-2"
{{^search}}style="visibility:hidden"{{/search}}
>
{{>searchbar}}
</div>
<div class="TableObject-item hide-sm hide-md">
<div class="BtnGroup" style="display: flex;">
{{#overview}}
<a
class="btn BtnGroup-item btn-sm"
href="{{overview_path}}"
id="minibutton-overview"
>
Overview
</a>
{{/overview}}
{{#latest_changes}}
<a
class="btn BtnGroup-item btn-sm"
href="{{latest_changes_path}}"
id="minibutton-latest-changes"
>
Latest Changes
</a>
{{/latest_changes}}
</div>
</div>
{{#history}}
<div class="TableObject-item pl-2 hide-sm hide-md">
<a <a
class="btn BtnGroup-item btn-sm hide-sm hide-md" class="btn btn-sm"
href="{{history_path}}/{{escaped_url_path}}" href="{{history_path}}/{{escaped_url_path}}"
id="minibutton-history" id="minibutton-history"
> >
History Page History
</a>
{{/history}}
{{#allow_editing}}
{{#allow_uploads}}
<button
class="btn BtnGroup-item btn-sm hide-sm hide-md
minibutton-upload-page"
>
Upload
</button>
{{/allow_uploads}}
{{#editable}}
<button
class="btn BtnGroup-item btn-sm hide-sm hide-md
minibutton-rename-page"
>
Rename
</button>
<a
class="btn BtnGroup-item btn-sm hide-sm hide-md"
href="{{edit_path}}/{{escaped_url_path}}"
id="minibutton-edit-page"
>
Edit
</a>
{{/editable}}
{{/allow_editing}}
</div>
</div>
{{#allow_editing}}
{{#editable}}
<div class="TableObject-item">
<a class="btn btn-primary btn-sm minibutton-new-page" href="#">
New
</a> </a>
</div> </div>
{{/editable}} {{/history}}
{{^editable}} {{#allow_editing}}
{{#newable}} <div class="TableObject-item px-2">
<div class="BtnGroup" style="display: flex;">
{{#allow_uploads}}
<a
class="btn BtnGroup-item btn-sm hide-sm hide-md
minibutton-upload-page"
>
Upload
</a>
{{/allow_uploads}}
{{#editable}}
<a
class="btn BtnGroup-item btn-sm hide-sm hide-md
minibutton-rename-page"
>
Rename
</a>
<a
class="btn BtnGroup-item btn-sm hide-sm hide-md"
href="{{edit_path}}/{{escaped_url_path}}"
id="minibutton-edit-page"
>
Edit
</a>
{{/editable}}
</div>
</div>
{{#editable}}
<div class="TableObject-item"> <div class="TableObject-item">
<a class="btn btn-primary btn-sm minibutton-new-page" href="#"> <a class="btn btn-primary btn-sm minibutton-new-page" href="#">
New New
</a> </a>
</div> </div>
{{/newable}} {{/editable}}
{{/editable}}
{{/allow_editing}} {{^editable}}
{{#newable}}
<div class="TableObject-item">
<a class="btn btn-primary btn-sm minibutton-new-page" href="#">
New
</a>
</div>
{{/newable}}
{{/editable}}
{{/allow_editing}}
</div>
</nav> </nav>
+1 -1
View File
@@ -20,7 +20,7 @@ module Precious
def lines(diff = @diff) def lines(diff = @diff)
lines = [] lines = []
lines_to_parse = diff.split("\n")[3..-1] lines_to_parse = diff.split("\n")[3..-1]
lines_to_parse = lines_to_parse[2..-1] if lines_to_parse[0] =~ /^(---|rename to )/ lines_to_parse = lines_to_parse[2..-1] if lines_to_parse[0].start_with?('---')
if lines_to_parse.nil? || lines_to_parse.empty? if lines_to_parse.nil? || lines_to_parse.empty?
lines_to_parse = [] # File is created without content lines_to_parse = [] # File is created without content
+1 -1
View File
@@ -47,7 +47,7 @@ module Precious
end end
def mathjax_js def mathjax_js
"#{page_route('gollum/assets/mathjax/MathJax.js')}?config=TeX-AMS-MML_HTMLorMML" page_route("gollum/assets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML")
end end
def css # custom css def css # custom css
+5 -5
View File
@@ -16,11 +16,6 @@ module Precious
DEFAULT_AUTHOR = 'you' DEFAULT_AUTHOR = 'you'
@@to_xml = { :save_with => Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML ^ 1, :indent => 0, :encoding => 'UTF-8' } @@to_xml = { :save_with => Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML ^ 1, :indent => 0, :encoding => 'UTF-8' }
def title
h1 = @h1_title ? page_header_from_content(@content) : false
h1 || @page.url_path_title # url_path_title is the metadata title if present, otherwise the filename-based title
end
def page_header def page_header
title title
end end
@@ -268,6 +263,11 @@ module Precious
end end
result << "</tr>\n</table>\n" result << "</tr>\n</table>\n"
end end
def title
h1 = @h1_title ? page_header_from_content(@content) : false
h1 || @page.url_path_title # url_path_title is the metadata title if present, otherwise the filename-based title
end
end end
end end
end end
+1 -1
View File
@@ -953,7 +953,7 @@ context 'Frontend with base path' do
test 'base path mathjax assets' do test 'base path mathjax assets' do
get '/wiki/Home' get '/wiki/Home'
assert last_response.ok? assert last_response.ok?
assert last_response.body.include?('<script defer src="/wiki/gollum/assets/mathjax/MathJax.js?config=') assert last_response.body.include?('<script defer src="/wiki/gollum/assets/mathjax/MathJax.js')
end end
test 'compare view' do test 'compare view' do
-12
View File
@@ -13,18 +13,6 @@ context "Precious::Views::Compare" do
# Precious::App.set(:gollum_path, @path) # Precious::App.set(:gollum_path, @path)
@wiki = Gollum::Wiki.new(@path) @wiki = Gollum::Wiki.new(@path)
end end
test 'rename diff' do
# JGit returns differenly formatted diffs for rename commits. Support both kinds of diff.
jgit_diff = "diff --git a/Foo.md b/Bar.md\nsimilarity index 100%\nrename from Foo.md\nrename to Bar.md"
rugged_diff = "diff --git a/Bar.md b/Bar.md\nnew file mode 100644\nindex 0000000..e69de29\n--- /dev/null\n+++ b/Bar.md\n"
[jgit_diff, rugged_diff].each do |diff|
view = Precious::Views::Compare.new
view.instance_variable_set(:@diff, diff)
assert_equal [], view.lines
end
end
test 'file addition diff' do test 'file addition diff' do
view = Precious::Views::Compare.new view = Precious::Views::Compare.new
+1 -25
View File
@@ -38,31 +38,7 @@ context "Precious::Views::Page" do
assert_include @view.breadcrumb, "数学 📘" assert_include @view.breadcrumb, "数学 📘"
end end
test 'page <title> is the page header from content, if present' do test "page header retains unicde and ASCII characters" do
page_title = 'Page header from content'
@wiki.write_page(page_title, :markdown, 'Contents', commit_details)
@view = Precious::Views::Page.new.tap do |view|
view.instance_variable_set :@page, @wiki.page(page_title)
view.instance_variable_set :@h1_title, true
end
assert_equal @view.title, 'Page header from content'
end
test 'page <title> is URL path title if no h1 present' do
@wiki.write_page('dir/My path title', :markdown, 'Contents', commit_details)
page = @wiki.page('dir/My path title')
@view = Precious::Views::Page.new.tap do |view|
view.instance_variable_set :@page, page
view.instance_variable_set :@h1_title, false
end
assert_equal @view.title, 'My path title'
end
test "page header retains unicode and ASCII characters" do
title = "数学 📘" title = "数学 📘"
@wiki.write_page(title, :markdown, "How old is Bilbo?") @wiki.write_page(title, :markdown, "How old is Bilbo?")
page = @wiki.page(title) page = @wiki.page(title)