Skip to content

Commit 81b2eaa

Browse files
committed
Employer - lvl exp - done.
1 parent cc1ed82 commit 81b2eaa

File tree

13 files changed

+203
-59
lines changed

13 files changed

+203
-59
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ src/main/webapp/components/*
1111

1212
src/main/webapp/styles/main.css
1313
/src/main/webapp/fonts/bootstrap/
14+
/src/main/webapp/fonts/awesome/

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"angular-http-auth": "^1.5.0",
2424
"angular-local-storage": "^0.5.2",
2525
"ngmap": "^1.17.8",
26-
"progressbar.js": "^1.0.1"
26+
"progressbar.js": "^1.0.1",
27+
"components-font-awesome": "^4.7.0"
2728
}
2829
}

src/main/webapp/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>Jobzz</title>
55

6+
<link href="components/components-font-awesome/css/font-awesome.min.css" rel="stylesheet">
67
<link href="styles/main.css" rel="stylesheet">
78
</head>
89

src/main/webapp/scripts/controllers/employerProfileEmployee.js

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
angular.module('jobzz')
22
.controller('EmployerProfileEmployeeCtrl', ['$scope', '$rootScope', '$http', 'employerProfileService', 'userProfilePictureService',
3-
function ($scope, $rootScope, $http, employerProfileService, userProfilePictureService) {
3+
'dateToStringService',
4+
function ($scope, $rootScope, $http, employerProfileService, userProfilePictureService, dateToStringService) {
45

56
$scope.employer = employerProfileService.getEmployer();
67
$scope.employer.profilePicture = userProfilePictureService.employerProfilePicture($scope.employer.profilePicture);
78
$scope.responses = {};
89

9-
var getAllEmployerReviews = function () {
10+
(function () {
1011

1112
var req = {
1213
method: 'GET',
@@ -25,11 +26,42 @@ angular.module('jobzz')
2526
});
2627

2728
}, function () {
28-
console.log('Fail');
29+
//Empty
2930
});
3031

31-
};
32+
})();
3233

33-
getAllEmployerReviews();
34+
(function () {
35+
36+
var lvl = Math.floor($scope.employer.reputation / 10);
37+
var exp = ($scope.employer.reputation % 10) * 0.1;
38+
39+
var bar = new ProgressBar.Circle(container1, {
40+
color: '#61B329',
41+
strokeWidth: 4,
42+
trailWidth: 1,
43+
easing: 'easeInOut',
44+
duration: 1400,
45+
text: {
46+
autoStyleContainer: false
47+
},
48+
from: {color: '#61B329', width: 1},
49+
to: {color: '#61B329', width: 4},
50+
51+
step: function (state, circle) {
52+
circle.path.setAttribute('stroke', state.color);
53+
circle.path.setAttribute('stroke-width', state.width);
54+
circle.setText('lvl ' + lvl);
55+
56+
}
57+
});
58+
bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
59+
bar.text.style.fontSize = '2rem';
60+
61+
bar.animate(exp);
62+
63+
$($('#container1').find('svg')[0]).hide();
64+
65+
})();
3466

3567
}]);

src/main/webapp/scripts/controllers/jobDetailsEmployee.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,36 @@ angular.module('jobzz')
4444

4545
};
4646

47+
(function () {
48+
49+
var lvl = Math.floor($scope.job.employer.reputation / 10);
50+
var exp = ($scope.job.employer.reputation % 10) * 0.1;
51+
52+
var bar = new ProgressBar.Circle(container, {
53+
color: '#61B329',
54+
strokeWidth: 4,
55+
trailWidth: 1,
56+
easing: 'easeInOut',
57+
duration: 1400,
58+
text: {
59+
autoStyleContainer: false
60+
},
61+
from: {color: '#61B329', width: 1},
62+
to: {color: '#61B329', width: 4},
63+
64+
step: function (state, circle) {
65+
circle.path.setAttribute('stroke', state.color);
66+
circle.path.setAttribute('stroke-width', state.width);
67+
circle.setText('lvl ' + lvl);
68+
69+
}
70+
});
71+
bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
72+
bar.text.style.fontSize = '2rem';
73+
74+
bar.animate(exp);
75+
76+
$($('#container').find('svg')[0]).hide();
77+
})();
78+
4779
}]);

src/main/webapp/scripts/controllers/postDetailsEmployee.js

Lines changed: 77 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,54 @@ angular.module('jobzz')
44
function ($scope, $rootScope, $http, $mdPanel, $location, jobService, dateToStringService, employerProfileService
55
, userProfilePictureService) {
66

7+
var reviewEmployerPopUp = function () {
8+
var position = $mdPanel.newPanelPosition()
9+
.absolute()
10+
.center();
11+
12+
var config = {
13+
attachTo: angular.element(document.body),
14+
controller: 'ReviewEmployerEmployeeCtrl',
15+
controllerAs: 'ReviewEmployerEmployeeCtrl',
16+
templateUrl: '/views/employee/reviewEmployer.html',
17+
hasBackdrop: true,
18+
panelClass: 'change-post',
19+
position: position,
20+
clickOutsideToClose: true,
21+
escapeToClose: true,
22+
disableParentScroll: true,
23+
trapFocus: true
24+
};
25+
26+
$mdPanel.open(config).then(function (result) {
27+
$rootScope.panelRef = result;
28+
});
29+
};
30+
31+
var warningNewReview = function () {
32+
var position = $mdPanel.newPanelPosition()
33+
.absolute()
34+
.center();
35+
36+
var config = {
37+
attachTo: angular.element(document.body),
38+
controller: 'WarningNewReviewEmployeeCtrl',
39+
controllerAs: 'WarningNewReviewEmployeeCtrl',
40+
templateUrl: '/views/employee/warningNewReview.html',
41+
hasBackdrop: true,
42+
panelClass: 'change-post',
43+
position: position,
44+
clickOutsideToClose: true,
45+
escapeToClose: true,
46+
disableParentScroll: true,
47+
trapFocus: true
48+
};
49+
50+
$mdPanel.open(config).then(function (result) {
51+
$rootScope.panelRef = result;
52+
});
53+
};
54+
755
$scope.job = jobService.getJob();
856
$scope.job.date = dateToStringService.dateToString(new Date($scope.job.date));
957
$scope.latlng = [$scope.job.employerPosting.latitude, $scope.job.employerPosting.longitude];
@@ -65,7 +113,7 @@ angular.module('jobzz')
65113
}
66114

67115
}, function () {
68-
console.log('Fail');
116+
//Empty
69117
});
70118

71119
} else {
@@ -80,52 +128,37 @@ angular.module('jobzz')
80128

81129
};
82130

83-
var reviewEmployerPopUp = function () {
84-
var position = $mdPanel.newPanelPosition()
85-
.absolute()
86-
.center();
87-
88-
var config = {
89-
attachTo: angular.element(document.body),
90-
controller: 'ReviewEmployerEmployeeCtrl',
91-
controllerAs: 'ReviewEmployerEmployeeCtrl',
92-
templateUrl: '/views/employee/reviewEmployer.html',
93-
hasBackdrop: true,
94-
panelClass: 'change-post',
95-
position: position,
96-
clickOutsideToClose: true,
97-
escapeToClose: true,
98-
disableParentScroll: true,
99-
trapFocus: true
100-
};
101-
102-
$mdPanel.open(config).then(function (result) {
103-
$rootScope.panelRef = result;
131+
(function () {
132+
133+
var lvl = Math.floor($scope.job.employerPosting.employer.reputation / 10);
134+
var exp = ($scope.job.employerPosting.employer.reputation % 10) * 0.1;
135+
136+
var bar = new ProgressBar.Circle(container, {
137+
color: '#61B329',
138+
strokeWidth: 4,
139+
trailWidth: 1,
140+
easing: 'easeInOut',
141+
duration: 1400,
142+
text: {
143+
autoStyleContainer: false
144+
},
145+
from: {color: '#61B329', width: 1},
146+
to: {color: '#61B329', width: 4},
147+
148+
step: function (state, circle) {
149+
circle.path.setAttribute('stroke', state.color);
150+
circle.path.setAttribute('stroke-width', state.width);
151+
circle.setText('lvl ' + lvl);
152+
153+
}
104154
});
105-
};
155+
bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
156+
bar.text.style.fontSize = '2rem';
106157

107-
var warningNewReview = function () {
108-
var position = $mdPanel.newPanelPosition()
109-
.absolute()
110-
.center();
158+
bar.animate(exp);
111159

112-
var config = {
113-
attachTo: angular.element(document.body),
114-
controller: 'WarningNewReviewEmployeeCtrl',
115-
controllerAs: 'WarningNewReviewEmployeeCtrl',
116-
templateUrl: '/views/employee/warningNewReview.html',
117-
hasBackdrop: true,
118-
panelClass: 'change-post',
119-
position: position,
120-
clickOutsideToClose: true,
121-
escapeToClose: true,
122-
disableParentScroll: true,
123-
trapFocus: true
124-
};
160+
$($('#container').find('svg')[0]).hide();
125161

126-
$mdPanel.open(config).then(function (result) {
127-
$rootScope.panelRef = result;
128-
});
129-
};
162+
})();
130163

131164
}]);

src/main/webapp/scripts/controllers/profileEmployee.js

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,40 @@ angular.module('jobzz')
55
$scope.employee = {};
66
$scope.responses = {};
77

8+
var calculateLvl = function () {
9+
10+
var lvl = Math.floor($scope.employee.reputation / 10);
11+
var exp = ($scope.employee.reputation % 10) * 0.1;
12+
13+
var bar = new ProgressBar.Circle(container, {
14+
color: '#61B329',
15+
strokeWidth: 4,
16+
trailWidth: 1,
17+
easing: 'easeInOut',
18+
duration: 1400,
19+
text: {
20+
autoStyleContainer: false
21+
},
22+
from: {color: '#61B329', width: 1},
23+
to: {color: '#61B329', width: 4},
24+
25+
step: function (state, circle) {
26+
circle.path.setAttribute('stroke', state.color);
27+
circle.path.setAttribute('stroke-width', state.width);
28+
circle.setText('lvl ' + lvl);
29+
30+
}
31+
});
32+
bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
33+
bar.text.style.fontSize = '2rem';
34+
35+
bar.animate(exp);
36+
37+
$($('#container').find('svg')[0]).hide();
38+
39+
};
40+
41+
842
var getAllEmployeeDetails = function () {
943

1044
var req = {
@@ -19,9 +53,10 @@ angular.module('jobzz')
1953
$http(req).then(function (response) {
2054
$scope.employee = response.data;
2155
$scope.employee.picture = userProfilePictureService.employeeProfilePicture(response.data.picture);
56+
calculateLvl();
2257

2358
}, function () {
24-
console.log('Fail');
59+
// Empty
2560
});
2661

2762
};
@@ -45,7 +80,7 @@ angular.module('jobzz')
4580
});
4681

4782
}, function () {
48-
console.log('Fail');
83+
// Empty
4984
});
5085

5186
};

src/main/webapp/scripts/directives/starRating.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
restrict: 'EA',
77
template: '<ul class="star-rating" ng-class="{readonly: readonly}">' +
88
' <li ng-repeat="star in stars" class="star" ng-class="{filled: star.filled}" ng-click="toggle($index)">' +
9-
' <i class="fa fa-star">&#9733</i>' +
9+
' <i class="fa fa-star" aria-hidden="true"></i>' +
1010
' </li>' +
1111
'</ul>',
1212
scope: {

src/main/webapp/styles/employer.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ div.home-employer {
150150
border-color: #5cb85c;
151151
}
152152

153-
#container {
153+
#container,
154+
#container1 {
154155
width: 100px;
155156
height: 100px;
156157
position: relative;

src/main/webapp/views/employee/employerProfile.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<br/>
1111
<span class="md-subhead"><b>Phone Number : </b> <br/> {{employer.phoneNumber}}</span>
1212
<br/>
13-
<span class="md-subhead"><b>Reputation : </b> {{employer.reputation}}</span>
13+
<span class="md-subhead">
14+
<div id="container1"></div>
15+
</span>
1416
</md-card-title-text>
1517
<md-card-title-media>
1618
<div class="md-media-lg">
@@ -32,7 +34,7 @@
3234
<md-list flex>
3335
<md-list-item class="md-3-line" ng-repeat="response in responses">
3436
<div class="md-list-item-text md-list-item-padding">
35-
<h4><b>{{response.employerFullName}}</b></h4>
37+
<h4><b>{{response.employeeFullName}}</b></h4>
3638
<h4><b>Date : </b> {{response.review.date}}</h4>
3739
<p><b>Comment : </b> {{response.review.comment}}</p>
3840
</div>

0 commit comments

Comments
 (0)