Merge pull request #34 from sagidayan/UI
-create campus as lecturer added
This commit is contained in:
commit
ab09d9851c
3 changed files with 70 additions and 43 deletions
|
@ -133,6 +133,13 @@ body.noscroll
|
|||
margin-top: auto;
|
||||
}
|
||||
|
||||
|
||||
.createCampus
|
||||
{
|
||||
position:relative;
|
||||
/*float:right;*/
|
||||
}
|
||||
|
||||
/*div.img campusAvatar
|
||||
{
|
||||
border: 1px solid #0000ff;
|
||||
|
|
|
@ -3,7 +3,14 @@ angular.module('SeHub')
|
|||
{
|
||||
$scope.userHasNoName = false;
|
||||
$scope.campusChecked = false;
|
||||
$scope.createCampusClicked = false;
|
||||
$scope.isEmpty = true; // if the academic email line is empty
|
||||
$scope.jsonCreateCampus =
|
||||
{
|
||||
"title": "Create Campus",
|
||||
"email": "email_ending",
|
||||
"avatar": "self.avatar.url"
|
||||
}
|
||||
|
||||
$rootScope.seToken = $cookies['com.sehub.www'];
|
||||
var token = $rootScope.seToken;
|
||||
|
@ -44,6 +51,7 @@ angular.module('SeHub')
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
$scope.submitClicked = function(ev)
|
||||
|
@ -56,6 +64,7 @@ angular.module('SeHub')
|
|||
console.log("DONE - 200");
|
||||
$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
|
||||
// TODO ADD delete cookies and redirect only after pressed 'Got it'
|
||||
$cookieStore.remove("com.sehub.www"); // Removing the cookies
|
||||
$window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page
|
||||
}).error(function()
|
||||
|
@ -66,38 +75,38 @@ angular.module('SeHub')
|
|||
};
|
||||
};
|
||||
|
||||
$scope.lecturerPrivilege = function(data)
|
||||
|
||||
$scope.lecturer = function(ev)
|
||||
{
|
||||
// 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
|
||||
console.log("inside");
|
||||
$scope.createCampusClicked = true;
|
||||
|
||||
if(!$scope.isLecturer) // if i am a lecturer (when pressing -> getting last data value before pressing) = "!isLecturer" it means => I Am Lecturer
|
||||
{
|
||||
isLecturer = true;
|
||||
console.log("im lecturer " + isLecturer);
|
||||
// var jsonCreateCampus =
|
||||
// {
|
||||
// "title": "Create Campus",
|
||||
// "email": "email_ending",
|
||||
// "avatar": "self.avatar.url"
|
||||
// }
|
||||
console.log("YES lecturer " + $scope.jsonCreateCampus.title);
|
||||
|
||||
if($scope.user.lecAcMail != null)
|
||||
{
|
||||
apiService.sendValidationMail($scope.user.seToken, $scope.user.lecAcMail).success(function(data)
|
||||
{
|
||||
console.log("DONE - 200");
|
||||
$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
|
||||
// TODO ADD delete cookies and redirect only after pressed 'Got it'
|
||||
$cookieStore.remove("com.sehub.www"); // Removing the cookies
|
||||
$window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page
|
||||
}).error(function()
|
||||
{
|
||||
$mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address or in the campus name.')
|
||||
.ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(ev));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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
|
||||
|
||||
}
|
||||
}]);
|
||||
|
|
|
@ -18,26 +18,37 @@
|
|||
<br></br>
|
||||
<div layout="row" layout-align="center center">
|
||||
<p>Are You A Lecturer?</p>
|
||||
<md-switch ng-click = "lecturerPrivilege(data.cb1)" ng-model="data.cb1" aria-label="Switch 1">
|
||||
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> -->
|
||||
<md-switch ng-model="user.isLecturer" aria-label="Switch 1">
|
||||
</md-switch>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div ng-if="user.isLecturer">
|
||||
<div>
|
||||
<md-button ng-click = "lecturer($event)" ng-model="jsonCreateCampus" class="md-raised">Create Campus</md-button>
|
||||
<div class = "createCampus" ng-if="createCampusClicked">
|
||||
<md-input-container>
|
||||
<label>Academic Lecturer Email</label>
|
||||
<input type="text" ng-disabled="!createCampusClicked" ng-model="user.lecAcMail" required/>
|
||||
</md-input-container>
|
||||
<md-input-container>
|
||||
<label>Campus Name</label>
|
||||
<input type="text" ng-disabled="!createCampusClicked" ng-model="user.campusName" required/>
|
||||
</md-input-container>
|
||||
<md-input-container>
|
||||
<label>Campus Avatar Url (optional)</label>
|
||||
<input type="text" ng-disabled="!createCampusClicked" ng-model="user.newCampusAvatar" required/>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class = "dropDown">
|
||||
<md-select placeholder="Pick your Campus" ng-model="campus" style="z-index: 300" ng-change="dropdownClicked()">
|
||||
<md-option ng-repeat="c in campuses" value="{{c.title}}">{{c.title}}</md-option>
|
||||
<md-option ng-switch="user.isLecturer" ng-repeat="c in campuses" value="{{c.title}}">{{c.title}}</md-option>
|
||||
</md-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div layout="col" layout-align="center center">
|
||||
<div>
|
||||
<div class="campusAvatar" ng-if="campusChecked">
|
||||
|
|
Loading…
Reference in a new issue