[Jifty-commit] r4489 - in apps/spensive: . lib/Spensive/Model
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Nov 20 12:11:18 EST 2007
Author: jesse
Date: Tue Nov 20 12:11:16 2007
New Revision: 4489
Modified:
apps/spensive/ (props changed)
apps/spensive/lib/Spensive/Model/User.pm
apps/spensive/lib/Spensive/View.pm
Log:
r67468 at pinglin (orig r7377): jesse | 2007-09-21 12:09:27 -0400
bugfix
Modified: apps/spensive/lib/Spensive/Model/User.pm
==============================================================================
--- apps/spensive/lib/Spensive/Model/User.pm (original)
+++ apps/spensive/lib/Spensive/Model/User.pm Tue Nov 20 12:11:16 2007
@@ -17,7 +17,7 @@
our $PWGEN = Text::Password::Pronounceable->new(6=>8);
-sub published_address { return shift->_value('published_address').shift->id."@".Jifty->config->app('EmailDomain') };
+sub published_address { my $self = shift; return $self->_value('published_address').$self->id."@".Jifty->config->app('EmailDomain') };
sub before_create {
my $self = shift;
Modified: apps/spensive/lib/Spensive/View.pm
==============================================================================
--- apps/spensive/lib/Spensive/View.pm (original)
+++ apps/spensive/lib/Spensive/View.pm Tue Nov 20 12:11:16 2007
@@ -82,7 +82,7 @@
my %appendices = ();
my $expenses = $report->expenses();
my ( $earliest, $latest );
- my $appendix_counter++;
+ my $appendix_counter='A';
warn $expenses->count;
map {
@@ -122,8 +122,8 @@
};
};
if ($expense->attachments->count) {
- $appendices{$expense->id} = $appendix_counter++;
- cell { 'For attachments, see appendix '.$appendices{$expense->id}};
+ $appendices{++$appendix_counter} = $expense;
+ cell { 'For attachments, see appendix '.$appendix_counter};
}
};
row {
@@ -167,6 +167,21 @@
};
outs( List::Util::sum( values %category_totals ) );
};
+
+ h1{ _('Attachments')};
+
+ for('A'..$appendix_counter) {
+ h2{_("Appendix %1",$_)};
+
+ my $expense = $appendices{$_};
+ my $attaches= $expense->attachments;
+ while (my $attach = $attaches->next) {
+
+ with( item => $attach), show('/attachment/image');
+ }
+ }
+
+
};
template 'report/build' => page {
More information about the Jifty-commit
mailing list