mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
make the button backwards compatible for deployment
This commit is contained in:
@@ -251,11 +251,11 @@ def style_line(button_width = None, bgcolor = "", bordercolor = ""):
|
||||
style_line += "width: %spx;" % button_width
|
||||
return style_line
|
||||
|
||||
def choose_width(thing, width):
|
||||
def choose_width(link, width):
|
||||
if width:
|
||||
return width - 5
|
||||
else:
|
||||
if thing:
|
||||
return 100 + (10 * (len(str(thing.link.score))))
|
||||
if link:
|
||||
return 100 + (10 * (len(str(link._ups - link._downs))))
|
||||
else:
|
||||
return 110
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</%def>
|
||||
|
||||
<%def name="button1(thing)">
|
||||
${class_def(1, width=choose_width(thing, thing.width))}
|
||||
${class_def(1, width=choose_width(thing.link, thing.width))}
|
||||
<div class="headimgcell">
|
||||
<a href="${submiturl(thing.url, thing.title)}" target="${thing.target}">
|
||||
<img src="http://www.reddit.com/static/blog_head.png" alt=""/>
|
||||
|
||||
Reference in New Issue
Block a user