From d9d2ef82765cdd67184e924bd999426dff72a9e3 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Fri, 2 Oct 2015 09:16:30 +0700 Subject: [PATCH 001/158] update translate --- src/main/webapp/assets/modules/translation/messages_vi.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/assets/modules/translation/messages_vi.json b/src/main/webapp/assets/modules/translation/messages_vi.json index 538c19022..bda671f95 100644 --- a/src/main/webapp/assets/modules/translation/messages_vi.json +++ b/src/main/webapp/assets/modules/translation/messages_vi.json @@ -754,5 +754,7 @@ "challengeIdeaTips": "Đây là ngày kết thúc giai đoạn Ý Tưởng của cuộc thi và thí sinh phải đề xuất ý tưởng trước ngày này. Nhà Tổ Chức sẽ phân loại, đánh giá và sắp xếp các ý tưởng. Các thí sinh với ý tưởng xuất sắc sẽ được lựa chọn để vào tiếp vòng trong.", "challengeUIUXTips":"Đây là ngày kết thúc giai đoạn UI/UX của cuộc thi và thí sinh phải nộp UI/UX mockup và/hay kết quả Kiểm Tra Khả Dụng (Usability Test) nếu được yêu cầu trước ngày này. Nhà Tổ Chức sẽ chịu trách nhiệm đánh giá UI/UX mockup và sẽ lựa chon các thí sinh với UI/UX mockup xuất sắc vào vòng tiếp theo.", "challengePrototypeTips":"Đây là ngày kết thúc giai đoạn Prototype của cuộc thi và thí sinh phải nộp Prototype trước ngày này. Nhà Tổ Chức sẽ chịu trách nhiệm đánh giá Prototype và sẽ lựa chon các thí sinh với Prototype xuất sắc vào vòng tiếp theo.", - "signInTitle": "Đăng nhập bằng chính tài khoản của bạn" + "signInTitle": "Đăng nhập bằng chính tài khoản của bạn", + "signInWithFaceBook": "Đăng nhập bằng Facebook", + "signInWithGooglePlus": "Đăng nhập bằng Google Plus" } From 81f727362addcac311cca528d61773bd685dcdfc Mon Sep 17 00:00:00 2001 From: Phuong H Date: Fri, 2 Oct 2015 11:44:59 +0700 Subject: [PATCH 002/158] Set logback level in production to Error --- src/main/resources/local/logback.groovy | 21 +++----------------- src/main/resources/production/logback.groovy | 8 ++++---- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/main/resources/local/logback.groovy b/src/main/resources/local/logback.groovy index 500e3fafb..9c759ef5e 100644 --- a/src/main/resources/local/logback.groovy +++ b/src/main/resources/local/logback.groovy @@ -11,29 +11,14 @@ import static ch.qos.logback.classic.Level.OFF scan() -def LOG_FOLDER = "./log/" - -new File(LOG_FOLDER).mkdirs() - -appender("ROOT_FILE", RollingFileAppender) { - file = "${LOG_FOLDER}techlooper-all.log" - rollingPolicy(TimeBasedRollingPolicy) { - fileNamePattern = "${LOG_FOLDER}%d{yyyyMMdd}-techlooper.log" - maxHistory = 30 - } - encoder(PatternLayoutEncoder) { - pattern = "%d{HH:mm:ss.SSS} %p [%t] %c{1}: %m%n" - } -} - appender("CONSOLE", ConsoleAppender) { encoder(PatternLayoutEncoder) { pattern = "%d{dd-MM-yyyy HH:mm:ss.SSS} %p [%t] %c{1}: %m%n" } } -logger("org.elasticsearch", ERROR) -logger("org.hibernate", ERROR) -logger("org.dozer", ERROR) +//logger("org.elasticsearch", ERROR) +//logger("org.hibernate", ERROR) +//logger("org.dozer", ERROR) root(DEBUG, ["CONSOLE"]) \ No newline at end of file diff --git a/src/main/resources/production/logback.groovy b/src/main/resources/production/logback.groovy index b35b913de..f481aa475 100644 --- a/src/main/resources/production/logback.groovy +++ b/src/main/resources/production/logback.groovy @@ -28,8 +28,8 @@ appender("ROOT_FILE", RollingFileAppender) { } } -logger("org.elasticsearch", ERROR) -logger("org.hibernate", ERROR) -logger("org.dozer", ERROR) +//logger("org.elasticsearch", ERROR) +//logger("org.hibernate", ERROR) +//logger("org.dozer", ERROR) -root(ALL, ["ROOT_FILE"]) \ No newline at end of file +root(ERROR, ["ROOT_FILE"]) \ No newline at end of file From 90ae8622d0edbb2963f77da7493bbc8d08649c4e Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Fri, 2 Oct 2015 11:48:08 +0700 Subject: [PATCH 003/158] fix bug font size for latest jobs on the personal home page --- src/main/webapp/assets/sass/main.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/webapp/assets/sass/main.sass b/src/main/webapp/assets/sass/main.sass index 14f3bb218..5d1761679 100644 --- a/src/main/webapp/assets/sass/main.sass +++ b/src/main/webapp/assets/sass/main.sass @@ -13,6 +13,9 @@ body position: relative height: auto font-size: 14px +h5 + font-size: 14px + font-weight: 500 div.breaking word-break: break-all input:invalid From 7ebda8535a11fa11c0aceab2a1128b27fac9bf53 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Mon, 5 Oct 2015 09:05:12 +0700 Subject: [PATCH 004/158] refactor and add submitsion for Challenge List page --- .../assets/modules/contests/contest-list.html | 40 +++++ .../modules/contests/contest.directive.js | 19 +++ .../assets/modules/contests/contests.con.js | 1 - .../assets/modules/contests/contests.tem.html | 61 ++------ src/main/webapp/assets/sass/contests.sass | 145 +++++++++++++++++- 5 files changed, 214 insertions(+), 52 deletions(-) create mode 100644 src/main/webapp/assets/modules/contests/contest-list.html create mode 100644 src/main/webapp/assets/modules/contests/contest.directive.js diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html new file mode 100644 index 000000000..e86876737 --- /dev/null +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -0,0 +1,40 @@ +
+
+
+ {{contest.challengeName}} + {{skill}} +
+
+

{{contest.startDateTime}}

+

{{contest.registrationDateTime}}

+

{{contest.submissionDateTime}}

+
+
+

${{contest.firstPlaceReward | number:0}}

+

${{contest.secondPlaceReward | number:0}}

+

${{contest.thirdPlaceReward | number:0}}

+
+
+ + +
+
+ {{contest.numberOfRegistrants}} +
+
+ + +
+
+
+
+ Johnson Pham +
+
+ phamthanhtrinh.vt@gmail.com +
+
+ +
+
+
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contests/contest.directive.js b/src/main/webapp/assets/modules/contests/contest.directive.js new file mode 100644 index 000000000..7c86f6131 --- /dev/null +++ b/src/main/webapp/assets/modules/contests/contest.directive.js @@ -0,0 +1,19 @@ +techlooper.directive('contestList', function () { + return { + restrict: "E", + replace: true, + templateUrl: "modules/contests/contest-list.html", + link: function (scope, el, attrs) { + scope.showSubmitForm = function(id){ + $('.submit-phase-contest').removeClass('show'); + var parent = $('#id-'+id); + var div = parent.find('.submit-phase-contest'); + if(div.hasClass('show')){ + div.removeClass('show'); + }else{ + div.addClass('show'); + } + } + } + }; +}); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contests/contests.con.js b/src/main/webapp/assets/modules/contests/contests.con.js index f94e8e0df..2cf2ff8ef 100644 --- a/src/main/webapp/assets/modules/contests/contests.con.js +++ b/src/main/webapp/assets/modules/contests/contests.con.js @@ -26,5 +26,4 @@ techlooper.controller('contestsController', function (apiService, $scope, jsonVa }).finally(function () { utils.sendNotification(jsonValue.notifications.loaded); }); - }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contests/contests.tem.html b/src/main/webapp/assets/modules/contests/contests.tem.html index 464fc713e..eb6a5ba2c 100644 --- a/src/main/webapp/assets/modules/contests/contests.tem.html +++ b/src/main/webapp/assets/modules/contests/contests.tem.html @@ -4,56 +4,17 @@

-
-
-
-

-
-
-
- - - - - - - - - - - - - - - - - - - - - -
-

{{contest.challengeName}}

- - {{skill}} - -
-

{{contest.startDateTime}}

-

{{contest.registrationDateTime}}

-

{{contest.submissionDateTime}}

-
-

${{contest.firstPlaceReward | number:0}}

-

${{contest.secondPlaceReward | number:0}}

-

${{contest.thirdPlaceReward | number:0}}

-
- - - - {{contest.numberOfRegistrants}} -

-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/assets/sass/contests.sass b/src/main/webapp/assets/sass/contests.sass index 29341c4f1..2f93705ed 100644 --- a/src/main/webapp/assets/sass/contests.sass +++ b/src/main/webapp/assets/sass/contests.sass @@ -118,4 +118,147 @@ text-align: center a display: block - text-align: center \ No newline at end of file + text-align: center + .contests-list-management + display: inline-block + clear: both + width: 100% + background-color: #fff + padding: 20px 0 + .challenge-name-col + width: 35% + float: left + height: 30px + text-align: left + a + font-weight: 500 + .challenge-timeline-col + width: 20% + float: left + height: 30px + text-align: center + .challenge-prize-col + width: 10% + float: left + height: 30px + text-align: center + .challenge-current-phase-col + width: 15% + float: left + height: 30px + text-align: center + .challenge-registrants-col + width: 10% + float: left + height: 30px + text-align: center + .challenge-actions-col + width: 10% + float: left + height: 30px + text-align: right + .contest-list-management-header + font-weight: 500 + font-size: 15px + width: 100% + clear: both + display: inline-block + border-bottom: 2px solid #337ab7 + padding: 0 20px + .contest-list-management-body + display: inline-block + clear: both + width: 100% + .contest-item-row + display: inline-block + clear: both + width: 100% + border-bottom: 1px solid #ddd + padding: 5px 20px + .challenge-name-col + height: auto + a + display: block + clear: both + width: 100% + span + display: inline-block + width: auto + background-color: #f4f4f4 + border: 1px solid #e6e5e5 + border-radius: 4px + color: #7b7b7b + font-size: 12px + padding: 1px 5px + text-transform: capitalize + margin-right: 4px + .challenge-timeline-col + height: auto + p + margin: 0 + padding: 0 + width: 100% + span + width: 80px + float: left + text-align: left + .challenge-prize-col + height: auto + p + margin: 0 + padding: 0 + .challenge-current-phase-col + height: auto + span + display: inline-block + width: auto + font-size: 12px + border-radius: 4px + padding: 2px 4px + span.not-started + background-color: #00bcd4 + color: #fff + span.registration + background-color: #f88568 + color: #fff + span.in-progress + background-color: #4caf50 + color: #fff + span.closed + background-color: #999999 + color: #fff + span.note + display: block + width: 100% + clear: both + border-radius: 0 + padding: 0 + .challenge-registrants-col + height: auto + font-weight: 500 + .challenge-actions-col + height: auto + a + display: inline-block + width: auto + clear: both + background-color: #337ab7 + border-radius: 4px + padding: 2px 8px + margin-bottom: 5px + color: #fff + .submit-phase-contest + height: 0px + transition: height 1s + overflow: hidden + width: 100% + display: inline-block + border-radius: 4px + margin-top: 10px + .submit-phase-contest.show + height: 100px + background-color: #f1f2f7 + transition: height 1s + padding: 10px + + From 719dff168ac1f6b08ecd7b88894a8689218917a6 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Mon, 5 Oct 2015 13:55:03 +0700 Subject: [PATCH 005/158] vilidation for submission challenge phase on the challenge list page --- .../assets/modules/contests/contest-list.html | 42 ++++++++++--- .../modules/contests/contest.directive.js | 7 +++ .../assets/modules/contests/contests.con.js | 8 +++ .../modules/translation/messages_en.json | 6 +- src/main/webapp/assets/sass/contests.sass | 61 +++++++++++++++++-- 5 files changed, 110 insertions(+), 14 deletions(-) diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html index e86876737..8c136002a 100644 --- a/src/main/webapp/assets/modules/contests/contest-list.html +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -27,14 +27,38 @@
-
- Johnson Pham -
-
- phamthanhtrinh.vt@gmail.com -
-
- -
+ +
+ Johnson Pham +
+
+ phamthanhtrinh.vt@gmail.com +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contests/contest.directive.js b/src/main/webapp/assets/modules/contests/contest.directive.js index 7c86f6131..79f73c946 100644 --- a/src/main/webapp/assets/modules/contests/contest.directive.js +++ b/src/main/webapp/assets/modules/contests/contest.directive.js @@ -14,6 +14,13 @@ techlooper.directive('contestList', function () { div.addClass('show'); } } + scope.hideSubmitForm = function(id){ + var parent = $('#id-'+id); + var div = parent.find('.submit-phase-contest'); + div.find('#txtDescription').val(''); + div.find('#txtSubmissionURL').val(''); + div.removeClass('show'); + } } }; }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contests/contests.con.js b/src/main/webapp/assets/modules/contests/contests.con.js index 2cf2ff8ef..314bb1778 100644 --- a/src/main/webapp/assets/modules/contests/contests.con.js +++ b/src/main/webapp/assets/modules/contests/contests.con.js @@ -26,4 +26,12 @@ techlooper.controller('contestsController', function (apiService, $scope, jsonVa }).finally(function () { utils.sendNotification(jsonValue.notifications.loaded); }); + + $scope.challengeSubmission = function(){ + $scope.submissionForm.$setSubmitted(); + if ($scope.submissionForm.$invalid) { + return false; + } + // send date + } }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index aa907cb03..c8d8f31cf 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -753,5 +753,9 @@ "mailSend": "Send", "challengeIdeaTips": "This date officially ends the Idea phase of the contest. Contestants must propose their ideas to Contest Owner by this date. Once the Contest Owner approves the idea, contestant who proposed the idea will be selected to go to the next phase.", "challengeUIUXTips": "This date officially ends the UI/UX phase of the contest. Contestants must propose their UI/UX mockups and/or Usability Test if required to Contest Owner by this date. Once the Contest Owner approves the mockup, contestant who submitted that mockup will be selected to go to the next phase.", - "challengePrototypeTips": "This date officially ends the Prototype phase of the contest. Contestants must submit their prototypes to Contest Owner by this date. Once the Contest Owner approves the prototype, contestant who submitted that prototype will be selected to go to the next phase." + "challengePrototypeTips": "This date officially ends the Prototype phase of the contest. Contestants must submit their prototypes to Contest Owner by this date. Once the Contest Owner approves the prototype, contestant who submitted that prototype will be selected to go to the next phase.", + "submissionURL": "Submission URL: *", + "submissionURLTips": "Input your submission link", + "description":"Description: *", + "descriptionSubmissionTips": "Write some lines to describe your submission to the challenge owner" } \ No newline at end of file diff --git a/src/main/webapp/assets/sass/contests.sass b/src/main/webapp/assets/sass/contests.sass index 2f93705ed..196f0a4d6 100644 --- a/src/main/webapp/assets/sass/contests.sass +++ b/src/main/webapp/assets/sass/contests.sass @@ -174,7 +174,7 @@ clear: both width: 100% border-bottom: 1px solid #ddd - padding: 5px 20px + padding: 25px 20px 10px 20px .challenge-name-col height: auto a @@ -256,9 +256,62 @@ border-radius: 4px margin-top: 10px .submit-phase-contest.show - height: 100px + height: 280px background-color: #f1f2f7 transition: height 1s - padding: 10px - + padding: 10px 20px + margin-top: 10px + float: left + .registrant-name + display: inline-block + clear: both + width: 100% + padding-bottom: 5px + span + width: 18% + float: left + display: inline-block + font-weight: 400 + .registrant-email + display: inline-block + clear: both + width: 100% + padding-bottom: 10px + span + width: 18% + float: left + display: inline-block + font-weight: 400 + .phase-description + display: inline-block + clear: both + width: 100% + padding-bottom: 5px + label + width: 18% + float: left + display: inline-block + font-weight: 400 + strong + color: red + font-weight: 500 + input + float: left + width: 82% + clear: none + textarea + height: 80px + float: left + width: 82% + clear: none + div.error-messages + padding-left: 18% + width: 100% + clear: both + display: inline-block + .phase-submission + text-align: center + button + margin: auto + padding: 6px 30px From 9d15d53d9e51ed2dbcf054f61e59b18b014fddbd Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Mon, 5 Oct 2015 14:07:28 +0700 Subject: [PATCH 006/158] update style for challenge list --- .../webapp/assets/modules/contests/contest-list.html | 9 +++++++-- src/main/webapp/assets/sass/contests.sass | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html index 8c136002a..f871e7fda 100644 --- a/src/main/webapp/assets/modules/contests/contest-list.html +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -22,8 +22,13 @@ {{contest.numberOfRegistrants}}
diff --git a/src/main/webapp/assets/sass/contests.sass b/src/main/webapp/assets/sass/contests.sass index 196f0a4d6..838c97f4e 100644 --- a/src/main/webapp/assets/sass/contests.sass +++ b/src/main/webapp/assets/sass/contests.sass @@ -240,13 +240,14 @@ height: auto a display: inline-block - width: auto + width: 95px clear: both background-color: #337ab7 border-radius: 4px padding: 2px 8px margin-bottom: 5px color: #fff + text-align: center .submit-phase-contest height: 0px transition: height 1s From 419aa7458c50aa31d374906f5fac82354a9baba4 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Mon, 5 Oct 2015 14:27:37 +0700 Subject: [PATCH 007/158] move submission challenge phase to component --- .../modules/common/submission-challenge.html | 35 ++++++++++++++++++ .../modules/common/submissionChallenge.js | 7 ++++ .../assets/modules/contests/contest-list.html | 36 +------------------ 3 files changed, 43 insertions(+), 35 deletions(-) create mode 100644 src/main/webapp/assets/modules/common/submission-challenge.html create mode 100644 src/main/webapp/assets/modules/common/submissionChallenge.js diff --git a/src/main/webapp/assets/modules/common/submission-challenge.html b/src/main/webapp/assets/modules/common/submission-challenge.html new file mode 100644 index 000000000..00802da60 --- /dev/null +++ b/src/main/webapp/assets/modules/common/submission-challenge.html @@ -0,0 +1,35 @@ +
+ +
+ Johnson Pham +
+
+ phamthanhtrinh.vt@gmail.com +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+ +
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/common/submissionChallenge.js b/src/main/webapp/assets/modules/common/submissionChallenge.js new file mode 100644 index 000000000..d06dfe2f9 --- /dev/null +++ b/src/main/webapp/assets/modules/common/submissionChallenge.js @@ -0,0 +1,7 @@ +techlooper.directive("submissionChallenge", function ($timeout, jsonValue, utils) { + return { + restrict: "E", + replace: true, + templateUrl: "modules/common/submission-challenge.html" + } +}); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html index f871e7fda..42ff0c306 100644 --- a/src/main/webapp/assets/modules/contests/contest-list.html +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -31,39 +31,5 @@ |
-
- -
- Johnson Pham -
-
- phamthanhtrinh.vt@gmail.com -
-
- - -
-
-
- - -
-
-
-
- - -
- -
+
\ No newline at end of file From 26833f0ae6ba18b57f24bcd60d35496450dd2158 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Mon, 5 Oct 2015 15:02:41 +0700 Subject: [PATCH 008/158] add submission challenge phase for Challenge details page --- .../contest-detail/contest-detail.con.js | 14 ++ .../contest-detail/contest-detail.tem.html | 19 ++- .../webapp/assets/sass/contest-detail.sass | 16 ++- src/main/webapp/assets/sass/contests.sass | 135 +++++++++--------- src/main/webapp/assets/sass/main.sass | 4 + 5 files changed, 110 insertions(+), 78 deletions(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js index d98c040c9..18cdf95f5 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js @@ -178,5 +178,19 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l },1000); }); } + $scope.showSubmitForm = function(){ + var subForm = $('.submit-phase-contest'); + if(subForm.hasClass('show')){ + subForm.removeClass('show'); + }else{ + subForm.addClass('show'); + } + } + $scope.hideSubmitForm = function(){ + var subForm = $('.submit-phase-contest'); + subForm.find('#txtDescription').val(''); + subForm.find('#txtSubmissionURL').val(''); + subForm.removeClass('show'); + } }); diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html index 4bc9bcc11..13a89e3d9 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html @@ -12,6 +12,11 @@

{{contestDetail.challengeName}}

+
+
+ +
+
@@ -58,16 +63,16 @@

- + + +

-
-
- -
-
+ +

diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index aca2e84a9..ddf80bbff 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -4,6 +4,10 @@ width: 100% text-align: center padding-bottom: 20px + .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus + border-color: #dddddd #dddddd #fff + .nav-tabs > li > a + font-weight: 500 .contest-detail-content background-color: white -webkit-border-radius: 5px @@ -183,15 +187,12 @@ .join-now width: 40% float: right - padding-top: 4px button float: right margin-left: 10px button.disabled background-color: gray !important cursor: not-allowed - i - border-right: 1px solid #ccc span display: inline-block text-align: right @@ -200,7 +201,7 @@ display: inline-block clear: both width: 100% - padding: 10px 0 20px 0 + padding: 0 .contest-content-detail padding: 20px 20px 0 20px width: 100% @@ -288,6 +289,13 @@ a font-weight: 400 cursor: pointer + .submit-phase-contest.show + height: 280px + background-color: #f1f2f7 + transition: height 1s + padding: 10px 20px + margin-top: 10px + float: left .col-md-12 padding: 0 .contest-content-item diff --git a/src/main/webapp/assets/sass/contests.sass b/src/main/webapp/assets/sass/contests.sass index 838c97f4e..a92575ef8 100644 --- a/src/main/webapp/assets/sass/contests.sass +++ b/src/main/webapp/assets/sass/contests.sass @@ -248,71 +248,72 @@ margin-bottom: 5px color: #fff text-align: center - .submit-phase-contest - height: 0px - transition: height 1s - overflow: hidden - width: 100% - display: inline-block - border-radius: 4px - margin-top: 10px - .submit-phase-contest.show - height: 280px - background-color: #f1f2f7 - transition: height 1s - padding: 10px 20px - margin-top: 10px - float: left - .registrant-name - display: inline-block - clear: both - width: 100% - padding-bottom: 5px - span - width: 18% - float: left - display: inline-block - font-weight: 400 - .registrant-email - display: inline-block - clear: both - width: 100% - padding-bottom: 10px - span - width: 18% - float: left - display: inline-block - font-weight: 400 - .phase-description - display: inline-block - clear: both - width: 100% - padding-bottom: 5px - label - width: 18% - float: left - display: inline-block - font-weight: 400 - strong - color: red - font-weight: 500 - input - float: left - width: 82% - clear: none - textarea - height: 80px - float: left - width: 82% - clear: none - div.error-messages - padding-left: 18% - width: 100% - clear: both - display: inline-block - .phase-submission - text-align: center - button - margin: auto - padding: 6px 30px + .submit-phase-contest + height: 0px + transition: height 1s + transition: background-color 1s + overflow: hidden + width: 100% + display: inline-block + border-radius: 4px + margin-top: 10px + .submit-phase-contest.show + height: 280px + background-color: #f1f2f7 + transition: height 1s + padding: 10px 20px + margin-top: 10px + float: left + .registrant-name + display: inline-block + clear: both + width: 100% + padding-bottom: 5px + span + width: 18% + float: left + display: inline-block + font-weight: 400 + .registrant-email + display: inline-block + clear: both + width: 100% + padding-bottom: 10px + span + width: 18% + float: left + display: inline-block + font-weight: 400 + .phase-description + display: inline-block + clear: both + width: 100% + padding-bottom: 5px + label + width: 18% + float: left + display: inline-block + font-weight: 400 + strong + color: red + font-weight: 500 + input + float: left + width: 82% + clear: none + textarea + height: 80px + float: left + width: 82% + clear: none + div.error-messages + padding-left: 18% + width: 100% + clear: both + display: inline-block + .phase-submission + text-align: center + button + margin: auto + padding: 6px 30px diff --git a/src/main/webapp/assets/sass/main.sass b/src/main/webapp/assets/sass/main.sass index 5d1761679..d2d03ee3b 100644 --- a/src/main/webapp/assets/sass/main.sass +++ b/src/main/webapp/assets/sass/main.sass @@ -194,6 +194,10 @@ a:focus border: 0 !important height: 36px box-shadow: none +.btn-primary:focus, +.btn-primary:hover + background-color: #337ab7 !important + background-position: 0 0 .hide display: none .show From eb0b5157af86d74b562185ac3140c5d2087bb6aa Mon Sep 17 00:00:00 2001 From: Phuong H Date: Mon, 5 Oct 2015 15:49:20 +0700 Subject: [PATCH 009/158] Enable user login token in 6 months --- .../web/DispatcherServletInitializer.java | 7 ++ .../config/web/sec/SecurityConfiguration.java | 91 ++++++++++--------- .../post-contest/postContestController.js | 38 ++++++++ 3 files changed, 91 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/techlooper/config/web/DispatcherServletInitializer.java b/src/main/java/com/techlooper/config/web/DispatcherServletInitializer.java index cabcfb13c..8495fe424 100644 --- a/src/main/java/com/techlooper/config/web/DispatcherServletInitializer.java +++ b/src/main/java/com/techlooper/config/web/DispatcherServletInitializer.java @@ -21,6 +21,8 @@ import com.techlooper.config.web.sec.SecurityConfiguration; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; import javax.servlet.ServletRegistration.Dynamic; public class DispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { @@ -31,6 +33,11 @@ public class DispatcherServletInitializer extends AbstractAnnotationConfigDispat // @Value("${spring.profiles.active}") // private String profile; + public void onStartup(ServletContext servletContext) throws ServletException { + servletContext.getSessionCookieConfig().setMaxAge(15770000); + super.onStartup(servletContext); + } + protected Class[] getRootConfigClasses() { return null; } diff --git a/src/main/java/com/techlooper/config/web/sec/SecurityConfiguration.java b/src/main/java/com/techlooper/config/web/sec/SecurityConfiguration.java index 9fc1be545..dd746f3b9 100644 --- a/src/main/java/com/techlooper/config/web/sec/SecurityConfiguration.java +++ b/src/main/java/com/techlooper/config/web/sec/SecurityConfiguration.java @@ -14,6 +14,8 @@ import org.springframework.security.web.authentication.AuthenticationFailureHandler; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; +import org.springframework.security.web.authentication.rememberme.InMemoryTokenRepositoryImpl; +import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; @@ -27,58 +29,57 @@ @EnableGlobalMethodSecurity(prePostEnabled = true) public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - @Bean - public AuthenticationProvider vnwAuthenticationProvider() { - return new VnwAuthenticationProvider(); - } + @Bean + public AuthenticationProvider vnwAuthenticationProvider() { + return new VnwAuthenticationProvider(); + } - @Bean - public AuthenticationProvider socialAuthenticationProvider() { - return new SocialAuthenticationProvider(); - } + @Bean + public AuthenticationProvider socialAuthenticationProvider() { + return new SocialAuthenticationProvider(); + } - @Bean - public AuthenticationProvider switchingAuthenticationProvider() { - SwitchingAuthenticationProvider switchingAuthenticationProvider = new SwitchingAuthenticationProvider(); - Map authenticationProviders = new HashMap<>(); - authenticationProviders.put(SocialProvider.VIETNAMWORKS, vnwAuthenticationProvider()); - authenticationProviders.put(SocialProvider.FACEBOOK, socialAuthenticationProvider()); - authenticationProviders.put(SocialProvider.GOOGLE, socialAuthenticationProvider()); - switchingAuthenticationProvider.setProviders(authenticationProviders); - return switchingAuthenticationProvider; - } + @Bean + public AuthenticationProvider switchingAuthenticationProvider() { + SwitchingAuthenticationProvider switchingAuthenticationProvider = new SwitchingAuthenticationProvider(); + Map authenticationProviders = new HashMap<>(); + authenticationProviders.put(SocialProvider.VIETNAMWORKS, vnwAuthenticationProvider()); + authenticationProviders.put(SocialProvider.FACEBOOK, socialAuthenticationProvider()); + authenticationProviders.put(SocialProvider.GOOGLE, socialAuthenticationProvider()); + switchingAuthenticationProvider.setProviders(authenticationProviders); + return switchingAuthenticationProvider; + } - @Bean - public AuthenticationManager authenticationManager() { - return new ProviderManager(Arrays.asList(switchingAuthenticationProvider())); - } + @Bean + public AuthenticationManager authenticationManager() { + return new ProviderManager(Arrays.asList(switchingAuthenticationProvider())); + } - protected void configure(HttpSecurity http) throws Exception { - http.csrf().disable() - .authorizeRequests() - .and().formLogin().loginPage("/login").usernameParameter("us").passwordParameter("pwd").successHandler(getSuccessHandler()).failureHandler(getAuthenticationFailureHandler()) - .and().logout().logoutUrl("/logout").logoutSuccessHandler(getLogoutSuccessHandler()).invalidateHttpSession(true).deleteCookies("SESSION").permitAll() - .and().exceptionHandling().authenticationEntryPoint(exceptionHandler()); + protected void configure(HttpSecurity http) throws Exception { + http.csrf().disable() + .authorizeRequests() + .and().formLogin().loginPage("/login").usernameParameter("us").passwordParameter("pwd").successHandler(getSuccessHandler()).failureHandler(getAuthenticationFailureHandler()) + .and().logout().logoutUrl("/logout").logoutSuccessHandler(getLogoutSuccessHandler()).invalidateHttpSession(true).deleteCookies("SESSION").permitAll() + .and().exceptionHandling().authenticationEntryPoint(exceptionHandler()); + } - } + private AuthenticationEntryPoint exceptionHandler() { + return (request, response, authException) -> response.setStatus(HttpServletResponse.SC_FORBIDDEN); + } - private AuthenticationEntryPoint exceptionHandler() { - return (request, response, authException) -> response.setStatus(HttpServletResponse.SC_FORBIDDEN); - } + private LogoutSuccessHandler getLogoutSuccessHandler() { + return (request, response, authentication) -> response.setStatus(HttpServletResponse.SC_NO_CONTENT); + } - private LogoutSuccessHandler getLogoutSuccessHandler() { - return (request, response, authentication) -> response.setStatus(HttpServletResponse.SC_NO_CONTENT); - } + private AuthenticationFailureHandler getAuthenticationFailureHandler() { + return (request, response, exception) -> response.setStatus(HttpServletResponse.SC_FORBIDDEN); + } - private AuthenticationFailureHandler getAuthenticationFailureHandler() { - return (request, response, exception) -> response.setStatus(HttpServletResponse.SC_FORBIDDEN); - } + private AuthenticationSuccessHandler getSuccessHandler() { + return (request, response, authentication) -> response.setStatus(HttpServletResponse.SC_NO_CONTENT); + } - private AuthenticationSuccessHandler getSuccessHandler() { - return (request, response, authentication) -> response.setStatus(HttpServletResponse.SC_NO_CONTENT); - } - - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/images/**", "/css/**", "/generate-resources/**", "/modules/**", "/bower_components/**", "/custom-js/**"); - } + public void configure(WebSecurity web) throws Exception { + web.ignoring().antMatchers("/images/**", "/css/**", "/generate-resources/**", "/modules/**", "/bower_components/**", "/custom-js/**"); + } } \ No newline at end of file diff --git a/src/main/webapp/assets/modules/post-contest/postContestController.js b/src/main/webapp/assets/modules/post-contest/postContestController.js index 777af239f..8b5347ff0 100644 --- a/src/main/webapp/assets/modules/post-contest/postContestController.js +++ b/src/main/webapp/assets/modules/post-contest/postContestController.js @@ -211,6 +211,44 @@ techlooper.controller("postContestController", function ($scope, $http, jsonValu ]; }, function () { + //if (!$scope.timelineForm) return; + //if (!$scope.contest) return; + + //if (!$scope.ideaChecked) delete $scope.contest.ideaSubmissionDate; + //if (!$scope.uiuxChecked) delete $scope.contest.uxSubmissionDate; + //if (!$scope.prototypeChecked) delete $scope.contest.prototypeSubmissionDate; + // + //var timeline = [ + // {name: "startDate", value: moment().add(4, 'weeks'), validatorName: "in4w"}, + // {name: "startDate", value: moment($scope.contest.startDate, jsonValue.dateFormat)}, + // {name: "registrationDate", value: moment($scope.contest.registrationDate, jsonValue.dateFormat)}, + // {name: "ideaSubmissionDate", value: moment($scope.contest.ideaSubmissionDate, jsonValue.dateFormat)}, + // {name: "uxSubmissionDate", value: moment($scope.contest.uxSubmissionDate, jsonValue.dateFormat), dependFrom: "registrationDate"}, + // {name: "prototypeSubmissionDate", value: moment($scope.contest.prototypeSubmissionDate, jsonValue.dateFormat), dependFrom: "registrationDate"}, + // {name: "submissionDate", value: moment($scope.contest.submissionDate, jsonValue.dateFormat), dependFrom: "registrationDate"} + //]; + // + ////var last = timeline[0]; + //var validators = []; + //for (var i = 1; i < timeline.length; ++i) { + // var current = timeline[i]; + // + // $.each(validators, function(i, validator) {//reset all validators + // $scope.timelineForm[current.name].$setValidity(validator, true); + // }); + // + // if (!current.value.isValid()) continue; + // + // var before = timeline[i-1]; + // var validatorName = before.validatorName || ("gt" + before.name.charAt(0).toUpperCase() + before.name.substr(1)); + // validators.push(validatorName); + // var valid = before.value.isValid() ? current.value.isAfter(before.value) : false; + // console.log(valid); + // $scope.timelineForm[current.name].$setValidity(validatorName, valid); + // console.log($scope.timelineForm[current.name]); + //} + + if (!$scope.contest) return; var currentDate = undefined; From ca5280b97d97dccaead8a474d6039360c245c581 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Mon, 5 Oct 2015 16:40:56 +0700 Subject: [PATCH 010/158] update source code for submission challenge phase --- .../modules/common/submission-challenge.html | 6 +++--- .../assets/modules/common/submissionChallenge.js | 15 ++++++++++++++- .../modules/contest-detail/contest-detail.con.js | 11 +++++++++++ .../contest-detail/contest-detail.tem.html | 6 ++++-- .../assets/modules/contests/contest-list.html | 2 +- .../assets/modules/contests/contests.con.js | 8 -------- .../assets/modules/translation/messages_en.json | 3 ++- 7 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/main/webapp/assets/modules/common/submission-challenge.html b/src/main/webapp/assets/modules/common/submission-challenge.html index 00802da60..7bd91d1ad 100644 --- a/src/main/webapp/assets/modules/common/submission-challenge.html +++ b/src/main/webapp/assets/modules/common/submission-challenge.html @@ -9,7 +9,7 @@

+ ng-model="submissionDescription" maxlength="3000" ng-required="true" touchable>
@@ -19,7 +19,7 @@ + ng-model="submissionURL" ng-required="true" touchable />
@@ -28,7 +28,7 @@ translate="requiredURL" />
- +
diff --git a/src/main/webapp/assets/modules/common/submissionChallenge.js b/src/main/webapp/assets/modules/common/submissionChallenge.js index d06dfe2f9..097e5677c 100644 --- a/src/main/webapp/assets/modules/common/submissionChallenge.js +++ b/src/main/webapp/assets/modules/common/submissionChallenge.js @@ -2,6 +2,19 @@ techlooper.directive("submissionChallenge", function ($timeout, jsonValue, utils return { restrict: "E", replace: true, - templateUrl: "modules/common/submission-challenge.html" + scope: { + ngModel: "=" + }, + templateUrl: "modules/common/submission-challenge.html", + link: function (scope, el, attrs) { + scope.pushChallengePhase = function(){ + scope.submissionForm.$setSubmitted(); + if (scope.submissionForm.$invalid) { + return false; + } + console.log(scope.submissionDescription); + console.log(scope.submissionURL); + } + } } }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js index 18cdf95f5..96996a846 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js @@ -192,5 +192,16 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l subForm.find('#txtSubmissionURL').val(''); subForm.removeClass('show'); } + //$scope.pushChallengePhase = function(){ + // $scope.submissionForm.$setSubmitted(); + // if ($scope.submissionForm.$invalid) { + // $scope.submittedPhase = false; + // return false; + // } + // $scope.submittedPhase = true; + // console.log($scope.submissionDescription); + // console.log($scope.submissionURL); + // $scope.hideSubmitForm(); + //} }); diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html index 13a89e3d9..b5e71c764 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html @@ -71,8 +71,10 @@

- - + +
+

+

diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html index 42ff0c306..2ee5a2d29 100644 --- a/src/main/webapp/assets/modules/contests/contest-list.html +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -31,5 +31,5 @@ |

