from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
-from django.forms.widgets import Textarea
+from django.forms.widgets import Textarea, RadioSelect
MODERATION_SET = SettingSet('moderation', _('Moderation settings'), _("Define the moderation workflow of your site"), 100)
label = _("Close Reasons"),
help_text = _("Create some close reasons to use in the close question popup."),
widget=StringListWidget))
+
+
+# Flag control position
+REPORT_OFFENSIVE_CONTROL_POSITION_CHOICES = (
+ ('more', _('Position it in the "More" menu')),
+ ('controls', _('Position it in main controls')),
+)
+
+REPORT_OFFENSIVE_CONTROL_POSITION = Setting('REPORT_OFFENSIVE_CONTROL_POSITION', 'more', MODERATION_SET, dict(
+label = _("Position of report control"),
+help_text = _("Choose the position of the \"report (0)\" control of nodes."),
+widget=RadioSelect,
+choices=REPORT_OFFENSIVE_CONTROL_POSITION_CHOICES,
+required=False))
if user.can_view_offensive_flags(post):\r
label = "%s (%d)" % (label, post.flag_count)\r
\r
- controls.append(post_control(label, reverse('flag_post', kwargs={'id': post.id}),\r
- command=True, withprompt=True, title=_("report as offensive (i.e containing spam, advertising, malicious text, etc.)")))\r
+\r
+ report_control = post_control(label, reverse('flag_post', kwargs={'id': post.id}),\r
+ command=True, withprompt=True,\r
+ title=_("report as offensive (i.e containing spam, advertising, malicious text, etc.)"))\r
+\r
+ # Depending on the setting choose where to attach the control\r
+ if settings.REPORT_OFFENSIVE_CONTROL_POSITION.value == "more":\r
+ menu.append(report_control)\r
+ else:\r
+ controls.append(report_control)\r
\r
if user.can_delete_post(post):\r
if post.nis.deleted:\r