Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 27640c6

Browse files
author
Parth Shah
committed
fixes ordering of skills
1 parent 7414a59 commit 27640c6

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

app/directives/skill-tile/skill-tile.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
a(ng-click="enableHide && toggle()")
1+
a(ng-click="enableHide && toggle()", ng-class="{'hidden': skill.hidden, 'new': skill.isNew}")
22

33
.skill-icon(ng-switch="skill.category")
44
img(ng-switch-when="DEVELOP", ng-src="{{ASSET_PREFIX}}images/skills/id-{{skill.tagId}}.svg", fallback-src="/images/skills/id-develop.svg")

app/settings/edit-profile/edit-profile.controller.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
angular.module('tc.settings').controller('EditProfileController', EditProfileController);
55

66

7-
EditProfileController.$inject = ['userData', 'userHandle', 'ProfileService', 'ExternalAccountService', '$log', 'ISO3166', 'ImageService', '$rootScope', 'CONSTANTS', 'TagsService'];
7+
EditProfileController.$inject = ['userData', 'userHandle', 'ProfileService', 'ExternalAccountService', '$log', 'ISO3166', 'ImageService', '$rootScope', 'CONSTANTS', 'TagsService', 'toaster'];
88

9-
function EditProfileController(userData, userHandle, ProfileService, ExternalAccountService, $log, ISO3166, ImageService, $rootScope, CONSTANTS, TagsService) {
9+
function EditProfileController(userData, userHandle, ProfileService, ExternalAccountService, $log, ISO3166, ImageService, $rootScope, CONSTANTS, TagsService, toaster) {
1010
$log = $log.getInstance("EditProfileCtrl");
1111
var vm = this;
1212
vm.toggleTrack = toggleTrack;
@@ -52,7 +52,9 @@
5252

5353
ProfileService.getUserSkills(vm.userData.handle)
5454
.then(function(skills) {
55-
vm.skills = skills.skills;
55+
vm.skills = _.map(skills.skills, function(el) {
56+
return _.extend({}, el, {isNew: 0});
57+
});
5658
})
5759
.catch(function(err) {
5860
$log.error(JSON.stringify(err));
@@ -66,7 +68,9 @@
6668
// find the new skill in response object and inject it into our existing list.
6769
// we dont want to replace the entire object / map because we will lose hidden tags
6870
var newSkill = _.find(resp.skills, {tagId: skillTagId});
71+
newSkill.isNew = new Date().getTime();
6972
vm.skills.push(newSkill);
73+
toaster.pop("success", "Success!", "Skill added.");
7074
});
7175
}
7276
}

app/settings/edit-profile/edit-profile.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
)
7676

7777
.list
78-
.skill(ng-repeat="skill in vm.skills | orderBy:'-score'")
78+
.skill(ng-repeat="skill in vm.skills | orderBy:'-score' | orderBy:'-isNew'")
7979
skill-tile(skill="skill" enable-hide="true")
8080

8181
.settings-section.links

assets/css/directives/skill-tile.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
@import '../partials/combined';
12
skill-tile {
23
display: flex;
34
flex-direction: column;
45
align-items: center;
56
justify-content: flex-start;
67
text-align: center;
7-
height: 120px;
8-
width: 80px;
8+
height: 130px;
9+
width: 100px;
910
.skill-icon {
1011
display: flex;
1112
flex-direction: column;
@@ -21,18 +22,21 @@ skill-tile {
2122
height: 45px;
2223
width: 45px;
2324
}
25+
&.new {
26+
background-color: #85CCFF;
27+
border: 1px solid #F2FAFF;
28+
}
2429
}
2530
.name {
2631
font-family: 'Sofia Pro';
2732
font-weight: 300;
2833
text-align: center;
2934
margin-top: 10px;
3035
font-size: 12px;
31-
}
32-
.hidden {
33-
font-family: 'Sofia Pro';
34-
font-size: 10px;
35-
text-transform: uppercase;
36+
&.hidden {
37+
@include sofia-pro-light;
38+
text-decoration: line-through;
39+
}
3640
}
3741
@media (min-width: 768px) {
3842
width: 100px;

0 commit comments

Comments
 (0)