## defs provided: ## singlepost(post, threadpage) - one post ## rules(board, thread=None) - the rules underneath the posting form (used internally here) ## postform(board, thread=None) - the posting form ## internal: ## post_name_label(post) - outputs a name (and link, if one is defined) ## post_timestamp_label(post, dateformat=None) - timestamp, with link if one is defined and no name is set. ## dateformat is passed to format_timestamp ## post_label(post, dateformat=None) - post subject, name, timestamp, and poster ID ## sticky_icon() - for a sticky icon ## post_message(post, threadpage=True) - message text of a post. if threadpage is False, long messages are ## abbreviated with a note to that effect. <%! import matsuba.templatetools as tt import extutil ##> # True = index.html, 1.html, 2.html, etc. # False = only index.html THREADLIST_MULTIPAGE = False # True = Wakaba style: # Posts increment globally # Threads served via /board/res/threadid.html # Post id references link to #postid on the thread page # False = Kareha style: # Each thread has a post #1 # Threads are served via /board/read/postrange # Post id references link to a single-post view # Multiple-post ranges are supported in post references # (Side effect note: posts are never deleted from the board in this style) # This requires some mod_rewrite magic to work. POSTIDS_ABSOLUTE = False # True = a subject is required when posting a new thread # False = subject can be blank REQUIRE_SUBJECT = True # Other pages to generate (catalog, subback, ...) OTHER_PAGES = [('rssreplies', 'rss.xml'), ('subback', 'subback.html')] ## ------------------------------------------------------------------------------------------------------------- ## Single post. ## vars: ## post = Post object ## threadpage = boolean. Affects post abbreviation etc. ## Just the name <%def name="post_name_label(post)"> ${tt.format_name_trip(post.name_trip, ['', ''], ['', ''], post.link)} ## Just the timestamp <%def name="post_timestamp_label(post, dateformat=None)"> % if post.link and not filter(None, post.name_trip): ${tt.timestamp(post, dateformat)} % else: ${tt.timestamp(post, dateformat)} % endif <%def name="singlepost(post, threadpage)"><% if threadpage: abbrev = None else: abbrev = extutil.abbreviate_html(post.message) %> % if post.aborn: ##

${post.resid} ${post.message}

## % else: ##

${post.resid} Name: ${post_name_label(post)} : ${post_timestamp_label(post, '2ch')} % if post.idcode: ID:${post.idcode|h} % endif % if post.filename: (File: ${post.fileinfo|h}) % endif ## should write this with javascript... meh [Del]

% if post.thumbnail: % if post.filename: % endif ${post.sizeinfo} % if post.filename: % endif % endif
${abbrev or post.message}
% if abbrev:
Post too long. Click to view the whole post or the thread page.
% endif
## % endif ## ------------------------------------------------------------------------------------------------------------- ## Posting form. ## vars: ## board = Board object ## thread = Thread object (if applicable) ## if wrapped inside a call block, the caller may define a 'links' def to append to the bottom of the form. <%def name="postform(board, thread=None)">
% if thread and thread.closed: % else: % if not thread: % endif ## default size is 10, javascript rewrites this to 5, and 15 when focused % if board.all_filetypes(thread is not None): % endif % endif % if caller and hasattr(caller, 'links'): % endif
This thread has been closed. You cannot post in this thread any longer.
Title:
${('Link' if board.forced_anon else 'Name')}: % if board.forced_anon: % else: Link: % endif % if thread: % endif
Spam trap (don't touch):
## More options...
File:
${caller.links()}