diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index f8f379fa..5b9a77c5 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -299,6 +299,7 @@ module Precious file.raw_data else @name = name + @path = path mustache :create end end diff --git a/lib/gollum/frontend/public/gollum/css/editor.css b/lib/gollum/frontend/public/gollum/css/editor.css index 9003bc01..a590946b 100755 --- a/lib/gollum/frontend/public/gollum/css/editor.css +++ b/lib/gollum/frontend/public/gollum/css/editor.css @@ -64,6 +64,12 @@ a { color: #999; } +#gollum-editor .path_note { + text-align: right; + font-size: small; + padding-right: 5px; +} + #gollum-editor-title-field input#gollum-editor-page-title { font-weight: bold; margin-top: 0; diff --git a/lib/gollum/frontend/public/gollum/javascript/gollum.js b/lib/gollum/frontend/public/gollum/javascript/gollum.js index 2d832a9c..3c614dd3 100755 --- a/lib/gollum/frontend/public/gollum/javascript/gollum.js +++ b/lib/gollum/frontend/public/gollum/javascript/gollum.js @@ -102,22 +102,28 @@ $(document).ready(function() { $('#minibutton-new-page').click(function(e) { e.preventDefault(); $.GollumDialog.init({ - title: 'Create New Page', - fields: [ - { - id: 'name', - name: 'Page Name', - type: 'text' - } - ], - OK: function( res ) { - var n = 'New Page'; - if ( res['name'] ) - var n = res['name']; - n = encodeURIComponent( n ); - window.location = '/' + n; - } - }); + title: 'Create New Page', + fields: [ + { + id: 'name', + name: 'Page Name', + type: 'text' + } + ], + OK: function( res ) { + var name = 'New Page'; + if ( res['name'] ) { + var name = res['name']; + } + + var url = ''; + var path = $('#minibutton-new-page').data('path'); + if (path) { + url += '/' + encodeURIComponent(path) + } + window.location = url + '/' + encodeURIComponent(name); + } + }); }); } diff --git a/lib/gollum/frontend/templates/editor.mustache b/lib/gollum/frontend/templates/editor.mustache index 2de7d7df..d81cd4ec 100644 --- a/lib/gollum/frontend/templates/editor.mustache +++ b/lib/gollum/frontend/templates/editor.mustache @@ -10,6 +10,9 @@
NOTE: This page will be created within the "{{path}}" directory
+ {{/has_path}}