Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit a64df43

Browse files
committed
Merge branch 'be_able_edit_dates_for_tasks' into dev
2 parents 69448e6 + 48b5d9e commit a64df43

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

src/web/scripts/launch/contestDetailSoftware.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,9 @@ function initContest(contestJson) {
11141114
phaseOpen = contestJson.phaseOpen;
11151115
isCompleted = contestJson.projectStatus.id == 7;
11161116
isCancelled = (contestJson.projectStatus.id > 3) && !isCompleted;
1117+
var isTask = projectHeader.properties[TASK_FLAG] == "1";
1118+
var hasPhaseOpen = $("ul.progressContainer li.current").size() > 0
1119+
var morePhaseCompleted = $("ul.progressContainer li.completed").size() > 1
11171120

11181121
// if has no write permission, no edit; if any phase is open, no edit
11191122
$('#contestNameText').hide();
@@ -1170,16 +1173,22 @@ function initContest(contestJson) {
11701173
if (contestJson.projectStatus != null && contestJson.projectStatus.name == DRAFT_STATUS) {
11711174
isActiveContest = true;
11721175
$(".edit_prize").parent().show();
1173-
if (contestJson.properties["Private Project Status"] == "1"){
1176+
if (isTask){
11741177
$(".edit_round").show();
11751178
$('#roundEdit').show();
11761179
$(".edit_prize").show();
11771180
}
11781181
} else {
11791182
$(".edit_prize").show();
11801183
$(".edit_round").show();
1181-
$('#roundEdit').hide();
1182-
$('#roundText').show();
1184+
//enable edit date for task, not have open phase, not have phase complete other than registration
1185+
if (isTask && !hasPhaseOpen && !morePhaseCompleted){
1186+
$('#roundEdit').show();
1187+
$('#roundText').hide();
1188+
}else {
1189+
$('#roundEdit').hide();
1190+
$('#roundText').show();
1191+
}
11831192
}
11841193

11851194
$(".edit_spec").show();
@@ -1194,7 +1203,7 @@ function initContest(contestJson) {
11941203
$(".edit_round").hide();
11951204
$(".privateCmd").hide();
11961205
}else if (contestJson.projectStatus != null && contestJson.projectStatus.id == ACTIVE_PROJECT_STATUS &&
1197-
contestJson.properties["Private Project Status"] == "1"){
1206+
contestJson.properties[TASK_FLAG] == "1"){
11981207
$(".privateCmd").show();
11991208
}
12001209

@@ -1266,7 +1275,7 @@ function populateTypeSection() {
12661275
}
12671276

12681277
if (isF2F() || isDesignF2F()) {
1269-
var privateProject = p["Private Project Status"];
1278+
var privateProject = p[TASK_FLAG];
12701279
var registrants = [];
12711280
for (var i=0; i < mainWidget.softwareCompetition.registrants.length; i++) {
12721281
registrants.push(mainWidget.softwareCompetition.registrants[i]["handle"]);
@@ -2671,7 +2680,6 @@ function populateSpecSection(initFlag) {
26712680
$('#swDetailedRequirements').val(detailedRequirements);
26722681
$('#swGuidelines').val(guidelines);
26732682
$('#swPrivateDescription').val(privateDescription);
2674-
26752683
if(isDevOrDesign()) {
26762684
if(mainWidget.softwareCompetition.assetDTO.directjsRootCategoryId != $('#catalogSelect').val() || initFlag) {
26772685
$('#catalogSelect').val(mainWidget.softwareCompetition.assetDTO.directjsRootCategoryId);
@@ -2680,7 +2688,6 @@ function populateSpecSection(initFlag) {
26802688
fillCategories();
26812689
}
26822690
}
2683-
26842691
if(isTechnologyContest()) {
26852692
//technlogies
26862693
jQuery_1_11_1("#technologies").magicSuggest().setValue(mainWidget.softwareCompetition.assetDTO.directjsTechnologies);
@@ -2696,7 +2703,6 @@ function populateSpecSection(initFlag) {
26962703
$('#rswTechnologies').html(selectedTechName.join("<br/>"));
26972704
technologyAndPlatformSelectsChanged();
26982705
}
2699-
27002706
if(isPlatformContest()) {
27012707
//platforms
27022708
jQuery_1_11_1("#platforms").magicSuggest().setValue(mainWidget.softwareCompetition.platforms);
@@ -2719,7 +2725,6 @@ function populateSpecSection(initFlag) {
27192725
} else {
27202726
$("#swThurgoodDiv input").removeAttr("checked");
27212727
}
2722-
27232728
// for studio
27242729
if (mainWidget.competitionType == "STUDIO") {
27252730
$('#contestIntroduction').val(mainWidget.softwareCompetition.projectHeader.projectStudioSpecification.contestIntroduction);
@@ -2744,7 +2749,6 @@ function populateSpecSection(initFlag) {
27442749
html += '<div><input type="checkbox" value="' + type.value +'" class="defaultFileType" /> <label>' + type.description + '</label></div>';
27452750
}
27462751
});
2747-
27482752
// other file types
27492753
$.each(types[1], function(i, type) {
27502754
html += '<div><input type="checkbox" checked="checked" />&nbsp;&nbsp;<input type="text" class="text fileInput" value="' + type + '"/></div>';

src/web/scripts/launch/entity.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ var STUDIO_IDEA_GENERATION = 22;
193193

194194
var DRAFT_STATUS = "Draft";
195195
var ACTIVE_STATUS = "Active";
196+
var TASK_FLAG = "Private Project Status";
196197

197198
var PRODUCT_SKU ="Product SKU";
198199

src/web/scripts/launch/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,15 +1036,15 @@ function saveAsDraftRequest() {
10361036

10371037
if (isF2F() || isDesignF2F()) {
10381038
if ($("input[name=privateProject]:checked").length > 0){
1039-
mainWidget.softwareCompetition.projectHeader.properties["Private Project Status"] = "1";
1040-
if (mainWidget.softwareCompetition.projectHeader.properties["Private Project Status"] ==
1039+
mainWidget.softwareCompetition.projectHeader.properties[TASK_FLAG] = "1";
1040+
if (mainWidget.softwareCompetition.projectHeader.properties[TASK_FLAG] ==
10411041
$("input[name=preRegisterUsers]").val().trim()){
10421042
mainWidget.softwareCompetition.preRegisterUsers = "";
10431043
}else{
10441044
mainWidget.softwareCompetition.preRegisterUsers = $("input[name=preRegisterUsers]").val();
10451045
}
10461046
}else{
1047-
mainWidget.softwareCompetition.projectHeader.properties["Private Project Status"] = "0";
1047+
mainWidget.softwareCompetition.projectHeader.properties[TASK_FLAG] = "0";
10481048
mainWidget.softwareCompetition.preRegisterUsers = "";
10491049
}
10501050
}
@@ -3239,7 +3239,7 @@ function validateFileTypes(errors) {
32393239
* Checks to see if the technology is needed for the contest
32403240
*/
32413241
function isTechnologyContest() {
3242-
if(!mainWidget.softwareCompetition.projectHeader.projectCategory) {
3242+
if(!mainWidget.softwareCompetition.projectHeader.projectCategory || isDesignType()) {
32433243
return false;
32443244
} else {
32453245
var categoryId = mainWidget.softwareCompetition.projectHeader.projectCategory.id;

0 commit comments

Comments
 (0)