Browse Source

moved to new gollum and ruby version

master
dan 4 weeks ago
parent
commit
6d1ebb4466
21 changed files with 461 additions and 285 deletions
  1. +2
    -2
      custom.css
  2. +1
    -0
      public/javascript/app.js
  3. +59
    -0
      public/javascript/editor/gollum.editor.js
  4. +1
    -1
      public/javascript/editor/modes.js.erb
  5. +20
    -15
      public/javascript/gollum.js.erb
  6. +6
    -0
      public/javascript/polyfills.js
  7. +0
    -83
      public/stylesheets/_layout.scss
  8. +0
    -4
      public/stylesheets/dialog.scss
  9. +23
    -0
      public/stylesheets/primer.css
  10. +0
    -23
      public/stylesheets/primer.scss
  11. +132
    -57
      public/stylesheets/template.scss.erb
  12. +9
    -7
      public/templates/create.mustache
  13. +4
    -2
      public/templates/edit.mustache
  14. +3
    -3
      public/templates/editor.mustache
  15. +3
    -18
      public/templates/error.mustache
  16. +1
    -1
      public/templates/latest_changes.mustache
  17. +4
    -9
      public/templates/layout.mustache
  18. +72
    -0
      public/templates/mobilenav.mustache
  19. +103
    -43
      public/templates/navbar.mustache
  20. +1
    -1
      public/templates/overview.mustache
  21. +17
    -16
      public/templates/wiki_content.mustache

+ 2
- 2
custom.css View File

@ -65,5 +65,5 @@
}
.container-lg {
max-width: 60%;
}
max-width: 80%;
}

+ 1
- 0
public/javascript/app.js View File

@ -7,3 +7,4 @@
//= require gollum.placeholder
//= require editor/sections
//= require jquery.resize
//= require polyfills

+ 59
- 0
public/javascript/editor/gollum.editor.js View File

