From 57541a4ee88da97f8cfabc9eaaf73b9994579f93 Mon Sep 17 00:00:00 2001
From: Deddy Syefria
Date: Thu, 5 Sep 2019 15:03:13 +0700
Subject: [PATCH] Add technology and platform to Marathon Match
---
.../includes/contest/editTabMarathon.jsp | 37 +++++++-
.../includes/contest/editTabSoftware.jsp | 4 +-
.../includes/launch/overviewAlgorithm.jsp | 95 +++++++++++--------
.../includes/launch/overviewSoftware.jsp | 82 ++++++++--------
.../includes/launch/reviewAlgorithm.jsp | 7 ++
.../includes/launch/reviewSoftware.jsp | 4 +-
src/web/css/direct/launchcontest.css | 4 +-
.../scripts/launch/contestDetailSoftware.js | 4 +-
src/web/scripts/launch/main.js | 45 ++++++++-
src/web/scripts/launch/pages/overview.js | 63 ++++++++----
10 files changed, 233 insertions(+), 112 deletions(-)
diff --git a/src/web/WEB-INF/includes/contest/editTabMarathon.jsp b/src/web/WEB-INF/includes/contest/editTabMarathon.jsp
index ca2f6c6d9..6b0877485 100644
--- a/src/web/WEB-INF/includes/contest/editTabMarathon.jsp
+++ b/src/web/WEB-INF/includes/contest/editTabMarathon.jsp
@@ -655,7 +655,28 @@
-
+
+
+
+
+
+
+ Current Project Technologies
+
+
+
+
+
+
+
<%--
Environment
@@ -706,6 +727,20 @@
+
+
+
+
+
Choose Your Technology:
+
+
<%--
Environment
diff --git a/src/web/WEB-INF/includes/contest/editTabSoftware.jsp b/src/web/WEB-INF/includes/contest/editTabSoftware.jsp
index 2b0b3beb3..39af0e2bf 100644
--- a/src/web/WEB-INF/includes/contest/editTabSoftware.jsp
+++ b/src/web/WEB-INF/includes/contest/editTabSoftware.jsp
@@ -891,7 +891,7 @@
Current Project Platforms
-
+
@@ -904,7 +904,7 @@
Current Project Technologies
-
+
diff --git a/src/web/WEB-INF/includes/launch/overviewAlgorithm.jsp b/src/web/WEB-INF/includes/launch/overviewAlgorithm.jsp
index f5c2b19f8..aa32601f4 100644
--- a/src/web/WEB-INF/includes/launch/overviewAlgorithm.jsp
+++ b/src/web/WEB-INF/includes/launch/overviewAlgorithm.jsp
@@ -1,9 +1,9 @@
<%--
- Author: bugbuka, GreatKevin, TCSCODER
- - Version: 1.6
- - Copyright (C) 2013 - 2018 TopCoder Inc., All Rights Reserved.
- -
- - Description: This page fragment renders edit algorithm contest page.
+ - Version: 1.6
+ - Copyright (C) 2013 - 2018 TopCoder Inc., All Rights Reserved.
+ -
+ - Description: This page fragment renders edit algorithm contest page.
-
- Version 1.2 (Module Assembly - TC Cockpit Launch Code Contest)
- - Add a specific CSS class for algorithm contest prize add and remove
@@ -15,9 +15,9 @@
- Add support for custom copilot fee
- Version 1.5 (Topcoder - Add Basic Marathon Match Creation And Update In Direct App):
- - Remove MM problem selection
- -
- - Version 1.6 (Topcoder - Support Points Prize Type For Challenges):
- - - Add "Challenge Points" section.
+ -
+ - Version 1.6 (Topcoder - Support Points Prize Type For Challenges):
+ - - Add "Challenge Points" section.
--%>
<%@ include file="/WEB-INF/includes/taglibs.jsp" %>
@@ -40,6 +40,23 @@
+
+
+
+
+
+
+
Choose Your Technology:
+
+
+
<%--
@@ -104,38 +121,38 @@
$
-
-
-
-
Challenge Points:
-
-
-
-
Pt.
-
-
-
Pt.
-
-
-
Pt.
-
-
ADD
-
-
-
-
-
-
+
+
+
+
Challenge Points:
+
+
+
+
Pt.
+
+
+
Pt.
+
+
+
Pt.
+
+
ADD
+
+
+
+
+
+
-
-
-
-
-
-
Challenge Points:
-
-
-
-
Pt.
-
-
-
Pt.
-
-
ADD
-
-
-
-
-
+
+
+
+
+
+
Challenge Points:
+
+
+
+
Pt.
+
+
+
Pt.
+
+
ADD
+
+
+
+
+
CONTINUE
diff --git a/src/web/WEB-INF/includes/launch/reviewAlgorithm.jsp b/src/web/WEB-INF/includes/launch/reviewAlgorithm.jsp
index 0c2796205..fb42375e9 100644
--- a/src/web/WEB-INF/includes/launch/reviewAlgorithm.jsp
+++ b/src/web/WEB-INF/includes/launch/reviewAlgorithm.jsp
@@ -80,6 +80,13 @@
Match Rules :
+
+
Platforms :
+
+
+
Technologies :
+
+
<%--
Environment :
diff --git a/src/web/WEB-INF/includes/launch/reviewSoftware.jsp b/src/web/WEB-INF/includes/launch/reviewSoftware.jsp
index f2f99d8e9..515f4b539 100644
--- a/src/web/WEB-INF/includes/launch/reviewSoftware.jsp
+++ b/src/web/WEB-INF/includes/launch/reviewSoftware.jsp
@@ -97,10 +97,10 @@
Platforms :
-
+
Technologies :
-
+
Environment :
diff --git a/src/web/css/direct/launchcontest.css b/src/web/css/direct/launchcontest.css
index 1e6d43fef..b635130fe 100644
--- a/src/web/css/direct/launchcontest.css
+++ b/src/web/css/direct/launchcontest.css
@@ -3194,14 +3194,14 @@ div#winnerDiv {
padding: 10px;
}
-.rGroups td span, #rTechnologies span, #rPlatforms span {
+.rGroups td span, .rTechnologies span, .rPlatforms span {
border: #e7e7e7 solid 1px;
border-radius: 5px;
padding: 2px 5px 2px 5px;
margin-right: 5px;
}
-#rTechnologies, #rPlatforms{
+.rTechnologies, .rPlatforms{
padding-top: 7px;
}
diff --git a/src/web/scripts/launch/contestDetailSoftware.js b/src/web/scripts/launch/contestDetailSoftware.js
index 994b3cc57..522d817f6 100644
--- a/src/web/scripts/launch/contestDetailSoftware.js
+++ b/src/web/scripts/launch/contestDetailSoftware.js
@@ -2943,7 +2943,7 @@ function populateSpecSection(initFlag) {
selectedTechName.push(technologyMap[val]);
});
- $('#rswTechnologies').html(selectedTechName.join("
"));
+ $('#rTechnologies').html(selectedTechName.join("
"));
technologyAndPlatformSelectsChanged();
}
if(isPlatformContest()) {
@@ -2959,7 +2959,7 @@ function populateSpecSection(initFlag) {
selectedPlatformName.push(platformMap[val]);
});
- $('#rswPlatforms').html(selectedPlatformName.join("
"));
+ $('#rPlatforms').html(selectedPlatformName.join("
"));
technologyAndPlatformSelectsChanged();
}
diff --git a/src/web/scripts/launch/main.js b/src/web/scripts/launch/main.js
index faeb5b233..5bce5aa13 100644
--- a/src/web/scripts/launch/main.js
+++ b/src/web/scripts/launch/main.js
@@ -299,6 +299,29 @@ $(document).ready(function() {
allowFreeEntries: false,
data: technologies
});
+
+ jQuery_1_11_1('#swPlatforms').magicSuggest({
+ placeholder: 'Type platform name here',
+ allowFreeEntries: false,
+ data: platforms
+ });
+ jQuery_1_11_1('#swTechnologies').magicSuggest({
+ placeholder: 'Type technology name here',
+ allowFreeEntries: false,
+ data: technologies
+ });
+
+ jQuery_1_11_1('#alPlatforms').magicSuggest({
+ placeholder: 'Type platform name here',
+ allowFreeEntries: false,
+ data: platforms
+ });
+
+ jQuery_1_11_1('#alTechnologies').magicSuggest({
+ placeholder: 'Type technology name here',
+ allowFreeEntries: false,
+ data: technologies
+ });
jQuery_1_11_1('#preRegisterUsers').magicSuggest({
placeholder: 'Type handle name here',
allowFreeEntries: false,
@@ -1550,6 +1573,14 @@ function saveAsDraftRequestAlgorithm() {
request['docCompIds'] = getCompDocumentIds();
request['fileTypes'] = mainWidget.softwareCompetition.fileTypes;
+ if (isTechnologyContest()) {
+ request['technologies'] = mainWidget.softwareCompetition.assetDTO.directjsTechnologies;
+ }
+
+ if (isPlatformContest()) {
+ request['platforms'] = mainWidget.softwareCompetition.platforms;
+ }
+
return request;
}
@@ -1818,14 +1849,18 @@ function showPage(pageId) {
if (pageId == 'overviewSoftwarePage') {
if (isTechnologyContest()) {
$('#swTechnologyDiv').show();
+ $('#alTechnologyDiv').show();
} else {
$('#swTechnologyDiv').hide();
+ $('#alTechnologyDiv').hide();
}
if (isPlatformContest()) {
$('#swPlatformDiv').show();
+ $('#alPlatformDiv').show();
} else {
$('#swPlatformDiv').hide();
+ $('#alPlatformDiv').hide();
}
if (isDevOrDesign()) {
@@ -3836,8 +3871,7 @@ function isTechnologyContest() {
return !(
categoryId == SOFTWARE_CATEGORY_ID_CONCEPT ||
categoryId == SOFTWARE_CATEGORY_ID_SPEC ||
- categoryId == SOFTWARE_CATEGORY_ID_CONTENT ||
- categoryId == ALGORITHM_CATEGORY_ID_MARATHON
+ categoryId == SOFTWARE_CATEGORY_ID_CONTENT
);
}
}
@@ -4119,14 +4153,17 @@ function technologyAndPlatformSelectsChanged() {
return { hasJavaTech: hasJavaTech, hasSalesforcePlatform: hasSalesforcePlatform };
}
- var selectedTechnologies = jQuery_1_11_1('#technologies')
+ var selectorTech = jQuery_1_11_1('#swTechnologies').length > 0 ? '#swTechnologies' : '#technologies';
+ var selectorPlat = jQuery_1_11_1('#swPlatforms').length > 0 ? '#swPlatforms' : '#platforms';
+
+ var selectedTechnologies = jQuery_1_11_1(selectorTech)
.magicSuggest()
.getSelection();
$(selectedTechnologies).each(function(val, i) {
if (val.name == 'Java') hasJavaTech = true;
});
- var selectedPlatforms = jQuery_1_11_1('#platforms')
+ var selectedPlatforms = jQuery_1_11_1(selectorPlat)
.magicSuggest()
.getSelection();
$(selectedPlatforms).each(function(val, i) {
diff --git a/src/web/scripts/launch/pages/overview.js b/src/web/scripts/launch/pages/overview.js
index 27d86dc63..45ba84e2b 100644
--- a/src/web/scripts/launch/pages/overview.js
+++ b/src/web/scripts/launch/pages/overview.js
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2010 - 2018 TopCoder Inc., All Rights Reserved.
+ * Copyright (C) 2010 - 2018 TopCoder Inc., All Rights Reserved.
*
* Overview Page (the second page of the launch challenge flow)
*
@@ -48,11 +48,11 @@
*
* Version 1.12 (Topcoder - Add Basic Marathon Match Creation And Update In Direct App)
* - Remove MM problem entry
- *
- * Version 1.13 (Topcoder - Support Points Prize Type For Challenges)
- * - Add support for points prize type
+ *
+ * Version 1.13 (Topcoder - Support Points Prize Type For Challenges)
+ * - Add support for points prize type
* @author bugbuka, GreatKevin, Veve, GreatKevin, TCSASSEMBLER
- * @version 1.13
+ * @version 1.13
*/
$(document).ready(function() {
// categories
@@ -193,13 +193,13 @@ function validateFieldsOverviewSoftware() {
if(isTechnologyContest()) {
- if(jQuery_1_11_1("#technologies").magicSuggest().getSelection().length == 0) {
+ if(jQuery_1_11_1("#swTechnologies").magicSuggest().getSelection().length == 0) {
errors.push('No technology is selected.');
}
}
if(isPlatformContest()) {
- if(jQuery_1_11_1("#platforms").magicSuggest().getSelection().length == 0) {
+ if(jQuery_1_11_1("#swPlatforms").magicSuggest().getSelection().length == 0) {
errors.push('No Platform is selected.');
}
}
@@ -242,7 +242,7 @@ function validateFieldsOverviewSoftware() {
if(error) {
errors.push(error);
}
- var points = validatePoints(errors);
+ var points = validatePoints(errors);
if(errors.length > 0) {
showErrors(errors);
return false;
@@ -259,7 +259,7 @@ function validateFieldsOverviewSoftware() {
}
if(isTechnologyContest()) {
- var selectedTechnologies = jQuery_1_11_1("#technologies").magicSuggest().getSelection();
+ var selectedTechnologies = jQuery_1_11_1("#swTechnologies").magicSuggest().getSelection();
mainWidget.softwareCompetition.assetDTO.directjsTechnologies = $.map(selectedTechnologies, function (val, i) {
return val.id.toString();
});
@@ -267,12 +267,12 @@ function validateFieldsOverviewSoftware() {
$.each(selectedTechnologies, function(i, g){
techSpan+='
'+ g.name+'';
});
- $("#rTechnologies span").remove();
- $(techSpan).insertBefore("#rTechnologies a");
+ $(".rTechnologies span").remove();
+ $(techSpan).insertBefore(".rTechnologies a");
}
if(isPlatformContest()) {
- var selectedPlatforms = jQuery_1_11_1("#platforms").magicSuggest().getSelection();
+ var selectedPlatforms = jQuery_1_11_1("#swPlatforms").magicSuggest().getSelection();
mainWidget.softwareCompetition.platforms = $.map(selectedPlatforms, function (val, i) {
return val.id.toString();
});
@@ -282,12 +282,12 @@ function validateFieldsOverviewSoftware() {
platformSpan+='
'+ g.name+'';
});
- $("#rPlatforms span").remove();
- $(platformSpan).insertBefore("#rPlatforms a");
+ $(".rPlatforms span").remove();
+ $(platformSpan).insertBefore(".rPlatforms a");
}
updateSoftwarePrizes();
- mainWidget.softwareCompetition.projectHeader.points = points;
+ mainWidget.softwareCompetition.projectHeader.points = points;
// add copilot cost into project header
mainWidget.softwareCompetition.projectHeader.setCopilotCost(mainWidget.softwareCompetition.copilotCost);
@@ -358,7 +358,7 @@ function validateFieldsOverviewStudio() {
}
}
- var points = validatePoints(errors);
+ var points = validatePoints(errors);
if(errors.length > 0) {
showErrors(errors);
return false;
@@ -369,7 +369,7 @@ function validateFieldsOverviewStudio() {
mainWidget.softwareCompetition.projectHeader.projectStudioSpecification.contestIntroduction = contestIntroduction;
mainWidget.softwareCompetition.projectHeader.prizes = prizes;
- mainWidget.softwareCompetition.projectHeader.points = points;
+ mainWidget.softwareCompetition.projectHeader.points = points;
mainWidget.softwareCompetition.fileTypes = fileTypes.concat(otherFileTypes);
// set specification review and review/screening cost
@@ -432,7 +432,7 @@ function validateFieldsOverviewAlgorithm() {
if(error) {
errors.push(error);
}
- var points = validatePoints(errors);
+ var points = validatePoints(errors);
if(errors.length > 0) {
showErrors(errors);
return false;
@@ -444,7 +444,32 @@ function validateFieldsOverviewAlgorithm() {
mainWidget.softwareCompetition.projectHeader.prizes = prizes;
- mainWidget.softwareCompetition.projectHeader.points = points;
+ mainWidget.softwareCompetition.projectHeader.points = points;
+
+ var selectedTechnologies = jQuery_1_11_1("#alTechnologies").magicSuggest().getSelection();
+ mainWidget.softwareCompetition.assetDTO.directjsTechnologies = $.map(selectedTechnologies, function (val, i) {
+ return val.id.toString();
+ });
+ var techSpan="";
+ $.each(selectedTechnologies, function(i, g){
+ techSpan+='
'+ g.name+'';
+ });
+ $(".rTechnologies span").remove();
+ $(techSpan).insertBefore(".rTechnologies a");
+
+ var selectedPlatforms = jQuery_1_11_1("#alPlatforms").magicSuggest().getSelection();
+ mainWidget.softwareCompetition.platforms = $.map(selectedPlatforms, function (val, i) {
+ return val.id.toString();
+ });
+
+ var platformSpan="";
+ $.each(selectedPlatforms, function(i, g){
+ platformSpan+='
'+ g.name+'';
+ });
+
+ $(".rPlatforms span").remove();
+ $(platformSpan).insertBefore(".rPlatforms a");
+
return true;
}