diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2014-08-12 03:01:39 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2014-08-12 03:01:39 -0300 |
commit | 77ace68612d0e942ff7865e1e99c702fe2873a60 (patch) | |
tree | b9dca63e7b993f4842564e8314235a29e37a0932 | |
parent | 35a6e9300088ad08293154972d5aa30c87cbeb57 (diff) | |
download | askbot-77ace68612d0e942ff7865e1e99c702fe2873a60.tar.gz askbot-77ace68612d0e942ff7865e1e99c702fe2873a60.tar.bz2 askbot-77ace68612d0e942ff7865e1e99c702fe2873a60.zip |
added management command askbot_clear_moderation_queue
-rw-r--r-- | askbot/doc/source/changelog.rst | 1 | ||||
-rw-r--r-- | askbot/doc/source/management-commands.rst | 2 | ||||
-rw-r--r-- | askbot/management/commands/askbot_clear_moderation_queue.py | 16 | ||||
-rw-r--r-- | askbot/media/style/style.css | 4 | ||||
-rw-r--r-- | askbot/media/style/style.less | 5 | ||||
-rw-r--r-- | askbot/templates/moderation/queue.html | 2 |
6 files changed, 29 insertions, 1 deletions
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst index 177d9018..f160dc95 100644 --- a/askbot/doc/source/changelog.rst +++ b/askbot/doc/source/changelog.rst @@ -3,6 +3,7 @@ Changes in Askbot Development master branch (only on github) ------------------------------------------ +* Added management command `askbot_clear_moderation_queue` * Admins and Moderators can merge questions. * Improved moderation modes: flags, audit, premoderation. Watched user status, IP blocking, mass content removal. diff --git a/askbot/doc/source/management-commands.rst b/askbot/doc/source/management-commands.rst index 1f5c3fa1..e61004ca 100644 --- a/askbot/doc/source/management-commands.rst +++ b/askbot/doc/source/management-commands.rst @@ -43,6 +43,8 @@ The bulk of the management commands fall into this group and will probably be th | | The command does not create associations with | | | any of the external login providers. | +---------------------------------+-------------------------------------------------------------+ +| `askbot_clear_moderation_queue` | Clear all items from the moderation queue | ++---------------------------------+-------------------------------------------------------------+ | `merge_users <from_id> | Merges user accounts and all related data from one user | | <to_id>` | to another, the "from user" account is deleted. | +---------------------------------+-------------------------------------------------------------+ diff --git a/askbot/management/commands/askbot_clear_moderation_queue.py b/askbot/management/commands/askbot_clear_moderation_queue.py new file mode 100644 index 00000000..c767e670 --- /dev/null +++ b/askbot/management/commands/askbot_clear_moderation_queue.py @@ -0,0 +1,16 @@ +from django.core.management.base import NoArgsCommand +from askbot import const +from askbot.models import Activity + +ACTIVITY_TYPES = ( + const.TYPE_ACTIVITY_MODERATED_NEW_POST, + const.TYPE_ACTIVITY_MODERATED_POST_EDIT, + const.TYPE_ACTIVITY_MARK_OFFENSIVE +) + +class Command(NoArgsCommand): + help = 'deletes all items from the moderation queue' + def handle_noargs(self, *args, **kwargs): + acts = Activity.objects.filter(activity_type__in=ACTIVITY_TYPES) + acts.delete() + diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css index 8d46fb20..95b987d1 100644 --- a/askbot/media/style/style.css +++ b/askbot/media/style/style.css @@ -1532,6 +1532,10 @@ ul#related-tags li { .moderate-tags-page h1 { float: left; } +.mod-queue-info { + margin-top: 12px; + margin-bottom: 0; +} .moderate-tags-page button { line-height: 18px; } diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less index 285b33dc..f2a97df6 100644 --- a/askbot/media/style/style.less +++ b/askbot/media/style/style.less @@ -1621,6 +1621,11 @@ ul#related-tags li { } } +.mod-queue-info { + margin-top: 12px; + margin-bottom: 0; +} + .moderate-tags-page { button { line-height: 18px; diff --git a/askbot/templates/moderation/queue.html b/askbot/templates/moderation/queue.html index d97bbd36..fd1e402a 100644 --- a/askbot/templates/moderation/queue.html +++ b/askbot/templates/moderation/queue.html @@ -33,7 +33,7 @@ <a class="btn btn-danger decline-block-users-ips">{% trans %}block spammers and IPs{% endtrans %}</a> {% endif %} </div> - <ul style="margin-top: 12px"> + <ul class="mod-queue-info"> <li>Approval of users removes them from the queue and approves ALL of their posts.</li> <li>Blocking spammers denies them future access and deletes ALL their posts.</li> {% if settings.IP_MODERATION_ENABLED %} |