from django.conf.urls import patterns, include, url
from .views import CampaignStatView

urlpatterns = patterns(
    '',
    url(r'^login', 'wiseadmin.views.login_view', name='login'),
    url(r'^logout', 'wiseadmin.views.logout_view', name='logout'),

    url(r'^json/subscribers', 'wiseadmin.views.json_subscribers', name='json_subscribers'),
    url(r'^subscribers', 'wiseadmin.views.subscribers', name='subscribers'),

    url(r'^segments', 'wiseadmin.views.segments', name='segments'),
    url(r'^segment/new', 'wiseadmin.views.segment_edit', name='segment_new'),
    url(r'^segment/edit/(?P<segment_id>.+)', 'wiseadmin.views.segment_edit', name='segment_edit'),
    url(r'^segment/test', 'wiseadmin.views.segment_test', name='segment_edit'),
    url(r'^json/segments', 'wiseadmin.views.json_segments', name='json_segment'),

    url(r'^json/campaigns', 'wiseadmin.views.json_campaigns', name='json_campaigns'),
    url(r'^campaigns', 'wiseadmin.views.campaigns', name='campaigns'),
    url(r'^campaign/new', 'wiseadmin.views.campaign_edit', name='campaign_new'),
    url(r'^campaign/edit/(?P<id>.+)', 'wiseadmin.views.campaign_edit', name='campaign_edit'),
    url(r'^campaign/test', 'wiseadmin.views.campaign_test', name='campaign_test'),
    url(r'^campaign/start', 'wiseadmin.views.campaign_start', name='campaign_start'),
    url(r'^campaign/statistics/(?P<campaign_id>.+)', CampaignStatView.as_view(), name='campaign_statistics'),

    url(r'^json/maillists', 'wiseadmin.views.json_maillists', name='json_maillists'),
    url(r'^maillists/new', 'wiseadmin.views.maillist_edit', name='maillist_new'),
    url(r'^maillists/edit/(?P<maillist_id>.+)', 'wiseadmin.views.maillist_edit', name='maillist_edit'),
    url(r'^maillists', 'wiseadmin.views.maillists', name='maillists'),

    url(r'^', 'wiseadmin.views.home', name='home'),
)
