From 0c04094a0b7a5b860db7f263152d3d6d2d286f04 Mon Sep 17 00:00:00 2001 From: KeyserSosa Date: Thu, 28 Aug 2008 11:21:49 -0700 Subject: [PATCH] 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 --- r2/r2/models/account.py | 2 +- r2/r2/templates/base.xml | 24 +++++++++++++++++------- r2/r2/templates/link.xml | 32 ++++++++++++++++++++++++++++---- 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/r2/r2/models/account.py b/r2/r2/models/account.py index 1ffaabdbb..428d54c51 100644 --- a/r2/r2/models/account.py +++ b/r2/r2/models/account.py @@ -59,7 +59,7 @@ class Account(Thing): spammer = 0, sort_options = {}, has_subscribed = False, - pref_media = 'off', + pref_media = 'subreddit', share = {}, ) diff --git a/r2/r2/templates/base.xml b/r2/r2/templates/base.xml index bdbc5cf79..56d107caf 100644 --- a/r2/r2/templates/base.xml +++ b/r2/r2/templates/base.xml @@ -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. ################################################################################ - - <%! - from pylons.i18n import _ + from r2.models.subreddit import DefaultSR %> - - + + ${self.Title()} http://${c.domain}${c.site.path} ${c.site.description or ''} + + <% + if g.css_killswitch or not c.site.header: + header_img = DefaultSR.header + else: + header_img = c.site.header + %> + ${header_img} + ${self.Title()} + http://${c.domain}${c.site.path} + ${next.body()} <%def name="Title()"> -${c.site.name}: ${_("what's new online")} + ${c.site.name}: ${_("what's new online")} diff --git a/r2/r2/templates/link.xml b/r2/r2/templates/link.xml index 19ad3bdf7..09c00ec64 100644 --- a/r2/r2/templates/link.xml +++ b/r2/r2/templates/link.xml @@ -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) + %> ${thing.title} - http://${request.host}/goto?rss=true&id=${thing._fullname} - http://${request.host}/goto?rss=true&id=${thing._fullname} + ${url} + ${url} + ${thing._date.isoformat()} ${thing._date.isoformat()} + %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 + %if thing.thumbnail: + ${thing.title} + + %endif