+ return HttpResponseRedirect(reverse("admin_tools", kwargs={'name': 'createuser'}))
+ else:
+ form = CreateUserForm()
+
+ return ('osqaadmin/createuser.html', {
+ 'form': form,
+ })
+
+class NodeManagementPaginatorContext(pagination.PaginatorContext):
+ def __init__(self, id='QUESTIONS_LIST', prefix='', default_pagesize=100):
+ super (NodeManagementPaginatorContext, self).__init__(id, sort_methods=(
+ (_('added_at'), pagination.SimpleSort(_('added_at'), '-added_at', "")),
+ (_('added_at_asc'), pagination.SimpleSort(_('added_at_asc'), 'added_at', "")),
+ (_('author'), pagination.SimpleSort(_('author'), '-author__username', "")),
+ (_('author_asc'), pagination.SimpleSort(_('author_asc'), 'author__username', "")),
+ (_('score'), pagination.SimpleSort(_('score'), '-score', "")),
+ (_('score_asc'), pagination.SimpleSort(_('score_asc'), 'score', "")),
+ (_('act_at'), pagination.SimpleSort(_('act_at'), '-last_activity_at', "")),
+ (_('act_at_asc'), pagination.SimpleSort(_('act_at_asc'), 'last_activity_at', "")),
+ (_('act_by'), pagination.SimpleSort(_('act_by'), '-last_activity_by__username', "")),
+ (_('act_by_asc'), pagination.SimpleSort(_('act_by_asc'), 'last_activity_by__username', "")),
+ ), pagesizes=(default_pagesize,), force_sort='added_at', default_pagesize=default_pagesize, prefix=prefix)
+
+@admin_tools_page(_("nodeman"), _("Bulk management"))
+def node_management(request):
+ if request.POST:
+ params = pagination.generate_uri(request.GET, ('page',))
+
+ if "save_filter" in request.POST:
+ filter_name = request.POST.get('filter_name', _('filter'))
+ params = pagination.generate_uri(request.GET, ('page',))
+ current_filters = settings.NODE_MAN_FILTERS.value
+ current_filters.append((filter_name, params))
+ settings.NODE_MAN_FILTERS.set_value(current_filters)