# Path: pyas2/views.py
# def server_error(request, template_name='500.html'):
# def client_error(request, template_name='400.html'):
# def home(request, *kw, **kwargs):
#     def get_queryset(self):
#     def get_context_data(self, **kwargs):
#     def get(self, request, *args, **kwargs):
#     def post(self, request, *args, **kwargs):
#     def get(self, request, pk, *args, **kwargs):
#     def get_queryset(self):
#     def get(self, request, *args, **kwargs):
#     def post(self, request, *args, **kwargs):
#     def get(self, request, pk, *args, **kwargs):
#     def get(self, request, *args, **kwargs):
#     def post(self, request, *args, **kwargs):
# def resend_message(request, pk, *args, **kwargs):
# def send_async_mdn(request, *args, **kwargs):
# def retry_failed_comms(request, *args, **kwargs):
# def cancel_retries(request, pk, *args, **kwargs):
# def send_test_mail_managers(request, *args, **kwargs):
# def download_cert(request, pk, *args, **kwargs):
# def as2receive(request, *args, **kwargs):
# class MessageList(ListView):
# class MessageDetail(DetailView):
# class MessageSearch(View):
# class PayloadView(View):
# class MDNList(ListView):
# class MDNSearch(View):
# class MDNView(View):
# class SendMessage(View):


from django.conf.urls import url
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth import views as auth_views
from pyas2 import views

staff_required = user_passes_test(lambda u: u.is_staff)
superuser_required = user_passes_test(lambda u: u.is_superuser)

urlpatterns = [
    url(r'^login.*', auth_views.login, {'template_name': 'admin/login.html'}, name='login'),
    url(r'^logout.*', auth_views.logout, {'next_page': 'home'}, name='logout'),
    url(r'^password_change/$', auth_views.password_change, name='password_change'),
    url(r'^password_change/done/$', auth_views.password_change_done, name='password_change_done'),
    url(r'^home.*', login_required(views.home, login_url='login'), name='home'),
    url(r'^msearch/$', login_required(views.MessageSearch.as_view(), login_url='login'), name='msearch'),
    url(r'^message/$', login_required(views.MessageList.as_view(), login_url='login'), name='messages'),
    url(r'^message/(?P<pk>.+)/$', login_required(views.MessageDetail.as_view(), login_url='login'),
        name='message_detail'),
    url(r'^payload/(?P<pk>.+)/$', login_required(views.PayloadView.as_view(), login_url='login'), name='payload_view'),
    url(r'^mdnsearch/$', login_required(views.MDNSearch.as_view(), login_url='login'), name='mdnsearch'),
    url(r'^mdn/$', login_required(views.MDNList.as_view(), login_url='login'), name='mdns'),
    url(r'^mdn/(?P<pk>.+)/$', login_required(views.MDNView.as_view(), login_url='login'), name='mdn_view'),
    url(r'^sendmessage/$', login_required(views.SendMessage.as_view(), login_url='login'), name='sendmessage'),

# Path: pyas2/views.py
# def server_error(request, template_name='500.html'):
# def client_error(request, template_name='400.html'):
# def home(request, *kw, **kwargs):
#     def get_queryset(self):
#     def get_context_data(self, **kwargs):
#     def get(self, request, *args, **kwargs):
#     def post(self, request, *args, **kwargs):
#     def get(self, request, pk, *args, **kwargs):
#     def get_queryset(self):
#     def get(self, request, *args, **kwargs):
#     def post(self, request, *args, **kwargs):
#     def get(self, request, pk, *args, **kwargs):
#     def get(self, request, *args, **kwargs):
#     def post(self, request, *args, **kwargs):
# def resend_message(request, pk, *args, **kwargs):
# def send_async_mdn(request, *args, **kwargs):
# def retry_failed_comms(request, *args, **kwargs):
# def cancel_retries(request, pk, *args, **kwargs):
# def send_test_mail_managers(request, *args, **kwargs):
# def download_cert(request, pk, *args, **kwargs):
# def as2receive(request, *args, **kwargs):
# class MessageList(ListView):
# class MessageDetail(DetailView):
# class MessageSearch(View):
# class PayloadView(View):
# class MDNList(ListView):
# class MDNSearch(View):
# class MDNView(View):
# class SendMessage(View):


# Path: pyas2/urls.py
from django.conf.urls import url
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth import views as auth_views
from pyas2 import views


staff_required = user_passes_test(lambda u: u.is_staff)
superuser_required = user_passes_test(lambda u: u.is_superuser)

urlpatterns = [
    url(r'^login.*', auth_views.login, {'template_name': 'admin/login.html'}, name='login'),
    url(r'^logout.*', auth_views.logout, {'next_page': 'home'}, name='logout'),
    url(r'^password_change/$', auth_views.password_change, name='password_change'),
    url(r'^password_change/done/$', auth_views.password_change_done, name='password_change_done'),
    url(r'^home.*', login_required(views.home, login_url='login'), name='home'),
    url(r'^msearch/$', login_required(views.MessageSearch.as_view(), login_url='login'), name='msearch'),
    url(r'^message/$', login_required(views.MessageList.as_view(), login_url='login'), name='messages'),
    url(r'^message/(?P<pk>.+)/$', login_required(views.MessageDetail.as_view(), login_url='login'),
        name='message_detail'),
    url(r'^payload/(?P<pk>.+)/$', login_required(views.PayloadView.as_view(), login_url='login'), name='payload_view'),
    url(r'^mdnsearch/$', login_required(views.MDNSearch.as_view(), login_url='login'), name='mdnsearch'),
    url(r'^mdn/$', login_required(views.MDNList.as_view(), login_url='login'), name='mdns'),
    url(r'^mdn/(?P<pk>.+)/$', login_required(views.MDNView.as_view(), login_url='login'), name='mdn_view'),
    url(r'^sendmessage/$', login_required(views.SendMessage.as_view(), login_url='login'), name='sendmessage'),

    url(r'^resendmessage/(?P<pk>.+)/$', login_required(views.resend_message, login_url='login'), name='resendmessage'),