Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
recreate demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
kpwebb committed Mar 9, 2015
1 parent c81cb80 commit b843529
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ public static Result linkUserProject(String username, String projectId) {
u.save();
return ok();
}

public static Result createDemoProject() {

if(Project.getProject("db7c31708ec68280a1a94a8ca633dae1") == null) {
Project demoProject = new Project();
demoProject.id = "db7c31708ec68280a1a94a8ca633dae1";
demoProject.name = "DF Demo";
demoProject.defaultLat = -99.1092967987060;
demoProject.defaultLon = 19.42223967;
demoProject.defaultZoom = 12;

demoProject.save();
}

return ok();
}

public static Result logout() throws IOException {
session().clear();
Expand Down
2 changes: 1 addition & 1 deletion conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GET /login controllers.Application.login(

GET /create controllers.Application.createUserForm()
POST /createUser controllers.Application.createUser()

POST /createDemoProject controllers.Application.createDemoProject()

GET /logout controllers.Application.logout()

Expand Down
2 changes: 1 addition & 1 deletion public/templates/app/app-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<li id="analysisTabRegional"><a href="#">Regional & Aggregate Analysis</a></li>
</ul>
</li>
<li id="projectSettingsTab" class="{{#if settingsActive}}active{{/if}}"><a href="#"><span class="glyphicon glyphicon-wrench"></span> Project Settings</a></li>
{{#writeAllowed}}<li id="projectSettingsTab" class="{{#if settingsActive}}active{{/if}}"><a href="#"><span class="glyphicon glyphicon-wrench"></span> Project Settings</a></li>{{/writeAllowed}}
</ul>

{{/if}}
Expand Down

0 comments on commit b843529

Please sign in to comment.