Skip to content

Commit

Permalink
Correct routing for other modules, renamed settings to groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoo12 committed Mar 20, 2016
1 parent 7ebf36e commit c6e5956
Show file tree
Hide file tree
Showing 15 changed files with 214 additions and 4 deletions.
22 changes: 22 additions & 0 deletions app/analysis/analysis.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en" ng-controller="analysisController">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Cmput391</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="bower_components/angular/angular.js"></script>
</head>
<body>
<h1 style="text-align: center;">Analysis</h1>


</body>
</html>
25 changes: 25 additions & 0 deletions app/analysis/analysis.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
angular.module("myApp.analysis", ["ngRoute", "LocalStorageModule"])

.config(["$routeProvider", function($routeProvider) {
$routeProvider.when("/analysis", {
templateUrl: "analysis/analysis.html",
controller: "analysisController"
});
}])

.controller("analysisController", function($scope, $location, localStorageService) {
var usernameFromStorage,
storageKey = "user";

function getItem(key) {
return localStorageService.get(key);
};

if(!getItem(storageKey)){
//User has not logged in yet so redirect to login
$location.url("/login");
}



});
4 changes: 4 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ angular.module("myApp", [
"LocalStorageModule",
"myApp.login",
"myApp.register",
"myApp.display",
"myApp.groups",
"myApp.analysis",
"myApp.search",
"myApp.home"
]).
config(["$routeProvider", function($routeProvider) {
Expand Down
22 changes: 22 additions & 0 deletions app/display/display.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en" ng-controller="displayController">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Cmput391</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="bower_components/angular/angular.js"></script>
</head>
<body>
<h1 style="text-align: center;">Display</h1>


</body>
</html>
25 changes: 25 additions & 0 deletions app/display/display.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
angular.module("myApp.display", ["ngRoute", "LocalStorageModule"])

.config(["$routeProvider", function($routeProvider) {
$routeProvider.when("/display", {
templateUrl: "display/display.html",
controller: "displayController"
});
}])

.controller("displayController", function($scope, $location, localStorageService) {
var usernameFromStorage,
storageKey = "user";

function getItem(key) {
return localStorageService.get(key);
};

if(!getItem(storageKey)){
//User has not logged in yet so redirect to login
$location.url("/login");
}



});
22 changes: 22 additions & 0 deletions app/groups/groups.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en" ng-controller="groupsController">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Cmput391</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="bower_components/angular/angular.js"></script>
</head>
<body>
<h1 style="text-align: center;">Groups</h1>


</body>
</html>
25 changes: 25 additions & 0 deletions app/groups/groups.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
angular.module("myApp.groups", ["ngRoute", "LocalStorageModule"])

.config(["$routeProvider", function($routeProvider) {
$routeProvider.when("/groups", {
templateUrl: "groups/groups.html",
controller: "groupsController"
});
}])

.controller("groupsController", function($scope, $location, localStorageService) {
var usernameFromStorage,
storageKey = "user";

function getItem(key) {
return localStorageService.get(key);
};

if(!getItem(storageKey)){
//User has not logged in yet so redirect to login
$location.url("/login");
}



});
File renamed without changes.
8 changes: 4 additions & 4 deletions app/homepage/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<h1 style="text-align: center;">Homepage</h1>
<div class="buttonContainer" style="text-align: center;bottom: 50%;left: 35%;position: absolute;">
<button type="button" class="btn btn-primary">Upload</button>
<button type="button" class="btn btn-primary">Display</button>
<button type="button" class="btn btn-primary">Settings</button>
<button type="button" class="btn btn-primary">Search</button>
<button type="button" class="btn btn-primary">Data Analysis</button>
<button type="button" class="btn btn-primary" ng-click="display()">Display</button>
<button type="button" class="btn btn-primary" ng-click="groups()">Groups</button>
<button type="button" class="btn btn-primary" ng-click="search()">Search</button>
<button type="button" class="btn btn-primary" ng-click="analysis()">Data Analysis</button>
</div>

</body>
Expand Down
12 changes: 12 additions & 0 deletions app/homepage/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ angular.module("myApp.home", ["ngRoute", "LocalStorageModule"])
$location.url("/login");
}

$scope.groups = function() {
$location.url("/groups");
};
$scope.display = function() {
$location.url("/display");
};
$scope.search = function() {
$location.url("/search");
};
$scope.analysis = function() {
$location.url("/analysis");
};


});
8 changes: 8 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@
<script src="homepage/home.js"></script>
<script src="register/register.js"></script>
<script src="register/registerHandler.js"></script>
<script src="display/display.js"></script>
<script src="display/displayHandler.js"></script>
<script src="search/search.js"></script>
<script src="search/searchHandler.js"></script>
<script src="groups/groups.js"></script>
<script src="groups/groupsHandler.js"></script>
<script src="analysis/analysis.js"></script>
<script src="analysis/analysisHandler.js"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions app/search/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en" ng-controller="searchController">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Cmput391</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="bower_components/angular/angular.js"></script>
</head>
<body>
<h1 style="text-align: center;">Search</h1>


</body>
</html>
23 changes: 23 additions & 0 deletions app/search/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
angular.module("myApp.search", ["ngRoute", "LocalStorageModule"])

.config(["$routeProvider", function($routeProvider) {
$routeProvider.when("/search", {
templateUrl: "search/search.html",
controller: "searchController"
});
}])

.controller("searchController", function($scope, $location, localStorageService) {
var usernameFromStorage,
storageKey = "user";

function getItem(key) {
return localStorageService.get(key);
};

if(!getItem(storageKey)){
//User has not logged in yet so redirect to login
$location.url("/login");
}

});
Empty file removed app/settings/settings.js
Empty file.
Empty file removed app/settings/settingsHandler.js
Empty file.

0 comments on commit c6e5956

Please sign in to comment.