from django.conf.urls import patterns, include, url
# from django.conf.urls.static import static
from django.views.generic import RedirectView

from django.contrib import admin

from bills.views import (BillDetail, BillSearchView, BillSearchJson,
                         SubjectDetail, SubjectListDetail, LegeStreamDetail)
from core.views import LandingView
from committees.views import (ChamberCommitteeList,
                              CommitteeDetail, CommitteeList)
from explainers.views import ExplainerListDetail
from legislators.views import LegislatorDetail
from topics.views import IssueDetail, TopicDetail

urlpatterns = patterns(
    '',
    url(r'^$', LandingView.as_view(), name='landing-view'),
    url(r'^topics/$',
        RedirectView.as_view(pattern_name='landing-view')),
    url(r'^topics/(?P<slug>[-\w]+)/$',
        TopicDetail.as_view(), name='topic-detail'),
    url(r'^topics/(?P<hot_list_slug>[-\w]+)/(?P<slug>[-\w]+)/$',
        IssueDetail.as_view(), name='issue-detail'),
    url(r'^84/bills/(?P<slug>[-\w]+)/$',
        BillDetail.as_view(), name='bill-detail'),
    url(r'^84/categories/(?P<slug>[-\w]+)/$',
        SubjectDetail.as_view(), name='category-detail'),
    url(r'^84/categories/$',
        SubjectListDetail.as_view(), name='category-list-detail'),
    url(r'^84/legislators/(?P<slug>[-\w]+)/$',
        LegislatorDetail.as_view(), name='legislator-detail'),
    url(r'^84/committees/(?P<chamber>[-\w]+)/(?P<slug>[-\w]+)/$',
        CommitteeDetail.as_view(), name='committee-detail'),
    url(r'^how-session-works/$',
        ExplainerListDetail.as_view(), name='explainer-list-detail'),
    url(r'^84/committees/(?P<slug>[-\w]+)/$',
        ChamberCommitteeList.as_view(), name='chamber-committees'),
    url(r'^84/committees/$',
        CommitteeList.as_view(), name='committees-landing'),
    url(r'^livestream/$',
        LegeStreamDetail.as_view(), name='legestream'),
    url(r'^search/bills/', BillSearchJson.as_view(), name='bill-search'),
    url(r'^84/find-bills/$', BillSearchView.as_view(), name='find-bills'),

    # Redirects
    url(r'^hot-lists/$',
        RedirectView.as_view(pattern_name='landing-view')),
    url(r'^hot-lists/(?P<slug>[-\w]+)/$',
        RedirectView.as_view(pattern_name='topic-detail')),
    url(r'^hot-lists/(?P<hot_list_slug>[-\w]+)/(?P<slug>[-\w]+)/$',
        RedirectView.as_view(pattern_name='issue-detail')),
    url(r'^legestream/$', RedirectView.as_view(pattern_name='legestream')),
    url(r'^texplainers/$',
        RedirectView.as_view(pattern_name='explainer-list-detail')),

    url(r'', include('social.apps.django_app.urls', namespace='social')),
    url(r'^admin/', include(admin.site.urls)),
)

# Uncomment the import above and next line to serve media files in development
# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

@@ -644,16 +644,36 @@
 %0A    '',
+%0A%0A    # Landing page
 %0A    url
@@ -729,87 +729,142 @@
 '),%0A
-    url(r'%5Etopics/$',%0A        RedirectView.as_view(pattern_name='landing-view')
+%0A    # Topic pages%0A    url(r'%5Etopics/(?P%3Chot_list_slug%3E%5B-%5Cw%5D+)/(?P%3Cslug%3E%5B-%5Cw%5D+)/$',%0A        IssueDetail.as_view(), name='issue-detail'
 ),%0A 
@@ -976,107 +976,89 @@
 ics/
-(?P%3Chot_list_slug%3E%5B-%5Cw%5D+)/(?P%3Cslug%3E%5B-%5Cw%5D+)/$',%0A        IssueDetail.as_view(), name='issue-detail'),
+$',%0A        RedirectView.as_view(pattern_name='landing-view')),%0A%0A    # Bill pages
 %0A   
@@ -1138,32 +1138,123 @@
 'bill-detail'),%0A
+    url(r'%5E84/bills/$', BillSearchView.as_view(), name='find-bills'),%0A%0A    # Subject pages%0A
     url(r'%5E84/ca
@@ -1428,32 +1428,56 @@
 y-list-detail'),
+%0A%0A    # Legislator pages
 %0A    url(r'%5E84/l
@@ -1562,32 +1562,55 @@
 slator-detail'),
+%0A%0A    # Committee pages
 %0A    url(r'%5E84/c
@@ -1725,111 +1725,8 @@
 '),%0A
-    url(r'%5Ehow-session-works/$',%0A        ExplainerListDetail.as_view(), name='explainer-list-detail'),%0A
     
@@ -1929,89 +1929,157 @@
 '),%0A
-    url(r'%5Elivestream/$',%0A        LegeStreamDetail.as_view(), name='leg
+%0A    # Explainer pages%0A    url(r'%5Ehow-session-works/$',%0A        ExplainerListDetail.as_view(), name='explainer-list-detail'),%0A%0A    # Liv
 estream
-'),
+ pages
 %0A   
@@ -2090,70 +2090,111 @@
 (r'%5E
-search/bills/', BillSearchJson.as_view(), name='
+livestream/$',%0A        LegeStreamDetail.as_view(), name='legestream'),%0A%0A    # JSON feed for 
 bill
--
+ 
 search
-'),
 %0A   
@@ -2205,23 +2205,21 @@
 (r'%5E
-84/find-
+search/
 bills/
-$
 ', B
@@ -2219,36 +2219,36 @@
 ls/', BillSearch
-View
+Json
 .as_view(), name
@@ -2245,34 +2245,35 @@
 ew(), name='
-find-bills
+bill-search
 '),%0A%0A    # R

Move find-bills page to 84/bills, organize urls()