# Path: dplace_app/views.py
# def view_language(request, glottocode):
# def download_file(request):
# def angular(request):
# 
# Path: dplace_app/api_views.py
# class VariableViewSet(viewsets.ReadOnlyModelViewSet):
# class CategoryViewSet(viewsets.ReadOnlyModelViewSet):
# class CodeDescriptionViewSet(viewsets.ReadOnlyModelViewSet):
# class ValueViewSet(viewsets.ReadOnlyModelViewSet):
# class SocietyViewSet(viewsets.ReadOnlyModelViewSet):
# class LargeResultsSetPagination(PageNumberPagination):
# class VeryLargeResultsSetPagination(PageNumberPagination):
# class LanguageViewSet(viewsets.ReadOnlyModelViewSet):
# class LanguageFamilyViewSet(viewsets.ReadOnlyModelViewSet):
# class TreeResultsSetPagination(PageNumberPagination):
# class LanguageTreeViewSet(viewsets.ReadOnlyModelViewSet):
# class LanguageTreeLabelsViewSet(viewsets.ReadOnlyModelViewSet):
# class SourceViewSet(viewsets.ReadOnlyModelViewSet):
# class GeographicRegionViewSet(viewsets.ReadOnlyModelViewSet):
#     def retrieve(self, request, *args, **kwargs):
#     def retrieve(self, request, *args, **kwargs):
#     def detail(self, request, society_id):
# def get_query_from_json(request):
# def result_set_from_query_dict(query_dict):
#     def id_array(l):
# def trees_from_societies(request):
# def find_societies(request):
# def get_categories(request):
# def get_dataset_sources(request):
# def get_min_and_max(request):
# def bin_cont_data(request):  # MAKE THIS GENERIC
# def csv_download(request):


from django.conf.urls import url, include
from django.views.generic.base import RedirectView
from rest_framework import routers
from rest_framework import renderers
from dplace_app import views, api_views
    # Redirect all static icon images (different sizes) crawled by any sites and bots
    url(r'^favicon\.ico/?$', RedirectView.as_view(url='/static/images/icons/favicon.ico')),
    url(r'^apple\-touch\-icon(\-precomposed)?\.png/?$', RedirectView.as_view(url='/static/images/icons/D-PLACE_Favicon_57x57.png')),
    url(r'^touch\-icon\iphone-\.png/?$', RedirectView.as_view(url='/static/images/icons/D-PLACE_Favicon_57x57.png')),
    url(r'^(apple\-)?touch\-icon\-(?P<size>.+?)(\-precomposed)?\.png/?$', RedirectView.as_view(url='/static/images/icons/D-PLACE_Favicon_%(size)s.png')),
    url(r'^browserconfig\.xml/?$', RedirectView.as_view(url='/static/images/icons/browserconfig.xml')),

    # This is needed in order to auto-generate sitemaps links
    # and to pass only valid paths to angular
    url(r'^home/?$', views.angular),
    url(r'^search/?$', views.angular, name='search'),
    url(r'^societies/?$', views.angular, name='societies'),
    url(r'^about/?$', views.angular, name='about'),
    url(r'^howto/?$', views.angular, name='howto'),
    url(r'^howtocite/?$', views.angular, name='howtocite'),
    url(r'^source/?$', views.angular, name='source'),
    url(r'^technology/?$', views.angular, name='technology'),
    url(r'^legal/?$', views.angular, name='legal'),
    url(r'^team/?$', views.angular, name='team'),
    url(r'^publication/?$', views.angular, name='publication'),

    url(r'^society/(?P<society_id>.*)$',
        api_views.SocietyViewSet.as_view(
            {'get': 'detail'},
            renderer_classes=[renderers.TemplateHTMLRenderer]
        ),
        name='view_society'),
    url(r'^language/(?P<glottocode>.*)$',
        views.view_language,
        name='view_language'),

