Skip to content

Commit

Permalink
Wiki: Correctly fix getting subreddit name from revision model
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-d authored and spladug committed Sep 12, 2012
1 parent d10ca35 commit a527104
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions r2/r2/models/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ def page(self):

@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):
Expand Down
6 changes: 3 additions & 3 deletions r2/r2/templates/wikirevision.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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

Expand Down

0 comments on commit a527104

Please sign in to comment.