Skip to content

Commit

Permalink
Profile page updated to utilize sweet animations from previous team
Browse files Browse the repository at this point in the history
  • Loading branch information
nlokare committed Feb 5, 2015
1 parent 0c32656 commit f19379f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"angular": "~1.3.10",
"ngFx": "~1.0.5",
"bootstrap": "~3.3.2",
"flag-icon-css": "~0.6.4"
"flag-icon-css": "~0.6.4",
"angular-bootstrap": "~0.12.0"
}
}
7 changes: 4 additions & 3 deletions client/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ angular.module('languageApp', ['translateModule', 'ngFx', 'ui.router', 'ui.boots
})

.controller('createProfileController', function ($scope, $http, $location) {
$scope.languages = [{lang: 'English'}, {lang: 'Chinese'}, {lang: 'Spanish'}, {lang: 'French'}, {lang: 'Italian'}];
$scope.native = {prof: 'Fluent', lang: ''};
$scope.desired = {prof: '', lang: ''};
$scope.languages = [['English','us'],['Chinese','cn'],['Spanish','es'],['French','fr'],['Italian','it']];
$scope.language = {};
$scope.native = {lang: '', prof: 'Fluent'};
$scope.desired = {lang: ''};
$scope.lastname = '';
$scope.firstname = '';
$scope.levels = ['Beginner', 'Intermediate', 'Advanced', 'Fluent'];
Expand Down
26 changes: 15 additions & 11 deletions client/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,24 @@ <h3>Create your profile</h3>
<label for="lastName">Last name</label>
<input type="text" class="form-control" name="lastname" placeholder="Enter last name" ng-model="lastname">
</div>
<div class="form-group desired">
<label for="languages">Native Language</label><br>
<label class="radio-inline" ng-repeat="lang in languages">
<input type="radio" value="" ng-model="native.lang[lang.lang]" name="desired">{{ lang.lang }}
</label>
<div class="list-group col-md-4 fx-fade-left fx-speed-500 fx-easing-back">
<h2> My native language is... </h2>
<a ng-repeat="lang in languages" href="#/profile" ng-click="language.native=lang[0]; native.lang=lang[0]" class="list-group-item">
<span class="flag-icon flag-icon-{{ lang[1] }}"></span>
{{ lang[0] }}
<span class="glyphicon glyphicon-menu-right right" aria-hidden="true"></span>
</a>
</div>
<div class="form-group desired">
<label for="languages">Desired Language</label><br>
<label class="radio-inline" ng-repeat="lang in languages">
<input type="radio" value="" ng-model="desired.lang[lang.lang]" name="desired">{{ lang.lang }}
</label>
<div ng-if="language.native" class="list-group col-md-4 fx-fade-left fx-speed-500 fx-easing-back">
<h2> I want to practice... </h2>
<a ng-repeat="lang in languages" href="#/profile" ng-click="language.desired=lang[0]; desired.lang=lang[0]" class="list-group-item">
<span class="flag-icon flag-icon-{{ lang[1] }}"></span>
{{ lang[0] }}
<span class="glyphicon glyphicon-menu-right right" aria-hidden="true"></span>
</a>
</div>
<div class="form-group proficiency">
<select class="form-control" ng-model="desired.prof[level]" ng-options="level for level in levels">
<select class="form-control" ng-model="desired.prof" ng-options="level for level in levels">
<option value="">Proficiency Level</option>
</select>
</div>
Expand Down
4 changes: 2 additions & 2 deletions server/user/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports.signInUserForm = function(req, res) {

exports.logoutUser = function(req, res) {
req.session.destroy(function(){
res.redirect('/signin');
res.redirect('/#/');
});
};

Expand All @@ -32,7 +32,7 @@ exports.signInUser = function(req, res) {
req.session.regenerate(function(){
req.session.user = username;
console.log(req.session.user);
res.redirect('/');
res.redirect('/#/dashboard');
});
} else {
console.log('wrooooong password or log in!');
Expand Down

0 comments on commit f19379f

Please sign in to comment.