r2/r2/templates/message.html
%endif %def> <%def name="thing_css_class(what)" buffered="True"> ${parent.thing_css_class(what)} ${"new" if thing.new else ""} ${"was-comment" if thing.was_comment else ""} ${"recipient" if thing.user_is_recipient else ""} ${"message-reply" if getattr(thing, "is_child", False) else ""} ${"message-parent" if getattr(thing, "is_parent", False) else ""} ${"gold" if getattr(thing, "distinguished", "") == "gold" else ""} ${"gold-auto" if getattr(thing, "distinguished", "") == "gold-auto" else ""} ${"threaded" if getattr(thing, "threaded", "") else ""} ${"most-recent" if getattr(thing, "most_recent", "") else ""} %def> <%def name="thing_css_rowclass(what)"> ${parent.thing_css_rowclass(what)} <% accent_color = getattr(thing, "accent_color", "") %> %if getattr(thing, "is_parent", False) and accent_color: color-bar %endif %def> <%def name="thing_data_attributes(what)"> ${parent.thing_data_attributes(what)} <% accent_color = getattr(thing, "accent_color", "") %> %if getattr(thing, "is_parent", False) and accent_color: style="border-color:${accent_color};" %endif %def> <%def name="tagline()"> ${"[%s]" % ("+" if thing.collapsed else "–")} %if c.user_is_admin: %if not thing.was_comment and hasattr(thing, "del_on_recipient") and thing.del_on_recipient: ${_("deleted message")} %endif %endif <% substitutions = {} if thing.sr_id: path = thing.subreddit.path.rstrip('/') if getattr(thing, "subreddit_distinguish", None) == "admin": distinguish_attribs_list = [] add_admin_distinguish(distinguish_attribs_list) distinguish = format_html(capture(make_distinguish, distinguish_attribs_list)) type = "admin-distinguish" substitutions['subreddit'] = format_html(u'%(path)s%(distinguish)s', path=path, distinguish=distinguish, type=type) elif getattr(thing, "subreddit_distinguish", None) == "moderator": distinguish_attribs_list = [] add_moderator_distinguish(distinguish_attribs_list, thing.subreddit) distinguish = format_html(capture(make_distinguish, distinguish_attribs_list)) type = "moderator-distinguish" substitutions['subreddit'] = format_html(u'%(path)s%(distinguish)s', path=path, distinguish=distinguish, type=type) else: substitutions['subreddit'] = format_html(u'%(path)s', path=path) substitutions['author'] = format_html(u'%s', WrappedUser(thing.author, thing.attribs, thing)) if isinstance(thing.to, Account): to_attribs = [] if thing.sr_id and not thing.was_comment: if thing.to.name in g.admins: add_admin_distinguish(to_attribs) elif thing.to_is_moderator: add_moderator_distinguish(to_attribs, thing.subreddit) substitutions['dest'] = format_html(u'%s', WrappedUser(thing.to, to_attribs, thing)) elif thing.sr_id: substitutions['dest'] = format_html(u'%(path)s', path=thing.subreddit.path) substitutions['when'] = unsafe(capture(thing_timestamp, thing, thing.timesince, live=True, include_tense=True)) taglinetext = conditional_websafe(thing.taglinetext).replace(' ', ' ') taglinetext = format_html(taglinetext, **substitutions) %> ${taglinetext} %if c.user_is_admin: ${self.admintagline()} %endif %def> <%def name="subject()">
%if getattr(thing, "is_parent", False): %if thing.sr_id: <% if getattr(thing, "user_is_moderator", False): sr_path = "%smessage/moderator/inbox" % thing.subreddit.path else: sr_path = thing.subreddit.path accent_color = getattr(thing, "accent_color", "") %> %if accent_color: %endif /r/${thing.subreddit.name} %else: <% corr = thing.author if thing.user_is_recipient else thing.to %> ${WrappedUser(corr)} %endif %endif ${thing.subject} %if thing.was_comment: ${thing.link_title} %elif getattr(thing, "is_parent", False):
${_("expand all")}${_("collapse all")} %endif
%def> <%def name="ParentDiv()"> %if getattr(thing, 'distinguished', '') == 'gold':
%endif ${self.subject()} %def> <%def name="commentBody()"> %if thing.was_comment and hasattr(thing, "parent"):
%endif ${unsafe(safemarkdown(thing.body))} %def> <%def name="buttons()"> ${MessageButtons(thing)} %def> <%def name="entry()"> ${parent.entry()} %def>