"""sikweb URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Import the include() function: from django.conf.urls import url, include
    3. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import url
from django.contrib import admin
# main
from webapp.views import main_index
# login
from webapp.views import login_view
from webapp.views import logout_view
# members
from members.views import index as mindex
from members.views import members as mems
from members.views import member as mem
from members.views import handle_mem_request
from members.views import csv_import as mem_csv_import
from members.views import new_member_request
from members.views import member_requests
from members.views import export_csv as mem_csv_export
#infoscreen
from infoscreen.views import index as infoindex
from infoscreen.views import default as infodefault
from infoscreen.views import rotation
from infoscreen.views import rotations
from infoscreen.views import infoItems
from infoscreen.views import infoTypes
from infoscreen.views import deleteInfoItem
from infoscreen.views import createInstance as createInfoInstance
from infoscreen.views import deleteInstance as deleteInfoInstance
from infoscreen.views import createExternalImageInfoItem
from infoscreen.views import createImageItem
from infoscreen.views import createABBItem
from infoscreen.views import createSossoItem
from infoscreen.views import admin as infoscreen_admin
#application
from members.views import applicationindex
from members.views import applicationSuccessIndex

urlpatterns = [
    # main
    url(r'^$', main_index),
    # admin
    url(r'^admin/', admin.site.urls),
    # login stuff
    url(r'^login$', login_view),
    url(r'^logout$', logout_view),
    # members
    url(r'^members/$', mindex),
    url(r'^members/api/members$', mems),
    url(r'^members/api/member/(?P<idx>\d+)$', mem),
    url(r'^members/api/member/$', mem),
    url(r'^members/api/csvimport$', mem_csv_import),
    url(r'^members/api/requests$', member_requests),
    url(r'^members/api/request$', new_member_request),
    url(r'^members/api/request/(?P<idx>\d+)$', handle_mem_request),
    url(r'^members/api/getCSV$', mem_csv_export),
    #infoscreen
    url(r'^infoscreen/$', infodefault),
    url(r'^infoscreen/(?P<idx>\d+)$', infoindex),
    url(r'^infoscreen/items$', infoItems),
    url(r'^infoscreen/rotation/(?P<idx>\d+)$', rotation),
    url(r'^infoscreen/rotations$', rotations),
    url(r'^infoscreen/instance$', createInfoInstance),
    url(r'^infoscreen/instance/(?P<idx>\d+)$', deleteInfoInstance),
    url(r'^infoscreen/types$', infoTypes),
    url(r'^infoscreen/delete_item/(?P<type_id>\d+)/(?P<idx>\d+)$', deleteInfoItem),
    url(r'^infoscreen/create_external_image$', createExternalImageInfoItem),
    url(r'^infoscreen/create_image$', createImageItem),
    url(r'^infoscreen/create_abbitem$', createABBItem),
    url(r'^infoscreen/create_sossoitem$', createSossoItem),
    url(r'^infoscreen/admin$', infoscreen_admin),
    #application
    url(r'^application/$', applicationindex),
    url(r'^application/success$', applicationSuccessIndex),
]
