## The contents of this file are subject to the Common Public Attribution ## License Version 1.0. (the "License"); you may not use this file except in ## compliance with the License. You may obtain a copy of the License at ## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public ## License Version 1.1, but Sections 14 and 15 have been added to cover use of ## software over a computer network and provide for limited attribution for the ## Original Developer. In addition, Exhibit A has been modified to be ## consistent with Exhibit B. ## ## Software distributed under the License is distributed on an "AS IS" basis, ## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for ## the specific language governing rights and limitations under the License. ## ## The Original Code is reddit. ## ## The Original Developer is the Initial Developer. The Initial Developer of ## the Original Code is reddit Inc. ## ## All portions of the code written by reddit are Copyright (c) 2006-2012 ## reddit Inc. All Rights Reserved. ############################################################################### <%! from r2.lib.template_helpers import get_domain from r2.lib.template_helpers import s3_https_if_secure from r2.lib.pages.things import LinkButtons from r2.lib.pages import WrappedUser from r2.lib.template_helpers import static from r2.lib.strings import Score, strings %> <%inherit file="printable.html"/> <%namespace file="utils.html" import="plain_link, thing_timestamp, edited" /> <%namespace file="printablebuttons.html" import="toggle_button" /> <%def name="numcol()"> <% num = thing.num %> ${thing.num} %def> <%def name="make_link(name, css_class)"> ${caller.body()} %def> <%def name="bottom_buttons()">
%def> <%def name="flair()"> %if c.user.pref_show_link_flair and thing.flair_text: ${thing.flair_text} %endif %def> <%def name="entry()">
%if c.site.link_flair_position == 'left':
<%call expr="flair()" />
%endif
<%call expr="make_link('title', 'title')">
${thing.title}
%call>
%if c.site.link_flair_position == 'right':
<%call expr="flair()" />
%endif
%if getattr(thing, "approval_checkmark", None):
%endif
${self.domain()}
%if c.user_is_admin:
%for link_note in thing.link_notes:
[${link_note}]
%endfor
%endif
${self.tagline()}
<% child_content = "" if thing.link_child and thing.link_child.load: child_content = unsafe(thing.link_child.content()) expand = thing.link_child and thing.link_child.expand %> ## if we're not on a permalink page we'll render the buttons on top ## (unless it's also a jury duty listing) %if not (expand or getattr(thing, "trial_mode", None)): ${bottom_buttons()} %endif %if not getattr(thing, "votable", True): %endif ##if we are on a permalink page, we'll render the buttons below %if expand: ${bottom_buttons()} %endif ##populate the expando cache if we have something %if not expand and child_content: %endif %def> <%def name="thing_css_class(what)" buffered="True"> ${parent.thing_css_class(what)} ${"over18" if thing.over_18 else ""} %if c.user.pref_show_link_flair and (thing.flair_text or thing.flair_css_class): <% css = thing.flair_css_class or '' %> linkflair ${' '.join('linkflair-' + c for c in css.split())} %endif %def> <%def name="thing_data_attributes(what)" buffered="True"> ${parent.thing_data_attributes(what)} data-ups="${what.upvotes}" data-downs="${what.downvotes}" %def> <%def name="subreddit()" buffered="True"> ${plain_link(thing.subreddit.name, thing.subreddit_path, sr_path = False, cname = False, _class = "subreddit hover", target='_blank' if thing.newwindow else '')} %def> <%def name="midcol(display=True, cls = '')"> %if thing.pref_compress: