Skip to content
Browse files

Rejigging dates

  • Loading branch information...
1 parent 8ba43d8 commit 527d4e8ee0a2bd9886d5aea9556a094741eb6cdc @ranginui ranginui committed
Showing with 18 additions and 18 deletions.
  1. +4 −0 data/dates.txt
  2. +6 −16 lib/KC/Dashboard.pm
  3. +6 −1 lib/KC/Data.pm
  4. +2 −1 views/show_entries.tt
View
4 data/dates.txt
@@ -2,4 +2,8 @@
2012-07-15|String freeze for 3.8.3
2012-07-22|Release date for 3.6.7
2012-07-22|Release date for 3.8.3
+2012-08-15|String freeze for 3.6.8
+2012-08-15|String freeze for 3.8.4
+2012-08-22|Release date for 3.6.8
+2012-08-22|Release date for 3.8.4
2012-10-22|Release date for 3.10.0
View
22 lib/KC/Dashboard.pm
@@ -60,13 +60,13 @@ AND added = 'Pushed to Master' AND bug_severity = 'enhancement' ORDER BY bug_whe
my $enhancement = $sth->fetchall_arrayref;
my $dates = get_dates();
my $devs = get_devs();
- my $ohloh = redis->get('ohloh');
+# my $ohloh = redis->get('ohloh');
- if ( !$ohloh ) {
- $ohloh = ohloh_activity();
- redis->set( 'ohloh' => $ohloh );
- redis->expire( 'ohloh', 6000 );
- }
+# if ( !$ohloh ) {
+my $ohloh = ohloh_activity();
+# redis->set( 'ohloh' => $ohloh );
+# redis->expire( 'ohloh', 6000 );
+# }
template 'show_entries.tt',
{
'entries' => $entries,
@@ -81,16 +81,6 @@ AND added = 'Pushed to Master' AND bug_severity = 'enhancement' ORDER BY bug_whe
};
};
-get '/ohloh' => sub {
- my $ohloh;
- $ohloh = redis->get('ohloh');
- if ( !$ohloh ) {
- $ohloh = ohloh_activity();
- redis->set( 'ohloh' => $ohloh );
- }
- template 'ohloh.tt', { 'ohloh' => $ohloh };
-};
-
get '/bug_status' => sub {
my $sql =
"SELECT count(*) as count,bug_status FROM bugs GROUP BY bug_status";
View
7 lib/KC/Data.pm
@@ -6,6 +6,7 @@ use warnings;
use LWP::Simple;
use XML::Simple;
+use DateTime;
require Exporter;
@@ -35,13 +36,17 @@ sub get_dates {
# subroutine to parse a date file and put it into a form suitable for TT
open( my $FH, '<', 'data/dates.txt' );
my @dates;
+ my $today = DateTime->now->ymd;
while ( my $line = <$FH> ) {
my ( $date, $desc ) = split( /\|/, $line );
my $daterow = {
'date' => $date,
'desc' => $desc
};
- push @dates, $daterow;
+ if ( $date gt $today ) {
+ push @dates, $daterow;
+ }
+
}
close $FH;
return \@dates;
View
3 views/show_entries.tt
@@ -151,17 +151,18 @@ $(document).ready(function(){
<% FOREACH date IN dates %>
<li><% date.date %> - <% date.desc %></li>
<% END %>
+<% IF ohloh %>
</ul>
<h3>June commit statistics - Master</h2>
<% i = ohloh.result.activity_fact.size - 2 %>
<% activity = ohloh.result.activity_fact.$i %>
-<% use Dumper %>
<ul>
<li>Commits - <% activity.commits %></li>
<li>Contributors - <% activity.contributors %></li>
<li>Code Added - <% activity.code_added %></li>
<li>Code Removed - <% activity.code_removed %></li>
</ul>
+<% END %>
</div>
</div>
</body>

0 comments on commit 527d4e8

Please sign in to comment.
Something went wrong with that request. Please try again.