Skip to content

Commit

Permalink
Merge pull request #374 from phuonghuynh/master
Browse files Browse the repository at this point in the history
Update changes
  • Loading branch information
phuonghuynh committed Aug 26, 2015
2 parents 3f056a9 + 9193a8a commit 798b3d6
Show file tree
Hide file tree
Showing 14 changed files with 428 additions and 405 deletions.
681 changes: 338 additions & 343 deletions src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import freemarker.template.Template;
import org.apache.commons.lang3.StringUtils;
import org.dozer.Mapper;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.*;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
import org.joda.time.DateTime;
Expand Down Expand Up @@ -235,22 +234,23 @@ public Long countJob(JobListingCriteria criteria) {
private NativeSearchQueryBuilder getJobListingQueryBuilder(JobListingCriteria criteria) {
NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder().withTypes("job");

QueryBuilder queryBuilder = null;
if (StringUtils.isEmpty(criteria.getKeyword()) && StringUtils.isEmpty(criteria.getLocation())) {
searchQueryBuilder.withQuery(matchAllQuery());
queryBuilder = matchAllQuery();
} else {
BoolQueryBuilder queryBuilder = boolQuery();
queryBuilder = boolQuery();

if (StringUtils.isNotEmpty(criteria.getKeyword())) {
queryBuilder.must(queryString(criteria.getKeyword()));
((BoolQueryBuilder)queryBuilder).must(queryString(criteria.getKeyword()));
}

if (StringUtils.isNotEmpty(criteria.getLocation())) {
queryBuilder.must(matchQuery("location", criteria.getLocation()));
((BoolQueryBuilder)queryBuilder).must(matchQuery("location", criteria.getLocation()));
}

searchQueryBuilder.withQuery(queryBuilder);
}

searchQueryBuilder.withQuery(filteredQuery(queryBuilder, FilterBuilders.rangeFilter("createdDateTime").from("now-30d/d")));
searchQueryBuilder.withSort(SortBuilders.fieldSort("salary").missing("_last"));
searchQueryBuilder.withSort(SortBuilders.fieldSort("createdDateTime").order(SortOrder.DESC));
searchQueryBuilder.withPageable(new PageRequest(criteria.getPage() - 1, NUMBER_OF_ITEMS_PER_PAGE));
return searchQueryBuilder;
Expand Down
3 changes: 0 additions & 3 deletions src/main/webapp/assets/modules/common/apiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ techlooper.factory("apiService", function ($rootScope, $location, jsonValue, $ht
$('.loading-data').css("height", $(window).height());
$('body').addClass('noscroll');
utils.sendNotification(jsonValue.notifications.loading);
//localStorageService.set("lastFoot", $location.url());
utils.sendNotification(jsonValue.notifications.loading);
instance.getFBLoginUrl().success(function (url) {
//localStorageService.set("lastFoot", $location.url());
localStorageService.set("joinNow", true);
window.location = url;
});
Expand Down
17 changes: 17 additions & 0 deletions src/main/webapp/assets/modules/common/joinNowSerivce.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
techlooper.factory("joinNowService", function(apiService, localStorageService) {

var from = localStorageService.get("joinForm");
var id = localStorageService.get("id");
switch (from) {
case "webinar":

break;
}

localStorageService.remove("joinForm");
localStorageService.remove("id");

return {
initialize: function() {}
}
});
14 changes: 7 additions & 7 deletions src/main/webapp/assets/modules/common/securityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util
};
return apiService.login(auth)
.success(function (data, status, headers, config) {
instance.getCurrentUser().success(function () {
instance.getCurrentUser().then(function () {
instance.routeByRole();
});
});
Expand Down Expand Up @@ -124,12 +124,12 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util
$rootScope.$on("$routeChangeSuccess", function (event, next, current) {
var fromLastPrint = localStorageService.get("lastFoot");
if (fromLastPrint) {
var uiView = utils.getUiView();
var roles = uiView.roles || [];
if (roles.length == 0) {
localStorageService.remove("lastFoot");
return $location.url(fromLastPrint);
}
// //var uiView = utils.getUiView();
// //var roles = uiView.roles || [];
// //if (roles.length == 0) {
// // localStorageService.remove("lastFoot");
// // return $location.url(fromLastPrint);
// //}
return event.preventDefault();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h2 class="text-left">{{webinar.name}}</h2>
<p translate="thereAreGoing" translate-value-number="{{'20'}}"></p>
</div>
<div class="join-with-facebook">
<a href="" translate="joinWithFacebook"></a>
<a href="" translate="joinWithFacebook" ng-click=""></a>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
techlooper.controller("eventDetailsController", function ($scope, apiService, $routeParams) {
techlooper.controller("eventDetailsController", function ($scope, apiService, $routeParams, joinNowService, localStorageService) {


var parts = $routeParams.id.split("-");
Expand All @@ -7,9 +7,13 @@ techlooper.controller("eventDetailsController", function ($scope, apiService, $r

apiService.findWebinarById(webinarId)
.success(function(webinar) {
console.log(webinar);
$scope.webinar = webinar;

});

$scope.joinNow = function() {
localStorageService.set("joinForm", "webinar");
localStorageService.set("id", webinarId);
apiService.joinNowByFB();
}
});

1 change: 0 additions & 1 deletion src/main/webapp/assets/modules/home-page/homeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ techlooper.controller("homeController", function ($scope, securityService, apiSe
$scope.homePage.termStatistic.logo = "images/" + $.grep(jsonValue.technicalSkill, function (skill) {
return skill.term == $scope.homePage.termStatistic.term;
})[0].logo;
console.log($scope.homePage);
});

$timeout(function () {
Expand Down
64 changes: 31 additions & 33 deletions src/main/webapp/assets/modules/job-listing/job-listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,50 +63,48 @@ <h2 translate="ItJobHub"></h2>
<div class="job-item" ng-show="jobs.length == 0">
<p translate="noData"></p>
</div>
<div class="hot-jobs">
<div class="job-item" ng-repeat="job in jobs | filter:{ techlooperJobType: '1' }">
<div class="left-content">
<h4><a href="/#/?action=redirectJA&targetUrl={{job.url}}" target="_blank">{{job.title}}</a></h4>
<ul class="info">
<li class="date"><i class="fa fa-calendar"></i>{{job.postedOn}}</li>
<li class="location"><i class="fa fa-map-marker"></i>{{job.location}}</li>
</ul>
<p><i class="fa fa-money"></i><span translate="salary"></span>:
<strong ng-show="!job.salary">{{'negotiable' | translate}}</strong>
<strong>{{job.salary}}</strong></p>
<div class="skills-list">
<ul>
<li ng-repeat="skill in job.skills">
<div class="job-item hot-job" ng-repeat="job in jobs | filter:{ techlooperJobType: '1' }">
<div class="left-content">
<h4><a href="/#/?action=redirectJA&targetUrl={{job.url}}" target="_blank">{{job.title}}</a></h4>
<ul class="info">
<li class="date"><i class="fa fa-calendar"></i>{{job.postedOn}}</li>
<li class="location"><i class="fa fa-map-marker"></i>{{job.location}}</li>
</ul>
<p><i class="fa fa-money"></i><span translate="salary"></span>:
<strong ng-show="!job.salary">{{'negotiable' | translate}}</strong>
<strong>{{job.salary}}</strong></p>
<div class="skills-list">
<ul>
<li ng-repeat="skill in job.skills">
<span class="left">
<span class="right">
<i>{{skill.skillName}}</i>
</span>
</span>
</li>
</ul>
</div>
<div class="offers-list">
<p class="offers">
<i class="fa fa-fw fa-gift blue"></i><span translate="whatDoWeOffer" ></span>
</p>
<ul>
<li ng-repeat="offer in job.benefits" show-hide-benefits>
<i class="fa fa-fw {{jsonValue.benefitIconsMap[offer.benefitId].iconClass}}"></i>
{{offer.benefitValue}}
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="right-content">
<div class="offers-list">
<p class="offers">
<i class="fa fa-fw fa-gift blue"></i><span translate="whatDoWeOffer" ></span>
</p>
<ul>
<li>{{job.company}}</li>
<li>
<img ng-src="{{job.logoUrl}}" alt="" ng-show="job.logoUrl.length"/>
<li ng-repeat="offer in job.benefits" show-hide-benefits>
<i class="fa fa-fw {{jsonValue.benefitIconsMap[offer.benefitId].iconClass}}"></i>
{{offer.benefitValue}}
</li>
<li><a href="/#/?action=redirectJA&targetUrl={{job.url}}" target="_blank" translate="viewDetails"></a></li>
</ul>
</div>
</div>
<div class="right-content">
<ul>
<li>{{job.company}}</li>
<li>
<img ng-src="{{job.logoUrl}}" alt="" ng-show="job.logoUrl.length"/>
</li>
<li><a href="/#/?action=redirectJA&targetUrl={{job.url}}" target="_blank" translate="viewDetails"></a></li>
</ul>
</div>
</div>
<div class="job-item" ng-repeat="job in jobs | filter:{ techlooperJobType: '0' }">
<div class="left-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ techlooper.controller("jobListingController", function (apiService, $scope, vnwC
$scope.totalJob = response.totalJob;
$scope.page = response.page;
$scope.jobs = response.jobs;
console.log($scope.jobs);
});
} else {
var searchParams = searchText.split("+");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
techlooper.controller("loadingBoxController", function (utils, jsonValue, $scope) {
techlooper.controller("loadingBoxController", function (utils, jsonValue, $scope, localStorageService, $location) {
utils.sendNotification(jsonValue.notifications.loading, $(window).height());

$scope.$on('$destroy', function () {
utils.sendNotification(jsonValue.notifications.loaded);
});

var joinNow = localStorageService.get("joinNow");
if (joinNow == true) {
var fromLastPrint = localStorageService.get("lastFoot");
localStorageService.remove("lastFoot");
return $location.url(fromLastPrint);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -693,5 +693,5 @@
"address": "Address",
"companyProfile": "Company Profile",
"attendantsLabel": "Attendant(s)",
"eventsTitle": "Let's HangOut 'cause WE are AWESOME when getting TOGETHER"
"eventsTitle": "Let's Hang Out 'cause WE are AWESOME when getting TOGETHER"
}
8 changes: 4 additions & 4 deletions src/main/webapp/assets/modules/translation/messages_vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,15 +682,15 @@
"postAnEvent": "Tạo Sự Kiện",
"webinar": "Webinar",
"allEvents": "Tất cả Sự Kiện",
"whatDoWeOffer": "what do we offer?",
"whatDoWeOffer": "Phúc lợi công ty",
"cannotInPast": "Trường này không được ở quá khứ.",
"register": "Đăng Ký",
"upcomingEvents": "Sự Kiện Sắp Diễn Ra",
"viewMoreEvents": "Các Sự Kiện Khác",
"tellYourFriends": "Tell Your Friends",
"joinWithFacebook": "Join With Facebook",
"tellYourFriends": "Chia Sẻ Tới Bạn Bè",
"joinWithFacebook": "Tham Gia Ngay Với Facebook",
"address": "Address",
"companyProfile": "Company Profile",
"companyProfile": "Sơ Lược Về Công Ty",
"attendantsLabel": "Người tham gia",
"eventsTitle": "Hãy cùng Gặp Gỡ và Giao Lưu thông qua các Sự Kiện Trực Tuyến"
}
5 changes: 5 additions & 0 deletions src/main/webapp/assets/sass/job-listing.sass
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@
max-width: 100px
.job-item:first-child
border-top: 0
.job-item.hot-job
border-top: 1px solid #9fd1ee
border-left: 1px solid #9fd1ee
border-right: 1px solid #9fd1ee
background-color: #f3fafe
.hot-jobs
display: inline-block
clear: both
Expand Down

0 comments on commit 798b3d6

Please sign in to comment.