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

Commit 48b5d9e

Browse files
committed
be able to edit dates for tasks
1 parent 9baabfd commit 48b5d9e

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
@@ -1111,6 +1111,9 @@ function initContest(contestJson) {
11111111
phaseOpen = contestJson.phaseOpen;
11121112
isCompleted = contestJson.projectStatus.id == 7;
11131113
isCancelled = (contestJson.projectStatus.id > 3) && !isCompleted;
1114+
var isTask = projectHeader.properties[TASK_FLAG] == "1";
1115+
var hasPhaseOpen = $("ul.progressContainer li.current").size() > 0
1116+
var morePhaseCompleted = $("ul.progressContainer li.completed").size() > 1
11141117

11151118
// if has no write permission, no edit; if any phase is open, no edit
11161119
$('#contestNameText').hide();
@@ -1167,16 +1170,22 @@ function initContest(contestJson) {
11671170
if (contestJson.projectStatus != null && contestJson.projectStatus.name == DRAFT_STATUS) {
11681171
isActiveContest = true;
11691172
$(".edit_prize").parent().show();
1170-
if (contestJson.properties["Private Project Status"] == "1"){
1173+
if (isTask){
11711174
$(".edit_round").show();
11721175
$('#roundEdit').show();
11731176
$(".edit_prize").show();
11741177
}
11751178
} else {
11761179
$(".edit_prize").show();
11771180
$(".edit_round").show();
1178-
$('#roundEdit').hide();
1179-
$('#roundText').show();
1181+
//enable edit date for task, not have open phase, not have phase complete other than registration
1182+
if (isTask && !hasPhaseOpen && !morePhaseCompleted){
1183+
$('#roundEdit').show();
1184+
$('#roundText').hide();
1185+
}else {
1186+
$('#roundEdit').hide();
1187+
$('#roundText').show();
1188+
}
11801189
}
11811190

11821191
$(".edit_spec").show();
@@ -1191,7 +1200,7 @@ function initContest(contestJson) {
11911200
$(".edit_round").hide();
11921201
$(".privateCmd").hide();
11931202
}else if (contestJson.projectStatus != null && contestJson.projectStatus.id == ACTIVE_PROJECT_STATUS &&
1194-
contestJson.properties["Private Project Status"] == "1"){
1203+
contestJson.properties[TASK_FLAG] == "1"){
11951204
$(".privateCmd").show();
11961205
}
11971206

@@ -1263,7 +1272,7 @@ function populateTypeSection() {
12631272
}
12641273

12651274
if (isF2F() || isDesignF2F()) {
1266-
var privateProject = p["Private Project Status"];
1275+
var privateProject = p[TASK_FLAG];
12671276
var registrants = [];
12681277
for (var i=0; i < mainWidget.softwareCompetition.registrants.length; i++) {
12691278
registrants.push(mainWidget.softwareCompetition.registrants[i]["handle"]);
@@ -2634,7 +2643,6 @@ function populateSpecSection(initFlag) {
26342643
$('#swDetailedRequirements').val(detailedRequirements);
26352644
$('#swGuidelines').val(guidelines);
26362645
$('#swPrivateDescription').val(privateDescription);
2637-
26382646
if(isDevOrDesign()) {
26392647
if(mainWidget.softwareCompetition.assetDTO.directjsRootCategoryId != $('#catalogSelect').val() || initFlag) {
26402648
$('#catalogSelect').val(mainWidget.softwareCompetition.assetDTO.directjsRootCategoryId);
@@ -2643,7 +2651,6 @@ function populateSpecSection(initFlag) {
26432651
fillCategories();
26442652
}
26452653
}
2646-
26472654
if(isTechnologyContest()) {
26482655
//technlogies
26492656
jQuery_1_11_1("#technologies").magicSuggest().setValue(mainWidget.softwareCompetition.assetDTO.directjsTechnologies);
@@ -2659,7 +2666,6 @@ function populateSpecSection(initFlag) {
26592666
$('#rswTechnologies').html(selectedTechName.join("<br/>"));
26602667
technologyAndPlatformSelectsChanged();
26612668
}
2662-
26632669
if(isPlatformContest()) {
26642670
//platforms
26652671
jQuery_1_11_1("#platforms").magicSuggest().setValue(mainWidget.softwareCompetition.platforms);
@@ -2682,7 +2688,6 @@ function populateSpecSection(initFlag) {
26822688
} else {
26832689
$("#swThurgoodDiv input").removeAttr("checked");
26842690
}
2685-
26862691
// for studio
26872692
if (mainWidget.competitionType == "STUDIO") {
26882693
$('#contestIntroduction').val(mainWidget.softwareCompetition.projectHeader.projectStudioSpecification.contestIntroduction);
@@ -2707,7 +2712,6 @@ function populateSpecSection(initFlag) {
27072712
html += '<div><input type="checkbox" value="' + type.value +'" class="defaultFileType" /> <label>' + type.description + '</label></div>';
27082713
}
27092714
});
2710-
27112715
// other file types
27122716
$.each(types[1], function(i, type) {
27132717
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)