- +
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contests/contests.con.js b/src/main/webapp/assets/modules/contests/contests.con.js index 314bb1778..2cf2ff8ef 100644 --- a/src/main/webapp/assets/modules/contests/contests.con.js +++ b/src/main/webapp/assets/modules/contests/contests.con.js @@ -26,12 +26,4 @@ techlooper.controller('contestsController', function (apiService, $scope, jsonVa }).finally(function () { utils.sendNotification(jsonValue.notifications.loaded); }); - - $scope.challengeSubmission = function(){ - $scope.submissionForm.$setSubmitted(); - if ($scope.submissionForm.$invalid) { - return false; - } - // send date - } }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index c8d8f31cf..9b08d750e 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -757,5 +757,6 @@ "submissionURL": "Submission URL: *", "submissionURLTips": "Input your submission link", "description":"Description: *", - "descriptionSubmissionTips": "Write some lines to describe your submission to the challenge owner" + "descriptionSubmissionTips": "Write some lines to describe your submission to the challenge owner", + "submissionPhaseSuccessful": "Submission Successful" } \ No newline at end of file From b73614226bed6f68dc0f506d49bd7f2a9d819f65 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Mon, 5 Oct 2015 17:04:29 +0700 Subject: [PATCH 011/158] update cancel function for submission form --- .../modules/common/submissionChallenge.js | 6 ++++++ .../contest-detail/contest-detail.con.js | 17 ----------------- .../modules/contests/contest.directive.js | 7 ------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/main/webapp/assets/modules/common/submissionChallenge.js b/src/main/webapp/assets/modules/common/submissionChallenge.js index 097e5677c..e52857c6e 100644 --- a/src/main/webapp/assets/modules/common/submissionChallenge.js +++ b/src/main/webapp/assets/modules/common/submissionChallenge.js @@ -15,6 +15,12 @@ techlooper.directive("submissionChallenge", function ($timeout, jsonValue, utils console.log(scope.submissionDescription); console.log(scope.submissionURL); } + scope.hideSubmitForm = function(){ + var subForm = $('.submit-phase-contest'); + subForm.find('#txtDescription').val(''); + subForm.find('#txtSubmissionURL').val(''); + subForm.removeClass('show'); + } } } }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js index 96996a846..5fe03480e 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js @@ -186,22 +186,5 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l subForm.addClass('show'); } } - $scope.hideSubmitForm = function(){ - var subForm = $('.submit-phase-contest'); - subForm.find('#txtDescription').val(''); - subForm.find('#txtSubmissionURL').val(''); - subForm.removeClass('show'); - } - //$scope.pushChallengePhase = function(){ - // $scope.submissionForm.$setSubmitted(); - // if ($scope.submissionForm.$invalid) { - // $scope.submittedPhase = false; - // return false; - // } - // $scope.submittedPhase = true; - // console.log($scope.submissionDescription); - // console.log($scope.submissionURL); - // $scope.hideSubmitForm(); - //} }); diff --git a/src/main/webapp/assets/modules/contests/contest.directive.js b/src/main/webapp/assets/modules/contests/contest.directive.js index 79f73c946..7c86f6131 100644 --- a/src/main/webapp/assets/modules/contests/contest.directive.js +++ b/src/main/webapp/assets/modules/contests/contest.directive.js @@ -14,13 +14,6 @@ techlooper.directive('contestList', function () { div.addClass('show'); } } - scope.hideSubmitForm = function(id){ - var parent = $('#id-'+id); - var div = parent.find('.submit-phase-contest'); - div.find('#txtDescription').val(''); - div.find('#txtSubmissionURL').val(''); - div.removeClass('show'); - } } }; }); \ No newline at end of file From 0542f10423a076e0371793fa4559623532d56918 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Tue, 6 Oct 2015 09:44:42 +0700 Subject: [PATCH 012/158] remove :: --- src/main/webapp/assets/modules/translation/messages_en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index 9b08d750e..3bad8ecec 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -349,7 +349,7 @@ "challengeStartTip": "This is the date when the challenge starts and start accepting registrations. During this time Contest Owner promotes the contest and review the registrations received.", "challengeRegister": "Contestants Have To Register By: *", "challengeRegisterTip": "Typically between 2-4 weeks after the challenge start date. After this date, the contest is officially in-progress and contestants are working on the challenge. It is up to you to accept more registrations at this stage.", - "challengeSubmit": "And Contestants Must Submit Final App By:: *", + "challengeSubmit": "And Contestants Must Submit Final App By: *", "challengeSubmitTip": "Contest duration should not be longer than 8 weeks. This date officially ends the contest. All the contestants must submit their solutions by this date.", "userName": "Enter User Name/Email Address: *", "userNameEX": "Username / Example@vietnamworks.com", From f1625a7c0607277f203289e9273dbc4a05d15ab0 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Tue, 6 Oct 2015 10:27:00 +0700 Subject: [PATCH 013/158] change url to URL for translate --- src/main/webapp/assets/modules/translation/messages_en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index 3bad8ecec..970b9a894 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -149,7 +149,7 @@ "categories": "Categories", "level": "Level", "requiredThisField": "You can’t leave this empty.", - "requiredURL": "This is invalid url.", + "requiredURL": "This is invalid URL.", "yob": "Year of birth", "exYob": "Ex: 1988", "doYouWantToEarnMore": "Do you want to earn more?", From e3b9327cb897e923797bd8e076ebaae0a3939136 Mon Sep 17 00:00:00 2001 From: Phuong H Date: Tue, 6 Oct 2015 11:41:03 +0700 Subject: [PATCH 014/158] Remove some unused js --- src/main/webapp/assets/modules/_app.js | 8 +- src/main/webapp/assets/modules/_appStart.js | 6 +- .../common/{ => email}/popupEmail.html | 0 .../common/{ => email}/popupEmailDirective.js | 2 +- .../assets/modules/common/shortcut.fac.js | 82 ------------- .../assets/modules/job/searchBox.ser.js | 8 +- .../assets/modules/register/register.con.js | 18 --- .../assets/modules/register/register.ser.js | 114 ------------------ .../assets/modules/register/register.tem.html | 83 ------------- .../assets/modules/signin/signin.con.js | 8 -- .../assets/modules/signin/signin.ser.js | 62 ---------- .../assets/modules/signin/signin.tem.html | 77 ------------ .../skill-analytics/skill-analytics.con.js | 2 +- .../skill-analytics/skill-analytics.ser.js | 8 +- .../talent-profile/talent-profile.con.js | 2 +- .../modules/user-profile/user-profile.con.js | 4 +- 16 files changed, 11 insertions(+), 473 deletions(-) rename src/main/webapp/assets/modules/common/{ => email}/popupEmail.html (100%) rename src/main/webapp/assets/modules/common/{ => email}/popupEmailDirective.js (92%) delete mode 100644 src/main/webapp/assets/modules/common/shortcut.fac.js delete mode 100644 src/main/webapp/assets/modules/register/register.con.js delete mode 100644 src/main/webapp/assets/modules/register/register.ser.js delete mode 100644 src/main/webapp/assets/modules/register/register.tem.html delete mode 100644 src/main/webapp/assets/modules/signin/signin.con.js delete mode 100644 src/main/webapp/assets/modules/signin/signin.ser.js delete mode 100644 src/main/webapp/assets/modules/signin/signin.tem.html diff --git a/src/main/webapp/assets/modules/_app.js b/src/main/webapp/assets/modules/_app.js index 9655e461c..4dc1d42bb 100644 --- a/src/main/webapp/assets/modules/_app.js +++ b/src/main/webapp/assets/modules/_app.js @@ -15,8 +15,6 @@ angular.module("Jobs", ['infinite-scroll']); angular.module("Pie", []); angular.module("SearchForm", []); angular.module("Skill", []); -angular.module("SignIn", []); -angular.module("Register", []); angular.module("UserProfile", []); var baseUrl = (function () { @@ -27,7 +25,7 @@ var baseUrl = (function () { var techlooper = angular.module("Techlooper", [ "ngSanitize", "pascalprecht.translate", "ngResource", "ngRoute", "satellizer", 'ngCookies', "LocalStorageModule", - "Bubble", "Pie", "Home", "Navigation", "Footer", "Common", "Chart", "Jobs", "Skill", "SignIn", "Register", + "Bubble", "Pie", "Home", "Navigation", "Footer", "Common", "Chart", "Jobs", "Skill", "UserProfile", "selectize", "autocomplete", "focusOn", "mgcrea.ngStrap", "angularUtils.directives.dirPagination" ]); @@ -106,10 +104,6 @@ techlooper.config(["$routeProvider", "$translateProvider", "$authProvider", "loc templateUrl: "modules/it-professional/main.tem.html", controller: "chartController" }) - .when("/register", { - templateUrl: "modules/it-professional/main.tem.html", - controller: "registerController" - }) .when("/user", { templateUrl: "modules/it-professional/main.tem.html", controller: "userProfileController" diff --git a/src/main/webapp/assets/modules/_appStart.js b/src/main/webapp/assets/modules/_appStart.js index 674c09833..b31b50225 100644 --- a/src/main/webapp/assets/modules/_appStart.js +++ b/src/main/webapp/assets/modules/_appStart.js @@ -1,5 +1,4 @@ -techlooper.run(function (shortcutFactory, connectionFactory, loadingBoxFactory, cleanupFactory, - signInService, historyFactory, userService, routerService, $location, +techlooper.run(function (connectionFactory, loadingBoxFactory, cleanupFactory, userService, $location, utils, $rootScope, $translate, jsonValue, localStorageService, securityService, apiService, resourcesService, seoService, joinAnythingService) { $rootScope.apiService = apiService; @@ -66,12 +65,9 @@ techlooper.run(function (shortcutFactory, connectionFactory, loadingBoxFactory, $rootScope.today = moment().format(jsonValue.dateFormat); //Exec all services - shortcutFactory.initialize(); connectionFactory.initialize(); loadingBoxFactory.initialize(); cleanupFactory.initialize(); - historyFactory.initialize(); - routerService.initialize(); userService.initialize(); securityService.initialize(); seoService.initialize(); diff --git a/src/main/webapp/assets/modules/common/popupEmail.html b/src/main/webapp/assets/modules/common/email/popupEmail.html similarity index 100% rename from src/main/webapp/assets/modules/common/popupEmail.html rename to src/main/webapp/assets/modules/common/email/popupEmail.html diff --git a/src/main/webapp/assets/modules/common/popupEmailDirective.js b/src/main/webapp/assets/modules/common/email/popupEmailDirective.js similarity index 92% rename from src/main/webapp/assets/modules/common/popupEmailDirective.js rename to src/main/webapp/assets/modules/common/email/popupEmailDirective.js index 38eba2439..b60daf6a6 100644 --- a/src/main/webapp/assets/modules/common/popupEmailDirective.js +++ b/src/main/webapp/assets/modules/common/email/popupEmailDirective.js @@ -2,7 +2,7 @@ techlooper.directive("popupEmail", function () { return { restrict: "E", replace: true, - templateUrl: "modules/common/popupEmail.html", + templateUrl: "modules/common/email/popupEmail.html", scope: { composeEmail: "=" }, diff --git a/src/main/webapp/assets/modules/common/shortcut.fac.js b/src/main/webapp/assets/modules/common/shortcut.fac.js deleted file mode 100644 index ef29ac4be..000000000 --- a/src/main/webapp/assets/modules/common/shortcut.fac.js +++ /dev/null @@ -1,82 +0,0 @@ -angular.module("Common").factory("shortcutFactory", function (jsonValue, $location, $rootScope, historyFactory, utils, $timeout) { - - //var $$ = { - // goBack: function () { - // var path = historyFactory.popHistory(); - // if (path === "/" && utils.isHome()) { - // return; - // } - // $location.path(path); - // $timeout(function(){ - // $('.js-footer').removeClass('technical-detail'); - // }, 600); - // } - //} - - //var traps = { - // esc: function (e) { - // switch (utils.getView()) { - // case jsonValue.views.jobsSearchText: - // if ($("#companyVideoInfor").is(":visible")) {// ESC from others, such as: Video dialog, ... - // $(".playerVideo").attr("src", ""); - // return; - // } - // $location.path(jsonValue.routerUris.jobsSearch); - // break; - // case jsonValue.views.register: - // if ($("#terms-conditions").is(":visible")) { - // return; - // } - // $$.goBack(); - // break; - // case jsonValue.views.companyProfile: - // if ($("#companyVideoInfor").is(":visible")) {// ESC from others, such as: Video dialog, ... - // $(".playerVideo").attr("src", ""); - // return; - // } - // break; - // case jsonValue.views.analyticsSkill: - // if ($("#changeSkill").is(":visible")) { - // $('#changeSkill').modal('hide'); - // return; - // } - // $$.goBack(); - // break; - // default: - // $$.goBack(); - // break; - // } - // }, - // - // enter: function (e) { - // switch (utils.getView()) { - // case jsonValue.views.jobsSearchText: - // case jsonValue.views.jobsSearch: - // utils.sendNotification(jsonValue.notifications.defaultAction); - // break; - // } - // } - //} - // - //Mousetrap.bindGlobal("esc", function (e) { - // if (e.defaultPrevented) { - // return; - // } - // traps.esc(e); - //}); - // - //Mousetrap.bindGlobal("enter", function (e) { - // if (e.defaultPrevented) { - // return; - // } - // traps.enter(e); - //}); - - return { - initialize: function () {} - - //trigger: function (key) { - // Mousetrap.trigger(key); - //} - }; -}); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/job/searchBox.ser.js b/src/main/webapp/assets/modules/job/searchBox.ser.js index 313b76d7e..6e72402b0 100644 --- a/src/main/webapp/assets/modules/job/searchBox.ser.js +++ b/src/main/webapp/assets/modules/job/searchBox.ser.js @@ -1,4 +1,4 @@ -angular.module("Jobs").factory("searchBoxService", function ($location, jsonValue, utils, $translate, shortcutFactory, navigationService) { +angular.module("Jobs").factory("searchBoxService", function ($location, jsonValue, utils, $translate) { var scope, searchText, textArray; var $$ = { @@ -97,9 +97,9 @@ angular.module("Jobs").factory("searchBoxService", function ($location, jsonValu } $('.btn-search').click($$.doSearch); - $('.btn-logo').click(function () { - shortcutFactory.trigger('esc'); - }); + //$('.btn-logo').click(function () { + // shortcutFactory.trigger('esc'); + //}); $('.btn-search').css({ 'height': $('.selectize-control').height() - 9, diff --git a/src/main/webapp/assets/modules/register/register.con.js b/src/main/webapp/assets/modules/register/register.con.js deleted file mode 100644 index 7c4aeff56..000000000 --- a/src/main/webapp/assets/modules/register/register.con.js +++ /dev/null @@ -1,18 +0,0 @@ -angular.module('Register').controller('registerController', - function ($scope, connectionFactory, jsonValue, localStorageService, utils, registerService, userService) { - utils.sendNotification(jsonValue.notifications.switchScope, $scope); - registerService.translation(); - $scope.authSource = jsonValue.authSource; - $scope.openOathDialog = registerService.openOathDialog; - $scope.hasProfile = registerService.hasProfile; - $scope.registerVietnamworks = registerService.registerVietnamworks; - userService.getUserInfo() - .then(function () { - localStorageService.remove(jsonValue.storage.back2Me, "true"); - utils.sendNotification(jsonValue.notifications.gotData); - }) - .catch(function () { - localStorageService.set(jsonValue.storage.back2Me, "true"); - utils.sendNotification(jsonValue.notifications.loginFailed); - }); - }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/register/register.ser.js b/src/main/webapp/assets/modules/register/register.ser.js deleted file mode 100644 index ebf21e8ac..000000000 --- a/src/main/webapp/assets/modules/register/register.ser.js +++ /dev/null @@ -1,114 +0,0 @@ -angular.module('Register').factory('registerService', - function (shortcutFactory, jsonValue, localStorageService, utils, $http, connectionFactory, $location, $auth, - $window, $rootScope, $translate) { - var scope; - var $$ = { - initialize: function ($scope) { - scope = $scope; - $("#salary").slider({}); - $('.btn-logo').click(function () { - shortcutFactory.trigger('esc'); - }); - $('.register-successful').click($$.saveUserInfo); - $$.userInfo(); - }, - - saveUserInfo: function (e) { - $(e.target).unbind("click tap"); - connectionFactory.saveUserInfo(scope.userInfo) - .then(function (resp) { - utils.notify(jsonValue.messages.successSave, 'success'); - $location.path("/"); - }) - .catch(function (errors) { - utils.notify(jsonValue.messages.errorFieldsSave, 'error'); - $.each(errors, function (i, error) { - // TODO: design error display - $("." + error.field).css("border", "1px solid red");//error.defaultMessage - }); - }) - .finally(function () { - $(e.target).bind("click tap", $$.saveUserInfo); - }); - }, - - enableNotifications: function () { - return utils.getView() === jsonValue.views.register; - }, - - userInfo: function () { - if ($rootScope.userInfo === undefined) { - return false; - } - $(".emailAddress").prop("disabled", $rootScope.userInfo.emailAddress != null); - - if (instance.hasProfile(jsonValue.authSource[0])) { - $("#alreadyRegisteredVietnamworks").show(); - $("#registerVietnamworksQuestion").hide(); - $(".register-vietnamworks").prop("disabled", true); - $(".register-vietnamworks").prop("checked", true); - } - else { - $("#alreadyRegisteredVietnamworks").hide(); - $("#registerVietnamworksQuestion").show(); - } - } - } - - var instance = { - hasProfile: function (auth) { - if ($rootScope.userInfo === undefined) { - return false; - } - return $rootScope.userInfo.profileNames.indexOf(auth.provider.toUpperCase()) > -1; - }, - - openOathDialog: function (auth) { - if (instance.hasProfile(auth)) { - return false; - } - utils.sendNotification(jsonValue.notifications.loading, $(window).height()); - $auth.authenticate(auth.provider) - .then(function (resp) {//success - delete $window.localStorage["satellizer_token"]; - $rootScope.userInfo.profileNames.push(auth.provider.toUpperCase()); - }) - .finally(function (resp) { - utils.sendNotification(jsonValue.notifications.loaded); - }); - }, - - translation: function () { - $translate("up2perMonth").then(function (translation) { - scope.salaryOptions = [-800, -1000, -1500, -2000, -2500, -3000, -4000].map(function (val) { - return { - label: translation.replace("{}", Math.abs(val)), - value: val - }; - }); - }); - $translate("moreThanPerMonth").then(function (translation) { - scope.salaryOptions.push({ - label: translation.replace("{}", 4000), - value: 4000 - }); - }); - }, - - registerVietnamworks: function () { - if ($('.register-vietnamworks').prop('checked') === true) { - $rootScope.userInfo.profileNames.push(jsonValue.authSource[0].provider.toUpperCase()); - } else { - var i = $rootScope.userInfo.profileNames.indexOf("VIETNAMWORKS"); - if (i != -1) { - $rootScope.userInfo.profileNames.splice(i, 1); - } - } - } - }; - - utils.registerNotification(jsonValue.notifications.userInfo, $$.userInfo, $$.enableNotifications); - utils.registerNotification(jsonValue.notifications.changeLang, instance.translation, $$.enableNotifications); - utils.registerNotification(jsonValue.notifications.switchScope, $$.initialize, $$.enableNotifications); - return instance; - }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/register/register.tem.html b/src/main/webapp/assets/modules/register/register.tem.html deleted file mode 100644 index be18929cd..000000000 --- a/src/main/webapp/assets/modules/register/register.tem.html +++ /dev/null @@ -1,83 +0,0 @@ - - \ No newline at end of file diff --git a/src/main/webapp/assets/modules/signin/signin.con.js b/src/main/webapp/assets/modules/signin/signin.con.js deleted file mode 100644 index 67c48a8f7..000000000 --- a/src/main/webapp/assets/modules/signin/signin.con.js +++ /dev/null @@ -1,8 +0,0 @@ -angular.module('SignIn').controller('signInController', function ($location, jsonValue, utils, $scope, signInService) { - signInService.initialize(); - $scope.authSource = jsonValue.authSource; - //utils.sendNotification(jsonValue.notifications.switchScope, $scope); - //utils.sendNotification(jsonValue.notifications.gotData); - $scope.openOathDialog = signInService.openOathDialog; - -}); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/signin/signin.ser.js b/src/main/webapp/assets/modules/signin/signin.ser.js deleted file mode 100644 index 463a7bfdc..000000000 --- a/src/main/webapp/assets/modules/signin/signin.ser.js +++ /dev/null @@ -1,62 +0,0 @@ -angular.module('SignIn').factory('signInService', - function (jsonValue, utils, shortcutFactory, $location, $auth, localStorageService, - $window, $http, connectionFactory, $rootScope, userService) { - - var $$ = { - enableNotifications: function () { - return utils.getView() === jsonValue.views.signIn; - }, - - loginFailed: function () { - // TODO: consider to use a "signing box" - utils.sendNotification(jsonValue.notifications.hideLoadingBox); - } - } - - var instance = { - init: function () {}, - - initialize: function () { - utils.sendNotification(jsonValue.notifications.loading, $(window).height()); - - // check if user already login - if (userService.verifyUserSession()) { - connectionFactory.verifyUserLogin() - .then(function () {utils.sendNotification(jsonValue.notifications.loginSuccess);}) - .catch(function () {utils.sendNotification(jsonValue.notifications.loginFailed);}); - } - else { - utils.sendNotification(jsonValue.notifications.hideLoadingBox); - } - - $('.signin-accounts').parallax(); - - $('.btn-logo').click(function () { - shortcutFactory.trigger('esc'); - }); - - $(".signin-popup-close").on('click', function () { - $('#signin-form').modal('hide'); - }); - - }, - - openOathDialog: function (auth) { - if (auth.isNotSupported) {return alert("Sign-in by " + auth.provider.toUpperCase() + " isn't supported");} - utils.sendNotification(jsonValue.notifications.loading, $(window).height()); - $auth.authenticate(auth.provider) - .then(function (resp) {//success - delete $window.localStorage["satellizer_token"]; - //localStorageService.cookie.set(jsonValue.storage.key, resp.data.key); - //connectionFactory.login(); - }) - .catch(function (resp) { - utils.sendNotification(jsonValue.notifications.loaded); - }); - } - }; - - //utils.registerNotification(jsonValue.notifications.loginSuccess, $$.loginSuccess); - utils.registerNotification(jsonValue.notifications.loginFailed, $$.loginFailed); - return instance; - }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/signin/signin.tem.html b/src/main/webapp/assets/modules/signin/signin.tem.html deleted file mode 100644 index 2a4406b00..000000000 --- a/src/main/webapp/assets/modules/signin/signin.tem.html +++ /dev/null @@ -1,77 +0,0 @@ -
-
- - - -
-

tagLine

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/webapp/assets/modules/skill-analytics/skill-analytics.con.js b/src/main/webapp/assets/modules/skill-analytics/skill-analytics.con.js index 82892e5cc..24ca0cd52 100644 --- a/src/main/webapp/assets/modules/skill-analytics/skill-analytics.con.js +++ b/src/main/webapp/assets/modules/skill-analytics/skill-analytics.con.js @@ -1,6 +1,6 @@ angular.module('Skill').controller('skillAnalyticsController', function ($scope, jsonValue, connectionFactory, $routeParams, animationFactory, utils, skillTableFactory, - skillCircleFactory, skillChartFactory, shortcutFactory, skillAnalyticsService, $location, navigationService) { + skillCircleFactory, skillChartFactory, skillAnalyticsService) { $(window).scrollTop(0); var histogramsAndPeriod = skillAnalyticsService.getHistogramsAndPeriod($routeParams.period); var skillStatisticRequest = { diff --git a/src/main/webapp/assets/modules/skill-analytics/skill-analytics.ser.js b/src/main/webapp/assets/modules/skill-analytics/skill-analytics.ser.js index 02b794ec3..442ed9d89 100644 --- a/src/main/webapp/assets/modules/skill-analytics/skill-analytics.ser.js +++ b/src/main/webapp/assets/modules/skill-analytics/skill-analytics.ser.js @@ -1,5 +1,5 @@ angular.module("Skill").factory("skillAnalyticsService", - function (jsonValue, utils, skillTableFactory, skillChartFactory, shortcutFactory, $location, termService) { + function (jsonValue, utils, skillTableFactory, skillChartFactory, $location, termService) { var viewJson; var scope; var skillStatisticRequest; @@ -108,12 +108,6 @@ angular.module("Skill").factory("skillAnalyticsService", registerEvents: function () { skillTableFactory.registerEvents(); - $('.btn-close').click(function () { - shortcutFactory.trigger('esc'); - }); - $('.btn-logo').click(function () { - shortcutFactory.trigger('esc'); - }); var type = $('.chart-management ul').find('li'); type.unbind("click"); diff --git a/src/main/webapp/assets/modules/talent-search/talent-profile/talent-profile.con.js b/src/main/webapp/assets/modules/talent-search/talent-profile/talent-profile.con.js index 6d78493cf..7e2ee46e1 100644 --- a/src/main/webapp/assets/modules/talent-search/talent-profile/talent-profile.con.js +++ b/src/main/webapp/assets/modules/talent-search/talent-profile/talent-profile.con.js @@ -1,4 +1,4 @@ -techlooper.controller("talentProfileController", function ($timeout, jsonValue, talentProfileService, $scope, $routeParams, $http, shortcutFactory) { +techlooper.controller("talentProfileController", function ($timeout, jsonValue, talentProfileService, $scope, $routeParams, $http) { //$timeout(function(){ // //talentProfileService.init(); // talentProfileService.showRating(parseFloat($scope.userProfile.rate)); diff --git a/src/main/webapp/assets/modules/user-profile/user-profile.con.js b/src/main/webapp/assets/modules/user-profile/user-profile.con.js index b21d84220..2c4362854 100644 --- a/src/main/webapp/assets/modules/user-profile/user-profile.con.js +++ b/src/main/webapp/assets/modules/user-profile/user-profile.con.js @@ -1,8 +1,6 @@ -angular.module('UserProfile').controller('userProfileController', function ($scope, jsonValue, shortcutFactory, userProfileFactory) { +angular.module('UserProfile').controller('userProfileController', function ($scope, jsonValue) { $scope.accounts = jsonValue.authSource; userProfileFactory.customScrollBar(); userProfileFactory.resizeScreen(); userProfileFactory.collapseContent(); - $('.btn-close').click(function () {shortcutFactory.trigger('esc');}); - $('.btn-logo').click(function () {shortcutFactory.trigger('esc');}); }); \ No newline at end of file From 492bd32cdf2062f9d0c2df392deaaa5c63a35d14 Mon Sep 17 00:00:00 2001 From: Phuong H Date: Tue, 6 Oct 2015 14:06:31 +0700 Subject: [PATCH 015/158] Refactor submitChallenge.html --- .../submissionChallenge.html} | 0 .../modules/common/{ => challenge}/submissionChallenge.js | 2 +- src/main/webapp/assets/modules/events/eventsController.js | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/main/webapp/assets/modules/common/{submission-challenge.html => challenge/submissionChallenge.html} (100%) rename src/main/webapp/assets/modules/common/{ => challenge}/submissionChallenge.js (91%) diff --git a/src/main/webapp/assets/modules/common/submission-challenge.html b/src/main/webapp/assets/modules/common/challenge/submissionChallenge.html similarity index 100% rename from src/main/webapp/assets/modules/common/submission-challenge.html rename to src/main/webapp/assets/modules/common/challenge/submissionChallenge.html diff --git a/src/main/webapp/assets/modules/common/submissionChallenge.js b/src/main/webapp/assets/modules/common/challenge/submissionChallenge.js similarity index 91% rename from src/main/webapp/assets/modules/common/submissionChallenge.js rename to src/main/webapp/assets/modules/common/challenge/submissionChallenge.js index e52857c6e..6ecbbcc8c 100644 --- a/src/main/webapp/assets/modules/common/submissionChallenge.js +++ b/src/main/webapp/assets/modules/common/challenge/submissionChallenge.js @@ -5,7 +5,7 @@ techlooper.directive("submissionChallenge", function ($timeout, jsonValue, utils scope: { ngModel: "=" }, - templateUrl: "modules/common/submission-challenge.html", + templateUrl: "modules/common/challenge/submissionChallenge.html", link: function (scope, el, attrs) { scope.pushChallengePhase = function(){ scope.submissionForm.$setSubmitted(); diff --git a/src/main/webapp/assets/modules/events/eventsController.js b/src/main/webapp/assets/modules/events/eventsController.js index 10086dff8..e50be619a 100644 --- a/src/main/webapp/assets/modules/events/eventsController.js +++ b/src/main/webapp/assets/modules/events/eventsController.js @@ -12,7 +12,7 @@ techlooper.controller("eventsController", function ($scope, apiService, utils, j if (!startDate.isValid()) continue; var web = {startDate: startDate.format(jsonValue.dateFormat)}; web.expired = moment(web.startDate, jsonValue.dateTimeFormat).isBefore(today, "day"); - if(web.expired == true){ + if (web.expired == true) { group.now = true; } group.push(web); From 707a2457b123ebb832e00d2f75b6a035274641e2 Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Tue, 6 Oct 2015 14:23:35 +0700 Subject: [PATCH 016/158] Don't send email job alert twice a day --- .../techlooper/cron/JobAlertEmailSender.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/techlooper/cron/JobAlertEmailSender.java b/src/main/java/com/techlooper/cron/JobAlertEmailSender.java index a67b9f829..0ba4fbf64 100644 --- a/src/main/java/com/techlooper/cron/JobAlertEmailSender.java +++ b/src/main/java/com/techlooper/cron/JobAlertEmailSender.java @@ -13,10 +13,12 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import static com.techlooper.model.JobAlertEmailResultEnum.EMAIL_SENT; import static com.techlooper.model.JobAlertEmailResultEnum.JOB_NOT_FOUND; +import static com.techlooper.util.DateTimeUtils.*; /** * This is cron job class that automatically sends job alert email to user periodically @@ -46,7 +48,7 @@ public class JobAlertEmailSender { * @throws Exception */ @Scheduled(cron = "${scheduled.cron.jobAlert}") - public void sendJobAlertEmail() throws Exception { + public synchronized void sendJobAlertEmail() throws Exception { if (enableJobAlert) { List jobAlertRegistrationEntities = jobAggregatorService.findJobAlertRegistration(JobAlertPeriodEnum.WEEKLY); @@ -54,14 +56,19 @@ public void sendJobAlertEmail() throws Exception { if (!jobAlertRegistrationEntities.isEmpty()) { int count = 0; for (JobAlertRegistrationEntity jobAlertRegistrationEntity : jobAlertRegistrationEntities) { - JobSearchCriteria criteria = dozerMapper.map(jobAlertRegistrationEntity, JobSearchCriteria.class); - JobSearchResponse jobSearchResponse = jobAggregatorService.findJob(criteria); - if (jobSearchResponse.getTotalJob() > 0) { - jobAggregatorService.sendEmail(jobAlertRegistrationEntity, jobSearchResponse); - jobAggregatorService.updateSendEmailResultCode(jobAlertRegistrationEntity, EMAIL_SENT); - count++; - } else { - jobAggregatorService.updateSendEmailResultCode(jobAlertRegistrationEntity, JOB_NOT_FOUND); + Date lastSentDate = string2Date(jobAlertRegistrationEntity.getLastEmailSentDateTime(), BASIC_DATE_TIME_PATTERN); + Date currentDate = new Date(); + + if (daysBetween(lastSentDate, currentDate) > 0) { + JobSearchCriteria criteria = dozerMapper.map(jobAlertRegistrationEntity, JobSearchCriteria.class); + JobSearchResponse jobSearchResponse = jobAggregatorService.findJob(criteria); + if (jobSearchResponse.getTotalJob() > 0) { + jobAggregatorService.sendEmail(jobAlertRegistrationEntity, jobSearchResponse); + jobAggregatorService.updateSendEmailResultCode(jobAlertRegistrationEntity, EMAIL_SENT); + count++; + } else { + jobAggregatorService.updateSendEmailResultCode(jobAlertRegistrationEntity, JOB_NOT_FOUND); + } } } LOGGER.info("There are " + count + " job alert emails has been sent"); From e5efac651fe241ae11ab4c5f538f610fda51fbec Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Tue, 6 Oct 2015 15:35:06 +0700 Subject: [PATCH 017/158] Add submissions list of a registrant of a challenge --- .../model/ChallengeSubmissionDto.java | 87 +++++++++++++++++++ .../techlooper/service/ChallengeService.java | 74 ++++++++-------- .../service/impl/ChallengeServiceImpl.java | 48 +++++++--- 3 files changed, 159 insertions(+), 50 deletions(-) create mode 100644 src/main/java/com/techlooper/model/ChallengeSubmissionDto.java diff --git a/src/main/java/com/techlooper/model/ChallengeSubmissionDto.java b/src/main/java/com/techlooper/model/ChallengeSubmissionDto.java new file mode 100644 index 000000000..f53cbfc75 --- /dev/null +++ b/src/main/java/com/techlooper/model/ChallengeSubmissionDto.java @@ -0,0 +1,87 @@ +package com.techlooper.model; + +/** + * Created by NguyenDangKhoa on 10/6/15. + */ +public class ChallengeSubmissionDto { + + private Long challengeSubmissionId; + + private Long registrantId; + + private String registrantName; + + private Long challengeId; + + private String submissionURL; + + private String submissionDateTime; + + private String submissionDescription; + + private String submissionStatus; + + public Long getChallengeSubmissionId() { + return challengeSubmissionId; + } + + public void setChallengeSubmissionId(Long challengeSubmissionId) { + this.challengeSubmissionId = challengeSubmissionId; + } + + public Long getRegistrantId() { + return registrantId; + } + + public void setRegistrantId(Long registrantId) { + this.registrantId = registrantId; + } + + public String getRegistrantName() { + return registrantName; + } + + public void setRegistrantName(String registrantName) { + this.registrantName = registrantName; + } + + public Long getChallengeId() { + return challengeId; + } + + public void setChallengeId(Long challengeId) { + this.challengeId = challengeId; + } + + public String getSubmissionURL() { + return submissionURL; + } + + public void setSubmissionURL(String submissionURL) { + this.submissionURL = submissionURL; + } + + public String getSubmissionDateTime() { + return submissionDateTime; + } + + public void setSubmissionDateTime(String submissionDateTime) { + this.submissionDateTime = submissionDateTime; + } + + public String getSubmissionDescription() { + return submissionDescription; + } + + public void setSubmissionDescription(String submissionDescription) { + this.submissionDescription = submissionDescription; + } + + public String getSubmissionStatus() { + return submissionStatus; + } + + public void setSubmissionStatus(String submissionStatus) { + this.submissionStatus = submissionStatus; + } +} diff --git a/src/main/java/com/techlooper/service/ChallengeService.java b/src/main/java/com/techlooper/service/ChallengeService.java index 76ebcd4ca..5df7be1ad 100644 --- a/src/main/java/com/techlooper/service/ChallengeService.java +++ b/src/main/java/com/techlooper/service/ChallengeService.java @@ -19,71 +19,73 @@ */ public interface ChallengeService { - ChallengeEntity savePostChallenge(ChallengeDto challengeDto) throws Exception; + ChallengeEntity savePostChallenge(ChallengeDto challengeDto) throws Exception; - void sendPostChallengeEmailToEmployer(ChallengeEntity challengeEntity) - throws MessagingException, IOException, TemplateException; + void sendPostChallengeEmailToEmployer(ChallengeEntity challengeEntity) + throws MessagingException, IOException, TemplateException; - void sendPostChallengeEmailToTechloopies(ChallengeEntity challengeEntity, Boolean isNewChallenge) - throws MessagingException, IOException, TemplateException; + void sendPostChallengeEmailToTechloopies(ChallengeEntity challengeEntity, Boolean isNewChallenge) + throws MessagingException, IOException, TemplateException; - void sendEmailNotifyRegistrantAboutChallengeTimeline(ChallengeEntity challengeEntity, - ChallengeRegistrantEntity challengeRegistrantEntity, ChallengePhaseEnum challengePhase) throws Exception; + void sendEmailNotifyRegistrantAboutChallengeTimeline(ChallengeEntity challengeEntity, + ChallengeRegistrantEntity challengeRegistrantEntity, ChallengePhaseEnum challengePhase) throws Exception; - ChallengeDetailDto getChallengeDetail(Long challengeId); + ChallengeDetailDto getChallengeDetail(Long challengeId); - Long getNumberOfRegistrants(Long challengeId); + Long getNumberOfRegistrants(Long challengeId); - void sendApplicationEmailToContestant(ChallengeEntity challengeEntity, ChallengeRegistrantEntity challengeRegistrantEntity) - throws MessagingException, IOException, TemplateException; + void sendApplicationEmailToContestant(ChallengeEntity challengeEntity, ChallengeRegistrantEntity challengeRegistrantEntity) + throws MessagingException, IOException, TemplateException; - void sendApplicationEmailToEmployer(ChallengeEntity challengeEntity, ChallengeRegistrantEntity challengeRegistrantEntity) - throws MessagingException, IOException, TemplateException; + void sendApplicationEmailToEmployer(ChallengeEntity challengeEntity, ChallengeRegistrantEntity challengeRegistrantEntity) + throws MessagingException, IOException, TemplateException; - long joinChallenge(ChallengeRegistrantDto challengeRegistrantDto) throws MessagingException, IOException, TemplateException; + long joinChallenge(ChallengeRegistrantDto challengeRegistrantDto) throws MessagingException, IOException, TemplateException; - List listChallenges(); + List listChallenges(); - List listChallenges(String ownerEmail); + List listChallenges(String ownerEmail); - List listChallengesByPhase(ChallengePhaseEnum challengePhase); + List listChallengesByPhase(ChallengePhaseEnum challengePhase); - Long getTotalNumberOfChallenges(); + Long getTotalNumberOfChallenges(); - Double getTotalAmountOfPrizeValues(); + Double getTotalAmountOfPrizeValues(); - Long getTotalNumberOfRegistrants(); + Long getTotalNumberOfRegistrants(); - ChallengeDetailDto getTheLatestChallenge(); + ChallengeDetailDto getTheLatestChallenge(); - Collection findByOwnerAndCondition(String owner, Predicate condition); + Collection findByOwnerAndCondition(String owner, Predicate condition); - Collection findInProgressChallenges(String owner); + Collection findInProgressChallenges(String owner); // Collection findRegistrantsByChallengeId(Long challengeId); - Long countRegistrantsByChallengeId(Long challengeId); + Long countRegistrantsByChallengeId(Long challengeId); - boolean delete(Long id, String ownerEmail); + boolean delete(Long id, String ownerEmail); - ChallengeDto findChallengeById(Long id); + ChallengeDto findChallengeById(Long id); - Set findRegistrantsByOwner(String ownerEmail, Long challengeId); + Set findRegistrantsByOwner(String ownerEmail, Long challengeId); - ChallengeRegistrantDto saveRegistrant(String ownerEmail, ChallengeRegistrantDto challengeRegistrantDto); + ChallengeRegistrantDto saveRegistrant(String ownerEmail, ChallengeRegistrantDto challengeRegistrantDto); - List findChallengeRegistrantWithinPeriod( - Long challengeId, Long currentDateTime, TimePeriodEnum period); + List findChallengeRegistrantWithinPeriod( + Long challengeId, Long currentDateTime, TimePeriodEnum period); - List findChallengeSubmissionWithinPeriod( - Long challengeId, Long currentDateTime, TimePeriodEnum period); + List findChallengeSubmissionWithinPeriod( + Long challengeId, Long currentDateTime, TimePeriodEnum period); - void sendDailySummaryEmailToChallengeOwner(ChallengeEntity challengeEntity) throws Exception; + void sendDailySummaryEmailToChallengeOwner(ChallengeEntity challengeEntity) throws Exception; - boolean isOwnerOfChallenge(String ownerEmail, Long challengeId); + boolean isOwnerOfChallenge(String ownerEmail, Long challengeId); - boolean sendEmailToDailyChallengeRegistrants(String challengeOwner, Long challengeId, Long now, EmailContent emailContent); + boolean sendEmailToDailyChallengeRegistrants(String challengeOwner, Long challengeId, Long now, EmailContent emailContent); - boolean sendEmailToRegistrant(String challengeOwner, Long challengeId, Long registrantId, EmailContent emailContent); + boolean sendEmailToRegistrant(String challengeOwner, Long challengeId, Long registrantId, EmailContent emailContent); + + List findChallengeSubmissionByRegistrant(Long challengeId, Long registrantId); } diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index b341341fa..4d17e4c34 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -592,7 +592,11 @@ public Set findRegistrantsByOwner(String ownerEmail, Lon if (challengeIterator.hasNext()) { Iterator registrants = challengeRegistrantRepository.search(challengeQuery).iterator(); - registrants.forEachRemaining(registrant -> registrantDtos.add(dozerMapper.map(registrant, ChallengeRegistrantDto.class))); + registrants.forEachRemaining(registrant -> { + ChallengeRegistrantDto registrantDto = dozerMapper.map(registrant, ChallengeRegistrantDto.class); + registrantDto.setSubmissions(findChallengeSubmissionByRegistrant(challengeId, registrant.getRegistrantId())); + registrantDtos.add(registrantDto); + }); } return registrantDtos; @@ -734,19 +738,35 @@ public boolean sendEmailToDailyChallengeRegistrants(String challengeOwner, Long return emailService.sendEmail(emailContent); } - public boolean sendEmailToRegistrant(String challengeOwner, Long challengeId, Long registrantId, EmailContent emailContent) { - if (isOwnerOfChallenge(challengeOwner, challengeId)) { - ChallengeRegistrantEntity registrant = challengeRegistrantRepository.findOne(registrantId); - String csvEmails = registrant.getRegistrantEmail(); - try { - emailContent.setRecipients(InternetAddress.parse(csvEmails)); - } - catch (AddressException e) { - LOGGER.debug("Can not parse email address", e); - return false; - } + public boolean sendEmailToRegistrant(String challengeOwner, Long challengeId, Long registrantId, EmailContent emailContent) { + if (isOwnerOfChallenge(challengeOwner, challengeId)) { + ChallengeRegistrantEntity registrant = challengeRegistrantRepository.findOne(registrantId); + String csvEmails = registrant.getRegistrantEmail(); + try { + emailContent.setRecipients(InternetAddress.parse(csvEmails)); + } catch (AddressException e) { + LOGGER.debug("Can not parse email address", e); + return false; + } + } + return emailService.sendEmail(emailContent); + } + + @Override + public List findChallengeSubmissionByRegistrant(Long challengeId, Long registrantId) { + List result = new ArrayList<>(); + NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder().withTypes("challengeSubmission"); + BoolFilterBuilder boolFilterBuilder = new BoolFilterBuilder(); + boolFilterBuilder.must(termFilter("challengeId", challengeId)); + boolFilterBuilder.must(termFilter("registrantId", registrantId)); + + searchQueryBuilder.withQuery(filteredQuery(matchAllQuery(), boolFilterBuilder)); + Iterator iterator = challengeSubmissionRepository.search(searchQueryBuilder.build()).iterator(); + while (iterator.hasNext()) { + result.add(dozerMapper.map(iterator.next(), ChallengeSubmissionDto.class)); + } + + return result; } - return emailService.sendEmail(emailContent); - } } From 8168c24dd9e14e0e0d5524390ce5008a29b4fe78 Mon Sep 17 00:00:00 2001 From: Phuong H Date: Tue, 6 Oct 2015 15:39:44 +0700 Subject: [PATCH 018/158] Enable status of join now button and submit button --- .../assets/modules/common/apiService.js | 2 + .../common/challenge/submissionChallenge.js | 1 + .../modules/common/filter/progressFilter.js | 18 ++++++--- .../assets/modules/contests/contest-list.html | 6 ++- .../assets/modules/contests/contests.con.js | 38 +++++++++++++++++-- 5 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/assets/modules/common/apiService.js b/src/main/webapp/assets/modules/common/apiService.js index 2c3a5ecc5..dbe831ce9 100644 --- a/src/main/webapp/assets/modules/common/apiService.js +++ b/src/main/webapp/assets/modules/common/apiService.js @@ -73,6 +73,8 @@ techlooper.factory("apiService", function ($rootScope, $location, jsonValue, $ht $('body').addClass('noscroll'); utils.sendNotification(jsonValue.notifications.loading); instance.getSocialLoginUrl("FACEBOOK_REGISTER").success(function (url) { + localStorageService.set("priorFoot", $location.url()); + localStorageService.set("lastFoot", $location.url()); localStorageService.set("joinNow", true); window.location = url; }); diff --git a/src/main/webapp/assets/modules/common/challenge/submissionChallenge.js b/src/main/webapp/assets/modules/common/challenge/submissionChallenge.js index 6ecbbcc8c..683f2f058 100644 --- a/src/main/webapp/assets/modules/common/challenge/submissionChallenge.js +++ b/src/main/webapp/assets/modules/common/challenge/submissionChallenge.js @@ -15,6 +15,7 @@ techlooper.directive("submissionChallenge", function ($timeout, jsonValue, utils console.log(scope.submissionDescription); console.log(scope.submissionURL); } + scope.hideSubmitForm = function(){ var subForm = $('.submit-phase-contest'); subForm.find('#txtDescription').val(''); diff --git a/src/main/webapp/assets/modules/common/filter/progressFilter.js b/src/main/webapp/assets/modules/common/filter/progressFilter.js index d8ddff7a6..6f84dddc2 100644 --- a/src/main/webapp/assets/modules/common/filter/progressFilter.js +++ b/src/main/webapp/assets/modules/common/filter/progressFilter.js @@ -1,38 +1,46 @@ -techlooper.filter("progress", function (jsonValue, resourcesService) { +techlooper.filter("progress", function (jsonValue, resourcesService, localStorageService) { var progressFn = function (input, type, param1) { if (!input) return ""; switch (type) { case "challenge": var contestDetail = input; + var joinContests = localStorageService.get("joinContests") || ""; + var email = localStorageService.get("email") || ""; + var isJoined = (joinContests.indexOf(contestDetail.challengeId) >= 0) && (email.length > 0); + contestDetail.currentUserJoined = isJoined; + //if current date < start date var startDate = moment(contestDetail.startDateTime, jsonValue.dateFormat); - contestDetail.progress = jsonValue.status.notStarted; + contestDetail.progress = angular.copy(jsonValue.status.notStarted); if (moment().isBefore(startDate, 'day')) { + delete contestDetail.currentUserJoined; return contestDetail.progress.translate; } //if start date <= current date <= register date var registrationDate = moment(contestDetail.registrationDateTime, jsonValue.dateFormat); - contestDetail.progress = jsonValue.status.registration; + contestDetail.progress = angular.copy(jsonValue.status.registration); if (moment().isBetween(startDate, registrationDate, 'day') || moment().isSame(startDate, 'day') || moment().isSame(registrationDate, 'day')) { return contestDetail.progress.translate; } // if register date < current date <= submit date var submissionDate = moment(contestDetail.submissionDateTime, jsonValue.dateFormat); - contestDetail.progress = jsonValue.status.progress; + contestDetail.progress = angular.copy(jsonValue.status.progress); if (moment().isBetween(registrationDate, submissionDate, 'day') || moment().isSame(submissionDate, 'day')) { return contestDetail.progress.translate; } // if submit date < current date - contestDetail.progress = jsonValue.status.closed; + contestDetail.progress = angular.copy(jsonValue.status.closed); if (submissionDate.isBefore(moment(), 'day')) { + delete contestDetail.currentUserJoined; return contestDetail.progress.translate; } delete contestDetail.progress; + delete contestDetail.currentUserJoined; return ""; case "challenges": diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html index 2ee5a2d29..1d0769200 100644 --- a/src/main/webapp/assets/modules/contests/contest-list.html +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -25,10 +25,12 @@ | - + | - | + + | +
diff --git a/src/main/webapp/assets/modules/contests/contests.con.js b/src/main/webapp/assets/modules/contests/contests.con.js index 2cf2ff8ef..258ce79fe 100644 --- a/src/main/webapp/assets/modules/contests/contests.con.js +++ b/src/main/webapp/assets/modules/contests/contests.con.js @@ -1,6 +1,33 @@ -techlooper.controller('contestsController', function (apiService, $scope, jsonValue, $window, $translate, $filter, utils) { +techlooper.controller('contestsController', function (apiService, $scope, jsonValue, $window, $translate, $filter, + utils, localStorageService) { utils.sendNotification(jsonValue.notifications.loading); - $scope.contestTimeLeft = function(contest) { + + if (localStorageService.get("joinNow")) { + localStorageService.remove("joinNow"); + var firstName = localStorageService.get("firstName"); + var lastName = localStorageService.get("lastName"); + var email = localStorageService.get("email"); + var contestId = localStorageService.get("joiningChallengeId"); + if (contestId) { + apiService.joinContest(contestId, firstName, lastName, email, $translate.use()) + .success(function (numberOfRegistrants) { + if ($scope.contestDetail) { + $scope.contestDetail.numberOfRegistrants = numberOfRegistrants; + } + + var joinContests = localStorageService.get("joinContests") || ""; + joinContests = joinContests.length > 0 ? joinContests.split(",") : []; + if ($.inArray(contestId, joinContests) < 0) { + joinContests.push(contestId); + } + + localStorageService.set("joinContests", joinContests.join(",")); + }); + localStorageService.remove("joiningChallengeId"); + } + } + + $scope.contestTimeLeft = function (contest) { if (!contest.progress) return ""; switch (contest.progress.translate) { case jsonValue.status.progress.translate: @@ -19,11 +46,16 @@ techlooper.controller('contestsController', function (apiService, $scope, jsonVa return ""; } - apiService.searchContests().success(function(contests) { + apiService.searchContests().success(function (contests) { //contests.sort(sortByStartDate); utils.sortByDate(contests, "startDateTime"); $scope.contestsList = contests; }).finally(function () { utils.sendNotification(jsonValue.notifications.loaded); }); + + $scope.joinNowByFB = function (challenge) { + localStorageService.set("joiningChallengeId", challenge.challengeId); + apiService.joinNowByFB(); + } }); \ No newline at end of file From fc18c10a063f350d5cbfc083ac3ce931851f182d Mon Sep 17 00:00:00 2001 From: Phuong H Date: Tue, 6 Oct 2015 16:12:00 +0700 Subject: [PATCH 019/158] Enable button join now and submit in contest-view --- .../contest-detail/contest-detail.con.js | 50 ++++++++++--------- .../contest-detail/contest-detail.tem.html | 2 +- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js index 5fe03480e..8732e9e8f 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js @@ -83,6 +83,7 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l } localStorageService.set("joinContests", joinContests.join(",")); + $filter("progress")($scope.contestDetail, "challenge"); }); } @@ -90,21 +91,23 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l .success(function (data) { $scope.contestDetail = data; $filter("progress")($scope.contestDetail, "challenge"); - var idea = $scope.contestDetail.ideaSubmissionDateTime? true : false, - uiux = $scope.contestDetail.uxSubmissionDateTime? true : false, - prototype = $scope.contestDetail.prototypeSubmissionDateTime? true : false; - if(!idea || !uiux || !prototype){ - if((idea && uiux) || (idea && prototype) || (prototype && uiux)){ - $scope.contestDetail.timeline = 4; - } - else if(((!idea && !uiux) && prototype) || ((!idea && !prototype) && uiux) || ((!prototype && !uiux) && idea)){ - $scope.contestDetail.timeline = 3; - }else{ - $scope.contestDetail.timeline = 2; - } - }else{ - $scope.contestDetail.timeline = 5; + var idea = $scope.contestDetail.ideaSubmissionDateTime ? true : false, + uiux = $scope.contestDetail.uxSubmissionDateTime ? true : false, + prototype = $scope.contestDetail.prototypeSubmissionDateTime ? true : false; + if (!idea || !uiux || !prototype) { + if ((idea && uiux) || (idea && prototype) || (prototype && uiux)) { + $scope.contestDetail.timeline = 4; } + else if (((!idea && !uiux) && prototype) || ((!idea && !prototype) && uiux) || ((!prototype && !uiux) && idea)) { + $scope.contestDetail.timeline = 3; + } + else { + $scope.contestDetail.timeline = 2; + } + } + else { + $scope.contestDetail.timeline = 5; + } }) .error(function () {$location.url("404");}); @@ -167,22 +170,23 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l $scope.sortStartDate = $(["asc", "desc"]).not([$scope.sortStartDate]).get()[0]; utils.sortByNumber($scope.registrants, "registrantId", $scope.sortStartDate); } - $scope.updateScore = function(registrant, $event) { + $scope.updateScore = function (registrant, $event) { $($event.currentTarget).addClass('green'); apiService.saveChallengeRegistrant(registrant) - .success(function (rt) { - registrant.score = rt.score; - }).finally(function () { - $timeout(function(){ + .success(function (rt) { + registrant.score = rt.score; + }).finally(function () { + $timeout(function () { $($event.currentTarget).removeClass('green'); - },1000); + }, 1000); }); } - $scope.showSubmitForm = function(){ + $scope.showSubmitForm = function () { var subForm = $('.submit-phase-contest'); - if(subForm.hasClass('show')){ + if (subForm.hasClass('show')) { subForm.removeClass('show'); - }else{ + } + else { subForm.addClass('show'); } } diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html index b5e71c764..755a0ef82 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html @@ -66,7 +66,7 @@

-

From d8a8a90321833887d8435252b0e178e8ddecf82e Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Tue, 6 Oct 2015 17:13:53 +0700 Subject: [PATCH 020/158] Add submissions field to challenge registrant dot --- .../entity/ChallengeRegistrantDto.java | 140 ++++++++++-------- 1 file changed, 77 insertions(+), 63 deletions(-) diff --git a/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java b/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java index 6df3ec0cd..4a214087e 100644 --- a/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java +++ b/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java @@ -1,99 +1,113 @@ package com.techlooper.entity; +import com.techlooper.model.ChallengeSubmissionDto; import com.techlooper.model.Language; +import java.util.List; + /** * Created by NguyenDangKhoa on 7/6/15. */ public class ChallengeRegistrantDto { - private Long challengeId; + private Long challengeId; + + private String registrantEmail; + + private String registrantFirstName; + + private String registrantLastName; + + private Language lang; - private String registrantEmail; + private Double score; - private String registrantFirstName; + private Long registrantId; - private String registrantLastName; + private Boolean disqualified; - private Language lang; + private String disqualifiedReason; - private Double score; + private List submissions; - private Long registrantId; - private Boolean disqualified; + public String getDisqualifiedReason() { + return disqualifiedReason; + } - private String disqualifiedReason; + public void setDisqualifiedReason(String disqualifiedReason) { + this.disqualifiedReason = disqualifiedReason; + } - public String getDisqualifiedReason() { - return disqualifiedReason; - } + public Boolean getDisqualified() { + return disqualified; + } - public void setDisqualifiedReason(String disqualifiedReason) { - this.disqualifiedReason = disqualifiedReason; - } + public void setDisqualified(Boolean disqualified) { + this.disqualified = disqualified; + } - public Boolean getDisqualified() { - return disqualified; - } + public Long getRegistrantId() { + return registrantId; + } - public void setDisqualified(Boolean disqualified) { - this.disqualified = disqualified; - } + public void setRegistrantId(Long registrantId) { + this.registrantId = registrantId; + } - public Long getRegistrantId() { - return registrantId; - } + public Double getScore() { + return score; + } - public void setRegistrantId(Long registrantId) { - this.registrantId = registrantId; - } + public void setScore(Double score) { + this.score = score; + } - public Double getScore() { - return score; - } + public Long getChallengeId() { + return challengeId; + } - public void setScore(Double score) { - this.score = score; - } + public void setChallengeId(Long challengeId) { + this.challengeId = challengeId; + } - public Long getChallengeId() { - return challengeId; - } + public String getRegistrantEmail() { + return registrantEmail; + } - public void setChallengeId(Long challengeId) { - this.challengeId = challengeId; - } + public void setRegistrantEmail(String registrantEmail) { + this.registrantEmail = registrantEmail; + } - public String getRegistrantEmail() { - return registrantEmail; - } + public String getRegistrantFirstName() { + return registrantFirstName; + } - public void setRegistrantEmail(String registrantEmail) { - this.registrantEmail = registrantEmail; - } + public void setRegistrantFirstName(String registrantFirstName) { + this.registrantFirstName = registrantFirstName; + } - public String getRegistrantFirstName() { - return registrantFirstName; - } + public String getRegistrantLastName() { + return registrantLastName; + } - public void setRegistrantFirstName(String registrantFirstName) { - this.registrantFirstName = registrantFirstName; - } + public void setRegistrantLastName(String registrantLastName) { + this.registrantLastName = registrantLastName; + } - public String getRegistrantLastName() { - return registrantLastName; - } + public Language getLang() { + return lang; + } - public void setRegistrantLastName(String registrantLastName) { - this.registrantLastName = registrantLastName; - } + public void setLang(Language lang) { + this.lang = lang; + } - public Language getLang() { - return lang; - } + public List getSubmissions() { + return submissions; + } - public void setLang(Language lang) { - this.lang = lang; - } + public void setSubmissions(List submissions) { + this.submissions = submissions; + } } From 27dfa205db91cd21c6bde815979a6944c7375439 Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Tue, 6 Oct 2015 17:47:09 +0700 Subject: [PATCH 021/158] Update daily sending email status for challenge contestant --- .../cron/ChallengeTimelineNotifier.java | 31 ++- .../entity/ChallengeRegistrantDto.java | 10 + .../entity/ChallengeRegistrantEntity.java | 207 ++++++++++-------- .../techlooper/model/EmailSentResultEnum.java | 19 ++ .../techlooper/service/ChallengeService.java | 2 + .../service/impl/ChallengeServiceImpl.java | 15 +- 6 files changed, 176 insertions(+), 108 deletions(-) create mode 100644 src/main/java/com/techlooper/model/EmailSentResultEnum.java diff --git a/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java b/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java index 786464401..426c52d3c 100644 --- a/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java +++ b/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java @@ -4,6 +4,7 @@ import com.techlooper.entity.ChallengeRegistrantDto; import com.techlooper.entity.ChallengeRegistrantEntity; import com.techlooper.model.ChallengePhaseEnum; +import com.techlooper.model.EmailSentResultEnum; import com.techlooper.service.ChallengeService; import org.apache.commons.lang3.StringUtils; import org.dozer.Mapper; @@ -15,9 +16,12 @@ import javax.annotation.Resource; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Set; +import static com.techlooper.util.DateTimeUtils.*; + @Service public class ChallengeTimelineNotifier { @@ -33,7 +37,7 @@ public class ChallengeTimelineNotifier { private Boolean enableJobAlert; @Scheduled(cron = "${scheduled.cron.notifyChallengeTimeline}") - public void notifyRegistrantAboutChallengeTimeline() throws Exception { + public synchronized void notifyRegistrantAboutChallengeTimeline() throws Exception { if (enableJobAlert) { List challengePhases = Arrays.asList(ChallengePhaseEnum.REGISTRATION, ChallengePhaseEnum.IN_PROGRESS); @@ -44,17 +48,24 @@ public void notifyRegistrantAboutChallengeTimeline() throws Exception { for (ChallengeEntity challengeEntity : challengeEntities) { Set challengeRegistrants = challengeService.findRegistrantsByOwner( challengeEntity.getAuthorEmail(), challengeEntity.getChallengeId()); - + for (ChallengeRegistrantDto challengeRegistrant : challengeRegistrants) { - ChallengeRegistrantEntity challengeRegistrantEntity = dozerMapper.map(challengeRegistrant, ChallengeRegistrantEntity.class); - try { - if (StringUtils.isNotEmpty(challengeRegistrantEntity.getRegistrantEmail())) { - challengeService.sendEmailNotifyRegistrantAboutChallengeTimeline( - challengeEntity, challengeRegistrantEntity, challengePhase); - count++; + Date lastSentDate = string2Date(challengeRegistrant.getLastEmailSentDateTime(), BASIC_DATE_TIME_PATTERN); + Date currentDate = new Date(); + + if (daysBetween(lastSentDate, currentDate) > 0) { + ChallengeRegistrantEntity challengeRegistrantEntity = dozerMapper.map(challengeRegistrant, ChallengeRegistrantEntity.class); + try { + if (StringUtils.isNotEmpty(challengeRegistrantEntity.getRegistrantEmail())) { + challengeService.sendEmailNotifyRegistrantAboutChallengeTimeline( + challengeEntity, challengeRegistrantEntity, challengePhase); + challengeService.updateSendEmailToContestantResultCode(challengeRegistrantEntity, EmailSentResultEnum.OK); + count++; + } + } catch (Exception ex) { + LOGGER.error(ex.getMessage(), ex); + challengeService.updateSendEmailToContestantResultCode(challengeRegistrantEntity, EmailSentResultEnum.ERROR); } - } catch (Exception ex) { - LOGGER.error(ex.getMessage(), ex); } } } diff --git a/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java b/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java index 4a214087e..0c3d69101 100644 --- a/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java +++ b/src/main/java/com/techlooper/entity/ChallengeRegistrantDto.java @@ -28,6 +28,8 @@ public class ChallengeRegistrantDto { private String disqualifiedReason; + private String lastEmailSentDateTime; + private List submissions; @@ -110,4 +112,12 @@ public List getSubmissions() { public void setSubmissions(List submissions) { this.submissions = submissions; } + + public String getLastEmailSentDateTime() { + return lastEmailSentDateTime; + } + + public void setLastEmailSentDateTime(String lastEmailSentDateTime) { + this.lastEmailSentDateTime = lastEmailSentDateTime; + } } diff --git a/src/main/java/com/techlooper/entity/ChallengeRegistrantEntity.java b/src/main/java/com/techlooper/entity/ChallengeRegistrantEntity.java index 646aac345..f8ff65297 100644 --- a/src/main/java/com/techlooper/entity/ChallengeRegistrantEntity.java +++ b/src/main/java/com/techlooper/entity/ChallengeRegistrantEntity.java @@ -2,14 +2,9 @@ import com.techlooper.model.Language; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.annotations.Document; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldIndex; +import org.springframework.data.elasticsearch.annotations.*; -import static org.springframework.data.elasticsearch.annotations.FieldType.Boolean; -import static org.springframework.data.elasticsearch.annotations.FieldType.Double; -import static org.springframework.data.elasticsearch.annotations.FieldType.Long; -import static org.springframework.data.elasticsearch.annotations.FieldType.String; +import static org.springframework.data.elasticsearch.annotations.FieldType.*; /** * Created by NguyenDangKhoa on 7/3/15. @@ -17,123 +12,145 @@ @Document(indexName = "techlooper", type = "challengeRegistrant") public class ChallengeRegistrantEntity { - @Id - private Long registrantId; + @Id + private Long registrantId; - @Field(type = String, index = FieldIndex.not_analyzed) - private String registrantEmail; + @Field(type = String, index = FieldIndex.not_analyzed) + private String registrantEmail; - @Field(type = Long) - private Long challengeId; + @Field(type = Long) + private Long challengeId; - @Field(type = String) - private String registrantFirstName; + @Field(type = String) + private String registrantFirstName; - @Field(type = String) - private String registrantLastName; + @Field(type = String) + private String registrantLastName; - @Field(type = Boolean) - private Boolean mailSent; + @Field(type = Boolean) + private Boolean mailSent; - @Field(type = String, index = FieldIndex.not_analyzed) - private Language lang; + @Field(type = String, index = FieldIndex.not_analyzed) + private Language lang; - @Field(type = Double) - private Double score; + @Field(type = Double) + private Double score; - @Field(type = Boolean) - private Boolean disqualified; + @Field(type = Boolean) + private Boolean disqualified; - @Field(type = String, index = FieldIndex.not_analyzed) - private String disqualifiedReason; + @Field(type = String, index = FieldIndex.not_analyzed) + private String disqualifiedReason; - public ChallengeRegistrantEntity() { - } + @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "dd/MM/yyyy HH:mm") + private String lastEmailSentDateTime; - public ChallengeRegistrantEntity(Long registrantId, java.lang.String registrantEmail, java.lang.String registrantFirstName, String registrantLastName) { - this.registrantId = registrantId; - this.registrantEmail = registrantEmail; - this.registrantLastName = registrantLastName; - this.registrantFirstName = registrantFirstName; - } + @Field(type = Integer) + private int lastEmailSentResultCode; - public java.lang.String getDisqualifiedReason() { - return disqualifiedReason; - } + public ChallengeRegistrantEntity() { + } - public void setDisqualifiedReason(java.lang.String disqualifiedReason) { - this.disqualifiedReason = disqualifiedReason; - } + public ChallengeRegistrantEntity(Long registrantId, java.lang.String registrantEmail, java.lang.String registrantFirstName, String registrantLastName) { + this.registrantId = registrantId; + this.registrantEmail = registrantEmail; + this.registrantLastName = registrantLastName; + this.registrantFirstName = registrantFirstName; + } - public java.lang.Boolean getDisqualified() { - return disqualified; - } + public java.lang.String getDisqualifiedReason() { + return disqualifiedReason; + } - public void setDisqualified(java.lang.Boolean disqualified) { - this.disqualified = disqualified; - } + public void setDisqualifiedReason(java.lang.String disqualifiedReason) { + this.disqualifiedReason = disqualifiedReason; + } - public Double getScore() { - return score; - } + public java.lang.Boolean getDisqualified() { + return disqualified; + } - public void setScore(Double score) { - this.score = score; - } + public void setDisqualified(java.lang.Boolean disqualified) { + this.disqualified = disqualified; + } - public Long getRegistrantId() { - return registrantId; - } + public Double getScore() { + return score; + } - public void setRegistrantId(Long registrantId) { - this.registrantId = registrantId; - } + public void setScore(Double score) { + this.score = score; + } - public Long getChallengeId() { - return challengeId; - } + public Long getRegistrantId() { + return registrantId; + } - public void setChallengeId(Long challengeId) { - this.challengeId = challengeId; - } + public void setRegistrantId(Long registrantId) { + this.registrantId = registrantId; + } - public String getRegistrantEmail() { - return registrantEmail; - } + public Long getChallengeId() { + return challengeId; + } - public void setRegistrantEmail(String registrantEmail) { - this.registrantEmail = registrantEmail; - } + public void setChallengeId(Long challengeId) { + this.challengeId = challengeId; + } - public String getRegistrantFirstName() { - return registrantFirstName; - } + public String getRegistrantEmail() { + return registrantEmail; + } - public void setRegistrantFirstName(String registrantFirstName) { - this.registrantFirstName = registrantFirstName; - } + public void setRegistrantEmail(String registrantEmail) { + this.registrantEmail = registrantEmail; + } - public String getRegistrantLastName() { - return registrantLastName; - } + public String getRegistrantFirstName() { + return registrantFirstName; + } - public void setRegistrantLastName(String registrantLastName) { - this.registrantLastName = registrantLastName; - } + public void setRegistrantFirstName(String registrantFirstName) { + this.registrantFirstName = registrantFirstName; + } - public Boolean getMailSent() { - return mailSent; - } + public String getRegistrantLastName() { + return registrantLastName; + } - public void setMailSent(Boolean mailSent) { - this.mailSent = mailSent; - } + public void setRegistrantLastName(String registrantLastName) { + this.registrantLastName = registrantLastName; + } - public Language getLang() { - return lang; - } + public Boolean getMailSent() { + return mailSent; + } - public void setLang(Language lang) { - this.lang = lang; - } + public void setMailSent(Boolean mailSent) { + this.mailSent = mailSent; + } + + public Language getLang() { + return lang; + } + + public void setLang(Language lang) { + this.lang = lang; + } + + public String getLastEmailSentDateTime() { + return lastEmailSentDateTime; + } + + public void setLastEmailSentDateTime(String lastEmailSentDateTime) { + this.lastEmailSentDateTime = lastEmailSentDateTime; + } + + public int getLastEmailSentResultCode() { + return lastEmailSentResultCode; + } + + public void setLastEmailSentResultCode(int lastEmailSentResultCode) { + this.lastEmailSentResultCode = lastEmailSentResultCode; + } } diff --git a/src/main/java/com/techlooper/model/EmailSentResultEnum.java b/src/main/java/com/techlooper/model/EmailSentResultEnum.java new file mode 100644 index 000000000..b457d7d68 --- /dev/null +++ b/src/main/java/com/techlooper/model/EmailSentResultEnum.java @@ -0,0 +1,19 @@ +package com.techlooper.model; + +public enum EmailSentResultEnum { + + OK(200), + + ERROR(500); + + private int value; + + private EmailSentResultEnum(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + +} diff --git a/src/main/java/com/techlooper/service/ChallengeService.java b/src/main/java/com/techlooper/service/ChallengeService.java index 5df7be1ad..b4d229805 100644 --- a/src/main/java/com/techlooper/service/ChallengeService.java +++ b/src/main/java/com/techlooper/service/ChallengeService.java @@ -88,4 +88,6 @@ List findChallengeSubmissionWithinPeriod( List findChallengeSubmissionByRegistrant(Long challengeId, Long registrantId); + void updateSendEmailToContestantResultCode(ChallengeRegistrantEntity challengeRegistrantEntity, EmailSentResultEnum code); + } diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index 4d17e4c34..6b4861974 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -10,7 +10,6 @@ import com.techlooper.repository.elasticsearch.ChallengeSubmissionRepository; import com.techlooper.service.ChallengeService; import com.techlooper.service.EmailService; -import com.techlooper.util.DateTimeUtils; import freemarker.template.Template; import freemarker.template.TemplateException; import org.apache.commons.lang3.StringUtils; @@ -51,6 +50,7 @@ import java.util.function.Predicate; import java.util.stream.Collectors; +import static com.techlooper.util.DateTimeUtils.*; import static org.elasticsearch.index.query.FilterBuilders.*; import static org.elasticsearch.index.query.QueryBuilders.*; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; @@ -224,9 +224,9 @@ public void sendEmailNotifyRegistrantAboutChallengeTimeline(ChallengeEntity chal int numberOfDays = 0; if (challengePhase == ChallengePhaseEnum.REGISTRATION) { - numberOfDays = DateTimeUtils.daysBetween(DateTimeUtils.currentDate(), challengeEntity.getRegistrationDateTime()) + 1; + numberOfDays = daysBetween(currentDate(), challengeEntity.getRegistrationDateTime()) + 1; } else if (challengePhase == ChallengePhaseEnum.IN_PROGRESS) { - numberOfDays = DateTimeUtils.daysBetween(DateTimeUtils.currentDate(), challengeEntity.getSubmissionDateTime()) + 1; + numberOfDays = daysBetween(currentDate(), challengeEntity.getSubmissionDateTime()) + 1; } templateModel.put("numberOfDays", numberOfDays); @@ -769,4 +769,13 @@ public List findChallengeSubmissionByRegistrant(Long cha return result; } + @Override + public void updateSendEmailToContestantResultCode(ChallengeRegistrantEntity challengeRegistrantEntity, EmailSentResultEnum code) { + if (challengeRegistrantEntity != null) { + challengeRegistrantEntity.setLastEmailSentDateTime(currentDate(BASIC_DATE_TIME_PATTERN)); + challengeRegistrantEntity.setLastEmailSentResultCode(code.getValue()); + challengeRegistrantRepository.save(challengeRegistrantEntity); + } + } + } From 4a37fcee7cd27b442332ff86fc68ac26150af95a Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 09:01:45 +0700 Subject: [PATCH 022/158] add submission list for registrants on the Challenge details page --- .../assets/modules/contest-detail/accept.html | 10 + .../contest-detail/contest-detail.con.js | 48 +++-- .../contest-detail.directive.js | 53 +++++ .../contest-detail/contest-detail.tem.html | 91 +++++--- .../modules/contest-detail/disqualify.html | 15 +- .../modules/contest-detail/qualify.html | 13 +- .../assets/modules/contest-detail/review.html | 55 +++++ .../modules/translation/messages_en.json | 8 +- .../webapp/assets/sass/contest-detail.sass | 203 +++++++++++++++--- src/main/webapp/assets/sass/main.sass | 19 +- 10 files changed, 411 insertions(+), 104 deletions(-) create mode 100644 src/main/webapp/assets/modules/contest-detail/accept.html create mode 100644 src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js create mode 100644 src/main/webapp/assets/modules/contest-detail/review.html diff --git a/src/main/webapp/assets/modules/contest-detail/accept.html b/src/main/webapp/assets/modules/contest-detail/accept.html new file mode 100644 index 000000000..8576f295a --- /dev/null +++ b/src/main/webapp/assets/modules/contest-detail/accept.html @@ -0,0 +1,10 @@ +
+
+
+
+
    + +
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js index 5fe03480e..8b56cca2f 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js @@ -14,8 +14,9 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l title = utils.toAscii(title); return $location.url(sprintf("/challenge-detail/%s-%s-id", title, contestId)); } - - $scope.status = function (type) { + $scope.action = ''; + $scope.actionContent = ''; + $scope.status = function (type, id) { switch (type) { case "able-to-join": if (!$scope.contestDetail) return false; @@ -36,6 +37,19 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l case "contest-in-progress": if (!$scope.contestDetail) return false; return ($scope.contestDetail.progress.translate == jsonValue.status.progress.translate); + + case "feedback-form": + $scope.action = 'feedback'; + return $scope.action; + case "disqualify-form": + $scope.action = 'disqualify'; + return $scope.action; + case "qualify-form": + $scope.action = 'qualify'; + return $scope.action; + case "review-history": + $scope.action = 'review'; + return $scope.action; } } @@ -134,26 +148,6 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l }).finally(function () { utils.sendNotification(jsonValue.notifications.loaded); }); - - $scope.disqualify = function (registrant) { - registrant.disqualified = true; - apiService.saveChallengeRegistrant(registrant) - .success(function (rt) { - registrant.disqualified = rt.disqualified; - registrant.disqualifiedReason = rt.disqualifiedReason; - }); - }; - - $scope.qualify = function (registrant) { - delete registrant.disqualified; - delete registrant.disqualifiedReason; - apiService.saveChallengeRegistrant(registrant) - .success(function (rt) { - registrant.disqualified = rt.disqualified; - registrant.disqualifiedReason = rt.disqualifiedReason; - }); - }; - $scope.sortByScore = function () { delete $scope.sortStartDate; $scope.sortScore = $scope.sortScore || "asc"; @@ -186,5 +180,15 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l subForm.addClass('show'); } } + $scope.showActionForm = function(id){ + $('.action-content').removeClass('show'); + var parent = $('#id-'+id); + var div = parent.find('.action-content'); + if(div.hasClass('show')){ + div.removeClass('show'); + }else{ + div.addClass('show'); + } + } }); diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js b/src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js new file mode 100644 index 000000000..63f982f92 --- /dev/null +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js @@ -0,0 +1,53 @@ +techlooper.directive('reviewSubmittedHistory', function (apiService) { + return { + restrict: "E", + replace: true, + templateUrl: "modules/contest-detail/review.html", + link: function (scope, el, attrs) { + + } + }; +}).directive('disqualifyForm', function (apiService) { + return { + restrict: "E", + replace: true, + scope: true, + templateUrl: "modules/contest-detail/disqualify.html", + link: function (scope, el, attrs) { + console.log('a', scope.action); + scope.disqualify = function (registrant) { + registrant.disqualified = true; + apiService.saveChallengeRegistrant(registrant) + .success(function (rt) { + registrant.disqualified = rt.disqualified; + registrant.disqualifiedReason = rt.disqualifiedReason; + }).finally(function () { + console.log('b', scope.action); + scope.action = ''; + }); + }; + } + }; +}).directive('qualifyForm', function (apiService) { + return { + restrict: "E", + replace: true, + scope: true, + templateUrl: "modules/contest-detail/qualify.html", + link: function (scope, el, attrs) { + scope.qualify = function (registrant) { + console.log('xx', scope.action); + delete registrant.disqualified; + delete registrant.disqualifiedReason; + apiService.saveChallengeRegistrant(registrant) + .success(function (rt) { + registrant.disqualified = rt.disqualified; + registrant.disqualifiedReason = rt.disqualifiedReason; + }).finally(function () { + console.log('xx', scope.action); + scope.action = ''; + }); + }; + } + }; +}); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html index b5e71c764..edbdf7e79 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html +++ b/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html @@ -181,40 +181,71 @@

- - - - - - - - - - + + +
{{'fullNameField' | translate}}{{'registrationDate' | translate}} - - {{'score' | translate}} - - + +
+
+ {{'fullNameField' | translate}} +
+
+ {{'registrationDate' | translate}} + +
+
+ {{'score' | translate}} + +
+
+ {{'action' | translate}} +
+
{{'action' | translate}}
{{user.registrantFirstName}} {{user.registrantLastName}}{{user.registrantId | timestamp: 'number'}} - - - - - - {{user.disqualifiedReason}} -
+
+
+ {{user.registrantFirstName}} {{user.registrantLastName}} +
+
+ {{user.registrantId | timestamp: 'number'}} +
+
+ + +
+ +
+
+ scope is {{action}} +
+ +
+ + + + +
+
diff --git a/src/main/webapp/assets/modules/contest-detail/disqualify.html b/src/main/webapp/assets/modules/contest-detail/disqualify.html index 8e634348b..bc4237e20 100644 --- a/src/main/webapp/assets/modules/contest-detail/disqualify.html +++ b/src/main/webapp/assets/modules/contest-detail/disqualify.html @@ -1,12 +1,11 @@ -
-
-
-
-

- -

+
+
+

+ +

+
- +
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/qualify.html b/src/main/webapp/assets/modules/contest-detail/qualify.html index 88723122d..f58cca095 100644 --- a/src/main/webapp/assets/modules/contest-detail/qualify.html +++ b/src/main/webapp/assets/modules/contest-detail/qualify.html @@ -1,10 +1,7 @@ -
-
-
-
-

- - -
+
+
+

+ +
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/review.html b/src/main/webapp/assets/modules/contest-detail/review.html new file mode 100644 index 000000000..aa2ea171f --- /dev/null +++ b/src/main/webapp/assets/modules/contest-detail/review.html @@ -0,0 +1,55 @@ +
+ +
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index 970b9a894..30ea52bdb 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -758,5 +758,11 @@ "submissionURLTips": "Input your submission link", "description":"Description: *", "descriptionSubmissionTips": "Write some lines to describe your submission to the challenge owner", - "submissionPhaseSuccessful": "Submission Successful" + "submissionPhaseSuccessful": "Submission Successful", + "review": "Review", + "feedback": "Feedback", + "subject": "Subject", + "submissionLink": "Submission Link", + "date": "Date", + "descriptionCol": "Description" } \ No newline at end of file diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index ddf80bbff..942c55512 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -232,14 +232,22 @@ border-bottom-right-radius: 5px border: 1px solid #ddd border-top: 0 - padding: 20px + padding: 20px 0 .registrants-paging display: inline-block clear: both text-align: right width: 100% + table.contests-table margin: 5px 0 10px 0 + td + padding: 0 + border: 0 + th + padding: 0 + border: 0 + border-bottom: 2px solid #337ab7 tr.qualify color: #929292 input @@ -252,43 +260,168 @@ line-height: 16px display: block word-break: break-all - td:nth-child(1) - //text-decoration: line-through - color: #c0c0c0 - td:nth-child(2) - //text-decoration: line-through + td color: #c0c0c0 - th:first-child - width: 55% - text-align: left - th:nth-child(2) - width: 20% - cursor: pointer - td:nth-child(2) - min-width: inherit - th:nth-child(3) - width: 10% - cursor: pointer - td:nth-child(3) - input - width: 60px + .action-content + display: none + .registrants-challenge-list + width: 100% + clear: both + .registrant-name + width: 55% + float: left + text-align: left + padding: 10px + .registration-date + width: 20% + float: left text-align: center - border-radius: 5px - border: 1px solid #d4d7d8 - button - height: 26px - border-radius: 5px - border: 1px solid #d4d7d8 - background-color: #fff - th:nth-child(3) - width: 15% - td - p.note + padding: 10px + .registration-score + width: 15% + float: left + text-align: center + padding: 10px + button + height: 24px + border-radius: 5px + border: 1px solid #d4d7d8 + background-color: #fff + input + width: 60px + text-align: center + border-radius: 3px + border: 1px solid #d4d7d8 + .registration-action + width: 10% + float: left text-align: right - padding-bottom: 10px - a + padding: 10px + a + margin: auto + width: auto + float: right + i + font-size: 20px + li + a + display: block + width: 100% + clear: both + cursor: pointer + text-align: left + font-size: 14px + padding: 0 5px 5px 5px + i + font-size: 14px + a:hover + color: #337ab7 + .dropdown-menu + right: 0 + left: inherit + .review-block + width: 100% + clear: both + display: inline-block + padding: 0 10px 10px 10px + .submitted-histories + width: 100% + clear: both + border: 1px solid #fff + padding: 0 10px + background-color: #f6f6f6 + display: inline-block + border-radius: 3px + .subject-col + width: 40% + float: left + text-align: left + .submission-link-col + width: 50% + float: left + text-align: left + a + text-align: left + color: #337ab7 + .date-col + width: 10% + float: left + text-align: right + .header-row + width: 100% font-weight: 400 - cursor: pointer + clear: both + border-bottom: 1px solid #fff + display: inline-block + padding: 10px 0 + .body-row + width: 100% + font-weight: 300 + clear: both + display: inline-block + .submitted-row + display: inline-block + clear: both + border-bottom: 1px solid #fff + width: 100% + padding: 5px 0 + .submitted-row:last-child + border-bottom: 0 + padding-bottom: 0 + .qualify-block + width: 100% + clear: both + display: inline-block + padding: 0 10px 10px 10px + .qualify-form + width: 100% + clear: both + border: 1px solid #fff + padding: 10px + background-color: #f6f6f6 + display: inline-block + border-radius: 3px + text-align: center + p + margin: 0 + padding: 0 0 10px 0 + text-align: center !important + .textarea-style + height: 60px + a + margin: auto + width: 120px + display: inline-block + color: #fff + .disqualify-block + width: 100% + clear: both + display: inline-block + padding: 0 10px 10px 10px + .disqualify-form + width: 100% + clear: both + border: 1px solid #fff + padding: 10px + background-color: #f6f6f6 + display: inline-block + border-radius: 3px + p + margin: 0 + padding: 0 + .textarea-style + height: 60px + .submission-disqualify + display: inline-block + clear: both + width: 100% + text-align: right + a + margin: auto + width: 120px + float: right + color: #fff + margin-left: 5px .submit-phase-contest.show height: 280px background-color: #f1f2f7 @@ -296,6 +429,8 @@ padding: 10px 20px margin-top: 10px float: left + + .col-md-12 padding: 0 .contest-content-item diff --git a/src/main/webapp/assets/sass/main.sass b/src/main/webapp/assets/sass/main.sass index d2d03ee3b..772e32c54 100644 --- a/src/main/webapp/assets/sass/main.sass +++ b/src/main/webapp/assets/sass/main.sass @@ -1640,7 +1640,7 @@ label.bootstrap-checkbox.disabled border-left-color: #828282 .popover.top > .arrow:after, .popover.top > .arrow - border-top-color: #828282 + border-top-color: #828282 !important .popover.bottom > .arrow:after, .popover.bottom > .arrow border-bottom-color: #828282 @@ -1665,6 +1665,23 @@ label.bootstrap-checkbox.disabled float: right .prev-tour margin-right: 0 +.popover.action-list-block + margin-top: -5px + padding-bottom: 0 + .popover-content + width: 120px + padding: 5px 0 0 + .action-list + ul + margin: 0 + padding: 0 + li + width: 100% + display: inline-block + clear: both + border-bottom: 1px solid #dddddd + li:last-child + border-bottom: 0 .bg-tour-giude background-color: #000 opacity: 0.1 From 84f11c135a13578bec3f798df0cbb1ef6f22e06b Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 09:19:51 +0700 Subject: [PATCH 023/158] update email template for challenge daily sumary --- src/main/resources/template/challengeDailySummary.en.ftl | 7 +++++-- src/main/resources/template/challengeDailySummary.vi.ftl | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/resources/template/challengeDailySummary.en.ftl b/src/main/resources/template/challengeDailySummary.en.ftl index b71eeda6c..31f8d2e1b 100644 --- a/src/main/resources/template/challengeDailySummary.en.ftl +++ b/src/main/resources/template/challengeDailySummary.en.ftl @@ -322,19 +322,22 @@ - +
${latestSubmission_index + 1} ${latestSubmission.registrantName}
- +
+
Review Feedback + Accept +
diff --git a/src/main/resources/template/challengeDailySummary.vi.ftl b/src/main/resources/template/challengeDailySummary.vi.ftl index 8c46889d0..cb216d6df 100644 --- a/src/main/resources/template/challengeDailySummary.vi.ftl +++ b/src/main/resources/template/challengeDailySummary.vi.ftl @@ -322,19 +322,22 @@ - +
${latestSubmission_index + 1} ${latestSubmission.registrantName}
- +
+
Xem Trước Phản Hồi + Đi Tiếp +
From 7a901c9f9b52acd5cd4565026f7d5ea1c7e1d663 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 10:59:10 +0700 Subject: [PATCH 024/158] update responsive for Challenge list page --- .../assets/modules/contests/contest-list.html | 6 ++ src/main/webapp/assets/sass/contests.sass | 2 + .../assets/sass/z-responsive-candidate.sass | 73 ++++++++++++++++++- 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html index 1d0769200..57ebc397d 100644 --- a/src/main/webapp/assets/modules/contests/contest-list.html +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -1,27 +1,33 @@
+

{{contest.startDateTime}}

{{contest.registrationDateTime}}

{{contest.submissionDateTime}}

+

${{contest.firstPlaceReward | number:0}}

${{contest.secondPlaceReward | number:0}}

${{contest.thirdPlaceReward | number:0}}

+
+
{{contest.numberOfRegistrants}}
+
| diff --git a/src/main/webapp/assets/sass/contests.sass b/src/main/webapp/assets/sass/contests.sass index a92575ef8..ae1b51655 100644 --- a/src/main/webapp/assets/sass/contests.sass +++ b/src/main/webapp/assets/sass/contests.sass @@ -175,6 +175,8 @@ width: 100% border-bottom: 1px solid #ddd padding: 25px 20px 10px 20px + .label-col + display: none .challenge-name-col height: auto a diff --git a/src/main/webapp/assets/sass/z-responsive-candidate.sass b/src/main/webapp/assets/sass/z-responsive-candidate.sass index 0c30e5f44..e7f0a312c 100644 --- a/src/main/webapp/assets/sass/z-responsive-candidate.sass +++ b/src/main/webapp/assets/sass/z-responsive-candidate.sass @@ -1227,7 +1227,6 @@ .contestant-page table.contests-table border: 0 - table.contests-table thead display: none @@ -1260,6 +1259,78 @@ text-align: right p text-align: right !important + .contests-list-management + .contest-list-management-header + display: none + .contest-list-management-body + .contest-item-row + padding: 5px + .label-col + display: block + font-weight: 500 + text-transform: capitalize + width: 100% + clear: both + .challenge-name-col + width: 100% + clear: both + padding-bottom: 10px + .challenge-timeline-col + width: 100% + clear: both + padding-bottom: 10px + text-align: left + .challenge-prize-col + width: 100% + clear: both + padding-bottom: 10px + text-align: left + p + width: 30% + float: left + clear: none + .challenge-current-phase-col + width: 100% + clear: both + padding-bottom: 10px + text-align: left + span + padding: 2px 15px + span.note + text-align: left + .challenge-registrants-col + width: 100% + clear: both + padding-bottom: 10px + text-align: left + .label-col + width: auto + padding-right: 10px + clear: none + float: left + .challenge-actions-col + width: 100% + clear: both + text-align: left + .submit-phase-contest.show + height: 350px + padding: 10px + .registrant-name + span + width: 100% + clear: both + .registrant-email + span + width: 100% + clear: both + .phase-description + label + width: 100% + clear: both + textarea + width: 100% + input + width: 100% .warning-alert-block .alert-warning top: auto From e2ed97d0dee31a4adca08c084905ad2833c040d7 Mon Sep 17 00:00:00 2001 From: Phuong H Date: Wed, 7 Oct 2015 11:06:27 +0700 Subject: [PATCH 025/158] Able to toogle registrant menu --- src/main/webapp/assets/modules/_app.js | 4 +- .../assets/modules/contest-detail/accept.html | 4 +- .../contest-detail.directive.js | 53 ------ ...est-detail.tem.html => contestDetail.html} | 171 ++++++++++-------- .../contest-detail/contestDetailAction.html | 5 + ...tail.con.js => contestDetailController.js} | 22 ++- .../contest-detail/contestDetailDirective.js | 98 ++++++++++ ...tml => contestDetailDisqualification.html} | 0 ...y.html => contestDetailQualification.html} | 0 ...tml => contestDetailReviewSubmission.html} | 0 10 files changed, 216 insertions(+), 141 deletions(-) delete mode 100644 src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js rename src/main/webapp/assets/modules/contest-detail/{contest-detail.tem.html => contestDetail.html} (70%) create mode 100644 src/main/webapp/assets/modules/contest-detail/contestDetailAction.html rename src/main/webapp/assets/modules/contest-detail/{contest-detail.con.js => contestDetailController.js} (95%) create mode 100644 src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js rename src/main/webapp/assets/modules/contest-detail/{disqualify.html => contestDetailDisqualification.html} (100%) rename src/main/webapp/assets/modules/contest-detail/{qualify.html => contestDetailQualification.html} (100%) rename src/main/webapp/assets/modules/contest-detail/{review.html => contestDetailReviewSubmission.html} (100%) diff --git a/src/main/webapp/assets/modules/_app.js b/src/main/webapp/assets/modules/_app.js index 4dc1d42bb..364380617 100644 --- a/src/main/webapp/assets/modules/_app.js +++ b/src/main/webapp/assets/modules/_app.js @@ -133,11 +133,11 @@ techlooper.config(["$routeProvider", "$translateProvider", "$authProvider", "loc controller: "loginController" }) .when("/contest-detail/:id", { - templateUrl: "modules/contest-detail/contest-detail.tem.html", + templateUrl: "modules/contest-detail/contestDetail.html", controller: "contestDetailController" }) .when("/challenge-detail/:id", { - templateUrl: "modules/contest-detail/contest-detail.tem.html", + templateUrl: "modules/contest-detail/contestDetail.html", controller: "contestDetailController" }) .when("/challenges", { diff --git a/src/main/webapp/assets/modules/contest-detail/accept.html b/src/main/webapp/assets/modules/contest-detail/accept.html index 8576f295a..935abfc64 100644 --- a/src/main/webapp/assets/modules/contest-detail/accept.html +++ b/src/main/webapp/assets/modules/contest-detail/accept.html @@ -2,9 +2,7 @@
-
    - -
+ ABC
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js b/src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js deleted file mode 100644 index 63f982f92..000000000 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.directive.js +++ /dev/null @@ -1,53 +0,0 @@ -techlooper.directive('reviewSubmittedHistory', function (apiService) { - return { - restrict: "E", - replace: true, - templateUrl: "modules/contest-detail/review.html", - link: function (scope, el, attrs) { - - } - }; -}).directive('disqualifyForm', function (apiService) { - return { - restrict: "E", - replace: true, - scope: true, - templateUrl: "modules/contest-detail/disqualify.html", - link: function (scope, el, attrs) { - console.log('a', scope.action); - scope.disqualify = function (registrant) { - registrant.disqualified = true; - apiService.saveChallengeRegistrant(registrant) - .success(function (rt) { - registrant.disqualified = rt.disqualified; - registrant.disqualifiedReason = rt.disqualifiedReason; - }).finally(function () { - console.log('b', scope.action); - scope.action = ''; - }); - }; - } - }; -}).directive('qualifyForm', function (apiService) { - return { - restrict: "E", - replace: true, - scope: true, - templateUrl: "modules/contest-detail/qualify.html", - link: function (scope, el, attrs) { - scope.qualify = function (registrant) { - console.log('xx', scope.action); - delete registrant.disqualified; - delete registrant.disqualifiedReason; - apiService.saveChallengeRegistrant(registrant) - .success(function (rt) { - registrant.disqualified = rt.disqualified; - registrant.disqualifiedReason = rt.disqualifiedReason; - }).finally(function () { - console.log('xx', scope.action); - scope.action = ''; - }); - }; - } - }; -}); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html b/src/main/webapp/assets/modules/contest-detail/contestDetail.html similarity index 70% rename from src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html rename to src/main/webapp/assets/modules/contest-detail/contestDetail.html index ab6a50e93..0487a71e6 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.tem.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetail.html @@ -7,25 +7,30 @@

{{contestDetail.challengeName}}

- +
-
+

+

${{contestDetail.firstPlaceReward | number:0}}
-
+

${{contestDetail.secondPlaceReward | number:0}}
@@ -38,15 +43,19 @@

{{contestDetail.challengeName}}

-

-

-

+

+ +

+ +

+
  • {{contestDetail.startDateTime}}
  • @@ -56,32 +65,39 @@

-
+

-

+

+
- -
-
+

+

+
@@ -113,12 +129,13 @@

- {{contestDetail.prototypeSubmissionDateTime}} + {{contestDetail.prototypeSubmissionDateTime}}

- - - + + +
@@ -131,14 +148,17 @@

-

+ +

-

+ +

+

{{skill}} @@ -147,22 +167,27 @@

-

+ +

-

+ +

+

{{contestDetail.reviewStyle}}

+

-

+

+

{{contestDetail.qualityIdea}}

@@ -171,40 +196,41 @@

- - -
+ boundary-links="true"> + +
- - - -
-
-
- {{'fullNameField' | translate}} -
-
- {{'registrationDate' | translate}} - -
-
- {{'score' | translate}} - -
-
- {{'action' | translate}} + + + + - - - - + + + + + - -
+
+
+ {{'fullNameField' | translate}} +
+
+ {{'registrationDate' | translate}} + +
+
+ {{'score' | translate}} + +
+
+ {{'action' | translate}} +
- -
-
- scope is {{action}} -
- -
- - - - -
+
+ +
- - + boundary-links="true"> +
diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailAction.html b/src/main/webapp/assets/modules/contest-detail/contestDetailAction.html new file mode 100644 index 000000000..04b1fb953 --- /dev/null +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailAction.html @@ -0,0 +1,5 @@ +
+ + + +
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js b/src/main/webapp/assets/modules/contest-detail/contestDetailController.js similarity index 95% rename from src/main/webapp/assets/modules/contest-detail/contest-detail.con.js rename to src/main/webapp/assets/modules/contest-detail/contestDetailController.js index ac777f337..ca1b03cae 100644 --- a/src/main/webapp/assets/modules/contest-detail/contest-detail.con.js +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailController.js @@ -175,6 +175,7 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l }, 1000); }); } + $scope.showSubmitForm = function () { var subForm = $('.submit-phase-contest'); if (subForm.hasClass('show')) { @@ -184,15 +185,16 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l subForm.addClass('show'); } } - $scope.showActionForm = function(id){ - $('.action-content').removeClass('show'); - var parent = $('#id-'+id); - var div = parent.find('.action-content'); - if(div.hasClass('show')){ - div.removeClass('show'); - }else{ - div.addClass('show'); - } - } + + //$scope.showActionForm = function(id){ + // $('.action-content').removeClass('show'); + // var parent = $('#id-'+id); + // var div = parent.find('.action-content'); + // if(div.hasClass('show')){ + // div.removeClass('show'); + // }else{ + // div.addClass('show'); + // } + //} }); diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js new file mode 100644 index 000000000..786e97cd2 --- /dev/null +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js @@ -0,0 +1,98 @@ +techlooper + .directive("contestDetailAction", function ($rootScope, paginationService) { + return { + restrict: "E", + replace: true, + templateUrl: "modules/contest-detail/contestDetailAction.html", + scope: { + registrant: "=" + }, + link: function (scope, element, attr, ctrl) { + var showView = function (view) { + if ($rootScope.$eval("lastRegistrant.visible")) { + console.log($rootScope.lastRegistrant); + delete $rootScope.lastRegistrant.visible; + } + scope.registrant.visible = {}; + scope.registrant.visible[view] = true; + $rootScope.lastRegistrant = scope.registrant; + } + + scope.registrant.showDisqualification = function () { + showView("disqualification"); + } + + scope.registrant.showQualification = function () { + showView("qualification"); + } + + scope.registrant.showReviewSubmission = function () { + showView("reviewSubmission"); + } + + scope.$on("$destroy", function () { + if ($rootScope.lastRegistrant) delete $rootScope.lastRegistrant; + }); + + //scope.$watch(function () { + // return paginationService.getCurrentPage("__default"); + //}, function (currentPage, previousPage) { + // //if (currentPage != previousPage) { + // // + // //} + //}); + } + }; + }) + .directive('contestDetailReviewSubmission', function (apiService) { + return { + restrict: "E", + replace: true, + templateUrl: "modules/contest-detail/contestDetailReviewSubmission.html" + }; + }) + .directive('contestDetailDisqualification', function (apiService) { + return { + restrict: "E", + replace: true, + scope: true, + templateUrl: "modules/contest-detail/contestDetailDisqualification.html", + link: function (scope, element, attr, ctrl) { + //console.log('a', scope.action); + //scope.disqualify = function (registrant) { + // registrant.disqualified = true; + // apiService.saveChallengeRegistrant(registrant) + // .success(function (rt) { + // registrant.disqualified = rt.disqualified; + // registrant.disqualifiedReason = rt.disqualifiedReason; + // }).finally(function () { + // console.log('b', scope.action); + // scope.action = ''; + // }); + //}; + } + }; + }) + .directive('contestDetailQualification', function (apiService) { + return { + restrict: "E", + replace: true, + scope: true, + templateUrl: "modules/contest-detail/contestDetailQualification.html", + link: function (scope, element, attr, ctrl) { + //scope.qualify = function (registrant) { + // console.log('xx', scope.action); + // delete registrant.disqualified; + // delete registrant.disqualifiedReason; + // apiService.saveChallengeRegistrant(registrant) + // .success(function (rt) { + // registrant.disqualified = rt.disqualified; + // registrant.disqualifiedReason = rt.disqualifiedReason; + // }).finally(function () { + // console.log('xx', scope.action); + // scope.action = ''; + // }); + //}; + } + }; + }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/disqualify.html b/src/main/webapp/assets/modules/contest-detail/contestDetailDisqualification.html similarity index 100% rename from src/main/webapp/assets/modules/contest-detail/disqualify.html rename to src/main/webapp/assets/modules/contest-detail/contestDetailDisqualification.html diff --git a/src/main/webapp/assets/modules/contest-detail/qualify.html b/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html similarity index 100% rename from src/main/webapp/assets/modules/contest-detail/qualify.html rename to src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html diff --git a/src/main/webapp/assets/modules/contest-detail/review.html b/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html similarity index 100% rename from src/main/webapp/assets/modules/contest-detail/review.html rename to src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html From bf56ead31f487aa27df5c6eebd29e6498b2cb3f9 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 11:24:37 +0700 Subject: [PATCH 026/158] translate for sumission form on the Challenge list page --- .../assets/modules/contests/contest-list.html | 8 ++++---- .../assets/modules/translation/messages_en.json | 6 ++++-- .../assets/modules/translation/messages_vi.json | 16 +++++++++++++++- src/main/webapp/assets/sass/contests.sass | 4 ++-- .../assets/sass/z-responsive-candidate.sass | 5 ++++- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/assets/modules/contests/contest-list.html b/src/main/webapp/assets/modules/contests/contest-list.html index 57ebc397d..3588d2553 100644 --- a/src/main/webapp/assets/modules/contests/contest-list.html +++ b/src/main/webapp/assets/modules/contests/contest-list.html @@ -31,11 +31,11 @@ | - - | + + | - - | + + |
diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index 30ea52bdb..f9429c993 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -758,11 +758,13 @@ "submissionURLTips": "Input your submission link", "description":"Description: *", "descriptionSubmissionTips": "Write some lines to describe your submission to the challenge owner", - "submissionPhaseSuccessful": "Submission Successful", + "submissionPhaseSuccessful": "You have submitted successfully.", "review": "Review", "feedback": "Feedback", "subject": "Subject", "submissionLink": "Submission Link", "date": "Date", - "descriptionCol": "Description" + "descriptionCol": "Description", + "join": "Join", + "submitPhase": "Submit" } \ No newline at end of file diff --git a/src/main/webapp/assets/modules/translation/messages_vi.json b/src/main/webapp/assets/modules/translation/messages_vi.json index bda671f95..68e55d74b 100644 --- a/src/main/webapp/assets/modules/translation/messages_vi.json +++ b/src/main/webapp/assets/modules/translation/messages_vi.json @@ -756,5 +756,19 @@ "challengePrototypeTips":"Đây là ngày kết thúc giai đoạn Prototype của cuộc thi và thí sinh phải nộp Prototype trước ngày này. Nhà Tổ Chức sẽ chịu trách nhiệm đánh giá Prototype và sẽ lựa chon các thí sinh với Prototype xuất sắc vào vòng tiếp theo.", "signInTitle": "Đăng nhập bằng chính tài khoản của bạn", "signInWithFaceBook": "Đăng nhập bằng Facebook", - "signInWithGooglePlus": "Đăng nhập bằng Google Plus" + "signInWithGooglePlus": "Đăng nhập bằng Google Plus", + "submissionURL": "URL bài gửi: *", + "submissionURLTips": "Nhập đường dẫn đến bài gửi", + "description":"Chú thích: *", + "descriptionSubmissionTips": "Chú thích cho bài gửi của bạn", + "submissionPhaseSuccessful": "Bạn đã gửi bài thành công.", + "review": "Xem bài", + "feedback": "Phản hồi", + "subject": "Subject", + "submissionLink": "URL bài gửi", + "date": "Date", + "descriptionCol": "Chú thích", + "join": "Tham Gia", + "submitPhase": "Gửi Bài" + } diff --git a/src/main/webapp/assets/sass/contests.sass b/src/main/webapp/assets/sass/contests.sass index ae1b51655..c05f4e5a5 100644 --- a/src/main/webapp/assets/sass/contests.sass +++ b/src/main/webapp/assets/sass/contests.sass @@ -201,7 +201,7 @@ padding: 0 width: 100% span - width: 80px + width: 115px float: left text-align: left .challenge-prize-col @@ -216,7 +216,7 @@ width: auto font-size: 12px border-radius: 4px - padding: 2px 4px + padding: 0px 4px span.not-started background-color: #00bcd4 color: #fff diff --git a/src/main/webapp/assets/sass/z-responsive-candidate.sass b/src/main/webapp/assets/sass/z-responsive-candidate.sass index e7f0a312c..39fd99790 100644 --- a/src/main/webapp/assets/sass/z-responsive-candidate.sass +++ b/src/main/webapp/assets/sass/z-responsive-candidate.sass @@ -1313,7 +1313,7 @@ clear: both text-align: left .submit-phase-contest.show - height: 350px + height: 380px padding: 10px .registrant-name span @@ -1331,6 +1331,9 @@ width: 100% input width: 100% + div.error-messages + text-align: left + padding-left: 0 .warning-alert-block .alert-warning top: auto From fec0dd5ba6fc0e8a6e502677184a8f1d8f5725e8 Mon Sep 17 00:00:00 2001 From: Phuong H Date: Wed, 7 Oct 2015 13:19:16 +0700 Subject: [PATCH 027/158] Able to cancel form --- .../contest-detail/contestDetailDirective.js | 25 +++++++++++++++++-- .../contestDetailDisqualification.html | 8 +++--- .../contestDetailQualification.html | 4 +-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js index 786e97cd2..215880f0a 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js @@ -1,5 +1,5 @@ techlooper - .directive("contestDetailAction", function ($rootScope, paginationService) { + .directive("contestDetailAction", function ($rootScope, apiService) { return { restrict: "E", replace: true, @@ -10,9 +10,9 @@ techlooper link: function (scope, element, attr, ctrl) { var showView = function (view) { if ($rootScope.$eval("lastRegistrant.visible")) { - console.log($rootScope.lastRegistrant); delete $rootScope.lastRegistrant.visible; } + scope.registrant.visible = {}; scope.registrant.visible[view] = true; $rootScope.lastRegistrant = scope.registrant; @@ -34,6 +34,27 @@ techlooper if ($rootScope.lastRegistrant) delete $rootScope.lastRegistrant; }); + scope.registrant.qualify = function () { + delete scope.registrant.disqualified; + delete scope.registrant.disqualifiedReason; + apiService.saveChallengeRegistrant(scope.registrant) + .success(function(rt) { + $.extend(scope.registrant, {visible: {}}, rt); + }); + }; + + scope.registrant.disqualify = function () { + scope.registrant.disqualified = true; + apiService.saveChallengeRegistrant(scope.registrant) + .success(function(rt) { + $.extend(scope.registrant, {visible: {}}, rt); + }); + }; + + scope.registrant.hide = function() { + $.extend(scope.registrant, {visible: {}}); + }; + //scope.$watch(function () { // return paginationService.getCurrentPage("__default"); //}, function (currentPage, previousPage) { diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailDisqualification.html b/src/main/webapp/assets/modules/contest-detail/contestDetailDisqualification.html index bc4237e20..63e206c51 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailDisqualification.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailDisqualification.html @@ -1,11 +1,11 @@

- -

+ +

- - + +
\ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html b/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html index f58cca095..e94f4bfd1 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html @@ -1,7 +1,7 @@

- - + +
\ No newline at end of file From c0b6412642fa6db8fdaad26fba564c9a70797421 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 13:23:25 +0700 Subject: [PATCH 028/158] update style for submission list on the challenge details page --- src/main/webapp/assets/sass/contest-detail.sass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index 942c55512..39a3f0426 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -301,6 +301,7 @@ margin: auto width: auto float: right + color: #333 i font-size: 20px li @@ -315,10 +316,16 @@ i font-size: 14px a:hover - color: #337ab7 + color: #333 + background-color: #f1f1f1 .dropdown-menu right: 0 left: inherit + background-color: #f1f1f1 + padding: 5px + button.btn-default + background-color: transparent + padding: 3px 10px .review-block width: 100% clear: both From b99c2526b1b8feecef75972e6ea9e7a98bbadea7 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 13:40:07 +0700 Subject: [PATCH 029/158] binding data for submission list --- .../contest-detail/contestDetailController.js | 1 + .../contestDetailReviewSubmission.html | 43 +++---------------- .../webapp/assets/sass/contest-detail.sass | 2 + 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailController.js b/src/main/webapp/assets/modules/contest-detail/contestDetailController.js index ca1b03cae..9ca166db2 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailController.js +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailController.js @@ -122,6 +122,7 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l else { $scope.contestDetail.timeline = 5; } + console.log($scope.contestDetail); }) .error(function () {$location.url("404");}); diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html b/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html index aa2ea171f..3fe95994b 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html @@ -6,48 +6,17 @@
- diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index 39a3f0426..3474d4825 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -326,6 +326,7 @@ button.btn-default background-color: transparent padding: 3px 10px + color: #333 .review-block width: 100% clear: both @@ -393,6 +394,7 @@ margin: 0 padding: 0 0 10px 0 text-align: center !important + color: #333 .textarea-style height: 60px a From 08bb83fc11ddd9f9f0cc5b4aa8e3cdf362e51554 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 13:44:32 +0700 Subject: [PATCH 030/158] show messages when dont have submission --- .../contest-detail/contestDetailReviewSubmission.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html b/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html index 3fe95994b..7c3d98fef 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html @@ -1,5 +1,8 @@
- \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js index 215880f0a..f0a1875da 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js @@ -30,6 +30,10 @@ techlooper showView("reviewSubmission"); } + scope.registrant.showFeedback = function () { + showView("feedbackForm"); + } + scope.$on("$destroy", function () { if ($rootScope.lastRegistrant) delete $rootScope.lastRegistrant; }); diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index 3474d4825..08b1860f1 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -340,6 +340,8 @@ background-color: #f6f6f6 display: inline-block border-radius: 3px + p.no-submission + padding: 10px 0 .subject-col width: 40% float: left @@ -426,11 +428,44 @@ width: 100% text-align: right a - margin: auto width: 120px float: right color: #fff margin-left: 5px + .feedback-block + clear: both + display: inline-block + width: 100% + padding: 0 10px 10px + .feedback-form + width: 100% + clear: both + border: 1px solid #fff + padding: 10px + background-color: #f6f6f6 + display: inline-block + border-radius: 3px + .mail-body + border: 0 + .mail-subject + padding: 10px 0 + .mail-text .note-editor + background-color: #fff + min-height: 200px + .note-toolbar + background-color: #f3fafe + .note-editable + background-color: #fff + .email-footer + text-align: right + padding: 10px 0 + a + width: auto + margin: auto auto auto 5px + padding: 6px 20px + color: #fff + display: inline-block + .submit-phase-contest.show height: 280px background-color: #f1f2f7 From d04221f44df6790e7c302974a14651d27e90fb57 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 15:05:57 +0700 Subject: [PATCH 033/158] add acceptance content for accept link on the challenge details page --- .../modules/contest-detail/contestDetail.html | 1 + .../contestDetailAcceptance.html | 7 +++ .../contest-detail/contestDetailAction.html | 1 + .../contest-detail/contestDetailDirective.js | 47 +++++++------------ .../contestDetailQualification.html | 2 +- .../modules/translation/messages_en.json | 4 +- .../modules/translation/messages_vi.json | 4 +- src/main/webapp/assets/sass/main.sass | 2 + 8 files changed, 36 insertions(+), 32 deletions(-) create mode 100644 src/main/webapp/assets/modules/contest-detail/contestDetailAcceptance.html diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetail.html b/src/main/webapp/assets/modules/contest-detail/contestDetail.html index 6cc7253fc..1c1f1ff12 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetail.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetail.html @@ -264,6 +264,7 @@

  • {{'review' | translate}}
  • {{'feedback' | translate}}
  • +
  • {{'accept' | translate}}
  • diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailAcceptance.html b/src/main/webapp/assets/modules/contest-detail/contestDetailAcceptance.html new file mode 100644 index 000000000..a38f5f05d --- /dev/null +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailAcceptance.html @@ -0,0 +1,7 @@ +
    +
    +

    + + +
    +
    \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailAction.html b/src/main/webapp/assets/modules/contest-detail/contestDetailAction.html index 7d597ab82..7b431869d 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailAction.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailAction.html @@ -3,4 +3,5 @@ +
    \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js index 6d5adf304..0e8fd9cba 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailDirective.js @@ -34,6 +34,11 @@ techlooper showView("feedbackForm"); } + scope.registrant.showAcceptance = function () { + showView("acceptance"); + } + + scope.$on("$destroy", function () { if ($rootScope.lastRegistrant) delete $rootScope.lastRegistrant; }); @@ -67,55 +72,39 @@ techlooper } }; }) - .directive('contestDetailReviewSubmission', function (apiService) { + .directive('contestDetailReviewSubmission', function () { return { restrict: "E", replace: true, templateUrl: "modules/contest-detail/contestDetailReviewSubmission.html" }; }) - .directive('contestDetailDisqualification', function (apiService) { + .directive('contestDetailDisqualification', function () { return { restrict: "E", replace: true, scope: true, templateUrl: "modules/contest-detail/contestDetailDisqualification.html", link: function (scope, element, attr, ctrl) { - //console.log('a', scope.action); - //scope.disqualify = function (registrant) { - // registrant.disqualified = true; - // apiService.saveChallengeRegistrant(registrant) - // .success(function (rt) { - // registrant.disqualified = rt.disqualified; - // registrant.disqualifiedReason = rt.disqualifiedReason; - // }).finally(function () { - // console.log('b', scope.action); - // scope.action = ''; - // }); - //}; } }; }) - .directive('contestDetailQualification', function (apiService) { + .directive('contestDetailQualification', function () { return { restrict: "E", replace: true, scope: true, templateUrl: "modules/contest-detail/contestDetailQualification.html", link: function (scope, element, attr, ctrl) { - //scope.qualify = function (registrant) { - // console.log('xx', scope.action); - // delete registrant.disqualified; - // delete registrant.disqualifiedReason; - // apiService.saveChallengeRegistrant(registrant) - // .success(function (rt) { - // registrant.disqualified = rt.disqualified; - // registrant.disqualifiedReason = rt.disqualifiedReason; - // }).finally(function () { - // console.log('xx', scope.action); - // scope.action = ''; - // }); - //}; } }; - }); \ No newline at end of file + }).directive('acceptance', function () { + return { + restrict: "E", + replace: true, + scope: true, + templateUrl: "modules/contest-detail/contestDetailAcceptance.html", + link: function (scope, element, attr, ctrl) { + } + }; +}); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html b/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html index e94f4bfd1..6b191e752 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailQualification.html @@ -1,7 +1,7 @@

    - +
    \ No newline at end of file diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index f9429c993..747a3bcc9 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -766,5 +766,7 @@ "date": "Date", "descriptionCol": "Description", "join": "Join", - "submitPhase": "Submit" + "submitPhase": "Submit", + "accept": "Accept", + "acceptDescription": "Are you sure you want to select this contestant from {{phase1}} phase to {{phase2}} phase?" } \ No newline at end of file diff --git a/src/main/webapp/assets/modules/translation/messages_vi.json b/src/main/webapp/assets/modules/translation/messages_vi.json index 68e55d74b..e6bd1ad91 100644 --- a/src/main/webapp/assets/modules/translation/messages_vi.json +++ b/src/main/webapp/assets/modules/translation/messages_vi.json @@ -769,6 +769,8 @@ "date": "Date", "descriptionCol": "Chú thích", "join": "Tham Gia", - "submitPhase": "Gửi Bài" + "submitPhase": "Gửi Bài", + "accept": "Đi Tiếp", + "acceptDescription": "Bạn có muốn chọn thí sinh này từ vòng {{phase1}} vào vòng {{phase1}}?" } diff --git a/src/main/webapp/assets/sass/main.sass b/src/main/webapp/assets/sass/main.sass index 772e32c54..c32675458 100644 --- a/src/main/webapp/assets/sass/main.sass +++ b/src/main/webapp/assets/sass/main.sass @@ -64,6 +64,8 @@ textarea.change-color border: 1px solid #008000 !important transition: color 0.5s ease color: #008000 !important +.btn + padding: 7px 12px 3px 12px .btn-primary background-color: #337ab7 border-color: #2e6da4 From 4ab931f943a8d4c5552b5d5f83082b12785bf0cf Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Wed, 7 Oct 2015 15:08:04 +0700 Subject: [PATCH 034/158] Add the filter options to find challenge service --- .../controller/ChallengeController.java | 211 +++++++++--------- .../model/RegistrantFilterCondition.java | 57 +++++ .../techlooper/service/ChallengeService.java | 4 +- .../service/impl/ChallengeServiceImpl.java | 51 ++++- 4 files changed, 209 insertions(+), 114 deletions(-) create mode 100644 src/main/java/com/techlooper/model/RegistrantFilterCondition.java diff --git a/src/main/java/com/techlooper/controller/ChallengeController.java b/src/main/java/com/techlooper/controller/ChallengeController.java index e1387de44..89cbb13c6 100644 --- a/src/main/java/com/techlooper/controller/ChallengeController.java +++ b/src/main/java/com/techlooper/controller/ChallengeController.java @@ -25,115 +25,116 @@ @RestController public class ChallengeController { - private final static Logger LOGGER = LoggerFactory.getLogger(ChallengeController.class); - - @Resource - private ChallengeService challengeService; - - @Resource - private EmployerService employerService; - - @Resource - private LeadAPIService leadAPIService; - - @Resource - private ChallengeRegistrantRepository challengeRegistrantRepository; - - @PreAuthorize("hasAuthority('EMPLOYER')") - @RequestMapping(value = "/challenge/publish", method = RequestMethod.POST) - public ChallengeResponse publishChallenge(@RequestBody ChallengeDto challengeDto, HttpServletRequest servletRequest) throws Exception { - int responseCode = 0; - String employerEmail = servletRequest.getRemoteUser(); - challengeDto.setAuthorEmail(employerEmail); - ChallengeEntity challengeEntity = challengeService.savePostChallenge(challengeDto); - boolean newEntity = challengeDto.getChallengeId() == null; - if (newEntity) { - if (challengeEntity != null) { - if (EmailValidator.validate(challengeEntity.getAuthorEmail())) { - challengeService.sendPostChallengeEmailToEmployer(challengeEntity); + private final static Logger LOGGER = LoggerFactory.getLogger(ChallengeController.class); + + @Resource + private ChallengeService challengeService; + + @Resource + private EmployerService employerService; + + @Resource + private LeadAPIService leadAPIService; + + @Resource + private ChallengeRegistrantRepository challengeRegistrantRepository; + + @PreAuthorize("hasAuthority('EMPLOYER')") + @RequestMapping(value = "/challenge/publish", method = RequestMethod.POST) + public ChallengeResponse publishChallenge(@RequestBody ChallengeDto challengeDto, HttpServletRequest servletRequest) throws Exception { + int responseCode = 0; + String employerEmail = servletRequest.getRemoteUser(); + challengeDto.setAuthorEmail(employerEmail); + ChallengeEntity challengeEntity = challengeService.savePostChallenge(challengeDto); + boolean newEntity = challengeDto.getChallengeId() == null; + if (newEntity) { + if (challengeEntity != null) { + if (EmailValidator.validate(challengeEntity.getAuthorEmail())) { + challengeService.sendPostChallengeEmailToEmployer(challengeEntity); + } + challengeService.sendPostChallengeEmailToTechloopies(challengeEntity, Boolean.TRUE); + } + + // Call Lead Management API to create new lead on CRM system + try { + VnwUser employer = employerService.findEmployerByUsername(employerEmail); + VnwCompany company = employerService.findCompanyById(employer.getCompanyId()); + if (employer != null && company != null) { + responseCode = leadAPIService.createNewLead( + employer, company, LeadEventEnum.POST_CHALLENGE, challengeEntity.getChallengeName()); + + String logMessage = "Create Lead API Response Code : %d ,EmployerID : %d ,CompanyID : %d"; + LOGGER.info(String.format(logMessage, responseCode, employer.getUserId(), company.getCompanyId())); + } + } catch (Exception ex) { + LOGGER.error(ex.getMessage(), ex); + } + } else { + challengeService.sendPostChallengeEmailToTechloopies(challengeEntity, Boolean.FALSE); } - challengeService.sendPostChallengeEmailToTechloopies(challengeEntity, Boolean.TRUE); - } - - // Call Lead Management API to create new lead on CRM system - try { - VnwUser employer = employerService.findEmployerByUsername(employerEmail); - VnwCompany company = employerService.findCompanyById(employer.getCompanyId()); - if (employer != null && company != null) { - responseCode = leadAPIService.createNewLead( - employer, company, LeadEventEnum.POST_CHALLENGE, challengeEntity.getChallengeName()); - - String logMessage = "Create Lead API Response Code : %d ,EmployerID : %d ,CompanyID : %d"; - LOGGER.info(String.format(logMessage, responseCode, employer.getUserId(), company.getCompanyId())); + + return new ChallengeResponse(challengeEntity.getChallengeId(), responseCode); + } + + @RequestMapping(value = "/challenge/{challengeId}", method = RequestMethod.GET) + public ChallengeDetailDto getChallengeDetail(@PathVariable Long challengeId, HttpServletResponse response) throws Exception { + ChallengeDetailDto challengeDetail = challengeService.getChallengeDetail(challengeId); + if (challengeDetail == null) response.setStatus(HttpServletResponse.SC_NOT_FOUND); + return challengeDetail; + } + + @RequestMapping(value = "/challenge/join", method = RequestMethod.POST) + public long joinChallenge(@RequestBody ChallengeRegistrantDto joinChallenge) throws Exception { + return challengeService.joinChallenge(joinChallenge); + } + + @RequestMapping(value = "/challenge/list", method = RequestMethod.GET) + public List listChallenges() throws Exception { + return challengeService.listChallenges(); + } + + @RequestMapping(value = "/challenge/stats", method = RequestMethod.GET) + public ChallengeStatsDto getChallengeStatistics() throws Exception { + ChallengeStatsDto challengeStatsDto = new ChallengeStatsDto(); + challengeStatsDto.setNumberOfChallenges(challengeService.getTotalNumberOfChallenges()); + challengeStatsDto.setNumberOfRegistrants(challengeService.getTotalNumberOfRegistrants()); + challengeStatsDto.setTotalPrizeAmount(challengeService.getTotalAmountOfPrizeValues()); + return challengeStatsDto; + } + + @PreAuthorize("hasAuthority('EMPLOYER')") + @RequestMapping(value = "/challenge/{id}", method = RequestMethod.DELETE) + public void deleteChallengeById(@PathVariable Long id, HttpServletRequest request, HttpServletResponse response) { + if (!challengeService.delete(id, request.getRemoteUser())) { + response.setStatus(HttpServletResponse.SC_FORBIDDEN); } - } - catch (Exception ex) { - LOGGER.error(ex.getMessage(), ex); - } } - else { - challengeService.sendPostChallengeEmailToTechloopies(challengeEntity, Boolean.FALSE); + + @RequestMapping(value = "/challenges/{challengeId}", method = RequestMethod.GET) + public ChallengeDto findChallengeById(@PathVariable Long challengeId) throws Exception { + return challengeService.findChallengeById(challengeId); + } + + @PreAuthorize("hasAuthority('EMPLOYER')") + @RequestMapping(value = "/challenges/{challengeId}/registrants", method = RequestMethod.POST) + public Set getRegistrantsById(@PathVariable Long challengeId, + @RequestBody RegistrantFilterCondition condition, HttpServletRequest request) { + condition.setChallengeId(challengeId); + condition.setAuthorEmail(request.getRemoteUser()); + return challengeService.findRegistrantsByOwner(condition); + } + + + @PreAuthorize("hasAuthority('EMPLOYER')") + @RequestMapping(value = "/challengeDetail/registrant", method = RequestMethod.POST) + public ChallengeRegistrantDto saveRegistrant(@RequestBody ChallengeRegistrantDto dto, HttpServletRequest request) { + return challengeService.saveRegistrant(request.getRemoteUser(), dto); } - return new ChallengeResponse(challengeEntity.getChallengeId(), responseCode); - } - - @RequestMapping(value = "/challenge/{challengeId}", method = RequestMethod.GET) - public ChallengeDetailDto getChallengeDetail(@PathVariable Long challengeId, HttpServletResponse response) throws Exception { - ChallengeDetailDto challengeDetail = challengeService.getChallengeDetail(challengeId); - if (challengeDetail == null) response.setStatus(HttpServletResponse.SC_NOT_FOUND); - return challengeDetail; - } - - @RequestMapping(value = "/challenge/join", method = RequestMethod.POST) - public long joinChallenge(@RequestBody ChallengeRegistrantDto joinChallenge) throws Exception { - return challengeService.joinChallenge(joinChallenge); - } - - @RequestMapping(value = "/challenge/list", method = RequestMethod.GET) - public List listChallenges() throws Exception { - return challengeService.listChallenges(); - } - - @RequestMapping(value = "/challenge/stats", method = RequestMethod.GET) - public ChallengeStatsDto getChallengeStatistics() throws Exception { - ChallengeStatsDto challengeStatsDto = new ChallengeStatsDto(); - challengeStatsDto.setNumberOfChallenges(challengeService.getTotalNumberOfChallenges()); - challengeStatsDto.setNumberOfRegistrants(challengeService.getTotalNumberOfRegistrants()); - challengeStatsDto.setTotalPrizeAmount(challengeService.getTotalAmountOfPrizeValues()); - return challengeStatsDto; - } - - @PreAuthorize("hasAuthority('EMPLOYER')") - @RequestMapping(value = "/challenge/{id}", method = RequestMethod.DELETE) - public void deleteChallengeById(@PathVariable Long id, HttpServletRequest request, HttpServletResponse response) { - if (!challengeService.delete(id, request.getRemoteUser())) { - response.setStatus(HttpServletResponse.SC_FORBIDDEN); + @PreAuthorize("hasAuthority('EMPLOYER')") + @RequestMapping(value = "challengeRegistrant/fullName/{registrantId}", method = RequestMethod.GET) + public String getChallengeRegistrant(@PathVariable Long registrantId) { + ChallengeRegistrantEntity registrantEntity = challengeRegistrantRepository.findOne(registrantId); + return registrantEntity.getRegistrantFirstName() + " " + registrantEntity.getRegistrantLastName(); } - } - - @RequestMapping(value = "/challenges/{challengeId}", method = RequestMethod.GET) - public ChallengeDto findChallengeById(@PathVariable Long challengeId) throws Exception { - return challengeService.findChallengeById(challengeId); - } - - @PreAuthorize("hasAuthority('EMPLOYER')") - @RequestMapping(value = "/challenges/{challengeId}/registrants", method = RequestMethod.GET) - public Set getRegistrantsById(@PathVariable Long challengeId, HttpServletRequest request, HttpServletResponse response) { - return challengeService.findRegistrantsByOwner(request.getRemoteUser(), challengeId); - } - - - @PreAuthorize("hasAuthority('EMPLOYER')") - @RequestMapping(value = "/challengeDetail/registrant", method = RequestMethod.POST) - public ChallengeRegistrantDto saveRegistrant(@RequestBody ChallengeRegistrantDto dto, HttpServletRequest request) { - return challengeService.saveRegistrant(request.getRemoteUser(), dto); - } - - @PreAuthorize("hasAuthority('EMPLOYER')") - @RequestMapping(value = "challengeRegistrant/fullName/{registrantId}", method = RequestMethod.GET) - public String getChallengeRegistrant(@PathVariable Long registrantId) { - ChallengeRegistrantEntity registrantEntity = challengeRegistrantRepository.findOne(registrantId); - return registrantEntity.getRegistrantFirstName() + " " + registrantEntity.getRegistrantLastName(); - } } diff --git a/src/main/java/com/techlooper/model/RegistrantFilterCondition.java b/src/main/java/com/techlooper/model/RegistrantFilterCondition.java new file mode 100644 index 000000000..52786de63 --- /dev/null +++ b/src/main/java/com/techlooper/model/RegistrantFilterCondition.java @@ -0,0 +1,57 @@ +package com.techlooper.model; + +/** + * Created by NguyenDangKhoa on 10/7/15. + */ +public class RegistrantFilterCondition { + + private String authorEmail; + + private Long challengeId; + + private String filterType; + + private String fromDate; + + private String toDate; + + public String getAuthorEmail() { + return authorEmail; + } + + public void setAuthorEmail(String authorEmail) { + this.authorEmail = authorEmail; + } + + public Long getChallengeId() { + return challengeId; + } + + public void setChallengeId(Long challengeId) { + this.challengeId = challengeId; + } + + public String getFilterType() { + return filterType; + } + + public void setFilterType(String filterType) { + this.filterType = filterType; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } +} diff --git a/src/main/java/com/techlooper/service/ChallengeService.java b/src/main/java/com/techlooper/service/ChallengeService.java index b4d229805..c877c0157 100644 --- a/src/main/java/com/techlooper/service/ChallengeService.java +++ b/src/main/java/com/techlooper/service/ChallengeService.java @@ -68,13 +68,15 @@ void sendApplicationEmailToEmployer(ChallengeEntity challengeEntity, ChallengeRe ChallengeDto findChallengeById(Long id); - Set findRegistrantsByOwner(String ownerEmail, Long challengeId); + Set findRegistrantsByOwner(RegistrantFilterCondition condition); ChallengeRegistrantDto saveRegistrant(String ownerEmail, ChallengeRegistrantDto challengeRegistrantDto); List findChallengeRegistrantWithinPeriod( Long challengeId, Long currentDateTime, TimePeriodEnum period); + List filterChallengeRegistrantByDate(RegistrantFilterCondition condition); + List findChallengeSubmissionWithinPeriod( Long challengeId, Long currentDateTime, TimePeriodEnum period); diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index 6b4861974..27d526114 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -574,15 +574,15 @@ public ChallengeDto findChallengeById(Long id) { return dozerMapper.map(challengeRepository.findOne(id), ChallengeDto.class); } - public Set findRegistrantsByOwner(String ownerEmail, Long challengeId) { + public Set findRegistrantsByOwner(RegistrantFilterCondition condition) { BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (StringUtils.isNotEmpty(ownerEmail)) { - boolQueryBuilder.must(matchQuery("authorEmail", ownerEmail).minimumShouldMatch("100%")); + if (StringUtils.isNotEmpty(condition.getAuthorEmail())) { + boolQueryBuilder.must(matchQuery("authorEmail", condition.getAuthorEmail()).minimumShouldMatch("100%")); } - TermQueryBuilder challengeQuery = termQuery("challengeId", challengeId); - if (challengeId != null) { + TermQueryBuilder challengeQuery = termQuery("challengeId", condition.getChallengeId()); + if (condition.getChallengeId() != null) { boolQueryBuilder.must(challengeQuery); } @@ -591,10 +591,10 @@ public Set findRegistrantsByOwner(String ownerEmail, Lon Set registrantDtos = new HashSet<>(); if (challengeIterator.hasNext()) { - Iterator registrants = challengeRegistrantRepository.search(challengeQuery).iterator(); - registrants.forEachRemaining(registrant -> { + List registrants = filterChallengeRegistrantByDate(condition); + registrants.forEach(registrant -> { ChallengeRegistrantDto registrantDto = dozerMapper.map(registrant, ChallengeRegistrantDto.class); - registrantDto.setSubmissions(findChallengeSubmissionByRegistrant(challengeId, registrant.getRegistrantId())); + registrantDto.setSubmissions(findChallengeSubmissionByRegistrant(condition.getChallengeId(), registrant.getRegistrantId())); registrantDtos.add(registrantDto); }); } @@ -638,6 +638,41 @@ public List findChallengeRegistrantWithinPeriod( return result; } + @Override + public List filterChallengeRegistrantByDate(RegistrantFilterCondition condition) { + NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder().withTypes("challengeRegistrant"); + BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); + + if (StringUtils.isNotEmpty(condition.getAuthorEmail())) { + boolQueryBuilder.must(matchQuery("authorEmail", condition.getAuthorEmail()).minimumShouldMatch("100%")); + } + + if (condition.getChallengeId() != null) { + boolQueryBuilder.must(termQuery("challengeId", condition.getChallengeId())); + } + + if (StringUtils.isNotEmpty(condition.getFilterType())) { + RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(condition.getFilterType()); + + if (StringUtils.isNotEmpty(condition.getFromDate())) { + rangeQueryBuilder.from(condition.getFromDate()); + } + if (StringUtils.isNotEmpty(condition.getToDate())) { + rangeQueryBuilder.to(condition.getToDate()); + } + + boolQueryBuilder.must(rangeQueryBuilder); + } + + List result = new ArrayList<>(); + Iterator iterator = challengeRegistrantRepository.search(searchQueryBuilder.build()).iterator(); + while (iterator.hasNext()) { + result.add(iterator.next()); + } + + return result; + } + @Override public List findChallengeSubmissionWithinPeriod( Long challengeId, Long currentDateTime, TimePeriodEnum period) { From 3d5ea2ada0412219cbbdd0acb173762b9a51c06b Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Wed, 7 Oct 2015 15:08:50 +0700 Subject: [PATCH 035/158] Change the search contestant condition --- .../com/techlooper/cron/ChallengeTimelineNotifier.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java b/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java index 426c52d3c..1c26d0711 100644 --- a/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java +++ b/src/main/java/com/techlooper/cron/ChallengeTimelineNotifier.java @@ -5,6 +5,7 @@ import com.techlooper.entity.ChallengeRegistrantEntity; import com.techlooper.model.ChallengePhaseEnum; import com.techlooper.model.EmailSentResultEnum; +import com.techlooper.model.RegistrantFilterCondition; import com.techlooper.service.ChallengeService; import org.apache.commons.lang3.StringUtils; import org.dozer.Mapper; @@ -46,9 +47,11 @@ public synchronized void notifyRegistrantAboutChallengeTimeline() throws Excepti List challengeEntities = challengeService.listChallengesByPhase(challengePhase); for (ChallengeEntity challengeEntity : challengeEntities) { - Set challengeRegistrants = challengeService.findRegistrantsByOwner( - challengeEntity.getAuthorEmail(), challengeEntity.getChallengeId()); - + RegistrantFilterCondition condition = new RegistrantFilterCondition(); + condition.setAuthorEmail(challengeEntity.getAuthorEmail()); + condition.setChallengeId(challengeEntity.getChallengeId()); + Set challengeRegistrants = challengeService.findRegistrantsByOwner(condition); + for (ChallengeRegistrantDto challengeRegistrant : challengeRegistrants) { Date lastSentDate = string2Date(challengeRegistrant.getLastEmailSentDateTime(), BASIC_DATE_TIME_PATTERN); Date currentDate = new Date(); From bef99ee29c516ab3a9b0f023eb7b700bf059fa56 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 15:21:33 +0700 Subject: [PATCH 036/158] restyle for action list item --- .../modules/contest-detail/contestDetail.html | 13 +++++-------- src/main/webapp/assets/sass/contest-detail.sass | 7 +++++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetail.html b/src/main/webapp/assets/modules/contest-detail/contestDetail.html index 1c1f1ff12..9b68b47bd 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetail.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetail.html @@ -253,18 +253,15 @@

    diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index 08b1860f1..ad098f910 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -238,7 +238,7 @@ clear: both text-align: right width: 100% - + padding: 0 10px table.contests-table margin: 5px 0 10px 0 td @@ -304,13 +304,16 @@ color: #333 i font-size: 20px + ul + width: 120px li + text-align: right a display: block width: 100% clear: both cursor: pointer - text-align: left + text-align: right font-size: 14px padding: 0 5px 5px 5px i From ebc7d77c2d0adbcaad58ca0592da43e685174b4e Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 15:31:49 +0700 Subject: [PATCH 037/158] re-show reason disqualify registrant --- .../webapp/assets/modules/contest-detail/contestDetail.html | 1 + src/main/webapp/assets/modules/translation/messages_en.json | 2 +- src/main/webapp/assets/modules/translation/messages_vi.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetail.html b/src/main/webapp/assets/modules/contest-detail/contestDetail.html index 9b68b47bd..204dae804 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetail.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetail.html @@ -235,6 +235,7 @@

    {{user.registrantFirstName}} {{user.registrantLastName}} +

    {{'disqualifyingReason' | translate}}: {{user.disqualifiedReason}}

    {{user.registrantId | timestamp: 'number'}} diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index 747a3bcc9..f4d1b27d6 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -721,7 +721,7 @@ "reject": "Reject", "pageNotFound": "This page does not exist.", "disqualifyConfirmation": "Are you sure to disqualify this contestant?", - "disqualifyingReason": "Disqualifying Reason", + "disqualifyingReason": "Disqualifying reason", "vietnamese": "Tiếng Việt", "english": "Tiếng Anh", "registrants": "Registrants", diff --git a/src/main/webapp/assets/modules/translation/messages_vi.json b/src/main/webapp/assets/modules/translation/messages_vi.json index e6bd1ad91..c7beea369 100644 --- a/src/main/webapp/assets/modules/translation/messages_vi.json +++ b/src/main/webapp/assets/modules/translation/messages_vi.json @@ -721,7 +721,7 @@ "reject": "Reject", "pageNotFound": "Trang này không tồn tại.", "disqualifyConfirmation": "Bạn có muốn loại bỏ thí sinh này?", - "disqualifyingReason": "Lý Do Loại Bỏ", + "disqualifyingReason": "Lý do loại bỏ", "vietnamese": "Vietnamese", "english": "English", "registrants": "Thí Sinh", From 9f4b39f0065535bd29c60f84f1632bea0fc09bae Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Wed, 7 Oct 2015 16:37:04 +0700 Subject: [PATCH 038/158] Save the last update send email date time to challenge owner --- .../DailyChallengeSummaryEmailSender.java | 17 +++++++++++--- .../techlooper/entity/ChallengeEntity.java | 23 +++++++++++++++++++ .../techlooper/service/ChallengeService.java | 1 + .../service/impl/ChallengeServiceImpl.java | 8 +++++++ 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/techlooper/cron/DailyChallengeSummaryEmailSender.java b/src/main/java/com/techlooper/cron/DailyChallengeSummaryEmailSender.java index 18af951bd..132536f02 100644 --- a/src/main/java/com/techlooper/cron/DailyChallengeSummaryEmailSender.java +++ b/src/main/java/com/techlooper/cron/DailyChallengeSummaryEmailSender.java @@ -2,6 +2,7 @@ import com.techlooper.entity.ChallengeEntity; import com.techlooper.model.ChallengePhaseEnum; +import com.techlooper.model.EmailSentResultEnum; import com.techlooper.service.ChallengeService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -11,8 +12,11 @@ import javax.annotation.Resource; import java.util.Arrays; +import java.util.Date; import java.util.List; +import static com.techlooper.util.DateTimeUtils.*; + @Service public class DailyChallengeSummaryEmailSender { @@ -25,7 +29,7 @@ public class DailyChallengeSummaryEmailSender { private Boolean enableJobAlert; @Scheduled(cron = "${scheduled.cron.dailyChallengeSummary}") - public void sendDailyEmailAboutChallengeSummary() throws Exception { + public synchronized void sendDailyEmailAboutChallengeSummary() throws Exception { if (enableJobAlert) { List challengePhases = Arrays.asList(ChallengePhaseEnum.REGISTRATION, ChallengePhaseEnum.IN_PROGRESS); @@ -35,9 +39,16 @@ public void sendDailyEmailAboutChallengeSummary() throws Exception { for (ChallengeEntity challengeEntity : challengeEntities) { try { - challengeService.sendDailySummaryEmailToChallengeOwner(challengeEntity); - count++; + Date lastSentDate = string2Date(challengeEntity.getLastEmailSentDateTime(), BASIC_DATE_TIME_PATTERN); + Date currentDate = new Date(); + + if (daysBetween(lastSentDate, currentDate) > 0) { + challengeService.sendDailySummaryEmailToChallengeOwner(challengeEntity); + challengeService.updateSendEmailToChallengeOwnerResultCode(challengeEntity, EmailSentResultEnum.OK); + count++; + } } catch (Exception ex) { + challengeService.updateSendEmailToChallengeOwnerResultCode(challengeEntity, EmailSentResultEnum.ERROR); LOGGER.error(ex.getMessage(), ex); } } diff --git a/src/main/java/com/techlooper/entity/ChallengeEntity.java b/src/main/java/com/techlooper/entity/ChallengeEntity.java index 12a776e4d..3f7d409ed 100644 --- a/src/main/java/com/techlooper/entity/ChallengeEntity.java +++ b/src/main/java/com/techlooper/entity/ChallengeEntity.java @@ -10,6 +10,7 @@ import java.util.List; import static org.springframework.data.elasticsearch.annotations.FieldType.Boolean; +import static org.springframework.data.elasticsearch.annotations.FieldType.Integer; import static org.springframework.data.elasticsearch.annotations.FieldType.String; /** @@ -87,6 +88,12 @@ public class ChallengeEntity { @Field(type = Boolean) private Boolean expired; + @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "dd/MM/yyyy HH:mm") + private String lastEmailSentDateTime; + + @Field(type = Integer) + private int lastEmailSentResultCode; + public Boolean getExpired() { return expired; } @@ -270,4 +277,20 @@ public String getChallengeOverview() { public void setChallengeOverview(String challengeOverview) { this.challengeOverview = challengeOverview; } + + public String getLastEmailSentDateTime() { + return lastEmailSentDateTime; + } + + public void setLastEmailSentDateTime(String lastEmailSentDateTime) { + this.lastEmailSentDateTime = lastEmailSentDateTime; + } + + public int getLastEmailSentResultCode() { + return lastEmailSentResultCode; + } + + public void setLastEmailSentResultCode(int lastEmailSentResultCode) { + this.lastEmailSentResultCode = lastEmailSentResultCode; + } } diff --git a/src/main/java/com/techlooper/service/ChallengeService.java b/src/main/java/com/techlooper/service/ChallengeService.java index c877c0157..7061b23bf 100644 --- a/src/main/java/com/techlooper/service/ChallengeService.java +++ b/src/main/java/com/techlooper/service/ChallengeService.java @@ -92,4 +92,5 @@ List findChallengeSubmissionWithinPeriod( void updateSendEmailToContestantResultCode(ChallengeRegistrantEntity challengeRegistrantEntity, EmailSentResultEnum code); + void updateSendEmailToChallengeOwnerResultCode(ChallengeEntity challengeEntity, EmailSentResultEnum code); } diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index 27d526114..03e3c11fc 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -813,4 +813,12 @@ public void updateSendEmailToContestantResultCode(ChallengeRegistrantEntity chal } } + @Override + public void updateSendEmailToChallengeOwnerResultCode(ChallengeEntity challengeEntity, EmailSentResultEnum code) { + if (challengeEntity != null) { + challengeEntity.setLastEmailSentDateTime(currentDate(BASIC_DATE_TIME_PATTERN)); + challengeEntity.setLastEmailSentResultCode(code.getValue()); + challengeRepository.save(challengeEntity); + } + } } From 79203e5ab0fde22943e187692d1dd96b92fc5f4a Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 17:19:05 +0700 Subject: [PATCH 039/158] send email affter user submitted feedback --- .../modules/common/feedback/feedback.html | 6 ++--- .../common/feedback/feedbackDirective.js | 26 +++++++++++++++++-- .../modules/contest-detail/contestDetail.html | 4 +++ .../contest-detail/contestDetailAction.html | 2 +- .../contest-detail/contestDetailController.js | 1 - .../webapp/assets/sass/contest-detail.sass | 11 ++++++-- .../assets/sass/z-responsive-candidate.sass | 14 +++++++++- 7 files changed, 54 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/assets/modules/common/feedback/feedback.html b/src/main/webapp/assets/modules/common/feedback/feedback.html index dfb50b912..07eacd43e 100644 --- a/src/main/webapp/assets/modules/common/feedback/feedback.html +++ b/src/main/webapp/assets/modules/common/feedback/feedback.html @@ -5,7 +5,7 @@
    - +
    @@ -21,8 +21,8 @@
    diff --git a/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js b/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js index 76a7752fa..513304c6a 100644 --- a/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js +++ b/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js @@ -1,4 +1,4 @@ -techlooper.directive("feedbackForm", function () { +techlooper.directive("feedbackForm", function (apiService) { return { restrict: "E", replace: true, @@ -6,7 +6,7 @@ techlooper.directive("feedbackForm", function () { scope: { composeEmail: "=" }, - link: function (scope, element, attr, ctrl) { + link: function (scope, element, attr, ctrl, composeEmail) { $('.summernote').summernote({ toolbar: [ ['fontname', ['fontname']], @@ -20,6 +20,28 @@ techlooper.directive("feedbackForm", function () { ['misc', ['undo', 'redo', 'codeview', 'fullscreen']] ] }); + if(scope.composeEmail.registrantLastName){ + scope.composeEmail.names = scope.composeEmail.registrantFirstName + ' ' + scope.composeEmail.registrantLastName; + }else{ + scope.composeEmail.names = scope.composeEmail.registrantFirstName; + } + + scope.send = function(){ + scope.composeEmail.content = $('.summernote').code(); + if(scope.composeEmail.content == '


    '){ + return; + } + apiService.sendEmailToDailyChallengeRegistrants(scope.composeEmail.challengeId, scope.composeEmail.registrantId, scope.composeEmail) + .finally(function () { + scope.cancel(); + }); + } + scope.cancel = function () { + if (!scope.composeEmail.visible) return; + scope.composeEmail.subject = ''; + $('.summernote').code(''); + delete scope.composeEmail.visible; + } } } }); \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetail.html b/src/main/webapp/assets/modules/contest-detail/contestDetail.html index 204dae804..2621d194e 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetail.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetail.html @@ -234,18 +234,22 @@

    +
    {{user.registrantFirstName}} {{user.registrantLastName}}

    {{'disqualifyingReason' | translate}}: {{user.disqualifiedReason}}

    +
    {{user.registrantId | timestamp: 'number'}}
    +
    +
    \ No newline at end of file diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailController.js b/src/main/webapp/assets/modules/contest-detail/contestDetailController.js index 9ca166db2..ca1b03cae 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailController.js +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailController.js @@ -122,7 +122,6 @@ techlooper.controller('contestDetailController', function ($scope, apiService, l else { $scope.contestDetail.timeline = 5; } - console.log($scope.contestDetail); }) .error(function () {$location.url("404");}); diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index ad098f910..0f098178d 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -252,14 +252,20 @@ color: #929292 input color: #333 - button - color: #333 span font-style: italic font-size: 12px line-height: 16px display: block word-break: break-all + button + color: #333 + span + display: inline-block + a.btn + span + display: inline-block + font-style: normal td color: #c0c0c0 .action-content @@ -459,6 +465,7 @@ background-color: #f3fafe .note-editable background-color: #fff + text-align: left .email-footer text-align: right padding: 10px 0 diff --git a/src/main/webapp/assets/sass/z-responsive-candidate.sass b/src/main/webapp/assets/sass/z-responsive-candidate.sass index 39fd99790..189ba8753 100644 --- a/src/main/webapp/assets/sass/z-responsive-candidate.sass +++ b/src/main/webapp/assets/sass/z-responsive-candidate.sass @@ -1131,7 +1131,7 @@ width: 95% padding: 10px 5px .contest-detail-page - padding: 20px 5px + padding: 0 5px 20px 5px .contest-detail-content padding: 10px 5px .timeline-reward-block @@ -1224,6 +1224,18 @@ margin-bottom: 10px span border: none !important + .contest-content-tab-detail + table.contests-table + .registrants-challenge-list + .registration-date, + .registration-score, + .registration-action, + .registrant-name + width: 100% + clear: both + text-align: left + .registrant-name + padding-top: 10px .contestant-page table.contests-table border: 0 From 4f8d30434d22643ea5c04e738315023261d6f0b2 Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Wed, 7 Oct 2015 17:56:15 +0700 Subject: [PATCH 040/158] Implement filter function for contestant list --- .../techlooper/service/ChallengeService.java | 3 + .../service/impl/ChallengeServiceImpl.java | 81 ++++++++++++++----- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/techlooper/service/ChallengeService.java b/src/main/java/com/techlooper/service/ChallengeService.java index 7061b23bf..2c6a7178c 100644 --- a/src/main/java/com/techlooper/service/ChallengeService.java +++ b/src/main/java/com/techlooper/service/ChallengeService.java @@ -9,6 +9,7 @@ import javax.mail.MessagingException; import java.io.IOException; +import java.text.ParseException; import java.util.Collection; import java.util.List; import java.util.Set; @@ -93,4 +94,6 @@ List findChallengeSubmissionWithinPeriod( void updateSendEmailToContestantResultCode(ChallengeRegistrantEntity challengeRegistrantEntity, EmailSentResultEnum code); void updateSendEmailToChallengeOwnerResultCode(ChallengeEntity challengeEntity, EmailSentResultEnum code); + + Set findChallengeSubmissionByDate(String fromDate, String toDate); } diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index 03e3c11fc..e26e5c277 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -640,34 +640,47 @@ public List findChallengeRegistrantWithinPeriod( @Override public List filterChallengeRegistrantByDate(RegistrantFilterCondition condition) { - NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder().withTypes("challengeRegistrant"); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - - if (StringUtils.isNotEmpty(condition.getAuthorEmail())) { - boolQueryBuilder.must(matchQuery("authorEmail", condition.getAuthorEmail()).minimumShouldMatch("100%")); - } - - if (condition.getChallengeId() != null) { - boolQueryBuilder.must(termQuery("challengeId", condition.getChallengeId())); - } + List result = new ArrayList<>(); - if (StringUtils.isNotEmpty(condition.getFilterType())) { - RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(condition.getFilterType()); + if ("challengeSubmission".equals(condition.getFilterType())) { + Set registrantIds = findChallengeSubmissionByDate(condition.getFromDate(), condition.getToDate()); + for (Long registrantId : registrantIds) { + ChallengeRegistrantEntity registrantEntity = challengeRegistrantRepository.findOne(registrantId); + if (registrantEntity != null) { + result.add(registrantEntity); + } + } + } else { + NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder().withTypes("challengeRegistrant"); + BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - if (StringUtils.isNotEmpty(condition.getFromDate())) { - rangeQueryBuilder.from(condition.getFromDate()); + if (StringUtils.isNotEmpty(condition.getAuthorEmail())) { + boolQueryBuilder.must(matchQuery("authorEmail", condition.getAuthorEmail()).minimumShouldMatch("100%")); } - if (StringUtils.isNotEmpty(condition.getToDate())) { - rangeQueryBuilder.to(condition.getToDate()); + + if (condition.getChallengeId() != null) { + boolQueryBuilder.must(termQuery("challengeId", condition.getChallengeId())); } - boolQueryBuilder.must(rangeQueryBuilder); - } + if (StringUtils.isNotEmpty(condition.getFilterType())) { + if ("challengeRegistrant".equals(condition.getFilterType())) { + RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(condition.getFilterType()); - List result = new ArrayList<>(); - Iterator iterator = challengeRegistrantRepository.search(searchQueryBuilder.build()).iterator(); - while (iterator.hasNext()) { - result.add(iterator.next()); + if (StringUtils.isNotEmpty(condition.getFromDate())) { + rangeQueryBuilder.from(condition.getFromDate()); + } + if (StringUtils.isNotEmpty(condition.getToDate())) { + rangeQueryBuilder.to(condition.getToDate()); + } + + boolQueryBuilder.must(rangeQueryBuilder); + } + } + + Iterator iterator = challengeRegistrantRepository.search(searchQueryBuilder.build()).iterator(); + while (iterator.hasNext()) { + result.add(iterator.next()); + } } return result; @@ -821,4 +834,28 @@ public void updateSendEmailToChallengeOwnerResultCode(ChallengeEntity challengeE challengeRepository.save(challengeEntity); } } + + @Override + public Set findChallengeSubmissionByDate(String fromDate, String toDate) { + Set registrantIds = new HashSet<>(); + NativeSearchQueryBuilder searchQueryBuilder = new NativeSearchQueryBuilder().withTypes("challengeSubmission"); + RangeQueryBuilder submissionDateQuery = QueryBuilders.rangeQuery("submissionDateTime"); + + if (StringUtils.isNotEmpty(fromDate)) { + submissionDateQuery.from(fromDate); + } + + if (StringUtils.isNotEmpty(toDate)) { + submissionDateQuery.to(toDate); + } + + searchQueryBuilder.withQuery(submissionDateQuery); + Iterator iterator = challengeSubmissionRepository.search(searchQueryBuilder.build()).iterator(); + while (iterator.hasNext()) { + ChallengeSubmissionEntity challengeSubmissionEntity = iterator.next(); + registrantIds.add(challengeSubmissionEntity.getRegistrantId()); + } + + return registrantIds; + } } From 8e85741f4268c7ff9e1828eed9517b33a7082594 Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 18:05:06 +0700 Subject: [PATCH 041/158] add loading when waiting send feedback --- .../webapp/assets/images/send_virtual_hug.gif | Bin 0 -> 22961 bytes .../modules/common/feedback/feedback.html | 2 ++ .../common/feedback/feedbackDirective.js | 8 ++++++-- src/main/webapp/assets/sass/contest-detail.sass | 1 + src/main/webapp/assets/sass/main.sass | 11 ++++++++++- 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/main/webapp/assets/images/send_virtual_hug.gif diff --git a/src/main/webapp/assets/images/send_virtual_hug.gif b/src/main/webapp/assets/images/send_virtual_hug.gif new file mode 100644 index 0000000000000000000000000000000000000000..9a4bfbe4c34b24b92b3724bc97980517547864ee GIT binary patch literal 22961 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 Ar~m)} literal 0 HcmV?d00001 diff --git a/src/main/webapp/assets/modules/common/feedback/feedback.html b/src/main/webapp/assets/modules/common/feedback/feedback.html index 07eacd43e..00a9b3e1e 100644 --- a/src/main/webapp/assets/modules/common/feedback/feedback.html +++ b/src/main/webapp/assets/modules/common/feedback/feedback.html @@ -24,5 +24,7 @@
    +
    +

    diff --git a/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js b/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js index 513304c6a..dc2890c66 100644 --- a/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js +++ b/src/main/webapp/assets/modules/common/feedback/feedbackDirective.js @@ -1,4 +1,4 @@ -techlooper.directive("feedbackForm", function (apiService) { +techlooper.directive("feedbackForm", function (apiService, $timeout) { return { restrict: "E", replace: true, @@ -31,9 +31,13 @@ techlooper.directive("feedbackForm", function (apiService) { if(scope.composeEmail.content == '


    '){ return; } + $('#feedback-loading').css('visibility', 'inherit'); apiService.sendEmailToDailyChallengeRegistrants(scope.composeEmail.challengeId, scope.composeEmail.registrantId, scope.composeEmail) .finally(function () { - scope.cancel(); + $timeout(function(){ + $('#feedback-loading').css('visibility', 'hidden'); + scope.cancel(); + }, 500); }); } scope.cancel = function () { diff --git a/src/main/webapp/assets/sass/contest-detail.sass b/src/main/webapp/assets/sass/contest-detail.sass index 0f098178d..a953f75cd 100644 --- a/src/main/webapp/assets/sass/contest-detail.sass +++ b/src/main/webapp/assets/sass/contest-detail.sass @@ -454,6 +454,7 @@ background-color: #f6f6f6 display: inline-block border-radius: 3px + position: relative .mail-body border: 0 .mail-subject diff --git a/src/main/webapp/assets/sass/main.sass b/src/main/webapp/assets/sass/main.sass index c32675458..55b1e49c6 100644 --- a/src/main/webapp/assets/sass/main.sass +++ b/src/main/webapp/assets/sass/main.sass @@ -128,7 +128,16 @@ textarea.change-color background-color: #0077b5 .buffer background-color: #323b43 - +#feedback-loading + width: 100% + height: 100% + position: absolute + z-index: 9999 + background: url("../images/send_virtual_hug.gif") #bbbbbb no-repeat center center + top: 0 + left: 0 + opacity: 0.5 + visibility: hidden .datepicker-days td, th From bd3f24eedb688eef6029a74305ae5ff872e40079 Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Wed, 7 Oct 2015 18:08:51 +0700 Subject: [PATCH 042/158] Fix the issue for filter contestant function --- .../java/com/techlooper/service/ChallengeService.java | 2 +- .../techlooper/service/impl/ChallengeServiceImpl.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/techlooper/service/ChallengeService.java b/src/main/java/com/techlooper/service/ChallengeService.java index 2c6a7178c..55fd58985 100644 --- a/src/main/java/com/techlooper/service/ChallengeService.java +++ b/src/main/java/com/techlooper/service/ChallengeService.java @@ -76,7 +76,7 @@ void sendApplicationEmailToEmployer(ChallengeEntity challengeEntity, ChallengeRe List findChallengeRegistrantWithinPeriod( Long challengeId, Long currentDateTime, TimePeriodEnum period); - List filterChallengeRegistrantByDate(RegistrantFilterCondition condition); + List filterChallengeRegistrantByDate(RegistrantFilterCondition condition) throws ParseException; List findChallengeSubmissionWithinPeriod( Long challengeId, Long currentDateTime, TimePeriodEnum period); diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index e26e5c277..6d9ae3fa6 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -639,7 +639,7 @@ public List findChallengeRegistrantWithinPeriod( } @Override - public List filterChallengeRegistrantByDate(RegistrantFilterCondition condition) { + public List filterChallengeRegistrantByDate(RegistrantFilterCondition condition) throws ParseException { List result = new ArrayList<>(); if ("challengeSubmission".equals(condition.getFilterType())) { @@ -663,14 +663,16 @@ public List filterChallengeRegistrantByDate(Registran } if (StringUtils.isNotEmpty(condition.getFilterType())) { - if ("challengeRegistrant".equals(condition.getFilterType())) { + if ("registrantId".equals(condition.getFilterType())) { RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(condition.getFilterType()); if (StringUtils.isNotEmpty(condition.getFromDate())) { - rangeQueryBuilder.from(condition.getFromDate()); + Long from = string2Date(condition.getFromDate(), BASIC_DATE_PATTERN).getTime(); + rangeQueryBuilder.from(from); } if (StringUtils.isNotEmpty(condition.getToDate())) { - rangeQueryBuilder.to(condition.getToDate()); + Long to = string2Date(condition.getToDate(), BASIC_DATE_PATTERN).getTime(); + rangeQueryBuilder.from(to); } boolQueryBuilder.must(rangeQueryBuilder); From 67161d2d0a47a9468f71d391247d7bd382df3156 Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Wed, 7 Oct 2015 18:10:24 +0700 Subject: [PATCH 043/158] Handle exception for find registrant service --- src/main/java/com/techlooper/service/ChallengeService.java | 2 +- .../java/com/techlooper/service/impl/ChallengeServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/techlooper/service/ChallengeService.java b/src/main/java/com/techlooper/service/ChallengeService.java index 55fd58985..a78992931 100644 --- a/src/main/java/com/techlooper/service/ChallengeService.java +++ b/src/main/java/com/techlooper/service/ChallengeService.java @@ -69,7 +69,7 @@ void sendApplicationEmailToEmployer(ChallengeEntity challengeEntity, ChallengeRe ChallengeDto findChallengeById(Long id); - Set findRegistrantsByOwner(RegistrantFilterCondition condition); + Set findRegistrantsByOwner(RegistrantFilterCondition condition) throws ParseException; ChallengeRegistrantDto saveRegistrant(String ownerEmail, ChallengeRegistrantDto challengeRegistrantDto); diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index 6d9ae3fa6..d15b3cd12 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -574,7 +574,7 @@ public ChallengeDto findChallengeById(Long id) { return dozerMapper.map(challengeRepository.findOne(id), ChallengeDto.class); } - public Set findRegistrantsByOwner(RegistrantFilterCondition condition) { + public Set findRegistrantsByOwner(RegistrantFilterCondition condition) throws ParseException { BoolQueryBuilder boolQueryBuilder = boolQuery(); if (StringUtils.isNotEmpty(condition.getAuthorEmail())) { From 31d6d0372aaacc2a603610c5c4eb290bb553821a Mon Sep 17 00:00:00 2001 From: khoa-nd Date: Wed, 7 Oct 2015 18:11:12 +0700 Subject: [PATCH 044/158] Handle controller exception --- .../java/com/techlooper/controller/ChallengeController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/techlooper/controller/ChallengeController.java b/src/main/java/com/techlooper/controller/ChallengeController.java index 89cbb13c6..53ad58991 100644 --- a/src/main/java/com/techlooper/controller/ChallengeController.java +++ b/src/main/java/com/techlooper/controller/ChallengeController.java @@ -19,6 +19,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; import java.util.List; import java.util.Set; @@ -118,7 +119,7 @@ public ChallengeDto findChallengeById(@PathVariable Long challengeId) throws Exc @PreAuthorize("hasAuthority('EMPLOYER')") @RequestMapping(value = "/challenges/{challengeId}/registrants", method = RequestMethod.POST) public Set getRegistrantsById(@PathVariable Long challengeId, - @RequestBody RegistrantFilterCondition condition, HttpServletRequest request) { + @RequestBody RegistrantFilterCondition condition, HttpServletRequest request) throws ParseException { condition.setChallengeId(challengeId); condition.setAuthorEmail(request.getRemoteUser()); return challengeService.findRegistrantsByOwner(condition); From ce626bfd5d53ba04dd176e6379d35eee7b5cff6d Mon Sep 17 00:00:00 2001 From: johnsonpham Date: Wed, 7 Oct 2015 18:14:42 +0700 Subject: [PATCH 045/158] update translate for no submission submitted yet --- .../modules/contest-detail/contestDetailReviewSubmission.html | 2 +- src/main/webapp/assets/modules/translation/messages_en.json | 1 + src/main/webapp/assets/modules/translation/messages_vi.json | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html b/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html index 7c3d98fef..33da5b321 100644 --- a/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html +++ b/src/main/webapp/assets/modules/contest-detail/contestDetailReviewSubmission.html @@ -1,6 +1,6 @@