Skip to content

Commit

Permalink
bug: duplicate filename
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Oct 28, 2016
1 parent e190d84 commit 76f6e45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/server/routes/get-main.js
Expand Up @@ -38,10 +38,15 @@ var route = function(req, res, next) {
var jsonPath = null
var linkPath = null
var templatePath = null
var fileName = null

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

if(filePath != null) {
fileName = filePath.split('/')
fileName = fileName[fileName.length-1]
fileName = fileName.replace(`.${config.files.templates.extension}`, '')

isHome = false

var filePathTest = cmsData.revision.getDocumentRevision(filePath)
Expand Down Expand Up @@ -113,6 +118,7 @@ var route = function(req, res, next) {
text: locale,
templatePath: req.params[0],
template: _template,
filename: fileName,
hasSingleBlock: _hasSingleBlock,
hasBlock: _hasBlock,
form: _form,
Expand Down
2 changes: 1 addition & 1 deletion src/server/views/partials/create-form-tplname.html
Expand Up @@ -5,7 +5,7 @@
{{#if isHome}}
<input class="form-control" type="text" name="tplName" id="tplName" placeholder="{{@root.text.file}}.{{config.files.templates.extension}}" />
{{else}}
<input class="form-control" type="text" name="tplName" value="{{json.abe_meta.cleanName}}" id="tplName" placeholder="{{@root.text.file}}.{{config.files.templates.extension}}" />
<input class="form-control" type="text" name="tplName" value="{{@root.filename}}" id="tplName" placeholder="{{@root.text.file}}.{{config.files.templates.extension}}" />
{{/if}}
</div>
</div>

0 comments on commit 76f6e45

Please sign in to comment.