Merge pull request #30 from sagidayan/UI

Ui
This commit is contained in:
Sagi Dayan 2015-06-15 19:13:46 +03:00
commit daf39d81cd
2 changed files with 48 additions and 8 deletions

View file

@ -1,7 +1,6 @@
angular.module('SeHub') angular.module('SeHub')
.controller('registerController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) .controller('registerController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
{ {
$scope.userHasNoName = false; $scope.userHasNoName = false;
$scope.campusChecked = false; $scope.campusChecked = false;
$scope.isEmpty = true; // if the academic email line is empty $scope.isEmpty = true; // if the academic email line is empty
@ -31,7 +30,6 @@ angular.module('SeHub')
{ {
// TODO // TODO
}); });
}); });
$scope.dropdownClicked = function() $scope.dropdownClicked = function()
@ -59,7 +57,7 @@ angular.module('SeHub')
$mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.')
.ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(ev)); // Pop-up alert for e-mail verification .ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(ev)); // Pop-up alert for e-mail verification
$cookieStore.remove("com.sehub.www"); // Removing the cookies $cookieStore.remove("com.sehub.www"); // Removing the cookies
$window.location.href = 'http://se-hub.appspot.com'; $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page
}).error(function() }).error(function()
{ {
$mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.')
@ -67,6 +65,39 @@ angular.module('SeHub')
}); });
}; };
}; };
$scope.lecturerPrivilege = function(data)
{
// console.log("Now " + data);
var isLecturer;
if(!data) // if i am a lecturer (when pressing -> getting last data value before pressing) = "!data" => I Am Lecturer
{
isLecturer = true;
console.log("im lecturer " + isLecturer);
}
}
// TODO FOR LATER - toast
// TODO FOR LATER
// $scope.getPopWindowPosition = function()
// {
// return Object.keys($scope.toastPosition).filter(function(pos)
// {
// return $scope.toastPosition[pos];
// }).join(' ');
// };
// $scope.toastPosition =
// {
// bottom: false,
// top: true,
// left: false,
// right: true
// };
// TODO FOR LATER
// TODO FOR LATER
}]); }]);

View file

@ -1,7 +1,7 @@
<div class="register"> <div class="register">
<md-content layout-padding> <md-content layout-padding>
<h1 style="margin-left:15px"><i class="fa fa-pencil"></i> Registration</h1>
<md-card layout-padding> <md-card layout-padding>
<h1 style="margin-left:15px"><i class="fa fa-pencil"></i> Registration</h1>
<center> <center>
First Login Of {{user.name}} First Login Of {{user.name}}
<div class="avatar"> <div class="avatar">
@ -18,8 +18,17 @@
<br></br> <br></br>
<div layout="row" layout-align="center center"> <div layout="row" layout-align="center center">
<p>Are You A Lecturer?</p> <p>Are You A Lecturer?</p>
<md-switch class="md-primary" md-no-ink aria-label="Switch No Ink" ng-model="data.cb5"> <md-switch ng-click = "lecturerPrivilege(data.cb1)" ng-model="data.cb1" aria-label="Switch 1">
</md-switch> Switch 1: {{ data.cb1 }}
<div ng-if="data">
<!-- <md-progress-circular class="md-hue-2" md-mode="indeterminate">
</md-progress-circular> -->
</div>
</md-switch>
<!-- TODO original -->
<!-- <md-switch class="md-primary" md-no-ink aria-label="Switch No Ink" ng-model="data.cb5">
</md-switch> -->
</div> </div>
</div> </div>
<div> <div>