\r
return " ".join(classes)\r
\r
-def post_control(text, url, command=False, withprompt=False, confirm=False, title="", copy=False):\r
+def post_control(text, url, command=False, withprompt=False, confirm=False, title="", copy=False, extra_classes=[]):\r
classes = (command and "ajax-command" or " ") + (withprompt and " withprompt" or " ") + (confirm and " confirm" or " ") + \\r
(copy and " copy" or " ")\r
+\r
+ for extra_class in extra_classes:\r
+ classes += " %s" % extra_class\r
+\r
return {'text': text, 'url': url, 'classes': classes, 'title': title}\r
\r
\r
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