mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
compressed links: Add class non-destructively.
For compressed links mode, augment the render class instead of replacing it. This fixes an issue where compressed promoted links in self serve listings didn't get the "promoted" class.
This commit is contained in:
@@ -394,7 +394,7 @@ class Link(Thing, Printable):
|
||||
item.score_fmt = Score.points
|
||||
item.pref_compress = user.pref_compress
|
||||
if user.pref_compress:
|
||||
item.render_css_class = "compressed link"
|
||||
item.extra_css_class = "compressed"
|
||||
item.score_fmt = Score.points
|
||||
elif pref_media == 'on' and not user.pref_compress:
|
||||
show_media = True
|
||||
|
||||
@@ -106,7 +106,9 @@ ${self.RenderPrintable()}
|
||||
cls = thing.render_class.__name__.lower()
|
||||
else:
|
||||
cls = thing.lookups[0].__class__.__name__.lower()
|
||||
|
||||
|
||||
cls += ' ' + getattr(thing, 'extra_css_class', '')
|
||||
|
||||
if getattr(thing, "is_self", False):
|
||||
selflink = "self"
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user