Subversion Repositories oidfminutesapp

Compare Revisions

Rev 4 → Rev 3

trunk/root/home.tt
7,10 → 7,18
of the committees listed below, log in to gain access to
minutes that have not yet been approved.</p>
 
<ul>
<table>
[% FOREACH team IN teams -%]
<li><a href="[% team.urlname | uri %]/">[% team.name | html %]</a></li>
<tr>
<td>[% team.name %]</td>
<td>[% team.teamid %]</td>
<td>
[% FOREACH user IN team.members -%]
<div>[% user.name %]</div>
[% END -%]
</td>
</tr>
[% END -%]
</ul>
</table>
 
[% INCLUDE "pagebottom.tt" %]
trunk/lib/OIDFMinutes/Model/DB.pm
25,38 → 25,6
return $user_rs->next();
}
 
sub fetch_team_by_urlname {
my ($urlname, $c) = @_;
 
my $team_rs = $c->model('DB::Team')->search({
urlname => $urlname,
});
 
return $team_rs->next();
}
 
sub fetch_minutes_by_team_urlname_and_meeting_date {
my ($team_urlname, $date, $c) = @_;
 
return undef unless $date =~ /^\d\d\d\d-\d\d-\d\d$/;
 
my $team = fetch_team_by_urlname($team_urlname, $c);
 
if ($team) {
my $teamid = $team->teamid;
 
my $minutes_rs = $c->model('DB::Minutes')->search({
teamid => $teamid,
meeting_date => $date,
});
 
return $minutes_rs->next();
}
else {
return undef;
}
}
 
=head1 NAME
 
OIDFMinutes::Model::DB - Catalyst DBIC Schema Model
trunk/lib/OIDFMinutes/Controller/Root.pm
82,22 → 82,6
}
}
 
sub team : Path("minutes") : Args(1) {
my ($self, $c, $team_urlname) = @_;
 
my $team = OIDFMinutes::Model::DB::fetch_team_by_urlname($team_urlname, $c);
 
$c->response->body("Team thing <plaintext>".Data::Dumper::Dumper($team));
}
 
sub minutes : Local : Args(2) {
my ($self, $c, $team_urlname, $date) = @_;
 
my $minutes = OIDFMinutes::Model::DB::fetch_minutes_by_team_urlname_and_meeting_date($team_urlname. $date, $c);
 
$c->response->body("Minutes thing <plaintext>".Data::Dumper::Dumper($minutes));
}
 
=head2 end
 
Attempt to render a view, if needed.