# Path: fossevents/events/views.py
# def event_detail(request, pk, slug=None, template_name='events/event_detail.html'):
#     event = get_object_or_404(models.Event, pk=pk)
#     if event.slug != slug:
#         return redirect(event.get_absolute_url())
#     ctx = {
#         'event': event,
#     }
#     if not request.user.is_anonymous() and request.user.is_moderator:
#         ctx['review_url'] = services.get_event_review_url(event)
#         ctx['form'] = EventReviewForm()
# 
#     return render(request, template_name, ctx)
# 
# Path: fossevents/views.py
# def homepage(request):
#     search_term = request.GET.get('q', None)
#     upcoming_events = past_events = list()
#     if not search_term:
#         upcoming_events, past_events = event_services.get_chronologically_sorted_events()
#     ctx = {
#         'events': event_services.get_public_event_listings(search_term=search_term) if search_term else [],
#         'upcoming_events': upcoming_events,
#         'past_events': past_events
#     }
#     return render(request, 'home.html', ctx)


from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from .events.feeds import AtomLatestEventFeed, LatestEvents
from .events.views import event_detail
from .views import homepage
# -*- coding: utf-8 -*-


uuid_regex = '[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[1345][a-fA-F0-9]{3}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}'

urlpatterns = [
    url(r'^$', homepage, name="home"),
    url(r'^about/$', TemplateView.as_view(template_name='about.html'), name="about"),
    url(r'^privacy/$', TemplateView.as_view(template_name='privacy.html'), name="privacy"),
    url(r'^(?P<slug>[-\w]+)-(?P<pk>%s)/$' % uuid_regex, event_detail, name="event-detail"),

# Path: fossevents/events/views.py
# def event_detail(request, pk, slug=None, template_name='events/event_detail.html'):
#     event = get_object_or_404(models.Event, pk=pk)
#     if event.slug != slug:
#         return redirect(event.get_absolute_url())
#     ctx = {
#         'event': event,
#     }
#     if not request.user.is_anonymous() and request.user.is_moderator:
#         ctx['review_url'] = services.get_event_review_url(event)
#         ctx['form'] = EventReviewForm()
# 
#     return render(request, template_name, ctx)
# 
# Path: fossevents/views.py
# def homepage(request):
#     search_term = request.GET.get('q', None)
#     upcoming_events = past_events = list()
#     if not search_term:
#         upcoming_events, past_events = event_services.get_chronologically_sorted_events()
#     ctx = {
#         'events': event_services.get_public_event_listings(search_term=search_term) if search_term else [],
#         'upcoming_events': upcoming_events,
#         'past_events': past_events
#     }
#     return render(request, 'home.html', ctx)


# Path: fossevents/urls.py
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from .events.feeds import AtomLatestEventFeed, LatestEvents
from .events.views import event_detail
from .views import homepage

# -*- coding: utf-8 -*-


uuid_regex = '[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[1345][a-fA-F0-9]{3}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}'

urlpatterns = [
    url(r'^$', homepage, name="home"),
    url(r'^about/$', TemplateView.as_view(template_name='about.html'), name="about"),
    url(r'^privacy/$', TemplateView.as_view(template_name='privacy.html'), name="privacy"),
    url(r'^(?P<slug>[-\w]+)-(?P<pk>%s)/$' % uuid_regex, event_detail, name="event-detail"),

    url(r'^event/', include('fossevents.events.urls', namespace='events')),