2013-06-03 16:31:39 +00:00
|
|
|
from django.conf import settings
|
2011-08-31 03:46:55 +00:00
|
|
|
from django.conf.urls.defaults import *
|
2013-07-24 18:52:01 +00:00
|
|
|
from django.contrib.admin.views.decorators import staff_member_required
|
2011-10-29 22:40:00 +00:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2013-01-21 15:33:08 +00:00
|
|
|
from django.contrib.sites.models import Site
|
2013-06-03 16:31:39 +00:00
|
|
|
from django.views.generic import ListView, DetailView
|
|
|
|
from django.views.generic.base import TemplateView
|
|
|
|
from django.views.generic.simple import direct_to_template
|
|
|
|
from django.views.decorators.csrf import csrf_exempt
|
2011-10-11 17:03:40 +00:00
|
|
|
|
2012-03-10 00:05:24 +00:00
|
|
|
from regluit.core.feeds import SupporterWishlistFeed
|
2011-10-11 17:03:40 +00:00
|
|
|
from regluit.core.models import Campaign
|
2013-05-31 15:34:51 +00:00
|
|
|
from regluit.frontend.views import (
|
|
|
|
GoodreadsDisplayView,
|
|
|
|
LibraryThingView,
|
|
|
|
PledgeView,
|
2013-06-27 17:10:33 +00:00
|
|
|
PurchaseView,
|
2013-08-20 02:52:22 +00:00
|
|
|
FundCompleteView,
|
2013-05-31 15:34:51 +00:00
|
|
|
PledgeCancelView,
|
|
|
|
PledgeRechargeView,
|
|
|
|
FAQView,
|
|
|
|
CampaignListView,
|
|
|
|
WorkListView,
|
|
|
|
UngluedListView,
|
|
|
|
InfoPageView,
|
|
|
|
InfoLangView,
|
2013-12-13 20:15:35 +00:00
|
|
|
GiftView,
|
2013-08-20 02:52:22 +00:00
|
|
|
FundView,
|
2013-05-31 15:34:51 +00:00
|
|
|
NonprofitCampaign,
|
2013-12-13 20:15:35 +00:00
|
|
|
GiftCredit,
|
2013-05-31 15:34:51 +00:00
|
|
|
PledgeModifiedView,
|
|
|
|
ManageAccount,
|
|
|
|
MergeView,
|
|
|
|
ByPubListView,
|
|
|
|
ByPubView,
|
2013-05-31 21:15:22 +00:00
|
|
|
kindle_config,
|
2013-06-07 14:19:06 +00:00
|
|
|
send_to_kindle,
|
2014-10-27 23:11:44 +00:00
|
|
|
LibModeView,
|
2014-02-20 03:18:23 +00:00
|
|
|
DownloadView,
|
2014-11-18 18:33:17 +00:00
|
|
|
FacetedView,
|
2015-03-12 15:58:49 +00:00
|
|
|
MapSubjectView,
|
2013-05-31 15:34:51 +00:00
|
|
|
)
|
2011-08-31 03:46:55 +00:00
|
|
|
|
|
|
|
urlpatterns = patterns(
|
|
|
|
"regluit.frontend.views",
|
|
|
|
url(r"^$", "home", name="home"),
|
2012-05-24 19:29:45 +00:00
|
|
|
url(r"^landing/$", "home", {'landing': True}, name="landing"),
|
2012-03-13 20:57:42 +00:00
|
|
|
url(r"^next/$", "next", name="next"),
|
2012-03-10 00:05:24 +00:00
|
|
|
url(r"^supporter/(?P<supporter_username>[^/]+)/$", "supporter", {'template_name': 'supporter.html'}, name="supporter"),
|
2014-10-27 15:55:46 +00:00
|
|
|
url(r"^supporter/(?P<userlist>[^/]+)/marc/$", "userlist_marc", name="user_marc"),
|
2013-10-18 16:36:55 +00:00
|
|
|
url(r"^library/(?P<library_name>[^/]+)/$", "library", name="library"),
|
2012-10-14 19:31:18 +00:00
|
|
|
url(r"^accounts/manage/$", login_required(ManageAccount.as_view()), name="manage_account"),
|
2011-09-29 01:36:47 +00:00
|
|
|
url(r"^search/$", "search", name="search"),
|
2011-09-29 06:23:50 +00:00
|
|
|
url(r"^privacy/$", TemplateView.as_view(template_name="privacy.html"),
|
2011-09-29 01:54:50 +00:00
|
|
|
name="privacy"),
|
2011-12-16 22:19:59 +00:00
|
|
|
url(r"^terms/$", TemplateView.as_view(template_name="terms.html"),
|
|
|
|
name="terms"),
|
2011-11-20 02:12:18 +00:00
|
|
|
url(r"^rightsholders/$", "rh_tools", name="rightsholders"),
|
2011-11-21 03:23:51 +00:00
|
|
|
url(r"^rightsholders/campaign/(?P<id>\d+)/$", "manage_campaign", name="manage_campaign"),
|
2013-12-31 02:51:32 +00:00
|
|
|
url(r"^rightsholders/campaign/(?P<id>\d+)/results/$", "manage_campaign", {'action': 'results'}, name="campaign_results"),
|
2012-05-14 05:07:02 +00:00
|
|
|
url(r"^rightsholders/edition/(?P<work_id>\d*)/(?P<edition_id>\d*)$", "new_edition",{'by': 'rh'}, name="rh_edition"),
|
2013-06-17 22:53:21 +00:00
|
|
|
url(r"^rightsholders/edition/(?P<edition_id>\d*)/upload/$", "edition_uploads", name="edition_uploads"),
|
2011-11-16 05:22:22 +00:00
|
|
|
url(r"^rightsholders/claim/$", "claim", name="claim"),
|
2011-12-20 22:42:06 +00:00
|
|
|
url(r"^rh_admin/$", "rh_admin", name="rh_admin"),
|
2014-02-08 18:28:52 +00:00
|
|
|
url(r"^rh_admin/accepted/$", "rh_admin", {'facet': 'accepted'}, name="accepted"),
|
|
|
|
url(r"^rh_admin/claims/$", "rh_admin", {'facet': 'claims'}, name="claims"),
|
2011-12-20 22:42:06 +00:00
|
|
|
url(r"^campaign_admin/$", "campaign_admin", name="campaign_admin"),
|
2012-01-06 15:42:17 +00:00
|
|
|
url(r"^faq/$", FAQView.as_view(), {'location':'faq', 'sublocation':'all'}, name="faq"),
|
2012-05-21 14:03:29 +00:00
|
|
|
url(r"^faq/(?P<location>\w*)/$", FAQView.as_view(), {'sublocation':'all'}, name="faq_location"),
|
2013-02-06 14:09:20 +00:00
|
|
|
url(r"^faq/(?P<location>\w*)/(?P<sublocation>\w*)/$", FAQView.as_view(), name="faq_sublocation"),
|
2011-09-29 06:23:50 +00:00
|
|
|
url(r"^wishlist/$", "wishlist", name="wishlist"),
|
2013-02-26 17:43:54 +00:00
|
|
|
url(r"^msg/$", "msg", name="msg"),
|
2011-12-01 18:17:33 +00:00
|
|
|
url(r"^campaigns/(?P<facet>\w*)$", CampaignListView.as_view(), name='campaign_list'),
|
2014-10-27 15:55:46 +00:00
|
|
|
url(r"^campaigns/(?P<facet>\w*)/marc/$", CampaignListView.as_view(send_marc=True), name='campaign_list_marc'),
|
2011-12-03 00:29:23 +00:00
|
|
|
url(r"^lists/(?P<facet>\w*)$", WorkListView.as_view(), name='work_list'),
|
2014-10-27 15:55:46 +00:00
|
|
|
url(r"^lists/(?P<facet>\w*)/marc/$", WorkListView.as_view(send_marc=True), name='work_list_marc'),
|
2014-12-10 22:45:19 +00:00
|
|
|
url(r"^free/(?P<path>.*)/marc/$", FacetedView.as_view(send_marc=True), name='faceted_list_marc'),
|
|
|
|
url(r"^free/(?P<path>.*)/$", FacetedView.as_view(), name='faceted_list'),
|
2014-11-18 18:33:17 +00:00
|
|
|
url(r"^free/$", FacetedView.as_view(), name='free'),
|
2013-03-26 03:41:19 +00:00
|
|
|
url(r"^pid/all/(?P<pubname>\d+)$", ByPubView.as_view(), name='bypubname_list'),
|
|
|
|
url(r"^pid/(?P<facet>\w*)/(?P<pubname>\d+)$", ByPubView.as_view(), name='bypubname_list'),
|
2014-10-27 15:55:46 +00:00
|
|
|
url(r"^pid/(?P<facet>\w*)/(?P<pubname>\d+)/marc/$", ByPubView.as_view(send_marc=True), name='bypubname_list_marc'),
|
2013-03-06 17:45:27 +00:00
|
|
|
url(r"^bypub/all/(?P<pubname>.*)$", ByPubListView.as_view(), name='bypub_list'),
|
|
|
|
url(r"^bypub/(?P<facet>\w*)/(?P<pubname>.*)$", ByPubListView.as_view(), name='bypub_list'),
|
2012-01-15 21:48:26 +00:00
|
|
|
url(r"^unglued/(?P<facet>\w*)$", UngluedListView.as_view(), name='unglued_list'),
|
2014-10-27 15:55:46 +00:00
|
|
|
url(r"^unglued/(?P<facet>\w*)/marc/$", UngluedListView.as_view(send_marc=True), name='unglued_list_marc'),
|
2014-12-03 15:15:38 +00:00
|
|
|
url(r"^creativecommons/$", FacetedView.as_view(), name='cc_list'),
|
|
|
|
url(r"^creativecommons/(?P<path>[^\s]*)/marc/$", FacetedView.as_view(send_marc=True), name='cc_list_marc'),
|
|
|
|
url(r"^creativecommons/(?P<path>[^\s]*)$", FacetedView.as_view(), name='cc_list_detail'),
|
2011-11-16 22:16:57 +00:00
|
|
|
url(r"^goodreads/auth/$", "goodreads_auth", name="goodreads_auth"),
|
2011-10-25 01:29:01 +00:00
|
|
|
url(r"^goodreads/auth_cb/$", "goodreads_cb", name="goodreads_cb"),
|
2011-11-01 00:26:05 +00:00
|
|
|
url(r"^goodreads/flush/$","goodreads_flush_assoc", name="goodreads_flush_assoc"),
|
|
|
|
url(r"^goodreads/load_shelf/$","goodreads_load_shelf", name="goodreads_load_shelf"),
|
2012-01-24 17:36:45 +00:00
|
|
|
url(r"^goodreads/shelves/$","goodreads_calc_shelves", name="goodreads_calc_shelves"),
|
2011-11-06 19:02:29 +00:00
|
|
|
url(r"^stub/", "stub", name="stub"),
|
2011-11-06 23:54:48 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/$", "work", name="work"),
|
2012-04-10 20:13:21 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/preview/$", "work", {'action': 'preview'}, name="work_preview"),
|
2012-07-07 22:13:05 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/acks/$", "work", {'action': 'acks'}, name="work_acks"),
|
2012-08-15 13:40:37 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/lockss/$", "lockss", name="lockss"),
|
2012-09-18 18:16:06 +00:00
|
|
|
url(r"^lockss/(?P<year>\d+)/$", "lockss_manifest", name="lockss_manifest"),
|
2014-02-20 03:18:23 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/download/$", DownloadView.as_view(), name="download"),
|
|
|
|
url(r"^work/(?P<work_id>\d+)/download/$", DownloadView.as_view(), name="thank"),
|
2013-11-14 19:48:16 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/unglued/(?P<format>\w+)/$", "download_campaign", name="download_campaign"),
|
2013-10-15 20:18:30 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/borrow/$", "borrow", name="borrow"),
|
2014-10-27 15:55:46 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/marc/$", "work_marc", name="work_marc"),
|
2013-11-08 17:13:34 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/reserve/$", "reserve", name="reserve"),
|
2014-07-01 18:09:21 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/feature/$", "feature", name="feature"),
|
2015-01-13 01:24:32 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/kw/$", "kw_edit", name="kw_edit"),
|
2012-12-13 03:35:35 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/merge/$", login_required(MergeView.as_view()), name="merge"),
|
2014-03-11 21:34:27 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/editions/$", "work",{'action': 'editions'}, name="work_editions"),
|
2012-07-07 22:13:05 +00:00
|
|
|
url(r"^work/\d+/acks/images/(?P<file_name>[\w\.]*)$", "static_redirect_view",{'dir': 'images'}),
|
2011-12-05 05:56:24 +00:00
|
|
|
url(r"^work/(?P<work_id>\d+)/librarything/$", "work_librarything", name="work_librarything"),
|
|
|
|
url(r"^work/(?P<work_id>\d+)/goodreads/$", "work_goodreads", name="work_goodreads"),
|
|
|
|
url(r"^work/(?P<work_id>\d+)/openlibrary/$", "work_openlibrary", name="work_openlibrary"),
|
2012-05-11 19:39:09 +00:00
|
|
|
url(r"^new_edition/(?P<work_id>)(?P<edition_id>)$", "new_edition", name="new_edition"),
|
2012-05-11 18:13:09 +00:00
|
|
|
url(r"^new_edition/(?P<work_id>\d*)/(?P<edition_id>\d*)$", "new_edition", name="new_edition"),
|
2011-11-22 01:12:13 +00:00
|
|
|
url(r"^googlebooks/(?P<googlebooks_id>.+)/$", "googlebooks", name="googlebooks"),
|
2013-09-06 02:54:11 +00:00
|
|
|
url(r"^download_ebook/(?P<ebook_id>\w+)/$", "download_ebook", name="download_ebook"),
|
|
|
|
url(r"^download_ebook/acq/(?P<format>\w+)/(?P<nonce>\w+)/$", "download_acq", name="download_acq"),
|
2014-12-18 06:07:59 +00:00
|
|
|
url(r"^receive_gift/(?P<nonce>\w+)/$", "receive_gift", name="receive_gift"),
|
2014-12-20 17:47:15 +00:00
|
|
|
url(r"^display_gift/(?P<gift_id>\d+)/(?P<message>newuser|existing)/$", "display_gift", name="display_gift"),
|
2013-12-13 20:15:35 +00:00
|
|
|
url(r"^gift/$", login_required(GiftView.as_view()), name="gift"),
|
|
|
|
url(r"^gift/credit/(?P<token>.+)/$", login_required(GiftCredit.as_view()), name="gift_credit"),
|
2013-03-21 18:24:11 +00:00
|
|
|
url(r"^pledge/(?P<work_id>\d+)/$", login_required(PledgeView.as_view(),login_url='/accounts/login/pledge/'), name="pledge"),
|
2012-05-21 14:56:18 +00:00
|
|
|
url(r"^pledge/cancel/(?P<campaign_id>\d+)$", login_required(PledgeCancelView.as_view()), name="pledge_cancel"),
|
2014-02-20 03:18:23 +00:00
|
|
|
url(r"^fund/complete/$", FundCompleteView.as_view(), name="pledge_complete"),
|
2012-09-07 21:48:48 +00:00
|
|
|
url(r"^pledge/modified/$", login_required(PledgeModifiedView.as_view()), name="pledge_modified"),
|
2012-08-31 07:16:04 +00:00
|
|
|
url(r"^pledge/modify/(?P<work_id>\d+)$", login_required(PledgeView.as_view()), name="pledge_modify"),
|
2014-02-20 03:18:23 +00:00
|
|
|
url(r"^payment/fund/(?P<t_id>\d+)$", FundView.as_view(), name="fund" ),
|
2012-07-11 13:54:15 +00:00
|
|
|
url(r"^pledge/recharge/(?P<work_id>\d+)$", login_required(PledgeRechargeView.as_view()), name="pledge_recharge"),
|
2013-06-27 17:10:33 +00:00
|
|
|
url(r"^purchase/(?P<work_id>\d+)/$", login_required(PurchaseView.as_view(),login_url='/accounts/login/purchase/'), name="purchase"),
|
|
|
|
url(r"^purchase/(?P<work_id>\d+)/download/$", "download_purchased", name="download_purchased"),
|
2012-09-06 05:01:17 +00:00
|
|
|
url(r"^donate_to_campaign/$", csrf_exempt(NonprofitCampaign.as_view()), name="nonprofit"),
|
2011-11-16 18:20:10 +00:00
|
|
|
url(r"^subjects/$", "subjects", name="subjects"),
|
2015-03-12 15:58:49 +00:00
|
|
|
url(r"^subjects/map/$", login_required(MapSubjectView.as_view()), name="map_subject"),
|
2011-11-16 19:58:39 +00:00
|
|
|
url(r"^librarything/$", LibraryThingView.as_view(), name="librarything"),
|
2011-11-17 00:47:29 +00:00
|
|
|
url(r"^librarything/load/$","librarything_load", name="librarything_load"),
|
2011-11-18 20:11:17 +00:00
|
|
|
url('^404testing/$', direct_to_template, {'template': '404.html'}),
|
|
|
|
url('^500testing/$', direct_to_template, {'template': '500.html'}),
|
2012-01-15 23:21:47 +00:00
|
|
|
url('^robots.txt$', direct_to_template, {'template': 'robots.txt', 'mimetype': 'text/plain'}),
|
2012-05-14 02:59:07 +00:00
|
|
|
url(r"^emailshare/(?P<action>\w*)/?$", "emailshare", name="emailshare"),
|
2013-03-27 16:22:30 +00:00
|
|
|
url(r"^feedback/campaign/(?P<campaign_id>\d+)/?$", "ask_rh", name="ask_rh"),
|
2012-01-09 20:53:09 +00:00
|
|
|
url(r"^feedback/$", "feedback", name="feedback"),
|
|
|
|
url(r"^feedback/thanks/$", TemplateView.as_view(template_name="thanks.html")),
|
2012-01-15 18:19:35 +00:00
|
|
|
url(r"^about/$", TemplateView.as_view(template_name="about.html"),
|
|
|
|
name="about"),
|
2012-02-03 15:22:53 +00:00
|
|
|
url(r"^comments/$", "comment", name="comment"),
|
2012-03-08 03:06:30 +00:00
|
|
|
url(r"^info/(?P<template_name>[\w\.]*)$", InfoPageView.as_view()),
|
2012-07-20 18:29:04 +00:00
|
|
|
url(r"^info/languages/(?P<template_name>[\w\.]*)$", InfoLangView.as_view()),
|
2012-03-10 00:05:24 +00:00
|
|
|
url(r'^supporter/(?P<supporter>[^/]+)/feed/$', SupporterWishlistFeed()),
|
2012-08-27 19:35:29 +00:00
|
|
|
url(r'^campaign_archive.js/$', "campaign_archive_js", name="campaign_archive_js"),
|
2013-02-06 14:09:20 +00:00
|
|
|
url(r"^about/(?P<facet>\w*)/$", "about", name="about_specific"),
|
2013-01-21 15:33:08 +00:00
|
|
|
url(r"^libraries/$", TemplateView.as_view(
|
|
|
|
template_name="libraries.html",
|
|
|
|
get_context_data=lambda: {'site': Site.objects.get_current()}
|
|
|
|
),
|
2013-01-21 14:09:26 +00:00
|
|
|
name="libraries"),
|
2013-03-04 22:01:33 +00:00
|
|
|
url(r"^ml/status/$","ml_status", name="ml_status"),
|
|
|
|
url(r"^ml/subscribe/$","ml_subscribe", name="ml_subscribe"),
|
|
|
|
url(r"^ml/unsubscribe/$","ml_unsubscribe", name="ml_unsubscribe"),
|
2013-04-08 18:16:08 +00:00
|
|
|
url(r"^press/$","press", name="press"),
|
2013-04-04 15:09:18 +00:00
|
|
|
url(r"^press_submitterator/$","press_submitterator", name="press_submitterator"),
|
2013-05-31 15:34:51 +00:00
|
|
|
url(r"^accounts/edit/kindle_config/$", "kindle_config", name="kindle_config"),
|
2013-09-06 02:54:11 +00:00
|
|
|
url(r"^accounts/edit/kindle_config/(?P<work_id>\d+)/$", "kindle_config", name="kindle_config_download"),
|
|
|
|
url(r"^send_to_kindle/(?P<work_id>\d+)/(?P<javascript>\d)/$", "send_to_kindle", name="send_to_kindle"),
|
2014-10-27 15:55:46 +00:00
|
|
|
url(r"^marc/$", direct_to_template, {'template': 'marc.html'}, name="marc"),
|
2014-10-27 23:11:44 +00:00
|
|
|
url(r"^accounts/edit/marc_config/$", login_required(LibModeView.as_view()), name="marc_config"),
|
2014-11-18 18:33:17 +00:00
|
|
|
|
2011-08-31 03:46:55 +00:00
|
|
|
)
|
2012-01-18 17:08:34 +00:00
|
|
|
|
2012-05-17 20:55:02 +00:00
|
|
|
if settings.DEBUG:
|
2012-01-18 17:08:34 +00:00
|
|
|
urlpatterns += patterns(
|
2012-01-18 19:34:23 +00:00
|
|
|
"regluit.frontend.views",
|
2012-01-18 17:08:34 +00:00
|
|
|
url(r"^goodreads/$", login_required(GoodreadsDisplayView.as_view()), name="goodreads_display"),
|
|
|
|
url(r"^goodreads/clear_wishlist/$","clear_wishlist", name="clear_wishlist"),
|
|
|
|
url(r"^celery/clear/$","clear_celery_tasks", name="clear_celery_tasks"),
|
2012-03-10 00:05:24 +00:00
|
|
|
)
|