Remove all sensor things Project: http://git-wip-us.apache.org/repos/asf/incubator-cmda/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cmda/commit/2d375c56 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cmda/tree/2d375c56 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cmda/diff/2d375c56
Branch: refs/heads/master Commit: 2d375c562f295501f158e4c1c4aaaddf6e3b26c5 Parents: 73b592c Author: mingqi830 <m...@andrew.cmu.edu> Authored: Wed Sep 2 16:10:37 2015 -0700 Committer: mingqi830 <m...@andrew.cmu.edu> Committed: Wed Sep 2 16:10:37 2015 -0700 ---------------------------------------------------------------------- app/controllers/ClimateServiceController.java | 69 ---- app/controllers/EstimateController.java | 147 --------- app/controllers/NasaRegistrationController.java | 268 --------------- app/models/NasaRegistration.java | 325 ------------------- app/views/climate/addUserForm.scala.html | 31 -- app/views/climate/allUsers.scala.html | 82 ----- app/views/climate/deleteUser.scala.html | 23 -- app/views/climate/estimate.scala.html | 119 ------- app/views/climate/estimate1.scala.html | 115 ------- app/views/climate/estimate2.scala.html | 32 -- app/views/climate/estimate3.scala.html | 171 ---------- app/views/climate/header.scala.html | 19 -- app/views/climate/login.scala.html | 20 -- app/views/climate/updateUserForm.scala.html | 31 -- .../climate/userRegistrationForm.scala.html | 31 -- app/views/estimator/accountSummary.scala.html | 79 ----- app/views/estimator/estimate.scala.html | 118 ------- app/views/estimator/estimate1.scala.html | 115 ------- app/views/estimator/estimate2.scala.html | 32 -- app/views/estimator/estimate3.scala.html | 171 ---------- app/views/estimator/header.scala.html | 55 ---- app/views/estimator/login.scala.html | 22 -- app/views/estimator/main.scala.html | 60 ---- app/views/estimator/tutorial.scala.html | 24 -- app/views/registration/@(users | 0 app/views/registration/adminPage.scala.html | 116 ------- app/views/registration/delete.scala.html | 23 -- app/views/registration/header.scala.html | 53 --- app/views/registration/main.scala.html | 58 ---- .../registration/registrationForm.scala.html | 48 --- app/views/registration/submit.scala.html | 5 - app/views/registration/updateForm.scala.html | 48 --- conf/routes | 24 -- 33 files changed, 2534 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/controllers/ClimateServiceController.java ---------------------------------------------------------------------- diff --git a/app/controllers/ClimateServiceController.java b/app/controllers/ClimateServiceController.java index 9e0b88a..0cd2a54 100644 --- a/app/controllers/ClimateServiceController.java +++ b/app/controllers/ClimateServiceController.java @@ -3,8 +3,6 @@ package controllers; import static play.data.Form.form; import models.DataSet; import models.BugReport; -import models.NasaRegistration; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -50,9 +48,6 @@ public class ClimateServiceController extends Controller { final static Form<ClimateService> climateServiceForm = Form .form(ClimateService.class); - public static Result estimate(String email, String vfile, String dataset) { - return ok(estimate.render(email, vfile, dataset)); - } public static Result home(String email, String vfile, String dataset) { return ok(home.render(email, vfile, dataset)); @@ -1085,68 +1080,4 @@ public class ClimateServiceController extends Controller { return ok(oneService.render("/assets/html/" + url)); } - // -- Authentication - public static class Login { - - - public String username; - public String password; - - public String validate() { - if (username == null || password == null) - return "Invalid username or password"; - - - return null; - } - - } - - /** - * Login page. - */ - - public static Result login() { - return ok(login.render(form(Login.class))); - } - - /** Handle login form submission. */ - - /** - * Handle login form submission. - */ - public static Result authenticate() { - Form<Login> loginForm = form(Login.class).bindFromRequest(); - /* - * if (loginForm.hasErrors()){ System.out.println("Test"); return - * badRequest(login.render(loginForm)); } else { - */ - session("username", loginForm.get().username); - System.out.println("Email:" + loginForm.field("username").value()); - if (loginForm.get().username.equals("admin")) { - System.out.println("Admin arena"); - // session("username", loginForm.field("username").value()); - return redirect(routes.NasaRegistrationController.adminPage()); - } else { - // session("username", loginForm.field("username").value()); - String userName = NasaRegistration.getUserInfo( - loginForm.field("username").value(), - loginForm.field("password").value()); - System.out.println("Value:" + userName); - if (userName != null) { - System.out.println("passed get User info"); - return redirect(routes.EstimateController - .accountSummary(userName)); - } else - return redirect(routes.EstimateController.authenticate()); - // Retrieve value from API and check against userName and password. - - } - } - - public static Result logout() { - session().clear(); - flash("success", "You've been logged out"); - return redirect(routes.EstimateController.estimate(null, null, null)); - } } http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/controllers/EstimateController.java ---------------------------------------------------------------------- diff --git a/app/controllers/EstimateController.java b/app/controllers/EstimateController.java deleted file mode 100644 index a15b99b..0000000 --- a/app/controllers/EstimateController.java +++ /dev/null @@ -1,147 +0,0 @@ -package controllers; - -import static play.data.Form.form; - -import models.NasaRegistration; -import java.io.*; - -import models.AWSClient; - -import controllers.Application.Login; -import play.data.Form; -import play.mvc.Controller; -import play.mvc.Http.MultipartFormData; -import play.mvc.Http.MultipartFormData.FilePart; -import play.mvc.Result; -import views.html.estimator.*; - -public class EstimateController extends Controller { - - public static Result estimate(String email, String vfile, String dataset) { - return ok(estimate.render(email, vfile, dataset)); - } - - public static Result estimate1() { - // get the file from the user's upload - MultipartFormData body = request().body().asMultipartFormData(); - FilePart picture = body.getFile("file"); - - String workingDir = System.getProperty("user.dir"); - if (picture != null) { - String fileName = picture.getFilename(); - String contentType = picture.getContentType(); - File file = picture.getFile(); - - // create new file with the same name under tmpfiles/ - File newfile = new File(workingDir + "/tmpfiles/" + fileName); - InputStream inStream; - try { - // copy files - inStream = new FileInputStream(file); - OutputStream outStream = new FileOutputStream(newfile); - byte[] buffer = new byte[1024]; - int length; - // copy the file content in bytes - while ((length = inStream.read(buffer)) > 0) { - outStream.write(buffer, 0, length); - } - inStream.close(); - outStream.close(); - // upload the new file to s3 - AWSClient.upload(newfile, fileName); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - - // TODO Auto-generated catch block - e.printStackTrace(); - } - return ok(estimate1.render()); - } else { - flash("error", "Missing file"); - - return ok(estimate.render("", "", "")); - } - - } - - public static Result estimate2() { - return ok(estimate2.render()); - } - - public static Result estimate3() { - return ok(estimate3.render()); - } - - public static Result tutorial() { - return ok(tutorial.render()); - } - - public static Result accountSummary(String userName) { - return ok(accountSummary.render(userName)); - } - - // -- Authentication - public static class Login { - - - public String username; - public String password; - - public String validate() { - if (username == null || password == null) - return "Invalid username or password"; - - - return null; - } - - } - - /** Login page. */ - - public static Result login() { - return ok(login.render(form(Login.class))); - } - - /** Handle login form submission. */ - - /** Handle login form submission. */ - public static Result authenticate() { - Form<Login> loginForm = form(Login.class).bindFromRequest(); - /* - * if (loginForm.hasErrors()){ System.out.println("Test"); return - * badRequest(login.render(loginForm)); } else { - */ - session("username", loginForm.get().username); - System.out.println("Email:" + loginForm.field("username").value()); - if (loginForm.get().username.equals("admin")) { - System.out.println("Admin arena"); - // session("username", loginForm.field("username").value()); - return redirect(routes.NasaRegistrationController.adminPage()); - } else { - // session("username", loginForm.field("username").value()); - String userName = NasaRegistration.getUserInfo( - loginForm.field("username").value(), - loginForm.field("password").value()); - System.out.println("Value:" + userName); - if (userName != null) { - System.out.println("passed get User info"); - return redirect(routes.EstimateController - .accountSummary(userName)); - } else - return redirect(routes.EstimateController.authenticate()); - // Retrieve value from API and check against userName and password. - - } - - // } - } - - public static Result logout() { - session().clear(); - flash("success", "You've been logged out"); - return redirect(routes.EstimateController.estimate(null, null, null)); - } -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/controllers/NasaRegistrationController.java ---------------------------------------------------------------------- diff --git a/app/controllers/NasaRegistrationController.java b/app/controllers/NasaRegistrationController.java deleted file mode 100644 index 7d480bf..0000000 --- a/app/controllers/NasaRegistrationController.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2013 Carnegie Mellon University Silicon Valley. - * All rights reserved. - * - * This program and the accompanying materials are made available - * under the terms of dual licensing(GPL V2 for Research/Education - * purposes). GNU Public License v2.0 which accompanies this distribution - * is available at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Please contact http://www.cmu.edu/silicon-valley/ if you have any - * questions. - * - * */ - -package controllers; - -import models.NasaRegistration; -import play.data.DynamicForm; -import play.data.Form; -import play.libs.Json; -import play.mvc.Controller; -import play.mvc.Result; -import util.APICall; -import util.APICall.ResponseType; -import views.html.registration.*; -import views.html.climate.*; -import util.*; -import java.util.*; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.gson.JsonObject; - -public class NasaRegistrationController extends Controller { - //final static Form<Sensor> sensorForm = Form.form(Sensor.class); - final static Form<NasaRegistration> userForm = Form - .form(NasaRegistration.class); - - public static Result registrationForm() { - return ok(userRegistrationForm.render(userForm)); - } - - public static Result addUserForm(){ - return ok(addUserForm.render(userForm)); - } - - public static Result updateForm() { - return ok(updateUserForm.render(userForm)); - } - - public static Result deleteForm(){ - return ok(deleteUser.render(userForm)); - } - - public static Result adminPage(){ - return ok(adminPage.render(NasaRegistration.all())); - } - - public static Result getAllUsers(){ - return ok(allUsers.render(NasaRegistration.getAllUser(), userForm)); - } - - - // Registration - public static Result submit() { - - Map<String, String[]> regFormEncoded = request().body().asFormUrlEncoded(); - - //Calling method to get values from the form - JsonObject getJsonValues = new JsonObject(); - getJsonValues = util.EstimatorGetValues.getMode(regFormEncoded, "submit"); - - String urlStr = "http://einstein.sv.cmu.edu:9000/addContestUser"; - // Sample data - try { - EstimatorAPICalls.HttpUserReg(urlStr, getJsonValues, "register"); - } - - - catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN)); - } - - return redirect(routes.EstimateController.login()); - } - - public static Result addUser() { - -// Form<NasaRegistration> filledForm = userForm.bindFromRequest(); -// Map<String, String[]> regFormEncoded = request().body().asFormUrlEncoded(); -// JsonObject getJsonValues = new JsonObject(); -// -// getJsonValues = util.EstimatorGetValues.getMode(regFormEncoded, "update"); -// -// String urlStr = "http://einstein.sv.cmu.edu:9000/updateContestUser"; -// -// try { -// EstimatorAPICalls.HttpUserReg(urlStr, getJsonValues, "update"); -// } -// -// catch (Exception e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN)); -// } - Form<NasaRegistration> dc = userForm.bindFromRequest(); - ObjectNode jsonData = Json.newObject(); - try { - - String userName = dc.field("userNameField").value(); - if (userName != null && !userName.isEmpty()) { - jsonData.put("userName", userName); - } - - String password = dc.field("passwordField").value(); - if (password != null && !password.isEmpty()) { - jsonData.put("password", password); - } - jsonData.put("firstName", dc.field("fNameField").value()); //TODO, since we don't have login/account id yet use a default val - jsonData.put("middleInitial", dc.field("mNameField").value()); - jsonData.put("lastName", dc.field("lNameField").value()); - jsonData.put("affiliation", dc.field("affliationField").value()); - jsonData.put("email", dc.field("emailField").value()); - jsonData.put("researchFields", dc.field("rAreaField").value()); - - // create the item by calling the API - JsonNode response = NasaRegistration.create(jsonData); - - // flash the response message - Application.flashMsg(response); - } catch (IllegalStateException e) { - e.printStackTrace(); - Application.flashMsg(APICall - .createResponse(ResponseType.CONVERSIONERROR)); - } catch (Exception e) { - e.printStackTrace(); - Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN)); - } - - return ok(allUsers.render(NasaRegistration.getAllUser(), userForm)); - } - - public static Result update() { - DynamicForm dc = DynamicForm.form().bindFromRequest(); - String id = dc.field("pk").value(); - - //Form<NasaRegistration> dc = userForm.bindFromRequest(); - ObjectNode jsonData = Json.newObject(); - try { - -// String userName = dc.field("userNameField").value(); -// System.out.println("id "+id); -// System.out.println("username "+userName); -// if (userName != null && !userName.isEmpty()) { -// jsonData.put("userName", userName); -// } -// -// String password = dc.field("passwordField").value(); -// if (password != null && !password.isEmpty()) { -// jsonData.put("password", password); -// } -// jsonData.put("firstName", dc.field("fNameField").value()); //TODO, since we don't have login/account id yet use a default val -// jsonData.put("middleInitial", dc.field("mNameField").value()); -// jsonData.put("lastName", dc.field("lNameField").value()); -// jsonData.put("affiliation", dc.field("affliationField").value()); -// jsonData.put("email", dc.field("emailField").value()); -// jsonData.put("researchFields", dc.field("rAreaField").value()); - - NasaRegistration originalUser = NasaRegistration.findUserByName(id); - if (originalUser == null) { - Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN)); - return notFound("not found original user " + id); - } - - jsonData.put("userName", originalUser.getfNameField()); - jsonData.put("password", originalUser.getPasswordField()); - jsonData.put("firstName", originalUser.getfNameField()); - jsonData.put("middleInitial", originalUser.getMiddleName()); - jsonData.put("lastName", originalUser.getLastName()); - jsonData.put("affiliation", originalUser.getAffliation()); - jsonData.put("email", originalUser.getEmail()); - jsonData.put("researchFields", originalUser.getResearchArea()); - - String editField = dc.field("name").value(); - if (editField != null && !editField.isEmpty()) { - jsonData.put(editField, dc.field("value").value()); - } - System.out.println(editField); - // create the item by calling the API - JsonNode response = NasaRegistration.update(id, jsonData); - - // flash the response message - Application.flashMsg(response); - } catch (IllegalStateException e) { - e.printStackTrace(); - Application.flashMsg(APICall - .createResponse(ResponseType.CONVERSIONERROR)); - } catch (Exception e) { - e.printStackTrace(); - Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN)); - } - return ok(allUsers.render(NasaRegistration.getAllUser(), userForm)); - } - - public static Result delete() { - -// Form<NasaRegistration> filledForm = userForm.bindFromRequest(); -// Map<String, String[]> regFormEncoded = request().body().asFormUrlEncoded(); -// -// JsonObject getJsonValues = new JsonObject(); -// -// getJsonValues = util.EstimatorGetValues.getMode(regFormEncoded, "delete"); -// -// String urlStr = "http://einstein.sv.cmu.edu:9000/deleteContestUser"; -// -// try { -// -// -// -// urlStr = urlStr + '/' + getJsonValues.get("userName").getAsString() + '/' -// + getJsonValues.get("password").getAsString(); -// -// EstimatorAPICalls.HttpUserReg(urlStr, getJsonValues, "delete"); -// -// } -// catch (Exception e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN)); -// } -// -// return redirect(routes.NasaRegistrationController.registrationForm()); - - Form<NasaRegistration> dc = userForm.bindFromRequest(); - ObjectNode jsonData = Json.newObject(); - try { - - String userName = dc.field("userNameField").value(); -// if (userName != null && !userName.isEmpty()) { -// jsonData.put("username", userName); -// } - - String password = dc.field("passwordField").value(); -// if (password != null && !password.isEmpty()) { -// jsonData.put("password", password); -// } - - // create the item by calling the API - JsonNode response = NasaRegistration.delete(jsonData, userName, password); - System.out.println(response); - // flash the response message - Application.flashMsg(response); - } catch (IllegalStateException e) { - e.printStackTrace(); - Application.flashMsg(APICall - .createResponse(ResponseType.CONVERSIONERROR)); - } catch (Exception e) { - e.printStackTrace(); - Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN)); - } - return ok(allUsers.render(NasaRegistration.getAllUser(), userForm)); - } -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/models/NasaRegistration.java ---------------------------------------------------------------------- diff --git a/app/models/NasaRegistration.java b/app/models/NasaRegistration.java deleted file mode 100644 index 60944be..0000000 --- a/app/models/NasaRegistration.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (c) 2013 Carnegie Mellon University Silicon Valley. - * All rights reserved. - * - * This program and the accompanying materials are made available - * under the terms of dual licensing(GPL V2 for Research/Education - * purposes). GNU Public License v2.0 which accompanies this distribution - * is available at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Please contact http://www.cmu.edu/silicon-valley/ if you have any - * questions. - * - * */ - - - -package models; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.List; - -import models.metadata.ClimateService; -import models.metadata.NasaRMdata; -import util.APICall; - -import com.fasterxml.jackson.databind.JsonNode; - -public class NasaRegistration { - public String id; - public String userName; - public String password; - public String firstName; - public String lastName; - public String mName; - public String affliation; - public String email; - public String researchArea; - public String goal; - public String algo; - public String budgetConcerns; - public String awsFamiliarity; - - private static final String GET_ALL_USER_DATA = "http://einstein.sv.cmu.edu:9000/getAllContestUsers/json"; - private static final String GET_ALL_USER_DATA_NEW = "http://localhost:9020/users/getAllUsers/json"; - - private static final String ADD_USER_CALL = "http://einstein.sv.cmu.edu:9020/users/add"; - private static final String UPDATE_USER_CALL = "http://einstein.sv.cmu.edu:9020/users/update/"; - private static final String DELETE_USER_CALL = "http://einstein.sv.cmu.edu:9020/users/delete/"; - - public NasaRegistration() { - - } - - public NasaRegistration(String userNameField, String passwordField, - String fNameField, String lNameField, String emailField, - String rAreaField, String goalField, String algoField, - String bConcernsField, String awsFamiliarityField, - String mNameField, String affiliationField) { - super(); - this.userName = userNameField; - this.password = passwordField; - this.firstName = fNameField; - this.email = emailField; - this.mName = mNameField; - this.affliation = affiliationField; - this.researchArea = rAreaField; - this.goal = goalField; - this.algo = algoField; - this.budgetConcerns = bConcernsField; - this.awsFamiliarity = awsFamiliarityField; - - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public void setMiddleName(String mName){ - this.mName = mName; - } - - public String getMiddleName(){ - return mName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getAffliation() { - return affliation; - } - - public void setAffliation(String affliation) { - this.affliation = affliation; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getResearchArea() { - return researchArea; - } - - public void setResearchArea(String researchArea) { - this.researchArea = researchArea; - } - - public String getGoal() { - return goal; - } - - public void setGoal(String goal) { - this.goal = goal; - } - - public String getAlgo() { - return algo; - } - - public void setAlgo(String algo) { - this.algo = algo; - } - - public String getBudgetConcerns() { - return budgetConcerns; - } - - public void setBudgetConcerns(String budgetConcerns) { - this.budgetConcerns = budgetConcerns; - } - - public String getAwsFamiliarity() { - return awsFamiliarity; - } - - public void setAwsFamiliarity(String awsFamiliarity) { - this.awsFamiliarity = awsFamiliarity; - } - - public String getUserNameField() { - return userName; - } - - public void setUserNameField(String userNameField) { - this.userName = userNameField; - } - - public String getPasswordField() { - return password; - } - - public void setPasswordField(String passwordField) { - this.password = passwordField; - } - - public String getfNameField() { - return firstName; - } - - public void setfNameField(String fNameField) { - this.firstName = fNameField; - } - - public static List<NasaRegistration> all() { - List<NasaRegistration> allUsers = new ArrayList<NasaRegistration>(); - - // Call the API to get the json string - JsonNode usersNode = APICall.callAPI(GET_ALL_USER_DATA_NEW); - // if no value is returned or error or is not json array - if (usersNode == null || usersNode.has("error") || !usersNode.isArray()) { - return allUsers; - } - - // parse the json string into object - for (int i = 0; i < usersNode.size(); i++) { - JsonNode json = usersNode.path(i); - NasaRegistration getUser = new NasaRegistration(); - - getUser.setUserNameField(json.findPath("userName").asText()); - getUser.setPasswordField(json.findPath("password").asText()); - getUser.setfNameField(json.findPath("firstName").asText()); - getUser.setEmail("static email"); - getUser.setGoal("static goal"); - - System.out.println("UserName:" + getUser.getfNameField()); - - allUsers.add(getUser); - } - - return allUsers; - - } - - public static List<NasaRegistration> getAllUser() { - List<NasaRegistration> allUsers = new ArrayList<NasaRegistration>(); - - // Call the API to get the json string - JsonNode usersNode = APICall.callAPI(GET_ALL_USER_DATA_NEW); - // if no value is returned or error or is not json array - if (usersNode == null || usersNode.has("error") || !usersNode.isArray()) { - return allUsers; - } - - // parse the json string into object - for (int i = 0; i < usersNode.size(); i++) { - JsonNode json = usersNode.path(i); - NasaRegistration getUser = new NasaRegistration(); - - getUser.setId(json.findPath("id").asText()); - getUser.setUserNameField(json.findPath("userName").asText()); - getUser.setPasswordField(json.findPath("password").asText()); - getUser.setfNameField(json.findPath("firstName").asText()); - getUser.setMiddleName(json.findPath("middleInitial").asText()); - getUser.setLastName(json.findPath("lastName").asText()); - getUser.setAffliation(json.findPath("affiliation").asText()); - getUser.setEmail(json.findPath("email").asText()); - getUser.setResearchArea(json.findPath("researchFields").asText()); - - //System.out.println("UserName:" + getUser.getfNameField()); - - allUsers.add(getUser); - } - - return allUsers; - - } - - public static String getUserInfo(String userName, String password) { - // System.out.println("Reached in getUserInfo:" + userName); - // System.out.println("Reached in password:" + password); - - List<NasaRegistration> allUsers = new ArrayList<NasaRegistration>(); - String GET_IND_USER_DATA = "http://einstein.sv.cmu.edu:9000/getContestUser/"; - GET_IND_USER_DATA = GET_IND_USER_DATA + userName + '/' + password + '/' - + "json"; - // Call the API to get the json string - JsonNode usersNode = APICall.callAPI(GET_IND_USER_DATA); - - System.out.println("Output1:" + GET_IND_USER_DATA); - // System.out.println("Value inside getUserInfo:" + - // usersNode.path(0).findPath("userName").asText()); - System.out.println("Check:" + usersNode.toString()); - // if no value is returned or error or is not json array - if (usersNode == null || usersNode.has("error")) { - System.out.println("inside userNode check"); - return null; - } - System.out.println("userName response:" + usersNode.get("userName")); - System.out.println("userName:" + userName); - System.out.println("password:" + usersNode.get("password")); - - if (usersNode.get("userName").textValue().equals(userName) - && usersNode.get("password").textValue().equals(password)) { - System.out.println("Comes inside the if block"); - return usersNode.get("firstName").textValue(); - } else { - System.out.println("Does not come inside the if clause"); - return null; - } - - // parse the json string into object - /* - * for (int i = 0; i < usersNode.size(); i++) { JsonNode json = - * usersNode.path(i); NasaRegistration getUser = new NasaRegistration(); - * - * getUser.setUserNameField(json.findPath("userName").asText()); - * getUser.setPasswordField(json.findPath("password").asText()); - * getUser.setfNameField(json.findPath("firstName").asText()); - * - * if(getUser.getUserNameField().equals(userName) && - * getUser.getPasswordField().equals(password)){ - * System.out.println("inside check of username and password"); return - * true; } else return false; - * - * System.out.println("UserName:" + getUser.getfNameField()); - * - * allUsers.add(getUser); } - */ - - } - - public static NasaRegistration findUserByName(String userId){ - List<NasaRegistration> allList = getAllUser(); - for (NasaRegistration element : allList) { - String elementUri = element.getId(); - if (elementUri.equals(userId)) - return element; - } - return null; - } - - public static JsonNode create(JsonNode jsonData) { - return APICall.postAPI(ADD_USER_CALL, jsonData); - } - - public static JsonNode update(String id, JsonNode jsonData) { - System.out.println(UPDATE_USER_CALL+id); - - return APICall.putAPI(UPDATE_USER_CALL+id, jsonData); - } - - public static JsonNode delete(JsonNode jsonData, String username, String password) throws UnsupportedEncodingException{ - System.out.println(DELETE_USER_CALL+"userName/"+ URLEncoder.encode(username, "UTF-8") +"/password/"+ URLEncoder.encode(password, "UTF-8")); - return APICall.deleteAPI(DELETE_USER_CALL+"userName/"+ URLEncoder.encode(username, "UTF-8") +"/password/"+ URLEncoder.encode(password, "UTF-8")); - } -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/addUserForm.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/addUserForm.scala.html b/app/views/climate/addUserForm.scala.html deleted file mode 100644 index ac392e6..0000000 --- a/app/views/climate/addUserForm.scala.html +++ /dev/null @@ -1,31 +0,0 @@ -@(userForm: Form[NasaRegistration]) -@import helper._ -@import helper.twitterBootstrap._ -@main("Nasa Update Form"){ - - - - <div class="clearfix " id="name_field"> - - - <legend>User Add Form</legend> - @helper.form(action = routes.NasaRegistrationController.addUser()){ - <fieldset> - @helper.inputText(userForm("userNameField"),'_label -> "User Name*") - @helper.inputPassword(userForm("passwordField"), '_label -> "Password*") - @helper.inputText(userForm("fNameField"), '_label -> "First Name*") - @helper.inputText(userForm("mNameField"), '_label -> "Middle Name") - @helper.inputText(userForm("lNameField"), '_label -> "Last Name") - - @textarea( - userForm("affliationField"), - '_label -> "Affliation", 'cols -> 50, 'rows -> 5 - ) - @helper.inputText(userForm("emailField"), '_label -> "Email") - @helper.inputText(userForm("rAreaField"), '_label -> "Research Area") - <input type="submit" class="btn btn-primary" value="Add"> - <fieldset> - </div> -} -} - http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/allUsers.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/allUsers.scala.html b/app/views/climate/allUsers.scala.html deleted file mode 100644 index 64e33eb..0000000 --- a/app/views/climate/allUsers.scala.html +++ /dev/null @@ -1,82 +0,0 @@ - -@(users: List[NasaRegistration], userForm: play.data.Form[NasaRegistration]) - -@import helper._ - -@scripts = { - <script src='@routes.Assets.at("javascripts/edit_button.js")'></script> - <script type="text/javascript"> - $(document).ready(function(){ - //alert($("#url").text()); - }); - </script> -} - -@main("Climate Services", scripts) { - - @flash_message() - - <h1>@users.size() Users</h1> - <table class="table table-striped table-bordered table-condensed ex2"> - <tr> - <td class="col-md-1">Id</td> - <td class="col-md-2">User Name</td> - <td class="col-md-2">Password</td> - <td class="col-md-2">First Name</td> - <td class="col-md-2">Middle Name</td> - <td class="col-md-2">Last Name</td> - <td class="col-md-2">Afflication</td> - <td class="col-md-4">Email</td> - <td class="col-md-2">Research Area</td> - @if(true){ - <td class="col-md-3">Operation</td> - } - </tr> - @for(user <- users){ - <tr> - <td>@user.getId()</td> - - <td><span class="@user.getId() editable" data-name='username'>@user.getUserNameField()</span></td> - - <td><span class="@user.getId() editable" data-name='password'>@user.getPasswordField()</span></td> - - <td><span class="@user.getId() editable" data-name='firstName'>@user.getfNameField()</span></td> - - <td><span class="@user.getId() editable" data-name='middleInitial'>@user.getMiddleName()</span></td> - - <td><span class="@user.getId() editable" data-name='lastName'>@user.getLastName()</span></td> - - <td><span class="@user.getId() editable" data-name='affiliation'>@user.getAffliation()</span></td> - - <td><span class="@user.getId() editable" data-name='email'>@user.getEmail()</span></td> - - <td><span class="@user.getId() editable" data-name='researchFields'>@user.getResearchArea()</span></td> - - @if(true){ - <td class="operation"> - <input type="button" class="edit-btn btn btn-primary" value="Edit" - data-pk='@user.getId()' - data-url='@routes.NasaRegistrationController.update()' - > - @form(routes.NasaRegistrationController.delete()){ - <!-- <input - name="idHolder" class="hidden" type="hidden" - value="@user.getId()"> --> - <input - name="userNameField" class="hidden" type="hidden" - value="@user.getUserNameField()"> - <input - name="passwordField" class="hidden" type="hidden" - value="@user.getPasswordField()"> - <input - type="submit" class="btn btn-danger delete-btn span2" value="Delete" - onclick="return confirm('Are you sure you want to delete this item?')"> - } - </td> - } - - </tr> - } - </table> - } - http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/deleteUser.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/deleteUser.scala.html b/app/views/climate/deleteUser.scala.html deleted file mode 100644 index 2f1360a..0000000 --- a/app/views/climate/deleteUser.scala.html +++ /dev/null @@ -1,23 +0,0 @@ -@(userForm: Form[NasaRegistration]) -@import helper._ -@import helper.twitterBootstrap._ -@main("Nasa Update Form"){ - - - - <div class="clearfix " id="name_field"> - - - <legend>User Deletion Form</legend> - @helper.form(action = routes.NasaRegistrationController.delete()){ - <fieldset> - @helper.inputText(userForm("userNameField"),'_label -> "User Name*") - @helper.inputPassword(userForm("passwordField"), '_label -> "Password*") - - - <input type="submit" class="btn btn-primary" value="Delete"> - <fieldset> - </div> -} -} - http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/estimate.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/estimate.scala.html b/app/views/climate/estimate.scala.html deleted file mode 100644 index f7282bc..0000000 --- a/app/views/climate/estimate.scala.html +++ /dev/null @@ -1,119 +0,0 @@ -@(email: String, vfile: String, dataset: String) - - -@import helper._ - -@main("Estimator") { - - -<ol class="breadcrumb"> - <li><a href="/climate/tutorial">Tutorials</a></li> - <li><a href="/climate/climateServices">Model Analytics Services</a></li> - <li><a href="/climate/datasets">Datasets</a></li> - <li><a href="/climate/workflows">Workflows</a></li> - <li><a href="/climate/recommendation">Recommendation</a></li> - <li><a href="/climate/user">User Management</a></li> -</ol> - -<div class="jumbotron"> -<div class="row"> - - <div class="col-lg-6"> - <img src="/assets/images/NASA_JPL_logo.png" height="150" width="430"> - </div> - <div class="col-lg-6"> - <h1>Climate Model Analysis</h1> - <p>JPL has provided a repository of web services for multi-aspect physics-based and phenomenon-oriented - phenomenon-oriented climate model performance evaluation and diagnosis through the comprehensive and - synergistic use of multiple observational data, reanalysis data, and model outputs.</p> - <p> - <a class="btn btn-lg btn-default" - href="/climate/tutorial" role="button">Getting Started »</a> - </p> - <!-- @if(!session.get("username")){ --> - <p> - We will help you learn the available web services, how to use them, and help you to design - your climate analytics workflows. - <p> - <a class="btn btn-primary" - href="climate/register" role="button">Register »</a> - </p> - <!-- } --> - </div> -</div> -</div> - -<form method="POST" action="/climate/1" enctype="multipart/form-data"> - - - <fieldset> - <legend>Estimator</legend> - - <div class="clearfix" id="name_field"> - <label for="name">Scripting file</label> - <div class="row"> - <div class="input col-lg-2"> - - <input type="file" id="name" name="file" value="@vfile" placeholder="/Downloads/Workflowfiles"> <span - class="help-inline"></span> <span class="help-block">Required</span> - </div> - <div class="upload col-lg-2"> - - </div> - </div> - </div> - <div class="clearfix" id="title_field"> - <label for="title">Dataset</label> - <div class="row"> - <div class="input col-lg-2"> - - <input type="text" id="title" name="title" value="@dataset" placeholder="/Downloads/Datasets"> <span - class="help-inline"></span> <span class="help-block">Required</span> - </div> - - <div class="upload col-lg-2"> - <input type="button" class="btn" id="upload-dataset" name="upload-dataset" value="upload"> - </div> - </div> - </div> - <div class="clearfix " id="email_field"> - <label for="email">Email</label> - <div class="input"> - - <input type="text" id="email" name="email" value="@email"> <span - class="help-inline"></span> <span class="help-block">Required</span> - </div> - </div> - - <div class="clearfix " id="organization_field"> - <label for="organization">Organization</label> - <div class="input"> - - <input type="text" id="organization" name="organization" value=""> - - <span class="help-inline"></span> <span class="help-block"></span> - </div> - </div> - - <div class="clearfix " id="description_field"> - <label for="description">Description</label> - <div class="input"> - - <textarea id="description" name="description" cols="65" rows="7"></textarea> - - <span class="help-inline"></span> <span class="help-block"></span> - </div> - </div> - - </fieldset> - - - <div class="actions"> - <input type="submit" class="btn btn-primary" - value="Get Recommendation"> <a href="/estimator" class="btn">Thanks, - I know what to use</a> - </div> - - -</form> -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/estimate1.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/estimate1.scala.html b/app/views/climate/estimate1.scala.html deleted file mode 100644 index ac42cd5..0000000 --- a/app/views/climate/estimate1.scala.html +++ /dev/null @@ -1,115 +0,0 @@ -@import helper._ - -@main("Estimator") { - -<ol class="breadcrumb"> - <li><a href="/estimator/tutorial">Tutorial</a></li> - <li><a href="/estimator">Collect Data</a></li> - <li class="active">Input preference</li> - <li><a href="/estimator/2">Workflow Summary</a></li> - <li><a href="/estimator/3">Recommendation</a></li> -</ol> - -<form method="GET" role="form" action="/estimator/2"> - - - <fieldset> - <legend>Tell us your preference</legend> - - <p>In general, you have two options, on-demand and batch mode. - Under each mode, you can select CPU, memory, storage, and OS.</p> - - - <div class="form-group"> - <label class="control-label" for="budget">1) Budget</label> - <div> - <span>$ </span><input type="text" class="input-xlarge" id="budget" placeholder="50"> - </div> - </div> - <div class="form-group"> - <label class="control-label">2) Flexible start - & end time?</label> - - <div> - <label class="checkbox-inline"> <input type="checkbox" - id="yes-flexible"> yes - </label> <label class="checkbox-inline"> <input type="checkbox" - id="no-flexible"> no - </label> - </div> - </div> - - <div class="form-group"> - <label class="control-label">3) Estimated Usage</label> - - <div class="form-horizontal"> - <div class="form-group"> - <label class="col-sm-2 control-label" for="cpu"> CPU </label> - <select id="cpu"> - <option>1</option> - <option>2</option> - <option>4</option> - <option>More than 4</option> - <option>No idea</option> - </select> - </div> - - <div class="form-group"> - <label class="col-sm-2 control-label" for="memory"> Memory (GiB) </label> - <select id="cpu"> - <option>1.7</option> - <option>3.75</option> - <option>7.5</option> - <option>15</option> - <option>More than 15</option> - <option>No idea</option> - </select> - - </div> - - <div class="form-group"> - <label class="col-sm-2 control-label" for="storage"> Storage (GiB) </label> - <select id="storage"> - <option>1*4 SSD</option> - <option>1*32 SSD</option> - <option>1*160</option> - <option>1*410</option> - <option>No idea</option> - </select> - </div> - </div> - </div> - - <div class="form-group"> - <label class="control-label">4) Operating System</label> - - <div> - <label class="checkbox-inline"> <input type="checkbox" - id="nix-os"> Linux/ Unix - </label> <label class="checkbox-inline"> <input type="checkbox" - id="windows-os"> Windows - </label> - </div> - </div> - - <div class="form-group"> - <label class="control-label" for="region">5) Region</label> - - <div> - <select id="region"> - <option value="US West (North California)">US West (North - California)</option> - <option value="US West (Oregon)">US West (Oregon)</option> - <option value="US East (N. Virginia)">US East (N. - Virginia)</option> - </select> - </div> - </div> - </fieldset> - - <div class="actions"> - <input type="submit" class="btn primary" value="Submit"> <a - href="/estimator" class="btn">Cancel</a> - </div> -</form> -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/estimate2.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/estimate2.scala.html b/app/views/climate/estimate2.scala.html deleted file mode 100644 index 2ebb333..0000000 --- a/app/views/climate/estimate2.scala.html +++ /dev/null @@ -1,32 +0,0 @@ - -@import helper._ - -@main("Estimator") { - -<ol class="breadcrumb"> - <li><a href="/estimator/tutorial">Tutorial</a></li> - <li><a href="/estimator">Collect Data</a></li> - <li><a href="/estimator/1">Input preference</a></li> - <li class="active">Workflow Summary</li> - <li><a href="/estimator/3">Recommendation</a></li> -</ol> - -<form method="GET" role="form" action="/estimator/3"> - -<fieldset> - <div class="container"> - <p>Here is the workflow summary</p> - <img alt="workflow summary" src='@routes.Assets.at("images/workflow_1.png")' height="500" width="700"> - <img alt="workflow summary" src='@routes.Assets.at("images/workflow_2.png")' height="500" width="700"> - </div> - -</fieldset> - <br></br> - <div class="actions"> - <input type="submit" class="btn btn-primary" value="See Recommendation" action="/estimator/3" style="position: relative; left: 15px"> - </div> - -</form> - - - } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/estimate3.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/estimate3.scala.html b/app/views/climate/estimate3.scala.html deleted file mode 100644 index 10a68b0..0000000 --- a/app/views/climate/estimate3.scala.html +++ /dev/null @@ -1,171 +0,0 @@ -@import helper._ - -@main("Estimator") { - -<ol class="breadcrumb"> - <li><a href="/estimator/tutorial">Tutorial</a></li> - <li><a href="/estimator">Collect Data</a></li> - <li><a href="/estimator/1">Input Preference</a></li> - <li><a href="/estimator/2">Workflow Summary</a></li> - <li class="active">Recommendation</li> -</ol> - - - -<body> - - - <div class="container"> - <p>Virtual Machine Recommendation</p> -<table cellspacing='0' class="table table-striped table-bordered table-condensed" align="center"> - <!-- cellspacing='0' is important, must stay --> - - <!-- Table Header --> - <thead> - <tr> - <th></th> - <th>vCPU</th> - <th>ECU</th> - <th>Memory(GiB)</th> - <th>Storage</th> - <th>Price</th> - <th>Estimated Total Cost</th> - <th></th> - </tr> - </thead> - - <tbody> - - <tr class="pure-table-odd"> - <td> - m3.large - </td> - <td> - 2 - </td> - <td> - 6.5 - </td> - <td> - 7.5 - </td> - <td> - 1*32 SSD - </td> - <td> - $.225 per hour - </td> - <td> - $88,000 - </td> - <td> - <button type="button" class="btn" onclick="" method="get">Use it</button> - </td> - - </tr> - - - </tbody> - - </table> - - </div> - - <div class="container"> - - <p><br><br>Other options</p> -<table cellspacing='0' class="table table-striped table-bordered table-condensed" align="center" id="pubvalues"> - <!-- cellspacing='0' is important, must stay --> - - <!-- Table Header --> - <thead> - <tr> - <th></th> - <th>vCPU</th> - <th>ECU</th> - <th>Memory(GiB)</th> - <th>Storage</th> - <th>Price</th> - <th>Estimated Total Cost</th> - <th></th> - </tr> - </thead> - - <tbody> - - <tr class="pure-table-odd"> - <td> - m3.medium - </td> - <td> - 1 - </td> - <td> - 3 - </td> - <td> - 3.75 - </td> - <td> - 1*4 SSD - </td> - <td> - $.113 per hour - </td> - <td> - $68,000 - </td> - <td> - <button type="button" class="btn" onclick="" method="get">Use it</button> - </td> - - </tr> - - - </tbody> - - <tbody> - - <tr class="pure-table-odd"> - <td> - m3.xlarge - </td> - <td> - 4 - </td> - <td> - 13 - </td> - <td> - 15 - </td> - <td> - 4*40 SSD - </td> - <td> - $.450 per hour - </td> - <td> - $128,000 - </td> - <td> - <button type="button" class="btn" onclick="" method="get">Use it</button> - </td> - - </tr> - - - </tbody> - - </table> - <div class="actions" style="width: 571px; "> - <input type="submit" class="btn btn-primary" - value="I still want to check price manually"> - </div> - - </div> - - - -</body> -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/header.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/header.scala.html b/app/views/climate/header.scala.html index c168ecd..3a48830 100644 --- a/app/views/climate/header.scala.html +++ b/app/views/climate/header.scala.html @@ -54,25 +54,6 @@ </ul> </li> - <!-- - @if(!session.get("username")){ - - <form class="navbar-form navbar-right" action="@routes.ClimateServiceController.authenticate()"> - <button type="submit" class="btn btn-success">Log in</button> - </form> - }else{ - <li><a href="/estimator/tutorial">Estimator</a></li> - <form class="navbar-form navbar-right" action="@routes.ClimateServiceController.logout()"> - <button type="submit" class="btn btn-success">Log out</button> - </form> - } - - @if(false){ - <form class="navbar-form navbar-right" action="@routes.NasaRegistrationController.adminPage()"> - <button type="submit" class="btn btn-success">Admin Console</button> - </form> - } - --> </ul> </div> <!--/.nav-collapse --> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/login.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/login.scala.html b/app/views/climate/login.scala.html deleted file mode 100644 index 689055f..0000000 --- a/app/views/climate/login.scala.html +++ /dev/null @@ -1,20 +0,0 @@ -@(form: Form[ClimateServiceController.Login]) - -@main("Climate Service") { - - @helper.form(routes.ClimateServiceController.authenticate) { - - <h1>Sign in</h1> - - <p> - <input type="text" name="username" placeholder="Username"> - </p> - <p> - <input type="password" name="password" placeholder="Password"> - </p> - <p> - <button type="submit" class="btn btn-primary">Login</button> - </p> - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/updateUserForm.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/updateUserForm.scala.html b/app/views/climate/updateUserForm.scala.html deleted file mode 100644 index 1e0f85d..0000000 --- a/app/views/climate/updateUserForm.scala.html +++ /dev/null @@ -1,31 +0,0 @@ -@(userForm: Form[NasaRegistration]) -@import helper._ -@import helper.twitterBootstrap._ -@main("Nasa Update Form"){ - - - - <div class="clearfix " id="name_field"> - - - <legend>User Update Form</legend> - @helper.form(action = routes.NasaRegistrationController.update()){ - <fieldset> - @helper.inputText(userForm("userNameField"),'_label -> "User Name*") - @helper.inputPassword(userForm("passwordField"), '_label -> "Password*") - @helper.inputText(userForm("fNameField"), '_label -> "First Name*") - @helper.inputText(userForm("mNameField"), '_label -> "Middle Name") - @helper.inputText(userForm("lNameField"), '_label -> "Last Name") - - @textarea( - userForm("affliationField"), - '_label -> "Affliation", 'cols -> 50, 'rows -> 5 - ) - @helper.inputText(userForm("emailField"), '_label -> "Email") - @helper.inputText(userForm("rAreaField"), '_label -> "Research Area") - <input type="submit" class="btn btn-primary" value="Update"> - <fieldset> - </div> -} -} - http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/climate/userRegistrationForm.scala.html ---------------------------------------------------------------------- diff --git a/app/views/climate/userRegistrationForm.scala.html b/app/views/climate/userRegistrationForm.scala.html deleted file mode 100644 index a8e1112..0000000 --- a/app/views/climate/userRegistrationForm.scala.html +++ /dev/null @@ -1,31 +0,0 @@ -@(userForm: Form[NasaRegistration]) -@import helper._ -@import helper.twitterBootstrap._ -@main("Nasa User Registration Form"){ - - - - <div class="clearfix " id="name_field"> - - - <legend>Registration Form</legend> - @helper.form(action = routes.NasaRegistrationController.submit()){ - <fieldset> - @helper.inputText(userForm("userNameField"),'_label -> "User Name*") - @helper.inputPassword(userForm("passwordField"), '_label -> "Password*") - @helper.inputText(userForm("fNameField"), '_label -> "First Name*") - @helper.inputText(userForm("mNameField"), '_label -> "Middle Name") - @helper.inputText(userForm("lNameField"), '_label -> "Last Name") - - @textarea( - userForm("affliationField"), - '_label -> "Affliation", 'cols -> 50, 'rows -> 5 - ) - @helper.inputText(userForm("emailField"), '_label -> "Email") - @helper.inputText(userForm("rAreaField"), '_label -> "Research Area") - <input type="submit" class="btn btn-primary" value="Register"> - <fieldset> - </div> -} -} - http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/accountSummary.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/accountSummary.scala.html b/app/views/estimator/accountSummary.scala.html deleted file mode 100644 index aa646e9..0000000 --- a/app/views/estimator/accountSummary.scala.html +++ /dev/null @@ -1,79 +0,0 @@ -@(userName: String) -<br>@import helper._ - -@main("Estimator") { - - -<div class="jumbotron"> - <div class="row"> - - <div class="col-lg-6"> - <h2>User: @userName</h2> - <h1>Account Summary</h1> - <table cellspacing='0' - class="table table-striped table-bordered table-condensed" - align="center"> - <!-- cellspacing='0' is important, must stay --> - - <!-- Table Header --> - <thead> - <tr> - <th>Start Date</th> - <th>Start Time</th> - <th>AMI Instance</th> - <th>Duration</th> - <th>Cost</th> - </tr> - </thead> - - <tbody> - - <tr class="pure-table-odd"> - <td>04/08/2014</td> - <td>9:34</td> - <td>m3.large</td> - <td>36 hours 5 minute</td> - <td>$36</td> - </tr> - <tr class="pure-table-odd"> - <td>04/12/2014</td> - <td>16:26</td> - <td>m3.medium</td> - <td>24 hours 17 minute</td> - <td>$24</td> - </tr> - <tr class="pure-table-odd"> - <td>04/15/2014</td> - <td>13:24</td> - <td>m3.large</td> - <td>10 hours 23 minute</td> - <td>$11</td> - </tr> - <tr class="pure-table-odd"> - <td></td> - <td></td> - <td></td> - <td></td> - <td>Total: $89</td> - </tr> - <tr class="pure-table-odd"> - <td></td> - <td></td> - <td></td> - <td></td> - <td>Budget left: $111</td> - </tr> - </tbody> - </table> - <button>New Task</button> - </div> - - <div class="col-lg-6" style = "padding-top: 2cm; padding-left: 2cm"> - <img src="/assets/images/NASA_logo.png"> - </div> - </div> - -</div> - - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/estimate.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/estimate.scala.html b/app/views/estimator/estimate.scala.html deleted file mode 100644 index dc2f58a..0000000 --- a/app/views/estimator/estimate.scala.html +++ /dev/null @@ -1,118 +0,0 @@ -@(email: String, vfile: String, dataset: String) - - -@import helper._ - -@main("Estimator") { - - -<ol class="breadcrumb"> - <li><a href="/estimator/tutorial">Tutorial</a></li> - <li class="active">Collect Data</li> - <li><a href="/estimator/1">Input preference</a></li> - <li><a href="/estimator/2">Workflow Summary</a></li> - <li><a href="/estimator/3">Recommendation</a></li> -</ol> - -<div class="jumbotron"> -<div class="row"> - - <div class="col-lg-6"> - <img src="/assets/images/NASA_logo.png"> - </div> - <div class="col-lg-6"> - <h1>We are ready to help you</h1> - <p>We have collected your workflow and datasets. Based on those - files, we can help you decide which virtual machine option is best for - you to use at Amazon EC2.</p> - <p> - <a class="btn btn-lg btn-default" - href="/estimator/tutorial" role="button">Getting Started »</a> - </p> - @if(!session.get("username")){ - <p>Nasa Provides 200 AWS accounts with $150 credit each. First come first serve for contest participants. - Remaining slots: 150. - If you would like to get a credited account please register here.</p> - <p> - <a class="btn btn-primary" - href="estimator/register" role="button">Register »</a> - </p> - } - </div> -</div> -</div> - -<form method="POST" action="/estimator/1" enctype="multipart/form-data"> - - - <fieldset> - <legend>Estimator</legend> - - <div class="clearfix" id="name_field"> - <label for="name">Scripting file</label> - <div class="row"> - <div class="input col-lg-2"> - - <input type="file" id="name" name="file" value="@vfile" placeholder="/Downloads/Workflowfiles"> <span - class="help-inline"></span> <span class="help-block">Required</span> - </div> - <div class="upload col-lg-2"> - - </div> - </div> - </div> - <div class="clearfix" id="title_field"> - <label for="title">Dataset</label> - <div class="row"> - <div class="input col-lg-2"> - - <input type="text" id="title" name="title" value="@dataset" placeholder="/Downloads/Datasets"> <span - class="help-inline"></span> <span class="help-block">Required</span> - </div> - - <div class="upload col-lg-2"> - <input type="button" class="btn" id="upload-dataset" name="upload-dataset" value="upload"> - </div> - </div> - </div> - <div class="clearfix " id="email_field"> - <label for="email">Email</label> - <div class="input"> - - <input type="text" id="email" name="email" value="@email"> <span - class="help-inline"></span> <span class="help-block">Required</span> - </div> - </div> - - <div class="clearfix " id="organization_field"> - <label for="organization">Organization</label> - <div class="input"> - - <input type="text" id="organization" name="organization" value=""> - - <span class="help-inline"></span> <span class="help-block"></span> - </div> - </div> - - <div class="clearfix " id="description_field"> - <label for="description">Description</label> - <div class="input"> - - <textarea id="description" name="description" cols="65" rows="7"></textarea> - - <span class="help-inline"></span> <span class="help-block"></span> - </div> - </div> - - </fieldset> - - - <div class="actions"> - <input type="submit" class="btn btn-primary" - value="Get Recommendation"> <a href="/estimator" class="btn">Thanks, - I know what to use</a> - </div> - - -</form> -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/estimate1.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/estimate1.scala.html b/app/views/estimator/estimate1.scala.html deleted file mode 100644 index ac42cd5..0000000 --- a/app/views/estimator/estimate1.scala.html +++ /dev/null @@ -1,115 +0,0 @@ -@import helper._ - -@main("Estimator") { - -<ol class="breadcrumb"> - <li><a href="/estimator/tutorial">Tutorial</a></li> - <li><a href="/estimator">Collect Data</a></li> - <li class="active">Input preference</li> - <li><a href="/estimator/2">Workflow Summary</a></li> - <li><a href="/estimator/3">Recommendation</a></li> -</ol> - -<form method="GET" role="form" action="/estimator/2"> - - - <fieldset> - <legend>Tell us your preference</legend> - - <p>In general, you have two options, on-demand and batch mode. - Under each mode, you can select CPU, memory, storage, and OS.</p> - - - <div class="form-group"> - <label class="control-label" for="budget">1) Budget</label> - <div> - <span>$ </span><input type="text" class="input-xlarge" id="budget" placeholder="50"> - </div> - </div> - <div class="form-group"> - <label class="control-label">2) Flexible start - & end time?</label> - - <div> - <label class="checkbox-inline"> <input type="checkbox" - id="yes-flexible"> yes - </label> <label class="checkbox-inline"> <input type="checkbox" - id="no-flexible"> no - </label> - </div> - </div> - - <div class="form-group"> - <label class="control-label">3) Estimated Usage</label> - - <div class="form-horizontal"> - <div class="form-group"> - <label class="col-sm-2 control-label" for="cpu"> CPU </label> - <select id="cpu"> - <option>1</option> - <option>2</option> - <option>4</option> - <option>More than 4</option> - <option>No idea</option> - </select> - </div> - - <div class="form-group"> - <label class="col-sm-2 control-label" for="memory"> Memory (GiB) </label> - <select id="cpu"> - <option>1.7</option> - <option>3.75</option> - <option>7.5</option> - <option>15</option> - <option>More than 15</option> - <option>No idea</option> - </select> - - </div> - - <div class="form-group"> - <label class="col-sm-2 control-label" for="storage"> Storage (GiB) </label> - <select id="storage"> - <option>1*4 SSD</option> - <option>1*32 SSD</option> - <option>1*160</option> - <option>1*410</option> - <option>No idea</option> - </select> - </div> - </div> - </div> - - <div class="form-group"> - <label class="control-label">4) Operating System</label> - - <div> - <label class="checkbox-inline"> <input type="checkbox" - id="nix-os"> Linux/ Unix - </label> <label class="checkbox-inline"> <input type="checkbox" - id="windows-os"> Windows - </label> - </div> - </div> - - <div class="form-group"> - <label class="control-label" for="region">5) Region</label> - - <div> - <select id="region"> - <option value="US West (North California)">US West (North - California)</option> - <option value="US West (Oregon)">US West (Oregon)</option> - <option value="US East (N. Virginia)">US East (N. - Virginia)</option> - </select> - </div> - </div> - </fieldset> - - <div class="actions"> - <input type="submit" class="btn primary" value="Submit"> <a - href="/estimator" class="btn">Cancel</a> - </div> -</form> -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/estimate2.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/estimate2.scala.html b/app/views/estimator/estimate2.scala.html deleted file mode 100644 index 2ebb333..0000000 --- a/app/views/estimator/estimate2.scala.html +++ /dev/null @@ -1,32 +0,0 @@ - -@import helper._ - -@main("Estimator") { - -<ol class="breadcrumb"> - <li><a href="/estimator/tutorial">Tutorial</a></li> - <li><a href="/estimator">Collect Data</a></li> - <li><a href="/estimator/1">Input preference</a></li> - <li class="active">Workflow Summary</li> - <li><a href="/estimator/3">Recommendation</a></li> -</ol> - -<form method="GET" role="form" action="/estimator/3"> - -<fieldset> - <div class="container"> - <p>Here is the workflow summary</p> - <img alt="workflow summary" src='@routes.Assets.at("images/workflow_1.png")' height="500" width="700"> - <img alt="workflow summary" src='@routes.Assets.at("images/workflow_2.png")' height="500" width="700"> - </div> - -</fieldset> - <br></br> - <div class="actions"> - <input type="submit" class="btn btn-primary" value="See Recommendation" action="/estimator/3" style="position: relative; left: 15px"> - </div> - -</form> - - - } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/estimate3.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/estimate3.scala.html b/app/views/estimator/estimate3.scala.html deleted file mode 100644 index 10a68b0..0000000 --- a/app/views/estimator/estimate3.scala.html +++ /dev/null @@ -1,171 +0,0 @@ -@import helper._ - -@main("Estimator") { - -<ol class="breadcrumb"> - <li><a href="/estimator/tutorial">Tutorial</a></li> - <li><a href="/estimator">Collect Data</a></li> - <li><a href="/estimator/1">Input Preference</a></li> - <li><a href="/estimator/2">Workflow Summary</a></li> - <li class="active">Recommendation</li> -</ol> - - - -<body> - - - <div class="container"> - <p>Virtual Machine Recommendation</p> -<table cellspacing='0' class="table table-striped table-bordered table-condensed" align="center"> - <!-- cellspacing='0' is important, must stay --> - - <!-- Table Header --> - <thead> - <tr> - <th></th> - <th>vCPU</th> - <th>ECU</th> - <th>Memory(GiB)</th> - <th>Storage</th> - <th>Price</th> - <th>Estimated Total Cost</th> - <th></th> - </tr> - </thead> - - <tbody> - - <tr class="pure-table-odd"> - <td> - m3.large - </td> - <td> - 2 - </td> - <td> - 6.5 - </td> - <td> - 7.5 - </td> - <td> - 1*32 SSD - </td> - <td> - $.225 per hour - </td> - <td> - $88,000 - </td> - <td> - <button type="button" class="btn" onclick="" method="get">Use it</button> - </td> - - </tr> - - - </tbody> - - </table> - - </div> - - <div class="container"> - - <p><br><br>Other options</p> -<table cellspacing='0' class="table table-striped table-bordered table-condensed" align="center" id="pubvalues"> - <!-- cellspacing='0' is important, must stay --> - - <!-- Table Header --> - <thead> - <tr> - <th></th> - <th>vCPU</th> - <th>ECU</th> - <th>Memory(GiB)</th> - <th>Storage</th> - <th>Price</th> - <th>Estimated Total Cost</th> - <th></th> - </tr> - </thead> - - <tbody> - - <tr class="pure-table-odd"> - <td> - m3.medium - </td> - <td> - 1 - </td> - <td> - 3 - </td> - <td> - 3.75 - </td> - <td> - 1*4 SSD - </td> - <td> - $.113 per hour - </td> - <td> - $68,000 - </td> - <td> - <button type="button" class="btn" onclick="" method="get">Use it</button> - </td> - - </tr> - - - </tbody> - - <tbody> - - <tr class="pure-table-odd"> - <td> - m3.xlarge - </td> - <td> - 4 - </td> - <td> - 13 - </td> - <td> - 15 - </td> - <td> - 4*40 SSD - </td> - <td> - $.450 per hour - </td> - <td> - $128,000 - </td> - <td> - <button type="button" class="btn" onclick="" method="get">Use it</button> - </td> - - </tr> - - - </tbody> - - </table> - <div class="actions" style="width: 571px; "> - <input type="submit" class="btn btn-primary" - value="I still want to check price manually"> - </div> - - </div> - - - -</body> -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/header.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/header.scala.html b/app/views/estimator/header.scala.html deleted file mode 100644 index 5a02fe2..0000000 --- a/app/views/estimator/header.scala.html +++ /dev/null @@ -1,55 +0,0 @@ - -@() - <div class="navbar navbar-default navbar-fixed-top" role="navigation"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" - data-target=".navbar-collapse"> - <span class="sr-only">Toggle navigation</span> <span - class="icon-bar"></span> <span class="icon-bar"></span> <span - class="icon-bar"></span> - </button> - <a class="navbar-brand" style="padding-bottom: 0;" href="/"><img - src='@routes.Assets.at("images/logo.png")' style="height: 28px; width: 40px;"></a> - </div> - <div class="navbar-collapse collapse" style="height:"> - <ul class="nav navbar-nav navbar-right"> - - - <li class="dropdown"><a href="#" - class="dropdown-toggle" data-toggle="dropdown">Account Management<b - class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="@routes.NasaRegistrationController.updateForm()">Update User Details</a></li> - <li><a href="@routes.NasaRegistrationController.deleteForm()">Delete User</a></li> - <li><a href="@routes.EstimateController.accountSummary(session.get("username"))">Account Summary</a></li> - </ul> - </li> - - <li><a>About Us</a></li> - - - - @if(!session.get("username")){ - - <form class="navbar-form navbar-right" action="@routes.EstimateController.login()"> - <button type="submit" class="btn btn-success">Log in</button> - </form> - }else{ - <li><a href="/estimator/tutorial">Estimator</a></li> - <form class="navbar-form navbar-right" action="@routes.EstimateController.logout()"> - <button type="submit" class="btn btn-success">Log out</button> - </form> - } - - @if(session.get("username") && session.get("username").equals("admin")){ - <form class="navbar-form navbar-right" action="@routes.NasaRegistrationController.adminPage()"> - <button type="submit" class="btn btn-success">Admin Console</button> - </form> - } - - </ul> - </div> - <!--/.nav-collapse --> - </div> - </div> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/login.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/login.scala.html b/app/views/estimator/login.scala.html deleted file mode 100644 index 272fe9d..0000000 --- a/app/views/estimator/login.scala.html +++ /dev/null @@ -1,22 +0,0 @@ -@(form: Form[EstimateController.Login]) - -@main("Estimator") { - - @helper.form(routes.EstimateController.authenticate) { - - <h1>Sign in</h1> - - - <p> - <input type="text" name="username" placeholder="Username"> - </p> - <p> - <input type="password" name="password" placeholder="Password"> - </p> - <p> - <button type="submit" class="btn btn-primary">Login</button> - </p> - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/main.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/main.scala.html b/app/views/estimator/main.scala.html deleted file mode 100644 index 05ef784..0000000 --- a/app/views/estimator/main.scala.html +++ /dev/null @@ -1,60 +0,0 @@ -@(title: String, moreScripts: Html = Html(""))(content: Html) - -<!DOCTYPE html> - -<html> -<head> - -<title>@title</title> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> - -<link rel="stylesheet" - href='@routes.Assets.at("stylesheets/bootstrap.css")'> -<link rel="stylesheet" - href='@routes.Assets.at("stylesheets/navbar-fixed-top.css")'> -<link rel="stylesheet" - href='@routes.Assets.at("stylesheets/custom.css")'> -<link rel="stylesheet" media="screen" - href='@routes.Assets.at("stylesheets/main.css")'> -<link rel="shortcut icon" type="image/png" - href='@routes.Assets.at("images/favicon.png")'> - - - -<link href='@routes.Assets.at("stylesheets/bootstrap-editable.css")' - rel="stylesheet" /> - -<script src='@routes.Assets.at("javascripts/jquery-1.9.0.min.js")' - type="text/javascript"></script> -<script src='@routes.Assets.at("javascripts/bootstrap.min.js")' - type="text/javascript"></script> - -<script src='@routes.Assets.at("javascripts/bootstrap-editable.min.js")'></script> -@moreScripts -</head> - -<body> - @header() - - - - <div class="container"> - - @content - - <!-- Footer --> - <div class="footer"> - <div class="row"> - <div class="col-lg-4 col-lg-offset-8"> - <p class="text-muted" style="text-align: right; font-size: 14px;">© - Carnegie Mellon University. Silicon Valley. 2014</p> - </div> - </div> - </div> - - </div> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/estimator/tutorial.scala.html ---------------------------------------------------------------------- diff --git a/app/views/estimator/tutorial.scala.html b/app/views/estimator/tutorial.scala.html deleted file mode 100644 index a9d72ef..0000000 --- a/app/views/estimator/tutorial.scala.html +++ /dev/null @@ -1,24 +0,0 @@ -@main("Tutorial") { - -<ol class="breadcrumb"> - <li class="active">Tutorial</li> - <li><a href="/estimator">Collect Data</a></li> - <li><a href="/estimator/1">Input Preference</a></li> - <li><a href="/estimator/2">Workflow Summary</a></li> - <li><a href="/estimator/3">Recommendation</a></li> -</ol> - -<iframe width="600" height="400" src="http://www.youtube.com/embed/6A_KMshTN2g?rel=0" frameborder="0" allowfullscreen></iframe> - -<p> -This video shows how to connect the vistrails workflow to the Einstein Website(http://einstein.sv.cmu.edu/estimator). - -<ul> -<li>Run vistrails. (python VISTRAILS_PATH/vistrails/vistrails.py)</li> -<li>Import a workflow.</li> -<li>Click the menu Packages, and then Amazon Plugin. Inside that choose the 'Go to estimator'</li> -<li>Input the notification email and click Estimate. Then you can be directed to the estimator web page.</li> -</ul> -</p> - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/registration/@(users ---------------------------------------------------------------------- diff --git a/app/views/registration/@(users b/app/views/registration/@(users deleted file mode 100644 index e69de29..0000000 http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/registration/adminPage.scala.html ---------------------------------------------------------------------- diff --git a/app/views/registration/adminPage.scala.html b/app/views/registration/adminPage.scala.html deleted file mode 100644 index 79cf1ae..0000000 --- a/app/views/registration/adminPage.scala.html +++ /dev/null @@ -1,116 +0,0 @@ -@(users: List[models.NasaRegistration]) -@import helper._ -@import helper.twitterBootstrap._ - -@main("Admin Page") { - - - - - -<body> - - - <div class="container"> - <div class="container"> - <legend>Current Usage Summary</legend> - <h1>@users.size() Active Users</h1> - <div><p><img alt="workflow summary" src='@routes.Assets.at("images/UsageSummart.png")' height="250" width="250" align="left"> - <h4> - 86 Slots available</h4><br></br> - <h4> - $14560 budget available</h4><br></br> - <h4>- 57% of 200 slots have been used</h4><br></br></p> - </div> - - <legend>Current Usage Details</legend> -<table cellspacing='0' class="table table-striped table-bordered table-condensed" align="center"> - <!-- cellspacing='0' is important, must stay --> - - <!-- Table Header --> - <thead> - <tr> - <th>User Name</th> - <th>First Name</th> - <th>Last Name</th> - <th>Organization</th> - <th>Occupation</th> - <th>Highest Education</th> - <th>Email</th> - <th>Register Date</th> - <th>Goal</th> - <th>Usage</th> - <th>Action</th> - - </tr> - </thead> - - <tbody> - <br></br> - - @for(user <- users) { - <tr> - <td>@user.getUserNameField</td> - <td>@user.getfNameField()</td> - <td>Last Name</td> - <td>Organization</td> - <td>Occupation</td> - <td>Occupation</td> - <td>@user.getEmail()</td> - <td>Registration Date</td> - <td>@user.getGoal()</td> - <td>Usage</td> - <td> - <button type="button" class="btn" onclick="" method="POST" action = "">Cease</button> - </td> - </tr> - } - - <tr> - <td> - 02 - </td> - <td> - Jane - </td> - <td> - Green - </td> - <td> - CMU - </td> - <td> - Faculty - </td> - <td> - Master - </td> - <td> - jane.gmail.com - </td> - <td> - 04/09/2014 - </td> - <td> - landscape data research - </td> - <td> - 100% of $200 - </td> - <td> - <button type="button" class="btn" onclick="" method="get">Fund</button> - </td> - - </tr> - - - </tbody> - - </table> - - </div> - - - - - -</body> -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/registration/delete.scala.html ---------------------------------------------------------------------- diff --git a/app/views/registration/delete.scala.html b/app/views/registration/delete.scala.html deleted file mode 100644 index 2f1360a..0000000 --- a/app/views/registration/delete.scala.html +++ /dev/null @@ -1,23 +0,0 @@ -@(userForm: Form[NasaRegistration]) -@import helper._ -@import helper.twitterBootstrap._ -@main("Nasa Update Form"){ - - - - <div class="clearfix " id="name_field"> - - - <legend>User Deletion Form</legend> - @helper.form(action = routes.NasaRegistrationController.delete()){ - <fieldset> - @helper.inputText(userForm("userNameField"),'_label -> "User Name*") - @helper.inputPassword(userForm("passwordField"), '_label -> "Password*") - - - <input type="submit" class="btn btn-primary" value="Delete"> - <fieldset> - </div> -} -} - http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/registration/header.scala.html ---------------------------------------------------------------------- diff --git a/app/views/registration/header.scala.html b/app/views/registration/header.scala.html deleted file mode 100644 index c7979e1..0000000 --- a/app/views/registration/header.scala.html +++ /dev/null @@ -1,53 +0,0 @@ - -@() - <div class="navbar navbar-default navbar-fixed-top" role="navigation"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" - data-target=".navbar-collapse"> - <span class="sr-only">Toggle navigation</span> <span - class="icon-bar"></span> <span class="icon-bar"></span> <span - class="icon-bar"></span> - </button> - <a class="navbar-brand" style="padding-bottom: 0;" href="/"><img - src='@routes.Assets.at("images/logo.png")' style="height: 28px;"></a> - </div> - <div class="navbar-collapse collapse" style="height:"> - <ul class="nav navbar-nav navbar-right"> - - - <li class="dropdown"><a href="#" - class="dropdown-toggle" data-toggle="dropdown">Account Management<b - class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="@routes.NasaRegistrationController.updateForm()">Update User Details</a></li> - <li><a href="@routes.NasaRegistrationController.deleteForm()">Delete User</a></li> - <li><a href="@routes.EstimateController.accountSummary(session.get("username"))">Account Summary</a></li> - </ul> - </li> - - <li><a>About Us</a></li> - - @if(!session.get("username")){ - - <form class="navbar-form navbar-right" action="@routes.EstimateController.login()"> - <button type="submit" class="btn btn-success">Log in</button> - </form> - }else{ - <li><a href="/estimator/tutorial">Estimator</a></li> - <form class="navbar-form navbar-right" action="@routes.EstimateController.logout()"> - <button type="submit" class="btn btn-success">Log out</button> - </form> - } - - @if(session.get("username") && session.get("username").equals("admin")){ - <form class="navbar-form navbar-right" action="@routes.NasaRegistrationController.adminPage()"> - <button type="submit" class="btn btn-success">Admin Console</button> - </form> - } - - </ul> - </div> - <!--/.nav-collapse --> - </div> - </div> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/2d375c56/app/views/registration/main.scala.html ---------------------------------------------------------------------- diff --git a/app/views/registration/main.scala.html b/app/views/registration/main.scala.html deleted file mode 100644 index 0a4dd2a..0000000 --- a/app/views/registration/main.scala.html +++ /dev/null @@ -1,58 +0,0 @@ -@(title: String, moreScripts: Html = Html(""))(content: Html) - -<!DOCTYPE html> - -<html> -<head> - -<title>@title</title> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> - -<link rel="stylesheet" - href='@routes.Assets.at("stylesheets/bootstrap.css")'> -<link rel="stylesheet" - href='@routes.Assets.at("stylesheets/navbar-fixed-top.css")'> -<link rel="stylesheet" - href='@routes.Assets.at("stylesheets/custom.css")'> -<link rel="stylesheet" media="screen" - href='@routes.Assets.at("stylesheets/main.css")'> -<link rel="shortcut icon" type="image/png" - href='@routes.Assets.at("images/favicon.png")'> - - - -<link href='@routes.Assets.at("stylesheets/bootstrap-editable.css")' - rel="stylesheet" /> - -<script src='@routes.Assets.at("javascripts/jquery-1.9.0.min.js")' - type="text/javascript"></script> -<script src='@routes.Assets.at("javascripts/bootstrap.min.js")' - type="text/javascript"></script> - -<script src='@routes.Assets.at("javascripts/bootstrap-editable.min.js")'></script> -@moreScripts -</head> - -<body> - @header() - - - <div class="container"> - - @content - - <div class="footer"> - <div class="row"> - <div class="col-lg-4 col-lg-offset-8"> - <p class="text-muted" style="text-align: right; font-size: 14px;">© - Carnegie Mellon University. Silicon Valley. 2014</p> - </div> - </div> - </div> - - </div> - -</body> -</html>