from django.conf.urls.defaults import *
from django.conf import settings
from django.views.static import serve
from unipath import FSPath as Path
from newsroom import views as nr_views
from darkroom import views as dr_views

# If we're in DEBUG, set a temp media directory at http://{{host}}/m/
if settings.DEBUG:
    urlpatterns = patterns(
        "",
        (
            r"^media/(?P<path>.*)$",
            serve,
            {"document_root": Path(__file__).parent.child("media")},
        ),
    )
else:
    urlpatterns = patterns("",)

from django.contrib import admin

admin.autodiscover()

urlpatterns += patterns(
    "",
    url(r"^multimedia/", include("darkroom.urls")),
    # url(r'^story/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[\-\d\w]+)/$', nr_views.story_detail, name="nr-story-detail"),
    # url(r'^gallery/(?P<title_slug>[\-\d\w]+)/$', dr_views.gallery_detail, name="dr-gallery"),
    url(r"^news/", include("newsroom.urls")),
    url(r"^documents/", include("documents.urls")),
    url(r"^directory/", include("marketplace.urls")),
    url(r"^community-info/", include("directory.urls")),
    url(r"^remember/", include("remember.urls")),
    url(r"^almanac/", include("almanac.urls")),
    url(r"^$", nr_views.paper_index, name="nr-index"),
    (r"^", include("adzone.urls")),
)