@ -17,6 +17,8 @@
NoDefinitionsFor: []
};
var ActiveOptions = {};
var autoSaveTimer = null;
var storageKey = 'gollum_autorecover_' + window.location;
function isRTL(s){
var ltrChars = 'A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u0300-\u0590\u0800-\u1FFF'+'\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF',
@ -32,6 +34,27 @@
window.ace_editor.renderer.updateFull();
}
function autoSaveHandler() {
// Autosave
if (autoSaveTimer) {
// Reset the timer because we just changed the text
clearTimeout(autoSaveTimer);
}
$('#gollum-saved-msg').text('Saving...');
// Wait 2 seconds, then actualy save the text to local storage
autoSaveTimer = setTimeout(function() {
localStorage.setItem(storageKey, window.ace_editor.getSession().getValue());
// Save any subpage editor text that might exist
$('#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar').each(function(_, el) {
var spStorageKey = storageKey + el.id.replace('gollum-editor-', '_');
localStorage.setItem(spStorageKey, el.value);
});
$('#gollum-saved-msg').text('Saved recovery text');
}, 2000);
}
/**
* $.GollumEditor
*
@ -55,6 +78,26 @@
var editor = ace.edit(editDiv[0], {rtlText: true});
window.ace_editor = editor;
// Check to see if we have any autosaved text and show a message to
// restore it if present.
var savedText = localStorage.getItem(storageKey);
if (savedText) {
$('#gollum-autorecover-button').click(function(e) {
editor.getSession().setValue(savedText);
// Restore subpage editor values too, if they exist
['header', 'footer', 'sidebar'].forEach(function(i) {
var sbSavedText = localStorage.getItem(storageKey + '_' + i);
if (sbSavedText) {
$('#gollum-editor-' + i).val(sbSavedText);
}
});
$('#gollum-autorecover-msg')[0].hidden = true;
e.preventDefault();
});
$('#gollum-autorecover-msg')[0].hidden = false;
}
editor.setTheme("ace/theme/tomorrow");
editor.setKeyboardHandler();
editor.renderer.setShowGutter(false);
@ -64,8 +107,13 @@
editor.getSession().on('change', function(){
textarea.val(editor.getSession().getValue());
autoSaveHandler();
});
// Autosave for the header, footer and sidebar
$('#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar')
.on('change keyup paste', autoSaveHandler);
if (isRTL(editor.getSession().getLine(0))) {
switchRtl(true);
}
@ -114,6 +162,16 @@
editor.focus();
});
// Remove any autosaved text when we hit save or cancel
$("#gollum-editor-submit, #gollum-editor-cancel").click(function() {
var storageKey = 'gollum_autorecover_' + window.location;
localStorage.removeItem(storageKey);
// Clear subpage editor values too, if they exist
['header', 'footer', 'sidebar'].forEach(function(i) {
localStorage.removeItem(storageKey + '_' + i);
});
});
debug('GollumEditor loading');
if ( EditorHas.baseEditorMarkup() ) {
@ -241,6 +299,7 @@
var ext = file.name.split('.').pop().toLowerCase()
var image_ext = ['jpg', 'jpeg', 'tif', 'tiff', 'png', 'gif', 'svg', 'bmp']
// Link directly to image files
uploadDest = uploadDest.replace(/%20/g, ' ');
if ((image_ext.indexOf(ext) > -1)) {
var text = '[[/' + uploadDest + '/' + file.name + ']]';
} else {


+ 1
- 1
public/javascript/editor/modes.js.erb View File

@ -23,7 +23,7 @@
// For Gollum link tags
var GollumTagStart = {
token: "support.function",
regex: "\\[\\[.*\\]\\]",
regex: "\\[\\[[^\\]]*\\]\\]",
next: 'start'
};


+ 20
- 15
public/javascript/gollum.js.erb View File

@ -105,7 +105,7 @@ function flashNotice(type, notice, button_label, button_function, button_type) {
}
html = '<p><div id="gollum-flash" class="flash flash-' + type +'"><button class="flash-close js-flash-close" type="button" onclick="parentNode.remove()"><%=rocticon('x')%></button>' + notice + nested_button_html + '</div></p>';
$('#gollum-flash').remove();
$('#wiki-content h1').before(html);
$('#wiki-content').before(html);
if (type == 'success') { setTimeout(function() {$('#gollum-flash').fadeOut();}, 5000); }
}
@ -156,12 +156,12 @@ $(document).ready(function() {
}
if ($('#minibutton-upload-page').length) {
if ($('.minibutton-upload-page').length) {
new ClipboardJS('#ClipboardJSlink');
$('#minibutton-upload-page').parent().removeClass('jaws');
$('#minibutton-upload-page').click(function(e) {
$('.minibutton-upload-page').parent().removeClass('jaws');
$('.minibutton-upload-page').click(function(e) {
e.preventDefault();
$.GollumDialog.init({
title: 'Upload File',
fields: [
@ -213,9 +213,9 @@ $(document).ready(function() {
});
}
if ($('#minibutton-rename-page').length) {
$('#minibutton-rename-page').parent().removeClass('jaws');
$('#minibutton-rename-page').click(function(e) {
if ($('.minibutton-rename-page').length) {
$('.minibutton-rename-page').parent().removeClass('jaws');
$('.minibutton-rename-page').click(function(e) {
e.preventDefault();
var path = decodeURI(pagePath());
@ -257,9 +257,9 @@ $(document).ready(function() {
});
}
if ($('#minibutton-new-page').length) {
$('#minibutton-new-page').parent().removeClass('jaws');
$('#minibutton-new-page').click(function(e) {
if ($('.minibutton-new-page').length) {
$('.minibutton-new-page').parent().removeClass('jaws');
$('.minibutton-new-page').click(function(e) {
e.preventDefault();
var path = pagePath();
if( path === undefined && $('#file-browser').length != 0 ){
@ -380,8 +380,12 @@ $(document).ready(function() {
active_tab = '#edit.tabnav-tab';
}
$('.tabnav-tab.selected').removeAttr('aria-current');
$('.tabnav-tab.selected').removeClass('selected');
$(active_tab).attr('aria-current', 'page');
$(active_tab).addClass('selected');
$('.tabnav-div').hide();
$(active_div).show();
}
@ -486,12 +490,13 @@ $(document).ready(function() {
}
numSelected = numSelected + 1;
});
if (numSelected == maxSelected) {
$('#version-form input:not(:checked)').prop('disabled', true);
$('.history button.action-compare-revision').prop('disabled', false);
if (numSelected < 1) {
$('.history button.action-compare-revision').prop('disabled', true);
} else if (numSelected < maxSelected) {
$('.history button.action-compare-revision').prop('disabled', false);
$('#version-form input').prop('disabled', false);
$('.history button.action-compare-revision').prop('disabled', true);
} else {
$('#version-form input:not(:checked)').prop('disabled', true);
}
};


+ 6
- 0
public/javascript/polyfills.js View File

@ -0,0 +1,6 @@
// Polyfill to support Internet Explorer
if (!Array.prototype.includes) {
Array.prototype.includes = function (x) {
return 0 <= this.indexOf(x)
};
}

+ 0
- 83
public/stylesheets/_layout.scss View File

@ -1,83 +0,0 @@
// Describes base page layout
/* @section wrapper */
#wiki-wrapper {
margin: 0 auto;
overflow: visible;
width: 100%;
@include desktop-breakpoint {
@include desktop-page-layout;
}
}
/* @section content */
#wiki-content {
height: 1%;
overflow: visible;
.wrap {
height: 1%;
overflow: auto;
}
&.uploading {
opacity: 0.5;
}
p, li {
code {
white-space:pre-wrap;
word-wrap:break-word;
}
}
}
/* @section body */
#wiki-body {
display: block;
width: 100%;
margin-right: 3%;
@include largemobile-breakpoint {
float: left;
clear: left;
.has-sidebar & {
width: $layout-with-sidebar - $layout-with-sidebar-leeway;
}
.has-leftbar & {
float: right;
clear: right;
}
}
}
/* @section sidebar */
#wiki-sidebar {
@include largemobile-breakpoint {
width: $layout-sidebar;
.has-leftbar & {
float: left;
}
.has-rightbar & {
float: right;
}
}
}
/* @section footer */
#wiki-footer {
clear: both;
@include largemobile-breakpoint {
.has-sidebar & {
width: $layout-with-sidebar;
}
}
}

