Skip to content

Commit

Permalink
refactoring: removing cleanNameNoExt from the code
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Oct 30, 2016
1 parent 00725d5 commit 527c72d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/cli/cms/data/file.js
Expand Up @@ -165,7 +165,6 @@ export function getFileObject(pathFile) {
const extension = '.json'

const name = path.basename(pathFile)
const nameNoExt = path.basename(pathFile, extension)
const relativePath = pathFile.replace(pathData + '/', '')

const parentName = cmsData.fileAttr.delete(name)
Expand All @@ -187,7 +186,6 @@ export function getFileObject(pathFile) {

let fileObject = {
'name': name,
'cleanNameNoExt': nameNoExt,
'path': pathFile,
'cleanPath': relativePath,
'filePath': relativePath,
Expand Down
1 change: 0 additions & 1 deletion src/cli/cms/data/revision.js
Expand Up @@ -163,7 +163,6 @@ export function getFilesMerged(files) {
cleanPathName: file.cleanPathName,
cleanPath: file.cleanPath,
cleanName: file.cleanName,
cleanNameNoExt: file.cleanNameNoExt,
cleanFilePath: file.cleanFilePath,
filePath: cmsData.fileAttr.delete(file.filePath),
revisions: []
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cms/templates/template.js
Expand Up @@ -284,7 +284,7 @@ export function getStructureAndTemplates() {
let additionalPath = path.dirname(templatePath).replace(pathTemplates,'')
if(additionalPath !== '') additionalPath = additionalPath.substring(1)
let name = path.join(additionalPath,path.basename(templatePath,extension))
let template = {'path':templatePath, 'cleanPath':templatePath, 'cleanNameNoExt':name}
let template = {'path':templatePath, 'cleanPath':templatePath, 'name':name}
result.templates.push(template)
})

Expand Down
8 changes: 4 additions & 4 deletions src/server/views/partials/create-form-template.html
Expand Up @@ -5,12 +5,12 @@
<option></option>
{{#each manager.list.templates}}
{{#if isHome}}
<option value="{{cleanPath}}" clean-value="{{website}}">{{cleanNameNoExt}}</option>
<option value="{{cleanPath}}" clean-value="{{website}}">{{name}}</option>
{{else}}
{{#ifCond @root.json.abe_meta.template cleanNameNoExt}}
<option value="{{cleanPath}}" clean-value="{{website}}" selected="selected">{{cleanNameNoExt}}</option>
{{#ifCond @root.json.abe_meta.template name}}
<option value="{{cleanPath}}" clean-value="{{website}}" selected="selected">{{name}}</option>
{{else}}
<option value="{{cleanPath}}" clean-value="{{website}}">{{cleanNameNoExt}}</option>
<option value="{{cleanPath}}" clean-value="{{website}}">{{name}}</option>
{{/ifCond}}
{{/if}}
{{/each}}
Expand Down

0 comments on commit 527c72d

Please sign in to comment.