from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.template import RequestContext
from django.utils.translation import ugettext as _
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.template import RequestContext
from django.utils.translation import ugettext as _
from forum.http_responses import HttpResponseUnauthorized
from forum.settings.base import Setting
from forum.forms import MaintenanceModeForm, PageForm, CreateUserForm
from forum.http_responses import HttpResponseUnauthorized
from forum.settings.base import Setting
from forum.forms import MaintenanceModeForm, PageForm, CreateUserForm
unsaved = request.session.get('previewing_settings', {})
context['unsaved'] = set([getattr(settings, s).set.name for s in unsaved.keys() if hasattr(settings, s)])
unsaved = request.session.get('previewing_settings', {})
context['unsaved'] = set([getattr(settings, s).set.name for s in unsaved.keys() if hasattr(settings, s)])
(time.mktime(d.timetuple()) * 1000, i + last_month_n_questions)
for i, d in enumerate(last_month_questions)
])
(time.mktime(d.timetuple()) * 1000, i + last_month_n_questions)
for i, d in enumerate(last_month_questions)
])
(time.mktime(d.timetuple()) * 1000, i + last_month_n_users)
for i, d in enumerate(last_month_users)
])
(time.mktime(d.timetuple()) * 1000, i + last_month_n_users)
for i, d in enumerate(last_month_users)
])
if set_name in ('minrep', 'badges', 'repgain'):
settings.SETTINGS_PACK.set_value("custom")
if set_name in ('minrep', 'badges', 'repgain'):
settings.SETTINGS_PACK.set_value("custom")
return HttpResponseRedirect(reverse('admin_maintenance'))
elif 'open' in request.POST:
settings.MAINTAINANCE_MODE.set_value(None)
return HttpResponseRedirect(reverse('admin_maintenance'))
elif 'open' in request.POST:
settings.MAINTAINANCE_MODE.set_value(None)
return HttpResponseRedirect(reverse('admin_maintenance'))
else:
form = MaintenanceModeForm(initial={'ips': request.META['REMOTE_ADDR'],
return HttpResponseRedirect(reverse('admin_maintenance'))
else:
form = MaintenanceModeForm(initial={'ips': request.META['REMOTE_ADDR'],
user_.get_profile_url(), _("See %s profile") % user_.username, target="_blank"))
return HttpResponseRedirect(reverse("admin_tools", kwargs={'name': 'createuser'}))
user_.get_profile_url(), _("See %s profile") % user_.username, target="_blank"))
return HttpResponseRedirect(reverse("admin_tools", kwargs={'name': 'createuser'}))