mirror of https://github.com/scrapy/scrapy.git
Add bool icon for public field in admin
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40113
This commit is contained in:
parent
baee62cf44
commit
9f8ce8f116
|
|
@ -32,8 +32,12 @@ class DownloadLink(models.Model):
|
|||
|
||||
# ugly, but django-admin isn't very versatile right now
|
||||
def public_link(self):
|
||||
return _("%s (<a href='%s/toggle/'>toggle</a>)") % \
|
||||
(self.public and _("Yes") or _("No"), self.id )
|
||||
img_url = "/media/img/admin/icon-%s.gif" % \
|
||||
(self.public and "yes" or "no")
|
||||
html = _('<img alt="%s" src="' + img_url + '"/> ' \
|
||||
'(<a href="%s/toggle/">Toggle</a>)')
|
||||
return html % (_(str(self.public)), self.id)
|
||||
|
||||
public_link.short_description = u"public"
|
||||
public_link.allow_tags = True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue