This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
/
link.xml
86 lines (84 loc) · 3.07 KB
/
link.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
## 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-2015
## reddit Inc. All Rights Reserved.
###############################################################################
<%!
from pylons.i18n import _, ungettext
from r2.lib.template_helpers import add_sr, get_domain
from r2.models import FakeSubreddit
from r2.lib.filters import unsafe, safemarkdown
%>
<%
permalink = add_sr(thing.permalink, force_hostname = True)
use_thumbs = thing.has_thumbnail and thing.thumbnail and not request.GET.has_key("nothumbs")
use_thumbs = use_thumbs and not thing.thumbnail_sprited
%>
<item>
<title>${thing.title}</title>
%if thing.different_sr:
<category>${thing.subreddit.name}</category>
%endif
<link>${permalink}</link>
<guid isPermaLink="true">${permalink}</guid>
<pubDate>${thing._date.strftime('%a, %d %b %Y %H:%M:%S %z')}</pubDate>
<description>
<%def name="description()" filter="h">
%if use_thumbs:
<table>
<tr><td>
<a href="${permalink}"><img src="${thing.thumbnail}" alt="${thing.title}" title="${thing.title}" /></a>
</td><td>
%endif
<%
domain = get_domain(cname = c.cname, subreddit = False)
%>
%if getattr(thing, 'selftext', None):
%if not thing.expunged:
${unsafe(safemarkdown(thing.selftext))}
%else:
${_('[removed]')}
%endif
%endif
submitted by
%if not thing.author._deleted:
<a href="${g.default_scheme}://${domain}/user/${thing.author.name}">
${thing.author.name}
</a>
%else:
${_("[deleted]")}
%endif
%if thing.different_sr:
to <a href="${g.default_scheme}://${domain}${thing.subreddit.path}">
${thing.subreddit.name}</a>
%endif
<br/>
<a href="${thing.url}">[link]</a>
</%def>
${description()}
<a href="${permalink}">[${thing.comment_label}]</a>
%if use_thumbs:
</td></tr></table>
%endif
</description>
%if use_thumbs:
<media:title>${thing.title}</media:title>
<media:thumbnail url="${thing.thumbnail}" />
%endif
</item>