Skip to content

Commit

Permalink
bug: duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Oct 28, 2016
1 parent 76f6e45 commit 75e460e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/server/public/scripts/modules/FormCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export default class FormCreate {
values[input.getAttribute('name')] = input.value
})
var toSave = qs.stringify(values)

this._ajax(
{
url: document.location.origin + '/abe/' + type + '/?' + toSave,
Expand Down
6 changes: 6 additions & 0 deletions src/server/routes/get-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var route = function(req, res, next) {
var linkPath = null
var templatePath = null
var fileName = null
var folderPath = null

let p = new Promise((resolve) => {

Expand All @@ -47,6 +48,10 @@ var route = function(req, res, next) {
fileName = fileName[fileName.length-1]
fileName = fileName.replace(`.${config.files.templates.extension}`, '')

folderPath = filePath.split('/')
folderPath.pop()
folderPath = folderPath.join('/')

isHome = false

var filePathTest = cmsData.revision.getDocumentRevision(filePath)
Expand Down Expand Up @@ -119,6 +124,7 @@ var route = function(req, res, next) {
templatePath: req.params[0],
template: _template,
filename: fileName,
folderPath: folderPath,
hasSingleBlock: _hasSingleBlock,
hasBlock: _hasBlock,
form: _form,
Expand Down
2 changes: 1 addition & 1 deletion src/server/views/partials/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>
</div>
</div>

<input class="form-control" type="hidden" name="filePath" id="filePath" value="{{json.abe_meta.cleanFilename}}" />
<input class="form-control" type="hidden" name="filePath" id="filePath" value="{{@root.folderPath}}" />
<input class="form-control" type="hidden" name="oldFilePath" id="oldFilePath" value="{{json.abe_meta.link}}" />

</form>
Expand Down

0 comments on commit 75e460e

Please sign in to comment.