From b84352911eece4156ca7d0deed2f4cf7b7a5724d Mon Sep 17 00:00:00 2001 From: Kevin Webb Date: Mon, 9 Mar 2015 12:42:04 -0400 Subject: [PATCH] recreate demo project --- app/controllers/Application.java | 16 ++++++++++++++++ conf/routes | 2 +- public/templates/app/app-nav.html | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/controllers/Application.java b/app/controllers/Application.java index 0fe6ded..d40ce1a 100644 --- a/app/controllers/Application.java +++ b/app/controllers/Application.java @@ -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(); diff --git a/conf/routes b/conf/routes index 13d6896..4145c65 100644 --- a/conf/routes +++ b/conf/routes @@ -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() diff --git a/public/templates/app/app-nav.html b/public/templates/app/app-nav.html index 3ffb29a..154ffa4 100644 --- a/public/templates/app/app-nav.html +++ b/public/templates/app/app-nav.html @@ -30,7 +30,7 @@
  • Regional & Aggregate Analysis
  • -
  • Project Settings
  • + {{#writeAllowed}}
  • Project Settings
  • {{/writeAllowed}} {{/if}}