%!
import matsuba.templatetools as tt
import extutil
THREADS_VISIBLE, THREADS_LISTED = 10, 40
%>
<%namespace file="common.html" import="*" />
<%inherit file="base.html" />
<%def name="bodyclass()">mainpage%def>
<% banner = get_random_banner(board) %>
% if banner:
% for tn, thread in enumerate(threads[:THREADS_VISIBLE]):
<%
op, res = thread[0], thread[1:]
if thread.sticky:
n = MAX_STICKY_REPLIES_SHOWN
else:
n = MAX_REPLIES_SHOWN
replies = res[-n:]
omitted = len(res) - len(replies)
omitted_files = tt.filecount(res) - tt.filecount(replies)
# extutil.make_plural(omitted_files, 'file')
%>
${singlepost(op, False)}
% if omitted:
% endif
% for post in replies:
${singlepost(post, False)}
% endfor
<%call expr="postform(board, thread)"><%def name="links()">
%def>%call>
% endfor