mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
updates to RSS feed to link to permalink page instead of goto. Also adds thumbnails and media support. Default user preference is now to show thumbnails on subreddits that show them by default
This commit is contained in:
@@ -59,7 +59,7 @@ class Account(Thing):
|
||||
spammer = 0,
|
||||
sort_options = {},
|
||||
has_subscribed = False,
|
||||
pref_media = 'off',
|
||||
pref_media = 'subreddit',
|
||||
share = {},
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## "The contents of this file are subject to the Common Public Attribution
|
||||
## 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
|
||||
@@ -19,22 +19,32 @@
|
||||
## All portions of the code written by CondeNet are Copyright (c) 2006-2008
|
||||
## CondeNet, Inc. All Rights Reserved.
|
||||
################################################################################
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<%!
|
||||
from pylons.i18n import _
|
||||
from r2.models.subreddit import DefaultSR
|
||||
%>
|
||||
|
||||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:media="http://search.yahoo.com/mrss">
|
||||
<channel>
|
||||
<title>${self.Title()}</title>
|
||||
<link>http://${c.domain}${c.site.path}</link>
|
||||
<description>${c.site.description or ''}</description>
|
||||
<image>
|
||||
<%
|
||||
if g.css_killswitch or not c.site.header:
|
||||
header_img = DefaultSR.header
|
||||
else:
|
||||
header_img = c.site.header
|
||||
%>
|
||||
<url>${header_img}</url>
|
||||
<title>${self.Title()}</title>
|
||||
<link>http://${c.domain}${c.site.path}</link>
|
||||
</image>
|
||||
${next.body()}
|
||||
</channel>
|
||||
</rss>
|
||||
|
||||
<%def name="Title()">
|
||||
${c.site.name}: ${_("what's new online")}
|
||||
${c.site.name}: ${_("what's new online")}
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -23,16 +23,40 @@
|
||||
<%!
|
||||
from pylons.i18n import _, ungettext
|
||||
from r2.lib.template_helpers import add_sr
|
||||
from r2.models import FakeSubreddit
|
||||
%>
|
||||
|
||||
<%
|
||||
com_label = ungettext("comment", "comments", thing.num_comments)
|
||||
url = "http://%s%s" % (request.host, add_sr(thing.permalink, nocname=True))
|
||||
sr_path = "http://%s%s" % (request.host, thing.subreddit.path)
|
||||
%>
|
||||
<item>
|
||||
<title>${thing.title}</title>
|
||||
<link>http://${request.host}/goto?rss=true&id=${thing._fullname}</link>
|
||||
<guid>http://${request.host}/goto?rss=true&id=${thing._fullname}</guid>
|
||||
<link>${url}</link>
|
||||
<guid isPermaLink="true">${url}</guid>
|
||||
<pubDate>${thing._date.isoformat()}</pubDate>
|
||||
<dc:date>${thing._date.isoformat()}</dc:date>
|
||||
<description>
|
||||
%if thing.thumbnail:
|
||||
<table>
|
||||
<tr><td>
|
||||
<a href="${url}"><img src="${thing.thumbnail}" alt="${thing.title}" title="${thing.title}" /></a>
|
||||
</td><td>
|
||||
%endif
|
||||
submitted by <a href="http://${request.host}/user/${thing.author.name}">${thing.author.name}</a>
|
||||
%if isinstance(c.site, FakeSubreddit):
|
||||
to <a href="${sr_path}">${thing.subreddit.name}</a>
|
||||
%endif
|
||||
<br/>
|
||||
<a href="${thing.url}">[link]</a>
|
||||
<a href="http://${request.host}${add_sr(thing.permalink, nocname=True)}">[comments]</a>
|
||||
<a href="${url}">[${thing.num_comments} ${com_label}]</a>
|
||||
%if thing.thumbnail:
|
||||
</td></tr></table>
|
||||
%endif
|
||||
</description>
|
||||
%if thing.thumbnail:
|
||||
<media:title>${thing.title}</media:title>
|
||||
<media:thumbnail url="${thing.thumbnail}" />
|
||||
%endif
|
||||
</item>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user