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