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:
Max Goodman
2013-09-20 16:48:11 -07:00
parent 7586026860
commit 7c9d9742d5
2 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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: