mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Allow a default url to be set per trophy codename.
This commit is contained in:
@@ -203,3 +203,7 @@ class Trophy(Relation(Account, Award)):
|
||||
user.set_trophy_id(uid, trophy._id)
|
||||
user._commit()
|
||||
return trophy, preexisting
|
||||
|
||||
@property
|
||||
def trophy_url(self):
|
||||
return getattr(self, "url", getattr(self._thing2, "url", None))
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
%endif
|
||||
>
|
||||
<div>
|
||||
%if hasattr(trophy, "url"):
|
||||
<a href="${trophy.url}">
|
||||
<% trophy_url = trophy.trophy_url %>
|
||||
%if trophy_url:
|
||||
<a href="${trophy_url}">
|
||||
%endif
|
||||
<img class="trophy-icon" src="${trophy._thing2.imgurl % 40}" />
|
||||
<br/>
|
||||
@@ -40,7 +41,7 @@
|
||||
<span class="trophy-description">${trophy.description}</span>
|
||||
<br/>
|
||||
%endif
|
||||
%if hasattr(trophy, "url"):
|
||||
%if trophy_url:
|
||||
</a>
|
||||
%endif
|
||||
%if c.user_is_admin:
|
||||
|
||||
Reference in New Issue
Block a user