# Path: dplace_app/views.py
# def view_language(request, glottocode):
# def download_file(request):
# def angular(request):
# 
# Path: dplace_app/api_views.py
# class VariableViewSet(viewsets.ReadOnlyModelViewSet):
# class CategoryViewSet(viewsets.ReadOnlyModelViewSet):
# class CodeDescriptionViewSet(viewsets.ReadOnlyModelViewSet):
# class ValueViewSet(viewsets.ReadOnlyModelViewSet):
# class SocietyViewSet(viewsets.ReadOnlyModelViewSet):
# class LargeResultsSetPagination(PageNumberPagination):
# class VeryLargeResultsSetPagination(PageNumberPagination):
# class LanguageViewSet(viewsets.ReadOnlyModelViewSet):
# class LanguageFamilyViewSet(viewsets.ReadOnlyModelViewSet):
# class TreeResultsSetPagination(PageNumberPagination):
# class LanguageTreeViewSet(viewsets.ReadOnlyModelViewSet):
# class LanguageTreeLabelsViewSet(viewsets.ReadOnlyModelViewSet):
# class SourceViewSet(viewsets.ReadOnlyModelViewSet):
# class GeographicRegionViewSet(viewsets.ReadOnlyModelViewSet):
#     def retrieve(self, request, *args, **kwargs):
#     def retrieve(self, request, *args, **kwargs):
#     def detail(self, request, society_id):
# def get_query_from_json(request):
# def result_set_from_query_dict(query_dict):
#     def id_array(l):
# def trees_from_societies(request):
# def find_societies(request):
# def get_categories(request):
# def get_dataset_sources(request):
# def get_min_and_max(request):
# def bin_cont_data(request):  # MAKE THIS GENERIC
# def csv_download(request):


# Path: dplace_app/urls.py
from django.conf.urls import url, include
from django.views.generic.base import RedirectView
from rest_framework import routers
from rest_framework import renderers
from dplace_app import views, api_views

    # Redirect all static icon images (different sizes) crawled by any sites and bots
    url(r'^favicon\.ico/?$', RedirectView.as_view(url='/static/images/icons/favicon.ico')),
    url(r'^apple\-touch\-icon(\-precomposed)?\.png/?$', RedirectView.as_view(url='/static/images/icons/D-PLACE_Favicon_57x57.png')),
    url(r'^touch\-icon\iphone-\.png/?$', RedirectView.as_view(url='/static/images/icons/D-PLACE_Favicon_57x57.png')),
    url(r'^(apple\-)?touch\-icon\-(?P<size>.+?)(\-precomposed)?\.png/?$', RedirectView.as_view(url='/static/images/icons/D-PLACE_Favicon_%(size)s.png')),
    url(r'^browserconfig\.xml/?$', RedirectView.as_view(url='/static/images/icons/browserconfig.xml')),

    # This is needed in order to auto-generate sitemaps links
    # and to pass only valid paths to angular
    url(r'^home/?$', views.angular),
    url(r'^search/?$', views.angular, name='search'),
    url(r'^societies/?$', views.angular, name='societies'),
    url(r'^about/?$', views.angular, name='about'),
    url(r'^howto/?$', views.angular, name='howto'),
    url(r'^howtocite/?$', views.angular, name='howtocite'),
    url(r'^source/?$', views.angular, name='source'),
    url(r'^technology/?$', views.angular, name='technology'),
    url(r'^legal/?$', views.angular, name='legal'),
    url(r'^team/?$', views.angular, name='team'),
    url(r'^publication/?$', views.angular, name='publication'),

    url(r'^society/(?P<society_id>.*)$',
        api_views.SocietyViewSet.as_view(
            {'get': 'detail'},
            renderer_classes=[renderers.TemplateHTMLRenderer]
        ),
        name='view_society'),
    url(r'^language/(?P<glottocode>.*)$',
        views.view_language,
        name='view_language'),

    url(r'^download$', views.download_file, name='download'),