diff --git a/r2/r2/public/static/css/reddit.css b/r2/r2/public/static/css/reddit.css index 3f88e803c..c8d0ebcae 100644 --- a/r2/r2/public/static/css/reddit.css +++ b/r2/r2/public/static/css/reddit.css @@ -668,7 +668,7 @@ ul.flat-vert {text-align: left;} a.author { margin-right: 0.5em; } -.flair, .linkflair { +.flair, .linkflairlabel { display: inline-block; margin-right: .5em; padding: 0 2px; @@ -684,7 +684,7 @@ a.author { margin-right: 0.5em; } font-size: xx-small; } -.linkflair { +.linkflairlabel { font-size: x-small; max-width: 10em; overflow: hidden; diff --git a/r2/r2/templates/flairselectorlinksample.html b/r2/r2/templates/flairselectorlinksample.html index 978a551e1..451cb99c3 100644 --- a/r2/r2/templates/flairselectorlinksample.html +++ b/r2/r2/templates/flairselectorlinksample.html @@ -21,11 +21,10 @@ ################################################################################ <%def name="flair()"> - - ${thing.flair_text} - + ${thing.flair_text} +
%if thing.flair_position == 'left': ${flair()} %endif @@ -34,7 +33,8 @@ if len(title) > 10: title = title[:7] + '...' %> -${title} + ${title} %if thing.flair_position == 'right': ${flair()} %endif +
diff --git a/r2/r2/templates/flairtemplatesample.html b/r2/r2/templates/flairtemplatesample.html index a935a9aa8..bab17a3b9 100644 --- a/r2/r2/templates/flairtemplatesample.html +++ b/r2/r2/templates/flairtemplatesample.html @@ -28,11 +28,7 @@ from r2.models import USER_FLAIR, LINK_FLAIR <%def name="flair()"> %if thing.flair_template.text or thing.flair_template.css_class: - ## TODO: clean this up - - ${thing.flair_template.text} - + ${thing.flair_template.text} %endif @@ -40,7 +36,7 @@ from r2.models import USER_FLAIR, LINK_FLAIR %if thing.flair_type == USER_FLAIR: ${thing.wrapped_user} %elif thing.flair_type == LINK_FLAIR: -
+

%if c.site.link_flair_position != 'right': <%call expr="flair()" /> diff --git a/r2/r2/templates/link.html b/r2/r2/templates/link.html index f7e323482..0c23e9c20 100644 --- a/r2/r2/templates/link.html +++ b/r2/r2/templates/link.html @@ -79,12 +79,8 @@ <%def name="flair()"> - <% css = thing.flair_css_class or '' %> - %if c.user.pref_show_link_flair and (thing.flair_text or css): - ## TODO: clean this up - - ${thing.flair_text} - + %if c.user.pref_show_link_flair and thing.flair_text: + ${thing.flair_text} %endif @@ -170,6 +166,10 @@ <%def name="thing_css_class(what)" buffered="True"> ${parent.thing_css_class(what)} ${"over18" if thing.over_18 else ""} +%if c.user.pref_show_link_flair and (thing.flair_text or thing.flair_css_class): + <% css = thing.flair_css_class or '' %> + linkflair ${' '.join('linkflair-' + c for c in css.split())} +%endif <%def name="thing_data_attributes(what)" buffered="True">