Mod log: add support for sticky/unsticky

This commit is contained in:
Chad Birch
2013-08-21 15:43:40 -06:00
parent ac83d83cbf
commit 3dab78c514
5 changed files with 21 additions and 4 deletions

View File

@@ -1163,8 +1163,10 @@ class ApiController(RedditController, OAuth2ResourceController):
if state:
sr.sticky_fullname = thing._fullname
ModAction.create(sr, c.user, 'sticky', target=thing)
elif not state:
sr.sticky_fullname = None
ModAction.create(sr, c.user, 'unsticky', target=thing)
sr._commit()
jquery.refresh()

View File

@@ -57,7 +57,8 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
'editsettings', 'editflair', 'distinguish', 'marknsfw',
'wikibanned', 'wikicontributor', 'wikiunbanned',
'removewikicontributor', 'wikirevise', 'wikipermlevel',
'ignorereports', 'unignorereports', 'setpermissions')
'ignorereports', 'unignorereports', 'setpermissions', 'sticky',
'unsticky')
_menu = {'banuser': _('ban user'),
'unbanuser': _('unban user'),
@@ -84,7 +85,10 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
'wikipermlevel': _('wiki page permissions'),
'ignorereports': _('ignore reports'),
'unignorereports': _('unignore reports'),
'setpermissions': _('permissions')}
'setpermissions': _('permissions'),
'sticky': _('sticky post'),
'unsticky': _('unsticky post'),
}
_text = {'banuser': _('banned'),
'wikibanned': _('wiki banned'),
@@ -111,7 +115,10 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
'marknsfw': _('marked nsfw'),
'ignorereports': _('ignored reports'),
'unignorereports': _('unignored reports'),
'setpermissions': _('changed permissions on')}
'setpermissions': _('changed permissions on'),
'sticky': _('stickied'),
'unsticky': _('unstickied'),
}
_details_text = {# approve comment/link
'unspam': _('unspam'),

View File

@@ -6345,7 +6345,9 @@ body:not(.gold) .allminus-link {
.modactions.wikicontributor,
.modactions.removewikicontributor,
.modactions.ignorereports,
.modactions.unignorereports {
.modactions.unignorereports,
.modactions.sticky,
.modactions.unsticky {
height: 16px;
width: 16px;
display: block;
@@ -6422,6 +6424,12 @@ body:not(.gold) .allminus-link {
.modactions.unignorereports {
background-image: url(../modactions_unmute.png); /* SPRITE */
}
.modactions.sticky {
background-image: url(../modactions_sticky.png); /* SPRITE */
}
.modactions.unsticky {
background-image: url(../modactions_unsticky.png); /* SPRITE */
}
.adminpasswordform {
display: block;

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B