Skip to content

Commit

Permalink
Merge commit '9c2b4b5ad81a153351ec35d2fd908fabaebad4cc'
Browse files Browse the repository at this point in the history
  • Loading branch information
phuonghuynh committed Aug 26, 2015
2 parents 45c2611 + 9c2b4b5 commit 9193a8a
Show file tree
Hide file tree
Showing 7 changed files with 388 additions and 389 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
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
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 9193a8a

Please sign in to comment.