# Path: telostats/stations/views.py
# class About(StationMap):
#     template_name = 'about.html'
# 
# class AboutApi(StationMap):
#     template_name = 'about_api.html'
# 
# class Contact(StationMap):
#     template_name = 'contact.html'
# 
#     def post(self, request):
#         msg = request.POST.get('message')
#         send_mail('Tel-O-Stats Feedback Received', msg,
#             'admin@telostats.com', ['idan@gazit.me', 'yuv.adm@gmail.com'])
#         return HttpResponseRedirect('/')
# 
# class StationMap(TemplateView):
#     template_name = 'map.html'
# 
#     def get_context_data(self, **kwargs):
#         context = super(StationMap, self).get_context_data(**kwargs)
#         context['tileserver_url'] = settings.TILESERVER_URL
#         return context
# 
# class StationDetail(PJAXResponseMixin, DetailView):
#     model = Station
#     context_object_name = 'station'
# 
#     def get_context_data(self, **kwargs):
#         context = super(StationDetail, self).get_context_data(**kwargs)
#         context['tileserver_url'] = settings.TILESERVER_URL
#         return context


from django.conf.urls import patterns, url
from .views import About, AboutApi, Contact, StationMap, StationDetail


urlpatterns = patterns('',

    url('^$', StationMap.as_view(), name='home'),
    url('^about$', About.as_view(), name='about'),
    url('^about/api$', AboutApi.as_view(), name='about_api'),
    url('^contact$', Contact.as_view(), name='contact'),
    url('^station/(?P<pk>\d+)', StationDetail.as_view(), name='station_detail'),

# Path: telostats/stations/views.py
# class About(StationMap):
#     template_name = 'about.html'
# 
# class AboutApi(StationMap):
#     template_name = 'about_api.html'
# 
# class Contact(StationMap):
#     template_name = 'contact.html'
# 
#     def post(self, request):
#         msg = request.POST.get('message')
#         send_mail('Tel-O-Stats Feedback Received', msg,
#             'admin@telostats.com', ['idan@gazit.me', 'yuv.adm@gmail.com'])
#         return HttpResponseRedirect('/')
# 
# class StationMap(TemplateView):
#     template_name = 'map.html'
# 
#     def get_context_data(self, **kwargs):
#         context = super(StationMap, self).get_context_data(**kwargs)
#         context['tileserver_url'] = settings.TILESERVER_URL
#         return context
# 
# class StationDetail(PJAXResponseMixin, DetailView):
#     model = Station
#     context_object_name = 'station'
# 
#     def get_context_data(self, **kwargs):
#         context = super(StationDetail, self).get_context_data(**kwargs)
#         context['tileserver_url'] = settings.TILESERVER_URL
#         return context


# Path: telostats/stations/urls.py
from django.conf.urls import patterns, url
from .views import About, AboutApi, Contact, StationMap, StationDetail



urlpatterns = patterns('',

    url('^$', StationMap.as_view(), name='home'),
    url('^about$', About.as_view(), name='about'),
    url('^about/api$', AboutApi.as_view(), name='about_api'),
    url('^contact$', Contact.as_view(), name='contact'),
    url('^station/(?P<pk>\d+)', StationDetail.as_view(), name='station_detail'),

)