# -*- coding: utf-8 -*-

"""kodo URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/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. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework import routers

from account import views as account_views
from group import grouppage_views
from group import views as group_views
from miniapp import views as mini_views
from photo import views as photo_views
from website import views as website_views


# router = routers.DefaultRouter()
# # router.register(r'users', account_views.UserViewSet)
# # router.register(r'groups', account_views.GroupViewSet)
#
# router.register(r'lensmans', account_views.LensmanInfoViewSet)
# router.register(r'users', account_views.UserInfoViewSet)
#
# router.register(r'groups', group_views.GroupInfoViewSet)
# router.register(r'group_users', group_views.GroupUserInfoViewSet)
# router.register(r'group_photos', group_views.GroupPhotoInfoViewSet)
#
# router.register(r'photos', photo_views.PhotoInfoViewSet)

urlpatterns = [
    url(r'^kodoadmin/', admin.site.urls),
]

# urlpatterns += [
#     # url(r'^api/', include('api.urls', namespace='api')),
#     url(r'^s/(?P<session_id>\w+)$', photo_views.session_detail, name='session_detail'),  # Session 详情
#     url(r'^p/(?P<photo_id>\w+)$', photo_views.photo_standard, name='photo_standard'),  # standard thumbnail, available for free
#     url(r'^m/(?P<photo_id>\w+)$', photo_views.photo_medium, name='photo_medium'),  # medium/mobile version, without watermark, login or paid by others
#     url(r'^l/(?P<photo_id>\w+)$', photo_views.photo_large, name='photo_large'),  # large, might support server side panning later, login required
#     url(r'^r/(?P<photo_id>\w+)$', photo_views.photo_raw, name='photo_raw'),  # raw image, only for finishers
# ]
#
# urlpatterns += [
#     url(r'^g/(?P<group_id>\w+)$', grouppage_views.group_detail, name='group_detail'),  # 群组详情(拍爱用户端下载页)
# ]
#
# urlpatterns += [
#     url(r'^gp/(?P<photo_id>\w+)$', grouppage_views.group_photo_detail, name='group_photo_detail'),  # 群组照片详情
# ]
#
# urlpatterns += [
#     url(r'^tg/(?P<admin_id>\w+)$', grouppage_views.tgu_group_detail, name='tgu_group_detail'),  # 旅行团详情(拍爱导游端下载页)
# ]
#
# urlpatterns += [
#     url(r'^tgu/(?P<admin_id>\w+)$', grouppage_views.tgu_group_user_detail, name='tgu_group_user_detail'),  # 旅行团成员详情(拍爱用户端下载页)
# ]
#
# urlpatterns += [
#     url(r'^$', website_views.kodo_home, name='kodo_home'),  # 官网首页
# ]

# Mini App
urlpatterns += [
    url(r'^mini/userinfo$', mini_views.get_userinfo_api, name='get_userinfo_api2'),  # 获取用户信息
]

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns += [
    # url(r'^restapi/', include(router.urls)),
    url(r'^api/', include('api.urls', namespace='api')),
    url(r'^uniapi/', include('django_uniapi.urls', namespace='uniapi')),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
]

urlpatterns += [
    url(r'^w/', include('django_we.urls', namespace='shortwechat')),
    url(r'^we/', include('django_we.urls', namespace='wechat')),
]

urlpatterns += [
    url(r'^p/', include('page.urls', namespace='shortpage')),
    url(r'^page/', include('page.urls', namespace='page')),
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

admin.site.site_header = u'［盈多］{}后台管理系统'.format(settings.KODO_BRAND_NAME)
