from django.utils.translation import ugettext as _
from django.utils import simplejson
from django.db.models import Sum
-
from forum.settings.base import Setting
from forum.settings.forms import SettingsSetForm, MaintenanceModeForm
'settings_pack': unicode(settings.SETTINGS_PACK),
'statistics': get_statistics(),
'recent_activity': get_recent_activity(),
+ 'flagged_posts': get_flagged_posts(),
})
@super_user_required
def get_recent_activity():
return Action.objects.order_by('-action_date')[0:30]
+def get_flagged_posts():
+ return Action.objects.filter(action_type="flag").order_by('-action_date')[0:30]
+
def get_statistics():
return {
'total_users': User.objects.all().count(),
return ('osqaadmin/maintenance.html', {'form': form, 'in_maintenance': settings.MAINTAINANCE_MODE.value is not None})
+@admin_page
+def flagged_posts(request):
+ return ('osqaadmin/flagged_posts.html', {
+ 'flagged_posts': get_flagged_posts(),
+ })
+
+