From 1edf678d90f2b9e2ec517ad7ea25d02f965b8c20 Mon Sep 17 00:00:00 2001 From: nekobit Date: Sun, 7 Aug 2022 22:03:46 +0000 Subject: [PATCH] Create statuses FossilOrigin-Name: 5767e0610e9a60b2c908fe7a62b2e723e761e4d372424a57d029ddb677fe3610 --- perl/account.pm | 3 +++ perl/timeline.pm | 2 +- templates/account.tt | 4 +--- templates/account_statuses.tt | 9 ++++++++- templates/timeline.tt | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/perl/account.pm b/perl/account.pm index 7b7be68..c75b41b 100644 --- a/perl/account.pm +++ b/perl/account.pm @@ -8,6 +8,7 @@ our @EXPORT = qw( account content_statuses ); use template_helpers 'to_template'; use l10n 'lang'; +use status 'generate_status'; sub generate_account { @@ -33,6 +34,8 @@ sub content_statuses prefix => '', ssn => $ssn, acct => $acct, + statuses => $statuses, + create_status => sub { generate_status($ssn, $data, shift); }, ); generate_account($ssn, $data, $acct, $relationship, to_template(\%vars, \$data->{'account_statuses.tt'})); diff --git a/perl/timeline.pm b/perl/timeline.pm index 45d65ab..f430188 100644 --- a/perl/timeline.pm +++ b/perl/timeline.pm @@ -22,7 +22,7 @@ sub content_timeline title => $title, show_post_box => $show_post_box, postbox => \&generate_postbox, - create_status => \&generate_status, + create_status => sub { generate_status($ssn, $data, shift); }, ); to_template(\%vars, \$data->{'timeline.tt'}); diff --git a/templates/account.tt b/templates/account.tt index c12d05d..6f05d8a 100644 --- a/templates/account.tt +++ b/templates/account.tt @@ -79,8 +79,6 @@
- [% FOREACH i IN statuses %] - [% create_status(ssn, data, i) %] - [% END %] + [% content %]
diff --git a/templates/account_statuses.tt b/templates/account_statuses.tt index 50d925c..3e788e3 100644 --- a/templates/account_statuses.tt +++ b/templates/account_statuses.tt @@ -1 +1,8 @@ -Account statuses +[% IF statuses %] + [% FOREACH i IN statuses %] + [% create_status(i) %] + asd + [% END %] +[% ELSE %] +

No statuses...

+[% END %] diff --git a/templates/timeline.tt b/templates/timeline.tt index 0c2c4e9..bb4158d 100644 --- a/templates/timeline.tt +++ b/templates/timeline.tt @@ -18,7 +18,7 @@ [% FOREACH i IN statuses %] - [% create_status(ssn, data, i) %] + [% create_status(i) %] [% END %] [%# TODO navigation %]