# Listing patterns # This has to be importable for now because of a hack in the view_video view # which imports this view to check whether the referer was a category page. category_videos = CompatibleListingView.as_view( template_name='localtv/category.html', filter_name='category', filter_kwarg='slug' ) urlpatterns += patterns( 'localtv.listing.views', url(r'^search/$', CompatibleListingView.as_view( template_name='localtv/video_listing_search.html', ), name='localtv_search'), url(r'^category/$', SiteListView.as_view( template_name='localtv/categories.html', queryset=Category.objects.filter(level=0), paginate_by=15 ), name='localtv_category_index'), url(r'^category/(?P<slug>[-\w]+)/$', category_videos, name='localtv_category'), url(r'^author/$', ListView.as_view( template_name='localtv/author_list.html', model=User, context_object_name='authors' ), name='localtv_author_index'), url(r'^author/(?P<pk>\d+)/$', CompatibleListingView.as_view( template_name='localtv/author.html', filter_name='author' ), name='localtv_author')) # Comments patterns
ContestAdminUpdateView, ContestAdminDeleteView) from localtv.submit_video.forms import (ScrapedSubmitVideoForm, EmbedSubmitVideoForm, DirectLinkSubmitVideoForm) from localtv.contrib.contests.submit_views import (can_submit_video, SubmitURLView, SubmitVideoView, submit_thanks) from localtv.decorators import require_site_admin from localtv.listing.views import SiteListView urlpatterns = patterns('localtv.contrib.voting.views', url(r'^contests/$', SiteListView.as_view(model=Contest, template_name='contests/list.html'), name='contests_contest_list'), url(r'^contests/(?P<pk>[0-9]+)(?:/(?P<slug>[\w-]+))?/?$', ContestDetailView.as_view(), name='contests_contest_detail'), url(r'^contests/(?P<pk>[0-9]+)(?:/(?P<slug>[\w-]+))?/videos/?$', ContestListingView.as_view(), name='contests_contest_listing'), url(r'^admin/contests/?$', require_site_admin(ContestAdminListView.as_view()), name='localtv_admin_contests'), url(r'^admin/contests/add/?$', require_site_admin(ContestAdminCreateView.as_view()), name='localtv_admin_contests_create'), url(r'^admin/contests/edit/(?P<pk>[\d]+)/?$', require_site_admin(ContestAdminUpdateView.as_view()),
ContestDetailView, ContestListingView, ContestAdminListView, ContestAdminCreateView, ContestAdminUpdateView, ContestAdminDeleteView) from localtv.submit_video.forms import (ScrapedSubmitVideoForm, EmbedSubmitVideoForm, DirectLinkSubmitVideoForm) from localtv.contrib.contests.submit_views import (can_submit_video, SubmitURLView, SubmitVideoView, submit_thanks) from localtv.decorators import require_site_admin from localtv.listing.views import SiteListView urlpatterns = patterns( 'localtv.contrib.voting.views', url(r'^contests/$', SiteListView.as_view(model=Contest, template_name='contests/list.html'), name='contests_contest_list'), url(r'^contests/(?P<pk>[0-9]+)(?:/(?P<slug>[\w-]+))?/?$', ContestDetailView.as_view(), name='contests_contest_detail'), url(r'^contests/(?P<pk>[0-9]+)(?:/(?P<slug>[\w-]+))?/videos/?$', ContestListingView.as_view(), name='contests_contest_listing'), url(r'^admin/contests/?$', require_site_admin(ContestAdminListView.as_view()), name='localtv_admin_contests'), url(r'^admin/contests/add/?$', require_site_admin(ContestAdminCreateView.as_view()), name='localtv_admin_contests_create'), url(r'^admin/contests/edit/(?P<pk>[\d]+)/?$', require_site_admin(ContestAdminUpdateView.as_view()),
url(r"^share/(\d+)/(\d+)", "share_email", name="email-share"), url(r"^video/(?P<video_id>[0-9]+)/(?P<slug>[\w-]*)/?$", "view_video", name="localtv_view_video"), url(r"^newsletter/$", "newsletter", name="localtv_newsletter"), ) # Listing patterns category_videos = CategoryVideoSearchView.as_view(template_name="localtv/category.html", default_filter="category") urlpatterns += patterns( "localtv.listing.views", url( r"^search/$", VideoSearchView.as_view(template_name="localtv/video_listing_search.html"), name="localtv_search" ), url( r"^category/$", SiteListView.as_view( template_name="localtv/categories.html", queryset=Category.objects.filter(parent=None), paginate_by=15 ), name="localtv_category_index", ), url(r"^category/(?P<slug>[-\w]+)/$", category_videos, name="localtv_category"), url( r"^author/$", ListView.as_view(template_name="localtv/author_list.html", model=User, context_object_name="authors"), name="localtv_author_index", ), url( r"^author/(?P<pk>\d+)/$", VideoSearchView.as_view(template_name="localtv/author.html", default_filter="author", default_sort="-date"), name="localtv_author", ), )
# Listing patterns category_videos = CategoryVideoSearchView.as_view( template_name='localtv/category.html', url_filter='category', url_filter_kwarg='slug', default_sort='-date') urlpatterns += patterns( 'localtv.listing.views', url(r'^search/$', VideoSearchView.as_view( template_name='localtv/video_listing_search.html', ), name='localtv_search'), url(r'^category/$', SiteListView.as_view(template_name='localtv/categories.html', queryset=Category.objects.filter(parent=None), paginate_by=15), name='localtv_category_index'), url(r'^category/(?P<slug>[-\w]+)/$', category_videos, name='localtv_category'), url(r'^author/$', ListView.as_view(template_name='localtv/author_list.html', model=User, context_object_name='authors'), name='localtv_author_index'), url(r'^author/(?P<pk>\d+)/$', VideoSearchView.as_view(template_name='localtv/author.html', url_filter='author', default_sort='-date'), name='localtv_author'))