Skip to content

Commit

Permalink
Merge pull request #433 from phuonghuynh/master
Browse files Browse the repository at this point in the history
Update changes
  • Loading branch information
phuonghuynh committed Oct 14, 2015
2 parents 677a5b9 + caa14ae commit f8efeaf
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,7 @@ public boolean checkIfChallengeRegistrantExist(Long challengeId, String email) {
NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder();
searchQueryBuilder.withQuery(boolQuery()
.must(matchPhraseQuery("registrantEmail", email))
.must(termQuery("challengeId", challengeId))
.must(termQuery("mailSent", true)));
.must(termQuery("challengeId", challengeId)));

long total = challengeRegistrantRepository.search(searchQueryBuilder.build()).getTotalElements();
return (total > 0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/assets/modules/_appStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ techlooper.run(function (connectionFactory, loadingBoxFactory, cleanupFactory, u
localStorageService.set("email", param.email);
break;


case "loginBySocial":
securityService.login(param.code, param.social, param.social);
break;

case "redirectJA":
console.log("redirect");
window.location.href = param.targetUrl;
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ techlooper.directive("submissionChallenge", function (localStorageService, apiSe
var lastName = localStorageService.get("lastName");
var email = localStorageService.get("email");

apiService.joinContest(challengeId, firstName, lastName, email, $translate.use())
.success(function() {
//apiService.joinContest(challengeId, firstName, lastName, email, $translate.use())
// .success(function() {
scope.challenge.visibleSubmitForm = true;
});
//});
scope.challenge.mixed = true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
</form>
</div>
<div class="mail-text h-200">
<div class="mail-text h-200" ng-controller="feedbackCtrl">
<summernote ng-model="feedbackContent" focus config="options"></summernote>
<div class="send-mail-error" ng-show="!composeEmail.error" data-ng-init="composeEmail.error = true">
<p translate="cannotSendMail"></p>
Expand Down
37 changes: 17 additions & 20 deletions src/main/webapp/assets/modules/common/email/popupEmailDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,22 @@ techlooper.directive("popupEmail", function () {
composeEmail: "="
},
link: function (scope, element, attr, ctrl) {
scope.options = {
height: 150,
focus: true,
airMode: true,
toolbar: [
['edit',['undo','redo']],
['headline', ['style']],
['style', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],
['fontface', ['fontname']],
['textsize', ['fontsize']],
['fontclr', ['color']],
['alignment', ['ul', 'ol', 'paragraph', 'lineheight']],
['height', ['height']],
['table', ['table']],
['insert', ['link','hr']],
['view', ['fullscreen', 'codeview']],
['help', ['help']]
]
};
}
}
});
}).controller('feedbackCtrl', function($scope) {
$scope.options = {
height: 150,
toolbar: [
['headline', ['style']],
['fontface', ['fontname']],
['textsize', ['fontsize']],
['style', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],
['fontclr', ['color']],
['alignment', ['ul', 'ol', 'paragraph', 'lineheight']],
['height', ['height']],
['table', ['table']],
['insert', ['link','hr']],
['view', ['fullscreen', 'codeview']]
]
};
});;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
</form>
</div>
<div class="mail-text h-200">
<div class="mail-text h-200" ng-controller="summernoteCtrl">
<summernote ng-model="feedbackContent" focus config="options"></summernote>
<div class="send-mail-error" ng-show="!composeEmail.error" data-ng-init="composeEmail.error = true">
<p translate="cannotSendMail"></p>
Expand Down
35 changes: 16 additions & 19 deletions src/main/webapp/assets/modules/common/feedback/feedbackDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ techlooper.directive("feedbackForm", function (apiService, $timeout) {
composeEmail: "="
},
link: function (scope, element, attr, ctrl, composeEmail) {
scope.options = {
height: 150,
focus: true,
airMode: true,
toolbar: [
['edit',['undo','redo']],
['headline', ['style']],
['style', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],
['fontface', ['fontname']],
['textsize', ['fontsize']],
['fontclr', ['color']],
['alignment', ['ul', 'ol', 'paragraph', 'lineheight']],
['height', ['height']],
['table', ['table']],
['insert', ['link','hr']],
['view', ['fullscreen', 'codeview']],
['help', ['help']]
]
};
if(scope.composeEmail.registrantLastName){
scope.composeEmail.names = scope.composeEmail.registrantFirstName + ' ' + scope.composeEmail.registrantLastName;
}else{
Expand Down Expand Up @@ -60,4 +41,20 @@ techlooper.directive("feedbackForm", function (apiService, $timeout) {
}
}
}
}).controller('summernoteCtrl', function($scope) {
$scope.options = {
height: 150,
toolbar: [
['headline', ['style']],
['fontface', ['fontname']],
['textsize', ['fontsize']],
['style', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],
['fontclr', ['color']],
['alignment', ['ul', 'ol', 'paragraph', 'lineheight']],
['height', ['height']],
['table', ['table']],
['insert', ['link','hr']],
['view', ['fullscreen', 'codeview']]
]
};
});
10 changes: 7 additions & 3 deletions src/main/webapp/assets/modules/common/securityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ techlooper.factory("securityService", function (apiService, $route, $rootScope,
logout: function () {
apiService.logout()
.success(function (data, status, headers, config) {
localStorageService.set("logout", true);
$rootScope.userInfo = undefined;
var roles = $rootScope.currentUiView.roles || [];
if (roles.length > 0) {
Expand Down Expand Up @@ -41,6 +42,7 @@ techlooper.factory("securityService", function (apiService, $route, $rootScope,
us: $.base64.encode(username),
pwd: $.base64.encode(password)
};
localStorageService.remove("logout");
return apiService.login(auth)
.success(function (data, status, headers, config) {
instance.getCurrentUser().then(function () {
Expand Down Expand Up @@ -132,9 +134,11 @@ techlooper.factory("securityService", function (apiService, $route, $rootScope,

if (!$rootScope.userInfo) instance.getCurrentUser();

$rootScope.$watch(function () {return $.cookie("JSESSIONID"); }, function () {
$rootScope.userInfo = undefined;
instance.getCurrentUser();
$rootScope.$watch(function () {return localStorageService.get("logout"); }, function () {
if (localStorageService.get("logout")) {
$rootScope.userInfo = undefined;
instance.getCurrentUser();
}
});
}
};
Expand Down
18 changes: 12 additions & 6 deletions src/main/webapp/assets/sass/contest-detail.sass
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,18 @@
padding: 10px 0
.control-label
color: #333
.mail-text .note-editor
background-color: #fff
min-height: 200px
.note-toolbar
background-color: #f3fafe
color: #333
.mail-text
a
color: #337ab7 !important
.form-group
margin: 0
padding: 0 20px
.note-editor
background-color: #fff
min-height: 200px
.note-toolbar
background-color: #f3fafe
color: #333
.note-editable
background-color: #fff
text-align: left
Expand Down
12 changes: 10 additions & 2 deletions src/main/webapp/assets/sass/dashboard.sass
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@
background-color: #f3fafe
h2
text-align: left
.mail-text .note-toolbar
padding: 10px
.mail-text
a
color: #337ab7 !important
.modal-dialog
top: 20px
.form-group
margin: 0
padding: 0 20px
.note-toolbar
padding: 10px
.note-editor
min-height: inherit
margin-bottom: 5px
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/assets/sass/z-responsive-candidate.sass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@media (min-width: 320px) and (max-width: 767px)
@media (min-width: 320px) and (max-width: 780px)
.body-content
padding-bottom: 0
.navbar
Expand Down Expand Up @@ -2112,7 +2112,8 @@
width: 100%
clear: both
padding-top: 10px
@media (min-width: 640px)

@media (max-width: 460px)
.rwd-table
margin: auto
td
Expand All @@ -2122,7 +2123,6 @@
display: table-cell
padding: 5px 10px
text-align: center
@media (max-width: 460px)
.sub-page-header
.logo-block img
max-width: 85% !important
Expand Down Expand Up @@ -2163,7 +2163,7 @@
ul li .select-group
float: left
width: 100%
@media (min-width: 768px) and (max-width: 999px)
@media (min-width: 780px) and (max-width: 999px)
.techlooper-homepage
.main-banner-block
.main-banner-content
Expand Down

0 comments on commit f8efeaf

Please sign in to comment.