Prefix all link flair CSS classes with "linkflair" instead of "flair".

This commit is contained in:
Logan Hanks
2012-03-13 15:29:24 -07:00
parent 9e3bfd4adf
commit f87e7c7334
5 changed files with 15 additions and 11 deletions

View File

@@ -2486,10 +2486,10 @@ class ApiController(RedditController):
# Push some client-side updates back to the browser.
# TODO: move this to a template
flair = '<span class="flair %s">%s</span>' % (
' '.join('flair-' + c for c in css_class.split()), text)
flair = '<span class="linkflair %s">%s</span>' % (
' '.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)

View File

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

View File

@@ -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
<span class=
"flair ${' '.join('flair-' + c for c in thing.flair_template.css_class.split())}">
"linkflair ${' '.join('linkflair-' + c for c in thing.flair_template.css_class.split())}">
${thing.flair_template.text}
</span>
%endif

View File

@@ -81,8 +81,7 @@
<%def name="flair()">
%if thing.flair_text or thing.flair_css_class:
## TODO: clean this up
<span class=
"flair ${' '.join('flair-' + c for c in thing.flair_css_class.split())}">
<span class="linkflair ${' '.join('linkflair-' + c for c in thing.flair_css_class.split())}">
${thing.flair_text}
</span>
%endif

View File

@@ -43,6 +43,9 @@
${optionalstyle("margin-left: 28px; min-height:32px;")}
%endif
>
%if c.site.link_flair_position == 'left' and thing.flair_text:
<span class="linkflair">${thing.flair_text}</span>
%endif
<a href="${thing.href_url}" class="reddit-link-title"
${optionalstyle("text-decoration:none;color:#336699;font-size:small;")}
%if thing.nofollow:
@@ -61,6 +64,9 @@
>
${thing.title}
</a>
%if c.site.link_flair_position == 'right' and thing.flair_text:
<span class="linkflair">${thing.flair_text}</span>
%endif
%if not expanded:
<br />
%endif