Wiki: Correctly fix getting subreddit name from revision model

This commit is contained in:
Andre D
2012-09-11 21:27:03 -05:00
committed by Neil Williams
parent d10ca35bbe
commit a527104c0a
2 changed files with 4 additions and 7 deletions

View File

@@ -150,10 +150,7 @@ class WikiRevision(tdb_cassandra.UuidThing, Printable):
@property
def sr(self):
id36 = self.info['sr']
if c.site._id36 == id36:
return c.site.name
return Subreddit._byID36(id36).name
return self.info['sr']
class WikiPage(tdb_cassandra.Thing):

View File

@@ -42,12 +42,12 @@
%if not c.page:
<td>
<a href="/r/${thing.sr}/wiki/${thing.page}">${thing.page}</a>
<a href="${c.wiki_base_url}/${thing.page}">${thing.page}</a>
</td>
%endif
<td>
<a href="/r/${thing.sr}/wiki/${thing.page}?v=${thing._id}">view</a>
<a href="${c.wiki_base_url}/${thing.page}?v=${thing._id}">view</a>
</td>
<td>
@@ -63,7 +63,7 @@
<a href="#" class="revision_hide" data-revision="${thing._id}" data-page="${thing.page}">hide</a>
</td>
<td class="wiki_revert" style="white-space: nowrap;">
${ynbutton(_("revert here"), _("done"), "../r/%s/wiki/api/revert/%s/%s" % (thing.sr, thing._id, thing.page), post_callback="$.refresh")}
${ynbutton(_("revert here"), _("done"), "..%s/api/revert/%s/%s" % (c.wiki_base_url, thing._id, thing.page), post_callback="$.refresh")}
</td>
%endif