diff --git a/perl/account.pm b/perl/account.pm index 51ac417..39755ff 100644 --- a/perl/account.pm +++ b/perl/account.pm @@ -48,3 +48,20 @@ sub content_statuses generate_account($ssn, $data, $acct, $relationship, to_template(\%vars, \$data->{'account_statuses.tt'})); } + +sub generate_account_item +{ + my ($ssn, $data, $account) = @_; + + my %vars = ( + prefix => '', + ssn => $ssn, + account => $account, + # Functions + icon => \&get_icon, + lang => \&lang, + format_username => \&format_username, + ); + + to_template(\%vars, \$data->{'account_item.tt'}); +} diff --git a/src/global_perl.c b/src/global_perl.c index 688f71f..0992b2a 100644 --- a/src/global_perl.c +++ b/src/global_perl.c @@ -34,6 +34,8 @@ #include "../templates/content_notifs.ctt" #include "../templates/content_lists.ctt" #include "../templates/navigation.ctt" +#include "../templates/accounts.ctt" +#include "../templates/account_item.ctt" PerlInterpreter* my_perl; HV* template_files; @@ -58,6 +60,8 @@ void init_template_files(pTHX) hv_stores(template_files, "content_notifs.tt", newSVpv(data_content_notifs_tt, data_content_notifs_tt_size)); hv_stores(template_files, "content_lists.tt", newSVpv(data_content_lists_tt, data_content_lists_tt_size)); hv_stores(template_files, "navigation.tt", newSVpv(data_navigation_tt, data_navigation_tt_size)); + hv_stores(template_files, "accounts.tt", newSVpv(data_accounts_tt, data_accounts_tt_size)); + hv_stores(template_files, "account_item.tt", newSVpv(data_account_item_tt, data_account_item_tt_size)); } void cleanup_template_files() diff --git a/templates/account_item.tt b/templates/account_item.tt new file mode 100644 index 0000000..d51c068 --- /dev/null +++ b/templates/account_item.tt @@ -0,0 +1,19 @@ + + + + + +
+ +
diff --git a/templates/accounts.tt b/templates/accounts.tt new file mode 100644 index 0000000..c9eda08 --- /dev/null +++ b/templates/accounts.tt @@ -0,0 +1,10 @@ +[% IF title %] +

$title

+[% END %] + +[% FOREACH i IN accounts %] + [% create_account(i) %] +[% END %] + +[%# TODO navigation %] +[% nav() %]