From 07ca1d31f4831d06f2271b52bcf7f2f852897606 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 20 Jan 2013 19:40:33 -0300 Subject: fixed some bugs in the UI of tags moderation --- askbot/conf/forum_data_rules.py | 14 -------------- askbot/conf/moderation.py | 14 ++++++++++++++ askbot/media/js/tag_moderation.js | 14 ++++++++++---- askbot/media/style/style.less | 6 ++++-- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/askbot/conf/forum_data_rules.py b/askbot/conf/forum_data_rules.py index bd974334..e8a2b539 100644 --- a/askbot/conf/forum_data_rules.py +++ b/askbot/conf/forum_data_rules.py @@ -154,20 +154,6 @@ settings.register( ) ) -settings.register( - livesettings.BooleanValue( - FORUM_DATA_RULES, - 'ENABLE_TAG_MODERATION', - default = False, - description = _('Enable tag moderation'), - help_text = _( - 'If enabled, any new tags will not be applied ' - 'to the questions, but emailed to the moderators. ' - 'To use this feature, tags must be optional.' - ) - ) -) - TAG_SOURCE_CHOICES = ( ('category-tree', _('category tree')), ('user-input', _('user input')), diff --git a/askbot/conf/moderation.py b/askbot/conf/moderation.py index 70cf9119..b537663f 100644 --- a/askbot/conf/moderation.py +++ b/askbot/conf/moderation.py @@ -29,3 +29,17 @@ settings.register( update_callback = empty_cache_callback ) ) + +settings.register( + BooleanValue( + MODERATION, + 'ENABLE_TAG_MODERATION', + default = False, + description = _('Enable tag moderation'), + help_text = _( + 'If enabled, any new tags will not be applied ' + 'to the questions, but emailed to the moderators. ' + 'To use this feature, tags must be optional.' + ) + ) +) diff --git a/askbot/media/js/tag_moderation.js b/askbot/media/js/tag_moderation.js index 31e05e37..009e4e32 100644 --- a/askbot/media/js/tag_moderation.js +++ b/askbot/media/js/tag_moderation.js @@ -86,9 +86,14 @@ PerThreadTagModerator.prototype.afterActionHandler = function() { ancestor.hideButtons(); this.dispose(); } else if (childCount == 0) { - var table = $('.suggested-tags-table'); - table.before($('

' + gettext('No suggested tags left') + '

')); - table.remove(); + //this does not work with the fade-out of table rows... + /* var callback = function() { + var table = $('.suggested-tags-table'); + if (table.find('tr.suggested-tag-row').length == 0) { + table.before($('

' + gettext('No suggested tags left') + '

')); + table.remove(); + } + }; */ ancestor.dispose(); } else { this.dispose(); @@ -164,7 +169,7 @@ AllThreadsTagModerator.prototype.afterActionHandler = function() { }; AllThreadsTagModerator.prototype.dispose = function() { - this._tag_entry_element.fadeOut('fast', function() { + var eventChain = this._tag_entry_element.fadeOut('fast', function() { $.each(this._children, function(idx, child) { child.dispose(); }); @@ -200,6 +205,7 @@ AllThreadsTagModerator.prototype.decorate = function(element) { var tagEntry = $(element); var tagId = tagEntry.data('tagId'); + //handles the case where there are >1 threads per tag var tagMod = new AllThreadsTagModerator(); tagMod.decorate(tagEntry.next()); tagMod.setTagId(tagId); diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less index 86b75968..c2e20577 100644 --- a/askbot/media/style/style.less +++ b/askbot/media/style/style.less @@ -1452,17 +1452,19 @@ ul#related-tags li { padding-right: 20px; } td.per-thread-controls { - width: 120px;/* 20px more to compensate for the padding */ + width: 160px;/* 20px more to compensate for the padding */ height: 30px; button { display: none; } } - th.decision-col, th.tags-col, th.users-col { width: 100px; } + th.decision-col { + width: 140px; + } tr.per-tag-controls { height: 30px; text-align: center; -- cgit v1.2.3-1-g7c22