Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Factor out NSFW stamp to utils.html.
Browse files Browse the repository at this point in the history
  • Loading branch information
spladug committed Sep 25, 2014
1 parent 2d7ee12 commit 9dede4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions r2/r2/templates/link.html
Expand Up @@ -31,7 +31,7 @@
%>

<%inherit file="printable.html"/>
<%namespace file="utils.html" import="plain_link, thing_timestamp, edited" />
<%namespace file="utils.html" import="plain_link, thing_timestamp, edited, nsfw_stamp" />
<%namespace file="printablebuttons.html" import="toggle_button" />

<%def name="numcol()">
Expand Down Expand Up @@ -67,9 +67,7 @@
<ul class="flat-list buttons">
%if thing.nsfw:
<li class="rounded nsfw-stamp stamp">
<acronym title="${_('Adult content: Not Safe For Work')}">
${_("NSFW")}
</acronym>
${nsfw_stamp()}
</li>
%endif
${self.buttons()}
Expand Down
6 changes: 6 additions & 0 deletions r2/r2/templates/utils.html
Expand Up @@ -564,3 +564,9 @@
<%def name="_mdf(text, wrap=False, **kwargs)">
${md(_(text) % kwargs, wrap=wrap)}
</%def>

<%def name="nsfw_stamp()">
<acronym title="${_('Adult content: Not Safe For Work')}">
${_("NSFW")}
</acronym>
</%def>

0 comments on commit 9dede4f

Please sign in to comment.