Skip to content

Commit

Permalink
Merge pull request #400 from phuonghuynh/master
Browse files Browse the repository at this point in the history
Update changes
  • Loading branch information
phuonghuynh committed Sep 10, 2015
2 parents 3e01422 + f2f4bb0 commit 3cae425
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public WebinarInfoDto createWebinarInfo(WebinarInfoDto webinarInfoDto, UserProfi
event.setEnd(new EventDateTime().setDateTime(new DateTime(endDate.toString())));

Set<UserProfileDto> webinarAttendees = webinarInfoDto.getAttendees();
webinarAttendees.add(organiser);

EventAttendee[] attendees = webinarAttendees.stream()
.map(attEmail -> new EventAttendee().setEmail(attEmail.getEmail()))
Expand All @@ -107,12 +108,10 @@ public WebinarInfoDto createWebinarInfo(WebinarInfoDto webinarInfoDto, UserProfi

event = googleCalendar.events().insert(googleSocialConfig.getCalendarId(), event).setSendNotifications(true).execute();

webinarAttendees.remove(organiser);//Remove organiser
WebinarEntity entity = dozerMapper.map(webinarInfoDto, WebinarEntity.class);
entity.setCalendarInfo(dozerMapper.map(event, CalendarInfo.class));

entity.setOrganiser(organiser);

webinarAttendees.remove(organiser);//Remove organiser
entity = webinarRepository.save(entity);
return dozerMapper.map(entity, WebinarInfoDto.class);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/production/logback.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ new File(LOG_FOLDER).mkdirs()
appender("ALL", RollingFileAppender) {
file = "${LOG_FOLDER}/techlooper-all.log"
rollingPolicy(FixedWindowRollingPolicy) {
fileNamePattern = "techlooper-all_%i.log"
fileNamePattern = "${LOG_FOLDER}/techlooper-all_%i.log"
minIndex = 1
maxIndex = 100
}
Expand All @@ -34,7 +34,7 @@ appender("ALL", RollingFileAppender) {
appender("SPRING", RollingFileAppender) {
file = "${LOG_FOLDER}/techlooper-spring-all.log"
rollingPolicy(FixedWindowRollingPolicy) {
fileNamePattern = "techlooper-spring-all_%i.log"
fileNamePattern = "${LOG_FOLDER}/techlooper-spring-all_%i.log"
minIndex = 1
maxIndex = 100
}
Expand All @@ -49,7 +49,7 @@ appender("SPRING", RollingFileAppender) {
appender("ERROR", RollingFileAppender) {
file = "${LOG_FOLDER}/techlooper-error.log"
rollingPolicy(FixedWindowRollingPolicy) {
fileNamePattern = "techlooper-error_%i.log"
fileNamePattern = "${LOG_FOLDER}/techlooper-error_%i.log"
minIndex = 1
maxIndex = 100
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/staging/logback.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ new File(LOG_FOLDER).mkdirs()
appender("ALL", RollingFileAppender) {
file = "${LOG_FOLDER}/techlooper-all.log"
rollingPolicy(FixedWindowRollingPolicy) {
fileNamePattern = "techlooper-all_%i.log"
fileNamePattern = "${LOG_FOLDER}/techlooper-all_%i.log"
minIndex = 1
maxIndex = 12
}
Expand All @@ -34,7 +34,7 @@ appender("ALL", RollingFileAppender) {
appender("ERROR", RollingFileAppender) {
file = "${LOG_FOLDER}/techlooper-error.log"
rollingPolicy(FixedWindowRollingPolicy) {
fileNamePattern = "techlooper-error_%i.log"
fileNamePattern = "${LOG_FOLDER}/techlooper-error_%i.log"
minIndex = 1
maxIndex = 12
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/webapp/assets/images/braille-contest-infographic-vi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/webapp/assets/images/braille-contest-infographic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 16 additions & 13 deletions src/main/webapp/assets/modules/common/listInputDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ techlooper.directive("listInput", function () {
organisers: "="
},

//TODO refactor organiser attribute
link: function (scope, element, attr, ctrl) {
scope.ngModel = scope.ngModel || [];
//scope.organisers = scope.organisers || [];
//scope.ngModel = $.merge(scope.ngModel, scope.organisers);
//var oriItems = angular.copy(scope.ngModel);


Expand Down Expand Up @@ -43,19 +46,19 @@ techlooper.directive("listInput", function () {
// return modelValue.length > 0;
//};

scope.status = function (type) {
switch (type) {
case "organiser":
var item = arguments[1];
return $.inArray(item, oriItems) > -1;

case "attendee":
var item = arguments[1];
return !scope.status("organiser", item)
}

return false;
}
//scope.status = function (type) {
// switch (type) {
// case "organiser":
// var item = arguments[1];
// return $.inArray(item, oriItems) > -1;
//
// case "attendee":
// var item = arguments[1];
// return !scope.status("organiser", item)
// }
//
// return false;
//}
}
}
});
28 changes: 9 additions & 19 deletions src/main/webapp/assets/modules/common/securityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util
})
.error(function () {
if ($rootScope.currentUiView && $rootScope.currentUiView.loginUrl) {
$location.path($rootScope.currentUiView.loginUrl);
$location.url($rootScope.currentUiView.loginUrl);
}
else {
$location.url("/");
}
utils.sendNotification(jsonValue.notifications.loaded);
});
Expand All @@ -66,26 +69,11 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util
utils.sendNotification(jsonValue.notifications.loaded);
var lastFoot = localStorageService.get("lastFoot");
var uiView = utils.getUiView(lastFoot);
var roles = uiView.roles || [];
//if (lastFoot) {
// if (!uiView.ignoreIfLastFoot) {
// return $location.url(lastFoot);
// }
//}

if (lastFoot && !uiView.ignoreIfLastFoot) {
return $location.url(lastFoot);
}

//if (lastFoot && !uiView.ignoreIfLastFoot) {
// return $location.url(lastFoot);
//}


//if (roles.length == 0) {
// return $location.url(lastFoot);
//}

switch ($rootScope.userInfo.roleName) {
case "EMPLOYER":
return $location.url("/employer-dashboard");
Expand All @@ -97,15 +85,15 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util

initialize: function () {
$rootScope.$on("$locationChangeSuccess", function (event, next, current) {
$rootScope.currentUiView = utils.getUiView();
if ($rootScope.currentUiView.name == "rootPage") {
var uiView = utils.getUiView();
if (uiView.name == "rootPage") {
return false;
}

var param = $location.search();
var notHasParam = !$.isEmptyObject(param);

var isSignInView = $rootScope.currentUiView.type == "LOGIN";
var isSignInView = uiView.type == "LOGIN";
var notSignedIn = !$rootScope.userInfo && isSignInView;
if (notSignedIn && notHasParam) {// should keep last print
localStorageService.set("lastFoot", $location.url());
Expand All @@ -115,6 +103,7 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util
});

$rootScope.$on("$routeChangeSuccess", function (event, next, current) {
$rootScope.currentUiView = utils.getUiView();
var isSignInView = $rootScope.currentUiView.type == "LOGIN";
var priorFoot = localStorageService.get("priorFoot");
if (isSignInView) {
Expand All @@ -137,6 +126,7 @@ techlooper.factory("securityService", function (apiService, $rootScope, $q, util
return false;
}

//$rootScope.currentUiView = utils.getUiView();
if (roles.length > 0) {//is protected pages
instance.getCurrentUser().error(function (userInfo) {
return $location.url(uiView.loginUrl);
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/assets/modules/common/vnwConfigService.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ techlooper.factory("vnwConfigService", function (jsonValue, $translate, $rootSco
"lang_en": "10-24"
},
{
"companySize_id": "2",
"companySize_id": "3",
"lang_vn": "25-99",
"lang_en": "25-99"
},
Expand Down

0 comments on commit 3cae425

Please sign in to comment.