Put framework for both the navigation and crawlable feeds
parent
2c48bb2bb9
commit
e3f32da12b
|
@ -39,6 +39,7 @@ from regluit.frontend.views import (
|
|||
MARCUngluifyView,
|
||||
MARCConfigView,
|
||||
DownloadView,
|
||||
OPDSNavigationView,
|
||||
)
|
||||
|
||||
urlpatterns = patterns(
|
||||
|
@ -153,6 +154,8 @@ urlpatterns = patterns(
|
|||
url(r"^marc/ungluify/$", staff_member_required(MARCUngluifyView.as_view()), name="MARCUngluify"),
|
||||
url(r"^marc/concatenate/$", "marc_concatenate", name="marc_concatenate"),
|
||||
url(r"^accounts/edit/marc_config/$", login_required(MARCConfigView.as_view()), name="marc_config"),
|
||||
url(r"^opds/$", OPDSNavigationView.as_view(template_name="opds.xml"), name="opds"),
|
||||
url(r"^opds/crawlable$", TemplateView.as_view(template_name="opds_crawlable.html"), name="opds_crawlable")
|
||||
)
|
||||
|
||||
if settings.DEBUG:
|
||||
|
|
|
@ -3166,4 +3166,12 @@ def marc_concatenate(request):
|
|||
outfile.write('</collection>')
|
||||
|
||||
return outfile
|
||||
|
||||
class OPDSNavigationView(TemplateView):
|
||||
|
||||
# http://stackoverflow.com/a/6867976
|
||||
|
||||
def render_to_response(self, context, **response_kwargs):
|
||||
|
||||
response_kwargs['content_type'] = "application/atom+xml;profile=opds-catalog;kind=navigation"
|
||||
return super(TemplateView, self).render_to_response(context, **response_kwargs)
|
||||
|
|
Loading…
Reference in New Issue