Skip to content

Commit

Permalink
Merge pull request #378 from phuonghuynh/master
Browse files Browse the repository at this point in the history
Update changes
  • Loading branch information
phuonghuynh committed Aug 27, 2015
2 parents 24ae286 + 94b6dfe commit 5dff2f9
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 51 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ module.exports = function (grunt) {
publicDirs: ["<%=pkg.public%>css"],
blockReplacements: {
js: function (block) {
return '<script src="' + block.dest + "?v=" + timestamp + '" charset="utf-8"></script>';//'<link rel="stylesheet" href="' + block.dest + '">';
return '<script src="' + block.dest.replace(".min.js", "") + "-" + timestamp + '.js" charset="utf-8"></script>';//'<link rel="stylesheet" href="' + block.dest + '">';
},
css: function (block) {
return '<link rel="stylesheet" href="' + block.dest + "?v=" + timestamp + '">';//'<link rel="stylesheet" href="' + block.dest + '">';
return '<link rel="stylesheet" href="' + block.dest.replace(".min.css", "") + "-" + timestamp + '.css">';//'<link rel="stylesheet" href="' + block.dest + '">';
}
}
}
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/com/techlooper/service/impl/WebinarServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Collection<WebinarInfoDto> findAvailableWebinars() {
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
.withIndices("techlooper").withTypes("webinar")
.withSort(SortBuilders.fieldSort("startDate").order(SortOrder.ASC))
.withFilter(FilterBuilders.rangeFilter("startDate").from("now"));
.withFilter(FilterBuilders.rangeFilter("startDate").from(org.joda.time.DateTime.now().toString("dd/MM/yyyy hh:mm a")));

List<WebinarInfoDto> webinarInfoDtos = new ArrayList<>();
int pageIndex = 0;
Expand All @@ -109,7 +109,10 @@ public Collection<WebinarInfoDto> findAvailableWebinars() {
public List<WebinarInfoDto> listUpcomingWebinar() {
List<WebinarInfoDto> upcomingWebinars = new ArrayList<>();
NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder().withTypes("webinar");
searchQueryBuilder.withQuery(QueryBuilders.rangeQuery("startDate").from("now"));

searchQueryBuilder.withQuery(QueryBuilders.rangeQuery("startDate")
.from(org.joda.time.DateTime.now().toString("dd/MM/yyyy hh:mm a")));

searchQueryBuilder.withSort(SortBuilders.fieldSort("startDate").order(SortOrder.DESC));
searchQueryBuilder.withPageable(new PageRequest(0, 4));

Expand Down Expand Up @@ -154,4 +157,10 @@ public WebinarInfoDto joinWebinar(JoinBySocialDto joinBySocialDto) throws IOExce
}
return dozerMapper.map(webinarRepository.save(webinar), WebinarInfoDto.class);
}

// public static void main(String[] ar) {
//// DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("dd/MM/yyyy hh:mm a");
// org.joda.time.DateTime now = org.joda.time.DateTime.now();
// System.out.println(org.joda.time.DateTime.now().toString("dd/MM/yyyy hh:mm a"));
// }
}
36 changes: 4 additions & 32 deletions src/main/webapp/assets/modules/common/securityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,15 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util

var instance = {
logout: function () {

var view = utils.getView();
switch (view) {
case jsonValue.views.freelancerPostProject:
case jsonValue.views.employerDashboard:
case jsonValue.views.postChallenge:
case jsonValue.views.createEvent:
break;

default:
localStorageService.set("lastFoot", $location.path());
break;
}

apiService.logout()
.success(function (data, status, headers, config) {
$.removeCookie("JSESSIONID");
localStorageService.remove("social");
$rootScope.userInfo = undefined;

switch (view) {
case jsonValue.views.freelancerPostProject:
case jsonValue.views.employerDashboard:
case jsonValue.views.postChallenge:
case jsonValue.views.createEvent:
break;

default:
var lastFoot = localStorageService.get("lastFoot");
if (lastFoot) {
return $location.url(lastFoot);
}
var roles = $rootScope.currentUiView.roles || [];
if (roles.length > 0) {
$location.path("/");
}

return $location.path("/");
})
.finally(function () {localStorageService.remove("lastFoot");});
});
},

getCurrentUser: function (type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h4><a href="/#/?action=redirectJA&targetUrl={{job.url}}" target="_blank">{{job.
<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>
<li ng-repeat="offer in job.benefits">
<i class="fa fa-fw {{jsonValue.benefitIconsMap[offer.benefitId].iconClass}}"></i>
{{offer.benefitValue}}
</li>
Expand Down
20 changes: 11 additions & 9 deletions src/main/webapp/assets/modules/job-listing/jobListingController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ techlooper.controller("jobListingController", function (apiService, $scope, vnwC

var searchText = $routeParams.searchText;

var capitalizeWords = function capitalizeWords(str) {
if (str) {
str = str.replace(/-/g, ' ');
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
return "";
}

if (!searchText) {
apiService.listAllJobs().success(function(response) {
utils.sendNotification(jsonValue.notifications.loading, $(window).height());
Expand Down Expand Up @@ -128,15 +138,7 @@ techlooper.controller("jobListingController", function (apiService, $scope, vnwC
return result;
}

capitalizeWords : function capitalizeWords(str) {
if (str) {
str = str.replace(/-/g, ' ');
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
return "";
}

$timeout(function () {
$('p.offers').on("click", function(){
$(this).next().toggleClass( "show", 1000);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
techlooper.controller("loadingBoxController", function (utils, jsonValue, $scope, localStorageService, $location) {
techlooper.controller("loadingBoxController", function (utils, jsonValue, $scope, localStorageService, $location, utils) {
utils.sendNotification(jsonValue.notifications.loading, $(window).height());

$scope.$on('$destroy', function () {
Expand All @@ -8,6 +8,10 @@ techlooper.controller("loadingBoxController", function (utils, jsonValue, $scope
var joinNow = localStorageService.get("joinNow");
if (joinNow == true) {
var fromLastPrint = localStorageService.get("lastFoot");
return $location.url(fromLastPrint);
var roles = utils.getUiView(fromLastPrint).roles || [];// $rootScope.currentUiView.roles || [];
if (roles.length == 0) {
return $location.url(fromLastPrint);
}
}

});
3 changes: 2 additions & 1 deletion src/main/webapp/assets/modules/translation/messages_vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@
"viewMoreEvents": "Các Sự Kiện Khác",
"tellYourFriends": "Chia Sẻ Tới Bạn Bè",
"joinWithFacebook": "Tham Gia Ngay Với Facebook",
"address": "Address",
"thereAreGoing": "Có <strong>{{number}}</strong> người tham dự",
"address": "Địa chỉ",
"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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
techlooper.controller("userTypeController", function ($scope, $rootScope, securityService) {

//if ($rootScope.userInfo) {
// securityService.routeByRole();
//}
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/assets/sass/events.sass
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@
text-align: left
float: left
width: auto
width: 87%
width: 85%
span.title
color: #808080
text-align: right
padding-left: 0
width: 13%
width: 15%

0 comments on commit 5dff2f9

Please sign in to comment.