From b79461f88ffdc54b220181685d4c4a0d2fec245e Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Tue, 17 May 2011 11:14:07 +0000 Subject: Add project-level box --- Report/Box.php | 2 +- Report/Box/00_Project.php | 56 +++++++++++++++++++++++++++++++++++++++++++++++ Report/HTML.php | 7 ++++-- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 Report/Box/00_Project.php diff --git a/Report/Box.php b/Report/Box.php index 79408a0..15bd940 100644 --- a/Report/Box.php +++ b/Report/Box.php @@ -105,7 +105,7 @@ abstract class Report_Box $values[] = $this->_render_value_gen($k); } } - + echo $status / $status_max; return array( diff --git a/Report/Box/00_Project.php b/Report/Box/00_Project.php new file mode 100644 index 0000000..7e310c2 --- /dev/null +++ b/Report/Box/00_Project.php @@ -0,0 +1,56 @@ + + * @license MIT License, see LICENSE.txt + * @link http://svnweb.mageia.org/svn/soft/dashboard/ +*/ + +/** +*/ +class Report_Box_Project extends Report_Box +{ + /** + */ + var $title = "Project info"; + + /** + */ + function _get_var_definitions() { + return array( + 'age' => ':render', + 'next' => ':render' +// 'contribs' => '%d registered contributors', +// 'packagers' => '%d packagers', + ); + } + + function _render_value_age() + { + $today = time(); + $myBirthDate = strtotime("2010-09-18 19:00:00"); + return array( + 't' => sprintf("I'm %d days old.", round(abs($today-$myBirthDate)/60/60/24)), + 'c' => 'ok', + 's' => 0 + ); + } + + function _render_value_next() + { + $today = time(); + $release = strtotime("2011-06-01 19:00:00"); + return array( + 't' => sprintf("Next release in %d days.", round(abs($today-$release)/60/60/24)), + 'c' => 'ok', + 's' => 0 + ); + + } + +} diff --git a/Report/HTML.php b/Report/HTML.php index 6e27f14..9f3f30a 100644 --- a/Report/HTML.php +++ b/Report/HTML.php @@ -42,6 +42,7 @@ class Report_HTML

{$links}

S; + $pubDate = date('r'); } $s = << @@ -114,14 +115,16 @@ S;

Mageia build chain dashboard

+
+

Last updated: {$pubDate}


    -
  • Light gray values are unknown for now.
  • +
  • Light gray values are unchecked for now; coming soon!
  • ISO Build block is still a mockup, doesn't work for now!
  • code is in svnweb.mageia.org/soft/dashboard; to get a copy of the code:
    $ svn checkout svn://svn.mageia.org/svn/soft/dashboard
    - patches welcome!
  • + patches or an even better dashboard option are welcome!
-- cgit v1.2.1