Add link flair to moderation logging.

This commit is contained in:
Logan Hanks
2011-12-30 12:57:24 -08:00
parent 1861d7933e
commit 26db7f7ced
3 changed files with 9 additions and 5 deletions

View File

@@ -2470,10 +2470,12 @@ class ApiController(RedditController):
jquery('#flairrow_%s input[name="css_class"]' % user._id36).data(
'saved', css_class).val(css_class)
elif flair_type == LINK_FLAIR:
# TODO: record mod action
link.flair_text = text
link.flair_css_class = css_class
link._commit()
if ((c.site.is_moderator(c.user) or c.user_is_admin)):
ModAction.create(c.site, c.user, action='editflair',
target=link, details='flair_edit')
@validatedForm(secret_used=VAdminOrAdminSecret("secret"),
award=VByName("fullname"),

View File

@@ -39,7 +39,7 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
'addcontributor': _('add contributor'),
'removecontributor': _('remove contributor'),
'editsettings': _('edit settings'),
'editflair': _('edit user flair'),
'editflair': _('edit flair'),
'distinguish': _('distinguish'),
'marknsfw': _('mark nsfw')}
@@ -54,7 +54,7 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
'addcontributor': _('added approved contributor'),
'removecontributor': _('removed approved contributor'),
'editsettings': _('edited settings'),
'editflair': _('edited user flair'),
'editflair': _('edited flair'),
'distinguish': _('distinguished'),
'marknsfw': _('marked nsfw')}
@@ -90,7 +90,8 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
'flair_delete': _('delete flair'),
'flair_csv': _('edit by csv'),
'flair_enabled': _('toggle flair enabled'),
'flair_position': _('toggle flair position'),
'flair_position': _('toggle user flair position'),
'link_flair_position': _('toggle link flair position'),
'flair_self_enabled': _('toggle user assigned flair enabled'),
'flair_template': _('add/edit flair templates'),
'flair_delete_template': _('delete flair template'),

View File

@@ -40,7 +40,8 @@
<td class="button">${thing.button}</td>
<td class="description">${thing.text}&#32;
%if hasattr(thing, 'target_text'):
${plain_link(thing.target_text, thing.target_path, title=thing.target_title, sr_path=False, cname=False, _class="subreddit hover",
${plain_link(thing.target_text, thing.target_path, title=thing.target_title,
sr_path=False, cname=False, _class="subreddit hover",
target='_blank' if c.user.pref_newwindow else '')}&#32;
%elif hasattr(thing, 'target_wrapped_user'):
${thing.target_wrapped_user}&#32;