+ 0
- 4
public/stylesheets/dialog.scss View File

@ -147,7 +147,3 @@
}
}
}
#gollum-dialog-dialog-buttons {
overflow: hidden;
}

+ 23
- 0
public/stylesheets/primer.css
File diff suppressed because it is too large
View File


+ 0
- 23
public/stylesheets/primer.scss
File diff suppressed because it is too large
View File


+ 132
- 57
public/stylesheets/template.scss.erb View File

@ -53,19 +53,85 @@ a {
/* Markdown body */
.header-enum {
h2 {counter-reset: h3}
h3 {counter-reset: h4}
h4 {counter-reset: h5}
h5 {counter-reset: h6}
--header-enum-style: decimal;
h1:before {counter-increment: h1; content: counter(h1, var(--header-enum-style)) ". ";}
h2:before {counter-increment: h2; content: counter(h1, var(--header-enum-style)) "." counter(h2, var(--header-enum-style)) ". ";}
h3:before {counter-increment: h3; content: counter(h1, var(--header-enum-style)) "." counter(h2, var(--header-enum-style)) "." counter(h3, var(--header-enum-style)) ". ";}
h4:before {counter-increment: h4; content: counter(h1, var(--header-enum-style)) "." counter(h2, var(--header-enum-style)) "." counter(h3, var(--header-enum-style)) "." counter(h4, var(--header-enum-style)) ". ";}
h5:before {counter-increment: h5; content: counter(h1, var(--header-enum-style)) "." counter(h2, var(--header-enum-style)) "." counter(h3, var(--header-enum-style)) "." counter(h4, var(--header-enum-style)) "." counter(h5, var(--header-enum-style)) ". ";}
h6:before {counter-increment: h6; content: counter(h1, var(--header-enum-style)) "." counter(h2, var(--header-enum-style)) "." counter(h3, var(--header-enum-style)) "." counter(h4, var(--header-enum-style)) "." counter(h5, var(--header-enum-style)) "." counter(h6, var(--header-enum-style)) ". ";}
h1 {
counter-increment: h1;
counter-reset: h2;
&:before {
content: counter(h1, var(--header-enum-style)) ". ";
}
}
h2 {
counter-increment: h2;
counter-reset: h3;
&:before {
content:
counter(h1, var(--header-enum-style))
"." counter(h2, var(--header-enum-style))
". ";
}
}
h3 {
counter-reset: h4;
counter-increment: h3;
&:before {
content:
counter(h1, var(--header-enum-style))
"." counter(h2, var(--header-enum-style))
"." counter(h3, var(--header-enum-style))
". ";
}
}
h4 {
counter-increment: h4;
counter-reset: h5;
&:before {
content:
counter(h1, var(--header-enum-style))
"." counter(h2, var(--header-enum-style))
"." counter(h3, var(--header-enum-style))
"." counter(h4, var(--header-enum-style))
". ";
}
}
h5 {
counter-increment: h5;
counter-reset: h6;
&:before {
content:
counter(h1, var(--header-enum-style))
"." counter(h2, var(--header-enum-style))
"." counter(h3, var(--header-enum-style))
"." counter(h4, var(--header-enum-style))
"." counter(h5, var(--header-enum-style))
". ";
}
}
h6 {
counter-increment: h6;
&:before {
content:
counter(h1, var(--header-enum-style))
"." counter(h2, var(--header-enum-style))
"." counter(h3, var(--header-enum-style))
"." counter(h4, var(--header-enum-style))
"." counter(h5, var(--header-enum-style))
"." counter(h6, var(--header-enum-style))
". ";
}
}
}
#footer {
@ -77,43 +143,58 @@ a {
padding: 1em 1em 1em 0;
font-size: 15px;
line-height: 1.7;
overflow: hidden;
word-wrap: break-word;
/* MediaWiki's TOC table -- this does not pertain to gollum's own TOC functionality */
table.toc {
width: auto;
display: inline-table;
.anchor {
display: none;
}
}
.anchor {
display: inline-block;
position: absolute;
opacity: 0;
background: url('data:image/svg+xml;utf8,<%= rocticon_css(:link) %>') no-repeat;
background-size: 0.6em 1.35em;
padding-right: 0.5em;
padding-top: 0.4em;
margin-left: -0.8em;
width: 1em;
height: 1em;
text-decoration: none;
transition-property: opacity;
transition: 0.1s;
}
h1,
h2,
h3,
h4,
h5,
h6 {
$anchor-icon-size: 20px;
*:hover > .anchor, .anchor:focus{
opacity: 1;
}
position: relative;
.anchor {
display: inline-block;
position: absolute;
margin-top: 0.1em;
width: $anchor-icon-size;
text-decoration: none;
opacity: 0;
transition: opacity 0.1s ease-in-out;
.anchor.edit {
margin-left: 2em !important;
margin-top: 0.5em;
height: 0.5em;
background: url('data:image/svg+xml;utf8,<%= rocticon_css(:pencil) %>') no-repeat;
&:before {
content: url('data:image/svg+xml;utf8,<%= rocticon_css(:link) %>');
}
&:not(.edit) {
left: -($anchor-icon-size/2);
}
&.edit {
margin-left: ($anchor-icon-size/2);
&:before {
content: url('data:image/svg+xml;utf8,<%= rocticon_css(:pencil) %>');
}
}
}
&:hover > .anchor,
.anchor:focus {
opacity: 1;
}
}
a {
@ -125,13 +206,6 @@ a {
color: inherit;
text-decoration: none;
}
&:first-child {
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
padding-top: 0;
}
}
}
> *:first-child {
@ -166,18 +240,6 @@ a {
border-bottom: 1px solid #eee;
}
h3 {
}
h4 {
}
h5 {
}
h6 {
}
p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0;
}
@ -615,6 +677,10 @@ a {
color: #999;
background-color: #EAF2F5;
}
.gg {
color: #000000a0;
}
}
.type-csharp {
@ -639,15 +705,24 @@ a {
.s, .sc {
color: #A31515;
}
}
}
}
div.pagination a.disabled {
pointer-events: none;
}
nav.actions {
scrollbar-width: none;
-ms-overflow-style: -ms-autohiding-scrollbar;
::webkit-scrollbar {
display: none;
}
}
.search-results {
.search-context li:nth-child(n+4) {
display: none;
}
}
}

