Subversion Repositories oidfminutesapp

Compare Revisions

Rev 3 → Rev 4

root/home.tt
7,18 → 7,10
of the committees listed below, log in to gain access to
minutes that have not yet been approved.</p>
 
<table>
<ul>
[% FOREACH team IN teams -%]
<tr>
<td>[% team.name %]</td>
<td>[% team.teamid %]</td>
<td>
[% FOREACH user IN team.members -%]
<div>[% user.name %]</div>
[% END -%]
</td>
</tr>
<li><a href="[% team.urlname | uri %]/">[% team.name | html %]</a></li>
[% END -%]
</table>
</ul>
 
[% INCLUDE "pagebottom.tt" %]
lib/OIDFMinutes/Model/DB.pm
25,6 → 25,38
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
lib/OIDFMinutes/Controller/Root.pm
82,6 → 82,22
}
}
 
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.