treebird/perl/timeline.pm
nekobit c18179b52b Navigation
FossilOrigin-Name: e1f2a5e64b2f8ba9ddb5c96d4d3ad8e37195d8f40020304df7f10ffb112a3c38
2022-08-10 05:06:47 +00:00

31 lines
800 B
Perl

package timeline;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT = qw( content_timeline );
use template_helpers 'to_template';
use icons 'get_icon';
use postbox 'generate_postbox';
use status 'generate_status';
use navigation 'generate_navigation';
sub content_timeline
{
my ($ssn, $data, $statuses, $title, $show_post_box) = @_;
my %vars = (
prefix => '',
ssn => $ssn,
data => $data,
statuses => $statuses,
title => $title,
show_post_box => $show_post_box,
postbox => \&generate_postbox,
create_status => sub { generate_status($ssn, $data, shift); },
nav => generate_navigation($ssn, $data, $statuses->[0]->{id}, $statuses->[-1]->{id}),
);
to_template(\%vars, \$data->{'timeline.tt'});
}