diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 4ef6bea52..b5557ad2a 100644 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -2095,9 +2095,8 @@ class ApiController(RedditController): FlairTemplateEditor(empty_template).render(style='html')) form.set_html('.status', _('saved')) else: - form.set_html('.flaircell:first', - FlairTemplateEditor(flair_template) - .render(style='html')) + jquery('#%s' % flair_template._id).html( + FlairTemplateEditor(flair_template).render(style='html')) form.set_html('.status', _('saved')) jquery('input[name="text"]').data('saved', text) jquery('input[name="css_class"]').data('saved', css_class) diff --git a/r2/r2/public/static/css/reddit.css b/r2/r2/public/static/css/reddit.css index 67ae12587..db8ccb57d 100644 --- a/r2/r2/public/static/css/reddit.css +++ b/r2/r2/public/static/css/reddit.css @@ -653,6 +653,8 @@ a.author { margin-right: 0.5em; } margin-top: -1px; } +.flair-settings { margin-bottom: 16px; } + .flairlist .flair-jump { margin-bottom: 1em; } @@ -672,28 +674,29 @@ a.author { margin-right: 0.5em; } .flaircell, .flairlist .header { display: inline-block; text-align: center; - width: 28ex; + width: 30ex; margin-right: 4ex; } +.flair-entry { display: inline-block; } + .flaircell.narrow, .flairlist .header.narrow { width: 14ex; } .flairsample-left { text-align: right !important; } .flairsample-right { text-align: left !important; } -.flairrow .tagline { text-align: left; width:36ex; } -.flairlist .header { text-align: center; } +.flairrow .tagline { + display: inline-block; + margin-bottom: 8px; + margin-left: 6px; + text-align: left; + width: 36ex; +} .flairlist .flaircell input[type="text"] { width: 28ex; } .flairrow > form button { display: none; } .flairrow .edited button { display: inline-block; } -.flairdeletebtn { - color: black; - font-weight: bold; - opacity: 0.2; - text-decoration: none; -} - +.flairrow .flairdeletebtn { display: inline; } .flairrow:hover .flairdeletebtn { opacity: 1.0; } .flairselector { diff --git a/r2/r2/public/static/js/flair.js b/r2/r2/public/static/js/flair.js index 975bfe847..1ca08eba0 100644 --- a/r2/r2/public/static/js/flair.js +++ b/r2/r2/public/static/js/flair.js @@ -150,7 +150,7 @@ $(function() { } $(selector) - .html('') + .html('') .addClass("active") .height(18).width(18) .css("padding-left", 4) diff --git a/r2/r2/templates/flairlist.html b/r2/r2/templates/flairlist.html index 942b10745..c78938aea 100644 --- a/r2/r2/templates/flairlist.html +++ b/r2/r2/templates/flairlist.html @@ -22,9 +22,7 @@ <%namespace name="utils" file="utils.html"/> -

users with flair

- -
+
<%utils:line_field title="${_('jump to user (or add):')}" css_class="flair-jump">
<% name = thing.user.name if thing.user else thing.name %> @@ -44,7 +42,7 @@ <% flair = thing.flair %> %if flair:
-   +   ${_('flair text')} ${_('css class')} %for row in flair: diff --git a/r2/r2/templates/flairlistrow.html b/r2/r2/templates/flairlistrow.html index cb416a06a..8cf5c0381 100644 --- a/r2/r2/templates/flairlistrow.html +++ b/r2/r2/templates/flairlistrow.html @@ -27,6 +27,10 @@ from r2.lib.pages import WrappedUser %>
+ + ${unsafe(WrappedUser(thing.user, force_show_flair=True, + include_flair_selector=True).render())} + @@ -39,13 +43,9 @@ from r2.lib.pages import WrappedUser value="${thing.flair_css_class}" /> - X + ${utils.error_field(('BAD_CSS_NAME', 'flair_css_class'), 'name')} ${utils.error_field(('TOO_MUCH_FLAIR_CSS', 'flair_css_class'), 'name')} - - ${unsafe(WrappedUser(thing.user, force_show_flair=True, - include_flair_selector=True).render())} -
diff --git a/r2/r2/templates/flairtemplateeditor.html b/r2/r2/templates/flairtemplateeditor.html index b13543e9b..d38b9d5f6 100644 --- a/r2/r2/templates/flairtemplateeditor.html +++ b/r2/r2/templates/flairtemplateeditor.html @@ -48,7 +48,7 @@ %if thing.id: - X + %endif ${utils.error_field('BAD_CSS_NAME', 'css_class')} diff --git a/r2/r2/templates/flairtemplatelist.html b/r2/r2/templates/flairtemplatelist.html index 468db1e79..0d8e92cbf 100644 --- a/r2/r2/templates/flairtemplatelist.html +++ b/r2/r2/templates/flairtemplatelist.html @@ -29,10 +29,12 @@ %>
-   - ${_('user can edit?')} - ${_('flair text')} - ${_('css class')} +
+   + ${_('user can edit?')} + ${_('flair text')} + ${_('css class')} +
%for flair_template in thing.templates: ${flair_template}