Skip to content

Commit 58e45d9

Browse files
authored
remove deprecated borrow and read pages (#11836)
1 parent c4fe941 commit 58e45d9

4 files changed

Lines changed: 7 additions & 43 deletions

File tree

openlibrary/i18n/messages.pot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5945,11 +5945,11 @@ msgstr ""
59455945
#: home/loans.html
59465946
#, python-format
59475947
msgid ""
5948-
"You can still <a href=\"/borrow\">borrow</a> one more book until you've "
5949-
"hit the limit!"
5948+
"You can still <a href=\"/subjects/in_library#ebooks=true\">borrow</a> one"
5949+
" more book until you've hit the limit!"
59505950
msgid_plural ""
5951-
"You can still <a href=\"/borrow\">borrow</a> %(count)d more books until "
5952-
"you've hit the limit!"
5951+
"You can still <a href=\"/subjects/in_library#ebooks=true\">borrow</a> "
5952+
"%(count)d more books until you've hit the limit!"
59535953
msgstr[0] ""
59545954
msgstr[1] ""
59555955

openlibrary/plugins/openlibrary/borrow_home.py

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,15 @@
11
"""
2-
Controllers for /borrow pages.
3-
4-
These endpoints are largely deprecated, and only maintained for
5-
backwards compatibility.
2+
Event handlers for loan statistics.
63
"""
74

85
import datetime
96
import json
107

118
import eventer
12-
import web
139

14-
from infogami.utils import delegate
15-
from infogami.utils.view import render_template # noqa: F401 used for its side effects
1610
from openlibrary.core import statsdb
1711

1812

19-
class borrow(delegate.page):
20-
path = "/borrow"
21-
22-
def GET(self):
23-
raise web.seeother('/subjects/in_library#ebooks=true')
24-
25-
26-
class borrow_json(delegate.page):
27-
path = "/borrow"
28-
encoding = "json"
29-
30-
def GET(self):
31-
raise web.seeother('/subjects/in_library.json' + web.ctx.query)
32-
33-
34-
class read(delegate.page):
35-
path = "/read"
36-
37-
def GET(self):
38-
web.seeother('/subjects/accessible_book#ebooks=true')
39-
40-
41-
class read_json(delegate.page):
42-
path = "/read"
43-
encoding = "json"
44-
45-
def GET(self):
46-
web.seeother('/subjects/accessible_book.json' + web.ctx.query)
47-
48-
4913
def on_loan_created_statsdb(loan):
5014
"""Adds the loan info to the stats database."""
5115
key = _get_loan_key(loan)

openlibrary/templates/home/loans.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ <h2 class="home-h2"><a href="/account/loans">$_("My Books")</a></h2>
88
&nbsp;
99
$if len(loans):
1010
$ loans_remaining = 5 - len(loans)
11-
$:ungettext('You can still <a href="/borrow">borrow</a> one more book until you\'ve hit the limit!', 'You can still <a href="/borrow">borrow</a> %(count)d more books until you\'ve hit the limit!', loans_remaining, count=loans_remaining)
11+
$:ungettext('You can still <a href="/subjects/in_library#ebooks=true">borrow</a> one more book until you\'ve hit the limit!', 'You can still <a href="/subjects/in_library#ebooks=true">borrow</a> %(count)d more books until you\'ve hit the limit!', loans_remaining, count=loans_remaining)
1212
$else:
1313
$_("You have reached the borrowing limit. Please return a book to checkout something new.")
1414
</p>

openlibrary/templates/home/stats.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h2 class="inline">$_('Around the Library')</h2>
3737
<div class="statschart">
3838
<div class="chartShow" onclick="window.location.href='/stats';" title="$_('We\'re a library, so we lend books, too')">
3939
<div id="ebooks-graph" style="width:150px;height:60px;" title="$_('Area graph of ebooks borrowed recently')"></div>
40-
<a href="/borrow" title="$_('We\'re a library, so we lend books, too')"><span class="ticks">$:commify(stats["loans"].get_summary(28))</span><span class="label">$_('eBooks Borrowed')</span></a>
40+
<a href="/subjects/in_library#ebooks=true" title="$_('We\'re a library, so we lend books, too')"><span class="ticks">$:commify(stats["loans"].get_summary(28))</span><span class="label">$_('eBooks Borrowed')</span></a>
4141
</div>
4242
</div>
4343
</div>

0 commit comments

Comments
 (0)