Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWayne Beaton2019-05-23 17:24:12 +0000
committerWayne Beaton2019-05-23 17:24:12 +0000
commit304888528389e85a2c931a9e63599b22807331ab (patch)
treee337c48935bae4e809ac87dbf5ce13b763b6c88a
parentefe524f5d7325a11142e4ccd25a5bcff683a54ce (diff)
downloadprojects-304888528389e85a2c931a9e63599b22807331ab.tar.gz
projects-304888528389e85a2c931a9e63599b22807331ab.tar.xz
projects-304888528389e85a2c931a9e63599b22807331ab.zip
Bug 469938 - Project proposals page issues
-rw-r--r--tools/proposals.php56
1 files changed, 28 insertions, 28 deletions
diff --git a/tools/proposals.php b/tools/proposals.php
index b761d465..bb9fd7c8 100644
--- a/tools/proposals.php
+++ b/tools/proposals.php
@@ -38,37 +38,37 @@ $pageAuthor = "Wayne Beaton";
<div class="homeitem">
<h1><?= $pageTitle ?></h1>
-<?php
-
-function sort_by_date($proposal1, $proposal2) {
- if ($proposal1->getDate() == $proposal2->getDate()) return 0;
- return $proposal1->getDate() > $proposal2->getDate() ? -1 : 1;
-}
-
-usort($proposals, 'sort_by_date');
+<p>The Eclipse Project Handbook contains information about our process for
+<a href="https://www.eclipse.org/projects/handbook/#starting">proposing
+a new open source project</a> at the Eclipse Foundation.</p>
-$counts = array();
-
-echo "<ul>";
-foreach($proposals as $proposal) {
- echo "<li>" . $proposal->asHtml();
- echo "<ul>";
- foreach($proposal->statuses as $status) {
- $text = $status->getText();
- $date = $App->getFormattedDate($status->getDate(), 'short');
+<?php
- echo "<li>$date $text</li>";
+ usort($proposals, function($proposal1, $proposal2) {
+ if ($proposal1->getDate() == $proposal2->getDate()) return 0;
+ return $proposal1->getDate() > $proposal2->getDate() ? -1 : 1;
+ });
+
+ function dumpProposals($title, $proposals, $when) {
+ $foundOne = false;
+ foreach($proposals as $proposal) {
+ if (call_user_func($when, $proposal)) {
+ if (!$foundOne) {
+ echo "<h2>{$title}</h2>";
+ echo "<ul>";
+ $foundOne = true;
+ }
+ echo "<li>{$proposal->asHtml()}</li>";
+ }
+ }
+ if ($foundOne) {
+ echo "</ul>";
+ }
}
- echo "</ul>";
- echo "</li>";
- $posted = $proposal->getProposalPosted();
- if ($posted) {
- $period = date('Y-m', $posted->getDate());
- @$counts[$period]++;
- }
-}
-echo "</ul>";
+ dumpProposals("Active", $proposals, function (Proposal $proposal) {return $proposal->isActive();});
+ dumpProposals("Complete", $proposals, function (Proposal $proposal) {return $proposal->isSuccessful();});
+ dumpProposals("Withdrawn", $proposals, function (Proposal $proposal) {return $proposal->isWithdrawn();});
?>
</div>
@@ -77,5 +77,5 @@ echo "</ul>";
<?php
$html = ob_get_contents();
ob_end_clean();
-$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
+$App->generatePage(null, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?> \ No newline at end of file

Back to the top