From 55e3888a3d09a5afecf82b7592cdc416d141f83e Mon, 18 Jun 2012 10:17:43 -0400 From: Christopher Guindon Date: Mon, 18 Jun 2012 10:16:01 -0400 Subject: [PATCH] Nova theme integration patch for downloads diff --git a/downloadsites/eclipse/default_style.css b/downloadsites/eclipse/default_style.css old mode 100755 new mode 100644 index d725483..6379825 --- a/downloadsites/eclipse/default_style.css +++ b/downloadsites/eclipse/default_style.css @@ -1,11 +1,12 @@ -p, table, td, th { font-family: arial, helvetica, geneva; font-size: 10pt} -pre { font-family: "Courier New", Courier, mono; font-size: 10pt} -h2 { font-family: arial, helvetica, geneva; font-size: 18pt; font-weight: bold ; line-height: 14px} -code { font-family: "Courier New", Courier, mono; font-size: 10pt} -sup { font-family: arial,helvetica,geneva; font-size: 10px} -h3 { font-family: arial, helvetica, geneva; font-size: 14pt; font-weight: bold} -li { font-family: arial, helvetica, geneva; font-size: 10pt} -h1 { font-family: arial, helvetica, geneva; font-size: 28px; font-weight: bold} -body { font-family: arial, helvetica, geneva; font-size: 10pt; clip: rect( ); margin-top: 5mm; margin-left: 3mm} -.indextop { font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold} -.indexsub { font-size: xx-small;; font-family: Arial, Helvetica, sans-serif; color: #8080FF} +p, table, td, th { font-family: arial, helvetica, geneva; font-size: 10pt} +pre { font-family: "Courier New", Courier, mono; font-size: 10pt} +h2 { font-family: arial, helvetica, geneva; font-size: 18pt; font-weight: bold ; line-height: 14px} +code { font-family: "Courier New", Courier, mono; font-size: 10pt} +sup { font-family: arial,helvetica,geneva; font-size: 10px} +h3 { font-family: arial, helvetica, geneva; font-size: 14pt; font-weight: bold} +li { font-family: arial, helvetica, geneva; font-size: 10pt} +h1 { font-family: arial, helvetica, geneva; font-size: 28px; font-weight: bold} +body { font-family: arial, helvetica, geneva; font-size: 10pt; clip: rect( ); margin-top: 5mm; margin-left: 3mm} +.indextop { font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold} +.indexsub { font-size: xx-small;; font-family: Arial, Helvetica, sans-serif; color: #8080FF} +.container_php, .container_default{ padding:0 20px} \ No newline at end of file diff --git a/downloadsites/eclipse/downloads/createIndex4x.php b/downloadsites/eclipse/downloads/createIndex4x.php index 43c4af7..d56f657 100644 --- a/downloadsites/eclipse/downloads/createIndex4x.php +++ b/downloadsites/eclipse/downloads/createIndex4x.php @@ -1,20 +1,44 @@ + - -Eclipse Project Downloads - +<?php echo $pageTitle;?> + +
@@ -93,17 +117,18 @@ } return $result; } -function runTestBoxes($buildName, $testResultsDirName) { +function runTestBoxes($buildName) { // hard code for now the tests ran on one box // https://bugs.eclipse.org/bugs/show_bug.cgi?id=378706 return 1; + global $subdirDrops; $testBoxes=array("linux", "macosx", "win32"); $length=count($testBoxes); $boxes=0; // TEMP? appears "old style" builds had directories named "results" - if (file_exists("$subdirDrops/$buildName/$testResultsDirName")) { - $buildDir = dir("$subdirDrops/$buildName/$testResultsDirName"); + if (file_exists("$subdirDrops/$buildName/results")) { + $buildDir = dir("$subdirDrops/$buildName/results"); while ($file = $buildDir->read()) { for ($i = 0 ; $i < $length ; $i++) { if (strncmp($file, $testBoxes[$i], count($testBoxes[$i])) == 0) { @@ -139,26 +164,17 @@ $time=intval(date("H"))*60+intval(date("i")); $diff=($day-$buildDay)*24*60+$time-$buildTime; // Add icons + // SHORT TERM? Since "old builds", not from scratch, don't have these swt md5s, well use an easy indicator file, for now. + // eventually may want to put in more complicated logic to check for date, or something? + // presumably this particular md5 was choosen since last one made, I'd guess? + //$build_done=file_exists("$dropDir/checksum/swt-$buildName-win32-wce_ppc-arm-j2me.zip.md5"); + $build_done=file_exists("$dropDir/eclipse-SDK-$buildName-linux-gtk.tar.gz"); echo "\n"; + echo "\n"; if (array_key_exists($prefix,$latestFile)) { @@ -327,22 +331,18 @@ if (count($parts)==3) { $buildName=$parts[1]; } - if (!file_exists($subdirDrops."/".$fileName."/buildHidden")) { - echo "\n"; - echo "\n"; - if ($fileName == "") { - echo "\n"; - } else { - echo "\n"; - } - $buildName = printBuildColumns($fileName, $parts); - echo "\n"; - echo "\n"; + if ($fileName == "") { + echo "\n"; + } else { + echo "\n"; } + $buildName = printBuildColumns($fileName, $parts); + echo "\n"; + echo "\n"; } } ?> -
\n"; // hard code for now the build is done // https://bugs.eclipse.org/bugs/show_bug.cgi?id=378706 - // but later, changed ... - // compute build done based on "buildPending" file, but if not - // present, assume build is done - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=382196 - $build_done=true; - if (file_exists("$dropDir/buildPending")) { - $build_done=false; - } - if ($build_done) { - // test results location changed. 'testresults' is new standard - // but we check for 'results' for older stuff. - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=379408 - $testResultsDirName="results"; - if (file_exists("$dropDir/testresults")) { - $testResultsDirName="testresults"; - } - $boxes=runTestBoxes($fileName, $testResultsDirName); + // if ($build_done) { + if (true) { + $boxes=runTestBoxes($fileName); echo "\"Build\n"; //$testResults="$dropDir/testresults/xml"; //if (file_exists("$testResults")) { @@ -175,22 +191,12 @@ break; case 5: - if ($testResultsDirName === "testresults") { - echo ""; - } else { - echo ""; - } - echo "\"Tests\n"; + echo "\"Tests\n"; break; default: // if more than 12 hours then consider that the regression tests did not finish if ($diff > 720) { - if ($testResultsDirName === "testresults") { - echo ""; - } else { - echo ""; - } - echo "\"Tests\n"; + echo "\"Tests\n"; } else { echo "\"Tests\n"; } @@ -245,47 +251,43 @@ if ($anEntry != "." && $anEntry!=".." && $anEntry!="TIME" && startsWithDropPrefix($anEntry,$dropPrefix)) { $parts = explode("-", $anEntry); // echo "

an entry: $anEntry\n"; - // do not count hidden directories in computation - // allows non-hidden ones to still show up as "most recent" else will be blank. - if (!file_exists($subdirDrops."/".$anEntry."/buildHidden")) { - if (count($parts) == 3) { + if (count($parts) == 3) { - $buckets[$parts[0]][] = $anEntry; + $buckets[$parts[0]][] = $anEntry; - $timePart = $parts[2]; - $year = substr($timePart, 0, 4); - $month = substr($timePart, 4, 2); - $day = substr($timePart, 6, 2); - $hour = substr($timePart,8,2); - $minute = substr($timePart,10,2); - $timeStamp = mktime($hour, $minute, 0, $month, $day, $year); + $timePart = $parts[2]; + $year = substr($timePart, 0, 4); + $month = substr($timePart, 4, 2); + $day = substr($timePart, 6, 2); + $hour = substr($timePart,8,2); + $minute = substr($timePart,10,2); + $timeStamp = mktime($hour, $minute, 0, $month, $day, $year); - $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp); - // latestTimeStamp will not be defined, first time through - if (!isset($latestTimeStamp) || !array_key_exists($parts[0],$latestTimeStamp) || $timeStamp > $latestTimeStamp[$parts[0]]) { - $latestTimeStamp[$parts[0]] = $timeStamp; - $latestFile[$parts[0]] = $anEntry; - } + $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp); + // latestTimeStamp will not be defined, first time through + if (!isset($latestTimeStamp) || !array_key_exists($parts[0],$latestTimeStamp) || $timeStamp > $latestTimeStamp[$parts[0]]) { + $latestTimeStamp[$parts[0]] = $timeStamp; + $latestFile[$parts[0]] = $anEntry; } + } - if (count($parts) == 2) { + if (count($parts) == 2) { - $buildType=substr($parts[0],0,1); - $buckets[$buildType][] = $anEntry; - $datePart = substr($parts[0],1); - $timePart = $parts[1]; - $year = substr($datePart, 0, 4); - $month = substr($datePart, 4, 2); - $day = substr($datePart, 6, 2); - $hour = substr($timePart,0,2); - $minute = substr($timePart,2,2); - $timeStamp = mktime($hour, $minute, 0, $month, $day, $year); - $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp); + $buildType=substr($parts[0],0,1); + $buckets[$buildType][] = $anEntry; + $datePart = substr($parts[0],1); + $timePart = $parts[1]; + $year = substr($datePart, 0, 4); + $month = substr($datePart, 4, 2); + $day = substr($datePart, 6, 2); + $hour = substr($timePart,0,2); + $minute = substr($timePart,2,2); + $timeStamp = mktime($hour, $minute, 0, $month, $day, $year); + $timeStamps[$anEntry] = date("D, j M Y -- H:i (O)", $timeStamp); - if (!isset($latestTimeStamp) || !array_key_exists($buildType,$latestTimeStamp) || $timeStamp > $latestTimeStamp[$buildType]) { - $latestTimeStamp[$buildType] = $timeStamp; - $latestFile[$buildType] = $anEntry; - } + if (!isset($latestTimeStamp) || !array_key_exists($buildType,$latestTimeStamp) || $timeStamp > $latestTimeStamp[$buildType]) { + $latestTimeStamp[$buildType] = $timeStamp; + $latestFile[$buildType] = $anEntry; } } } @@ -311,6 +313,8 @@ $prefix=$typeToPrefix[$value]; // if empty bucket, do not print this row if (array_key_exists($prefix,$buckets)) { + echo "

$value
$value$buildName$timeStamps[$fileName]
$buildName$timeStamps[$fileName]
+ \n"; - $parts = explode("-", $innerValue); + // Uncomment the line below if we need click through licenses. + // echo "$parts[1]\n"; - echo "\n"; - - // Uncomment the line below if we need click through licenses. - // echo "$parts[1]\n"; - - // Comment the line below if we need click through licenses. - $buildName=$innerValue; - if (count ($parts)==3) { - echo "$parts[1]\n"; - } else if (count ($parts)==2) { - echo "$innerValue\n"; - } else { - echo "Unexpected numberof parts?\n"; - } - - $buildName = printBuildColumns($innerValue, $parts); - echo "$timeStamps[$innerValue]\n"; - echo "\n"; + // Comment the line below if we need click through licenses. + $buildName=$innerValue; + if (count ($parts)==3) { + echo "$parts[1]\n"; + } else if (count ($parts)==2) { + echo "$innerValue\n"; + } else { + echo "Unexpected numberof parts?\n"; } + + $buildName = printBuildColumns($innerValue, $parts); + echo "$timeStamps[$innerValue]\n"; + echo "\n"; } } echo "\n"; @@ -414,7 +410,22 @@ } } -?> - - +echo '
'; +$html = ob_get_clean(); + +switch($layout){ + case 'html': + #echo the computed content with the body and html closing tag. This is for the old layout. + echo $html; + echo ''; + echo ''; + break; + + default: + #For the default view we use $App->generatePage to generate the page inside nova. + $App->AddExtraHtmlHeader(''); + $App->Promotion = FALSE; + $App->generatePage('Nova', $Menu, NULL , $pageAuthor, $pageKeywords, $pageTitle, $html); + break; +}