diff --git a/src/web/WEB-INF/includes/contest/editTabMarathon.jsp b/src/web/WEB-INF/includes/contest/editTabMarathon.jsp index 506b85f32..1f20b4068 100644 --- a/src/web/WEB-INF/includes/contest/editTabMarathon.jsp +++ b/src/web/WEB-INF/includes/contest/editTabMarathon.jsp @@ -96,6 +96,11 @@ : + + MM Type + : + + <%-- Product @@ -225,7 +230,20 @@ -


+

+ +
+
+ MM Type +
+ +
+
+

<%-- Product diff --git a/src/web/WEB-INF/includes/launch/contestSelection.jsp b/src/web/WEB-INF/includes/launch/contestSelection.jsp index d6d3cf394..63c829f4b 100644 --- a/src/web/WEB-INF/includes/launch/contestSelection.jsp +++ b/src/web/WEB-INF/includes/launch/contestSelection.jsp @@ -135,6 +135,22 @@ + +
+ +
+ +
+
+ +
+    Run this challenge in a private community ?    +
+
diff --git a/src/web/css/direct/launchcontest.css b/src/web/css/direct/launchcontest.css index bee67ab1b..a8227a7e5 100644 --- a/src/web/css/direct/launchcontest.css +++ b/src/web/css/direct/launchcontest.css @@ -349,7 +349,7 @@ border: 1px solid #a8abad; } -#launchContestOut .addNewContest .projectSelect, #launchContestOut .addNewContest .billingSelect, #launchContestOut .addNewContest .copilotSelect, .reviewScorecardSelect, .milestoneSelect, .reviewerSelect, .registrantsSelect { +#launchContestOut .addNewContest .projectSelect, #launchContestOut .addNewContest .billingSelect, #launchContestOut .addNewContest .copilotSelect, .reviewScorecardSelect, .milestoneSelect, .reviewerSelect, .registrantsSelect, .mmTypeSelect{ width: auto; float: left; display: inline; @@ -1952,7 +1952,7 @@ a.draft:hover span.right, a.preview:hover span.right { } /** billing and round select **/ -.reviewScorecardSelect .newListSelected, .billingSelect .newListSelected, .prizeBillingSelect .newListSelected, .roundelect .newListSelected, .copilotSelect .newListSelected, .milestoneSelect .newListSelected, .projectsSelect .newListSelected, .copilotsSelect .newListSelected, .problemSelect .newListSelected, .reviewerSelect .newListSelected, .registrantsSelect .newListSelected { +.reviewScorecardSelect .newListSelected, .billingSelect .newListSelected, .prizeBillingSelect .newListSelected, .roundelect .newListSelected, .copilotSelect .newListSelected, .milestoneSelect .newListSelected, .projectsSelect .newListSelected, .copilotsSelect .newListSelected, .problemSelect .newListSelected, .reviewerSelect .newListSelected, .registrantsSelect .newListSelected, .mmTypeSelect .newListSelected { width: 283px; height: 28px; padding: 0 5px; @@ -1969,11 +1969,11 @@ a.draft:hover span.right, a.preview:hover span.right { color: #6c6c6c; } -.reviewScorecardSelect .selectedTxt, .billingSelect .selectedTxt, .prizeBillingSelect .selectedTxt, .roundelect .selectedTxt, .copilotSelect .selectedTxt, .milestoneSelect .selectedTxt, .copilotsSelect .selectedTxt, .projectsSelect .selectedTxt, .problemSelect .selectedTxt, .reviewerSelect .selectedTxt, .registrantsSelect .selectedTxt { +.reviewScorecardSelect .selectedTxt, .billingSelect .selectedTxt, .prizeBillingSelect .selectedTxt, .roundelect .selectedTxt, .copilotSelect .selectedTxt, .milestoneSelect .selectedTxt, .copilotsSelect .selectedTxt, .projectsSelect .selectedTxt, .problemSelect .selectedTxt, .reviewerSelect .selectedTxt, .registrantsSelect .selectedTxt, .mmTypeSelect .selectedTxt { width: 281px; } -.reviewScorecardSelect .newList, .billingSelect .newList, .prizeBillingSelect .newList, .roundelect .newList, .copilotSelect .newList, .milestoneSelect .newList, .copilotsSelect .newList, .projectsSelect .newList, .problemSelect .newList, .reviewerSelect .newList, .registrantsSelect .newList{ +.reviewScorecardSelect .newList, .billingSelect .newList, .prizeBillingSelect .newList, .roundelect .newList, .copilotSelect .newList, .milestoneSelect .newList, .copilotsSelect .newList, .projectsSelect .newList, .problemSelect .newList, .reviewerSelect .newList, .registrantsSelect .newList, .mmTypeSelect .newList{ width: 290px; border: #ccc solid 1px; background: #fff; diff --git a/src/web/scripts/launch/contestDetailSoftware.js b/src/web/scripts/launch/contestDetailSoftware.js index 6f1f3466c..d841799c9 100644 --- a/src/web/scripts/launch/contestDetailSoftware.js +++ b/src/web/scripts/launch/contestDetailSoftware.js @@ -1389,6 +1389,11 @@ function populateTypeSection() { $(".matchRoundId").show(); } + if (mainWidget.softwareCompetition.projectHeader.properties.hasOwnProperty(MM_TYPE)) { + $('#rMMType').text(mainWidget.softwareCompetition.projectHeader.properties[MM_TYPE]); + $('#mmType').getSetSSValue(mainWidget.softwareCompetition.projectHeader.properties[MM_TYPE]); + } + // populate review style if (mainWidget.softwareCompetition.projectHeader.properties['Review Type'] && mainWidget.competitionType == "SOFTWARE") { var reviewType = mainWidget.softwareCompetition.projectHeader.properties['Review Type']; @@ -1524,6 +1529,9 @@ function validateFieldsTypeSection() { && categoryId != STUDIO_CATEGORY_ID_DESIGN_F2F) { validateDirectProjectMilestone(milestoneId, errors); } + if (categoryId == ALGORITHM_CATEGORY_ID_MARATHON && $('#mmType').val() === '0') { + errors.push('Marathon match type is required'); + } if (errors.length > 0) { showErrors(errors); return false; @@ -1569,6 +1577,11 @@ function validateFieldsTypeSection() { // set iterative review scorecard mainWidget.softwareCompetition.projectHeader.reviewScorecardId = parseInt($('select#reviewScorecardSelects').val()); } + + if (categoryId == ALGORITHM_CATEGORY_ID_MARATHON) { + mainWidget.softwareCompetition.projectHeader.properties[MM_TYPE] = $('#mmType').val().trim(); + } + return true; } @@ -1627,6 +1640,11 @@ function showTypeSectionEdit() { $('#reviewer').data('customized',true); } + if(!$('#mmType').data('customized')) { + $('#mmType').sSelect({ddMaxHeight: '220',yscroll: true}); + $('#mmType').data('customized',true); + } + $('#contestTypes').getSetSSValue(mainWidget.competitionType + mainWidget.softwareCompetition.projectHeader.projectCategory.id); var projectType = mainWidget.competitionType; diff --git a/src/web/scripts/launch/entity.js b/src/web/scripts/launch/entity.js index fea440292..dc69bc3cc 100644 --- a/src/web/scripts/launch/entity.js +++ b/src/web/scripts/launch/entity.js @@ -203,6 +203,7 @@ var PRODUCT_SKU ="Product SKU"; var ENVIRONMENT = "Environment"; var CODE_REPO = "Code Repo"; +var MM_TYPE = "Marathon Match Type"; var projectCategoryArray = [ {id:SOFTWARE_CATEGORY_ID_CONCEPT, name:'CONCEPTUALIZATION', label:'Software Conceptualization', typeId:2, typeName:'Application', hasMulti:true, hideInDropdown: true}, diff --git a/src/web/scripts/launch/main.js b/src/web/scripts/launch/main.js index 3f35cad9d..d33aa21c9 100644 --- a/src/web/scripts/launch/main.js +++ b/src/web/scripts/launch/main.js @@ -1216,6 +1216,8 @@ function saveAsDraftRequestSoftware() { mainWidget.softwareCompetition.projectHeader.properties['Thurgood Platform'] = ''; } + delete mainWidget.softwareCompetition.projectHeader.properties[MM_TYPE]; + if(isF2F() || isCode()) { // get the auto assign reviewer ID to F2F / CODE challenge mainWidget.softwareCompetition.projectHeader.autoAssignReviewerId = @@ -1321,6 +1323,8 @@ function saveAsDraftRequestStudio() { request['directProjectMilestoneId'] = mainWidget.softwareCompetition.projectMilestoneId; request['preRegisterUsers'] = mainWidget.softwareCompetition.preRegisterUsers; + delete mainWidget.softwareCompetition.projectHeader.properties[MM_TYPE]; + if (!isNaN(mainWidget.softwareCompetition.copilotUserId)) { request['contestCopilotId'] = mainWidget.softwareCompetition.copilotUserId; request['contestCopilotName'] = mainWidget.softwareCompetition.copilotUserName; diff --git a/src/web/scripts/launch/pages/selection.js b/src/web/scripts/launch/pages/selection.js index 74a33a15c..0223a0f23 100644 --- a/src/web/scripts/launch/pages/selection.js +++ b/src/web/scripts/launch/pages/selection.js @@ -150,7 +150,7 @@ function validateFieldsContestSelectionAlgorithm() { var startDate = getDateByIdPrefix('start'); var regEndDate = getDateByIdPrefix('regEnd'); var endDate = getDateByIdPrefix('subEnd'); - + //validation var errors = []; @@ -158,7 +158,10 @@ function validateFieldsContestSelectionAlgorithm() { validateContestName(contestName, errors); validateTcProject(tcProjectId, errors); - + + if ($('#mmType').val() === '0') { + errors.push('Marathon match type is required'); + } // validate schedule if(startDate >= regEndDate) { errors.push('The registration end date should be after the start date.'); @@ -196,6 +199,7 @@ function validateFieldsContestSelectionAlgorithm() { mainWidget.softwareCompetition.subEndDate = endDate; mainWidget.softwareCompetition.regEndDate = regEndDate; + mainWidget.softwareCompetition.projectHeader.properties[MM_TYPE] = $('#mmType').val().trim(); //prizes is on category id // fillPrizes(); diff --git a/src/web/scripts/launchcontest.js b/src/web/scripts/launchcontest.js index c9a5040d5..88b9a4aaf 100644 --- a/src/web/scripts/launchcontest.js +++ b/src/web/scripts/launchcontest.js @@ -482,7 +482,7 @@ $(document).ready(function() { ddMaxHeight: '220px', yscroll: true }; - $('.billingSelect select,.roundelect select,.startEtSelect select,.checkpointEtSelect select,.endEtSelect select').sSelect(SelectOptions); + $('.billingSelect select,.roundelect select,.startEtSelect select,.checkpointEtSelect select,.endEtSelect select, .mmTypeSelect select').sSelect(SelectOptions); $('.projectSelect select').sSelect(SelectOptions).change(function() { handleProjectDropDownChange(); }); @@ -884,12 +884,15 @@ function onContestTypeChange() { // show the end date for marathon match $("#subEndDateDiv").show(); $("div.milestoneSelect").parents("div.row").hide(); + $("#mmType").closest(".row").show(); } else if(contestType == 'SOFTWARE') { $("#subEndDateDiv").show(); $("div.milestoneSelect").parents("div.row").show(); + $("#mmType").closest(".row").hide(); } else { $("#subEndDateDiv").hide(); $("div.milestoneSelect").parents("div.row").show(); + $("#mmType").closest(".row").hide(); } if (isContestSaved() && mainWidget.competitionType != contestType) {