diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 5fdbd4ddc..fa6390e31 100644 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -2486,10 +2486,10 @@ class ApiController(RedditController): # Push some client-side updates back to the browser. # TODO: move this to a template - flair = '%s' % ( - ' '.join('flair-' + c for c in css_class.split()), text) + flair = '%s' % ( + ' '.join('linkflair-' + c for c in css_class.split()), text) - jquery('.id-%s .entry .flair' % link._fullname).remove() + jquery('.id-%s .entry .linkflair' % link._fullname).remove() title_path = '.id-%s .entry > .title > .title' % link._fullname if c.site.link_flair_position == 'left': jquery(title_path).before(flair) diff --git a/r2/r2/public/static/css/reddit.css b/r2/r2/public/static/css/reddit.css index c9cf18734..c5a9d5049 100644 --- a/r2/r2/public/static/css/reddit.css +++ b/r2/r2/public/static/css/reddit.css @@ -664,7 +664,7 @@ ul.flat-vert {text-align: left;} a.author { margin-right: 0.5em; } -.flair { +.flair, .linkflair { display: inline-block; margin-right: .5em; padding: 0 2px; @@ -680,11 +680,10 @@ a.author { margin-right: 0.5em; } font-size: xx-small; } -.title .flair { - font-size: x-small; -} +.linkflair { font-size: x-small; } -.link .tagline .flair { +.link .flair { + font-size: x-small; margin-top: -1px; } diff --git a/r2/r2/templates/flairtemplatesample.html b/r2/r2/templates/flairtemplatesample.html index aaaba08c7..c253127ac 100644 --- a/r2/r2/templates/flairtemplatesample.html +++ b/r2/r2/templates/flairtemplatesample.html @@ -30,7 +30,7 @@ from r2.models import USER_FLAIR, LINK_FLAIR %if thing.flair_template.text or thing.flair_template.css_class: ## TODO: clean this up + "linkflair ${' '.join('linkflair-' + c for c in thing.flair_template.css_class.split())}"> ${thing.flair_template.text} %endif diff --git a/r2/r2/templates/link.html b/r2/r2/templates/link.html index 71f139af1..b9433ffd9 100644 --- a/r2/r2/templates/link.html +++ b/r2/r2/templates/link.html @@ -81,8 +81,7 @@ <%def name="flair()"> %if thing.flair_text or thing.flair_css_class: ## TODO: clean this up - + ${thing.flair_text} %endif diff --git a/r2/r2/templates/link.htmllite b/r2/r2/templates/link.htmllite index 258f76bcc..b45ccb19e 100644 --- a/r2/r2/templates/link.htmllite +++ b/r2/r2/templates/link.htmllite @@ -43,6 +43,9 @@ ${optionalstyle("margin-left: 28px; min-height:32px;")} %endif > + %if c.site.link_flair_position == 'left' and thing.flair_text: + ${thing.flair_text} + %endif ${thing.title} + %if c.site.link_flair_position == 'right' and thing.flair_text: + ${thing.flair_text} + %endif %if not expanded:
%endif