Timeline template

FossilOrigin-Name: 33082559569a1dd5aa038d4636583d0918253724defbb58570f5baafe06220d1
This commit is contained in:
nekobit 2022-08-04 02:47:48 +00:00
parent a3bb29d01a
commit ff3d383464
4 changed files with 19 additions and 3 deletions

View file

@ -17,8 +17,8 @@ sub content_timeline
ssn => $ssn,
statuses => $statuses,
title => $title,
post_box => $show_post_box,
show_post_box => $show_post_box,
);
to_template(\&vars, \&data->{'attachment.tt'});
to_template(\&vars, \&data->{'timeline.tt'});
}

View file

@ -26,6 +26,7 @@
#include "../templates/attachment.ctt"
#include "../templates/emoji.ctt"
#include "../templates/postbox.ctt"
#include "../templates/timeline.ctt"
HV* template_files;
pthread_mutex_t perl_mutex = PTHREAD_MUTEX_INITIALIZER;
@ -42,6 +43,7 @@ void init_template_files()
hv_stores(template_files, "attachment.tt", newSVpv(data_attachment_tt, data_attachment_tt_size));
hv_stores(template_files, "emoji.tt", newSVpv(data_emoji_tt, data_emoji_tt_size));
hv_stores(template_files, "postbox.tt", newSVpv(data_postbox_tt, data_postbox_tt_size));
hv_stores(template_files, "timeline.tt", newSVpv(data_timeline_tt, data_timeline_tt_size);)
}
void cleanup_template_files()

View file

@ -947,7 +947,7 @@ void content_status(PATH_ARGS, uint8_t flags)
SAVETMPS;
PUSHMARK(SP);
HV* session_hv = perlify_session(ssn);
XPUSHs(newRV_inc((SV*)session_hv));
XPUSHs(newRV_noinc((SV*)session_hv));
XPUSHs(newRV_noinc((SV*)template_files));
XPUSHs(newRV_noinc((SV*)perlify_status(&status)));
if (statuses_before)

14
templates/timeline.tt Normal file
View file

@ -0,0 +1,14 @@
<div class="menubar">
<form action="." method="post">
Only media:
<input type="checkbox" name="only_media" value="1" [% ssn.post.only_media %]>
<span class="bullet-separate">&bull;</span>
Replies:
<select name="replies_only">
<option value="0">Show replies</option>
<option value="1">Self</option>
<option value="2">Following</option>
</select>
<input type="submit" value="Filter">
</form>
</div>