Skip to content

Commit

Permalink
Modified the partials directory structure.
Browse files Browse the repository at this point in the history
The partials are now placed in the 'views' directory, just like in the yeoman/yo generated angular app.
  • Loading branch information
VineetReynolds committed Feb 19, 2013
1 parent 275bd70 commit 1a041cc
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public List<Resource<?>> generateIndex(String targetDir, Resource<?> template, b
ArrayList<Resource<?>> result = new ArrayList<Resource<?>>();
List<String> entityNames = new ArrayList<String>();
WebResourceFacet web = this.project.getFacet(WebResourceFacet.class);
FileResource<?> partialsDirectory = web.getWebResource("partials");
FileResource<?> partialsDirectory = web.getWebResource("views");
for (Resource<?> resource : partialsDirectory.listResources()) {
entityNames.add(resource.getName());
}
Expand Down Expand Up @@ -128,8 +128,8 @@ public List<Resource<?>> generateFromEntity(String targetDir, Resource<?> templa
// be obtained dynamically. Another list to be processed for all entities (like index.html.ftl) also needs to be
// maintained. In short, a template should be associated with a processing directive like PER_ENTITY, PER_PROJECT etc.
Map<String, String> perEntityTemplates = new HashMap<String, String>();
perEntityTemplates.put("partials/detail.html.ftl", "/partials/" + entity.getName() + "/detail.html");
perEntityTemplates.put("partials/search.html.ftl", "/partials/" + entity.getName() + "/search.html");
perEntityTemplates.put("views/detail.html.ftl", "/views/" + entity.getName() + "/detail.html");
perEntityTemplates.put("views/search.html.ftl", "/views/" + entity.getName() + "/search.html");
perEntityTemplates.put("scripts/entityModule.js.ftl", "/scripts/" + entity.getName() + "/" + entity.getName() + ".js");

FreemarkerClient freemarkerClient = new FreemarkerClient();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/scaffold/angularjs/scripts/app.js.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var ${angularApp} = angular.module('${angularApp}', ['${angularApp}.filters'
editEntityController = "Edit${entityName}Controller"
entityId = "${entityName}Id"
entityRoute = "/${entityName}s"
entityPartialsLocation = "partials/${entityName}">
entityPartialsLocation = "views/${entityName}">
.when('${entityRoute}',{templateUrl:'${entityPartialsLocation}/search.html',controller:'${searchEntityController}'})
.when('${entityRoute}/new',{templateUrl:'${entityPartialsLocation}/detail.html',controller:'${newEntityController}'})
.when('${entityRoute}/edit/:${entityId}',{templateUrl:'${entityPartialsLocation}/detail.html',controller:'${editEntityController}'})
Expand Down

0 comments on commit 1a041cc

Please sign in to comment.