+ 9
- 7
public/templates/create.mustache View File

@ -4,13 +4,15 @@
<h1 class="py-4">Create New Page</h1>
</div>
<div id="wiki-content" class="create edit">
<div class="tabnav">
<nav class="tabnav-tabs" aria-label="Foo bar">
<a href="#" id="edit" class="tabnav-tab selected" aria-current="edit">Edit</a>
<a href="#" id="preview" class="tabnav-tab" aria-current="preview">Preview</a>
</nav>
</div>
<div class="tabnav">
<nav class="tabnav-tabs" aria-label="Toggle edit or preview mode">
<a href="#" id="edit" class="tabnav-tab selected" aria-current="page">
Edit
</a>
<a href="#" id="preview" class="tabnav-tab">Preview</a>
</nav>
</div>
<div class="has-sidebar tabnav-div" id="edit-content">
{{>editor}}
</div>


+ 4
- 2
public/templates/edit.mustache View File

@ -5,8 +5,10 @@
</div>
<div class="tabnav">
<nav class="tabnav-tabs">
<a href="#" id="edit" class="tabnav-tab selected" aria-current="edit">Edit</a>
<a href="#" id="preview" class="tabnav-tab" aria-current="preview">Preview</a>
<a href="#" id="edit" class="tabnav-tab selected" aria-current="page">
Edit
</a>
<a href="#" id="preview" class="tabnav-tab">Preview</a>
</nav>
</div>
<div class="tabnav-div" id="edit-content">{{>editor}}</div>


