@@ -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" /> <input type="text" class="text fileInput" value="' + type + '"/></div>' ;
0 commit comments