+ 3
- 3
public/templates/editor.mustache View File

@ -37,7 +37,7 @@
<button class="btn btn-sm function-button" id="function-h3" title="Heading 3">h3</button>
<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-image" title="Image">{{#octicon}}file-media{{/octicon}}</button>
<button class="btn btn-sm function-button" id="function-image" title="Image">{{#octicon}}image{{/octicon}}</button>
<span class="pr-2"></span>
{{#critic_markup}}
<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">
<label for="format">Keybinding</label>
<select id="keybinding" name="keybinding" class="form-select">
<select id="keybinding" name="keybinding" class="form-select input-sm">
<option selected="selected">default</option>
<option>vim</option>
<option>emacs</option>
</select>
<label for="format">Markup</label>
<select id="wiki_format" name="format" class="form-select">
<select id="wiki_format" name="format" class="form-select input-sm">
{{#formats}}
{{#enabled}}
<option {{#selected}}selected="selected" {{/selected}}value="{{id}}" data-ext="{{ext}}">


+ 3
- 18
public/templates/error.mustache View File

@ -1,23 +1,8 @@
<div id="wiki-wrapper" class="error" style="text-align:center;">
<div id="wiki-wrapper" class="error">
<div id="error">
<br>
<br>
<br>
<br>
<br>
<br>
<h1>Sorry, not allowed &#128580;</h1>
<h1>Error</h1>
<p>
You cannot change pages directly from the Wiki! Please take a look at our
<a href='/content/pwoss/wiki#how-to-create-change-wiki-pages'>guide</a>
for more information on how to make any changes.<br>
Thank you!
<br>
<br>
<br>
<br>
<br>
<br>
{{message}}
</p>
</div>
</div>

+ 1
- 1
public/templates/latest_changes.mustache View File

@ -13,7 +13,7 @@
<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="flex-auto col-1 text-gray-light">{{date}}</span>
<span class="flex-auto col-7">{{message}}<br/>
<span class="flex-auto col-5">{{message}}<br/>
{{#files}}
<span class="flex-auto col-2">{{#renamed}}{{renamed}} -> {{/renamed}}<a href="{{link}}">{{file}}</a></span><br/>
{{/files}}


+ 4
- 9
public/templates/layout.mustache View File

@ -22,17 +22,12 @@
<center><img id="logo" src="{{base_url}}/public/images/pwoss.svg">
<h1>PwOSS - Wiki</h1></center>
<meta http-equiv="Content-type" content="text/html;charset=utf-8">
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width">
{{#sprockets_stylesheet_tag}}app{{/sprockets_stylesheet_tag}}
{{#sprockets_stylesheet_tag}}print print{{/sprockets_stylesheet_tag}}
{{#css}}<link rel="stylesheet" type="text/css" href="{{custom_path}}/custom.css" media="all">{{/css}}
{{#css}}<link rel="stylesheet" type="text/css" href="{{custom_css}}" media="all">{{/css}}
{{#noindex}}<meta name="robots" content="noindex, nofollow" />{{/noindex}}
<script>
var criticMarkup = '{{critic_markup}}';
var baseUrl = '{{base_url}}';
@ -70,11 +65,11 @@
};
</script>
{{#mathjax_config}}
<script type="text/javascript" src="{{base_url}}/{{mathjax_config}}"></script>
<script type="text/javascript" src="{{mathjax_config_path}}"></script>
{{/mathjax_config}}
<script defer src="{{base_url}}/gollum/assets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script defer src="{{mathjax_js}}"></script>
{{/mathjax}}
{{#js}}<script type="text/javascript" src="{{custom_path}}/custom.js"></script>{{/js}}
{{#js}}<script type="text/javascript" src="{{custom_js}}"></script>{{/js}}
<title>{{title}}</title>
</head>


+ 72
- 0
public/templates/mobilenav.mustache View File

@ -0,0 +1,72 @@
<details class="details-reset details-overlay">
<summary class="btn btn-invisible" aria-haspopup="true">
<span aria-label="Open menu">☰</span>
</summary>
<div class="SelectMenu mx-sm-2">
<div class="SelectMenu-modal">
<div class="SelectMenu-divider py-3">
<h2 class="h6">Current Page</h2>
<div>{{page_header}}</div>
</div>
{{#history}}
<a
class="SelectMenu-item"
href="{{history_path}}/{{escaped_url_path}}"
role="menuitem"
>
<span>History</span>
</a>
{{/history}}
{{#allow_editing}}
{{#allow_uploads}}
<a class="SelectMenu-item minibutton-upload-page" role="menuitem">
<span>Upload</span>
</a>
{{/allow_uploads}}
{{#editable}}
<a class="SelectMenu-item minibutton-rename-page" role="menuitem">
<span>Rename</span>
</a>
<a
class="SelectMenu-item minibutton-edit-page"
href="{{edit_path}}/{{escaped_url_path}}"
role="menuitem"
>
<span>Edit</span>
</a>
{{/editable}}
{{/allow_editing}}
<div class="SelectMenu-divider py-3">
<h2 class="h6">Main Menu</h2>
</div>
<div class="SelectMenu-list">
<a class="SelectMenu-item" role="menuitem" href="{{page_route}}">
Home
</a>
{{#overview}}
<a class="SelectMenu-item" role="menuitem" href="{{overview_path}}">
Overview
</a>
{{/overview}}
{{#latest_changes}}
<a
class="SelectMenu-item"
href="{{latest_changes_path}}"
role="menuitem"
>
Latest Changes
</a>
{{/latest_changes}}
</div>
</div>
</div>
</details>

+ 103
- 43
public/templates/navbar.mustache View File

@ -1,43 +1,103 @@
<nav class="actions pt-4">
<div class="TableObject">
<div class="TableObject-item">
<a class="btn" 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">
{{#overview}}<a class="btn" id="minibutton-overview" href="{{overview_path}}">Overview</a>{{/overview}}
{{#latest_changes}}<a class="btn" id="minibutton-latest-changes" href="{{latest_changes_path}}">Latest Changes</a>{{/latest_changes}}
</div>
{{#history}}
<div class="TableObject-item pl-1">
<a class="btn" id="minibutton-history" href="{{history_path}}/{{escaped_url_path}}">Page History</a>
</div>
{{/history}}
{{#allow_editing}}
<div class="TableObject-item pl-1">
{{#allow_uploads}}
<a class="btn" id="minibutton-upload-page" href="#">Upload</a>
{{/allow_uploads}}
{{#editable}}
<a class="btn" id="minibutton-rename-page" href="#">Rename</a>
<a class="btn" id="minibutton-edit-page" href="{{edit_path}}/{{escaped_url_path}}">Edit</a>
<a class="btn btn-primary" id="minibutton-new-page" href="#">New</a>
{{/editable}}
{{^editable}}
{{#newable}}
<a class="btn btn-primary" id="minibutton-new-page" href="#">New</a>
{{/newable}}
{{/editable}}
</div>
{{/allow_editing}}
</div>
</nav>
<nav class="TableObject actions pt-4 px-2 px-lg-0 overflow-x-scroll">
<div class="TableObject-item hide-lg hide-xl">
{{>mobilenav}}
</div>
<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 class="TableObject-item px-2">
<div class="BtnGroup d-flex">
{{#history}}
<a
class="btn BtnGroup-item btn-sm hide-sm hide-md"
href="{{history_path}}/{{escaped_url_path}}"
id="minibutton-history"
>
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>
</div>
{{/editable}}
{{^editable}}
{{#newable}}
<div class="TableObject-item">
<a class="btn btn-primary btn-sm minibutton-new-page" href="#">
New
</a>
</div>
{{/newable}}
{{/editable}}
{{/allow_editing}}
</nav>

+ 1
- 1
public/templates/overview.mustache View File

@ -18,7 +18,7 @@
<span class="pr-2">{{{icon}}}</span>
<span><a href="{{url}}">{{name}}</a></span>
{{#allow_editing}}
{{#is_file}}<button class="btn btn-sm float-right delete-file" data-file-path="{{url}}" data-confirm="Are you sure you want to delete {{name}}?">{{#octicon}}trashcan{{/octicon}}</button>{{/is_file}}
{{#is_file}}<button class="btn btn-sm float-right delete-file" data-file-path="{{file_path}}" data-confirm="Are you sure you want to delete {{name}}?">{{#octicon}}trash{{/octicon}}</button>{{/is_file}}
{{/allow_editing}}
</li>
{{/files_folders}}


+ 17
- 16
public/templates/wiki_content.mustache View File

@ -1,7 +1,6 @@
<div id="wiki-content">
<div id="wiki-content" class="px-2 px-lg-0">
<h1 class="pt-4">{{page_header}}</h1>
<div class="breadcrumb">{{{breadcrumb}}}</div>
<div class="{{#has_header}}has-header{{/has_header}}{{#has_footer}} has-footer{{/has_footer}}{{#has_sidebar}} has-sidebar has-{{bar_side}}bar{{/has_sidebar}}{{#has_toc}} has-toc{{/has_toc}}">
{{#has_toc}}
@ -9,14 +8,7 @@
{{{toc_content}}}
</div>
{{/has_toc}}
{{#has_sidebar}}
<div id="wiki-sidebar" class="gollum-{{sidebar_format}}-content">
<div id="sidebar-content" class="Box Box--condensed col-3 markdown-body px-4 float-{{bar_side}}">
{{{sidebar_content}}}
</div>
</div>
{{/has_sidebar}}
<div id="wiki-body" class="gollum-{{format}}-content overflow-hidden {{#left_bar}}pl-4{{/left_bar}}">
<div id="wiki-body" class="gollum-{{format}}-content">
{{#has_header}}
<div id="wiki-header" class="gollum-{{header_format}}-content">
<div id="header-content" class="markdown-body">
@ -24,14 +16,23 @@
</div>
</div>
{{/has_header}}
<div class="markdown-body {{#header_enum?}}header-enum{{/header_enum?}}" {{#header_enum?}}style="--header-enum-style:{{header_enum_style}};"{{/header_enum?}}>
{{{rendered_metadata}}}
{{{content}}}
<div class="main-content clearfix container-lg">
<div class="markdown-body {{#header_enum?}}header-enum{{/header_enum?}} {{#has_sidebar}}float-md-{{body_side}} col-md-9{{/has_sidebar}}" {{#header_enum?}}style="--header-enum-style:{{header_enum_style}};"{{/header_enum?}}>
{{{rendered_metadata}}}
{{{content}}}
</div>
{{#has_sidebar}}
<div id="wiki-sidebar" class="Box Box--condensed float-md-{{body_side}} col-md-3">
<div id="sidebar-content" class="gollum-{{sidebar_format}}-content markdown-body px-4">
{{{sidebar_content}}}
</div>
</div>
{{/has_sidebar}}
</div>
</div>
{{#has_footer}}
<div id="wiki-footer" class="gollum-{{footer_format}}-content">
<div id="footer-content" class="Box Box-condensed markdown-body pl-2">
<div id="wiki-footer" class="gollum-{{footer_format}}-content my-2">
<div id="footer-content" class="Box Box-condensed markdown-body px-4">
{{{footer_content}}}
</div>
</div>
@ -57,5 +58,5 @@
{{/historical}}
</div>
</div>

Loading…
Cancel
Save