Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unused admin, loan, and login templates and endpoints #9722

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 0 additions & 219 deletions openlibrary/admin/templates/admin/index.html

This file was deleted.

41 changes: 5 additions & 36 deletions openlibrary/i18n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,11 @@ msgstr ""
msgid "Forgot your Internet Archive email?"
msgstr ""

#: account/email/forgot-ia.html account/email/forgot.html forms.py login.html
#: account/email/forgot-ia.html forms.py login.html
msgid "Password"
msgstr ""

#: account/email/forgot.html login.html
#: login.html
msgid "Forgot your Password?"
msgstr ""

Expand Down Expand Up @@ -1967,7 +1967,7 @@ msgstr ""
msgid "Set my goal"
msgstr ""

#: account/email/forgot-ia.html account/email/forgot.html
#: account/email/forgot-ia.html
msgid "Forgot Your Internet Archive Email?"
msgstr ""

Expand All @@ -1977,11 +1977,11 @@ msgid ""
"your Archive.org email."
msgstr ""

#: account/email/forgot-ia.html account/email/forgot.html
#: account/email/forgot-ia.html
msgid "Your email is:"
msgstr ""

#: account/email/forgot-ia.html account/email/forgot.html
#: account/email/forgot-ia.html
msgid "Return to Log In?"
msgstr ""

Expand All @@ -1997,37 +1997,6 @@ msgstr ""
msgid "Forgot your Archive.org Password?"
msgstr ""

#: account/email/forgot.html
msgid ""
"To look up your Archive.org email, <a href=\"/account/email/forgot-"
"ia\">click here</a>."
msgstr ""

#: account/email/forgot.html
msgid "Forgot Your Open Library Email?"
msgstr ""

#: account/email/forgot.html
msgid ""
"Please enter your Open Library username and password, and we’ll retrieve "
"your email."
msgstr ""

#: account/email/forgot.html
msgid "Open Library Username"
msgstr ""

#: account/email/forgot.html
msgid "Need help updating your account email address?"
msgstr ""

#: account/email/forgot.html
msgid ""
"First login with your current email address and then follow <a "
"href=\"https://openlibrary.org/help/faq/my_account#update-email\">these "
"instructions</a> to change it to something new."
msgstr ""

#: account/password/forgot.html account/password/sent.html
msgid "Username/Password Reminder"
msgstr ""
Expand Down
63 changes: 0 additions & 63 deletions openlibrary/plugins/admin/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,68 +650,6 @@ def g(docs):
from openlibrary.plugins.upstream import borrow


class loans_admin:
def GET(self):
i = web.input(page=1, pagesize=200)

total_loans = len(web.ctx.site.store.keys(type="/type/loan", limit=100000))
pdf_loans = len(
web.ctx.site.store.keys(
type="/type/loan", name="resource_type", value="pdf", limit=100000
)
)
epub_loans = len(
web.ctx.site.store.keys(
type="/type/loan", name="resource_type", value="epub", limit=100000
)
)

pagesize = h.safeint(i.pagesize, 200)
pagecount = 1 + (total_loans - 1) // pagesize
pageindex = max(h.safeint(i.page, 1), 1)

begin = (pageindex - 1) * pagesize # pagecount starts from 1
end = min(begin + pagesize, total_loans)

loans = web.ctx.site.store.values(
type="/type/loan", offset=begin, limit=pagesize
)

stats = {
"total_loans": total_loans,
"pdf_loans": pdf_loans,
"epub_loans": epub_loans,
"bookreader_loans": total_loans - pdf_loans - epub_loans,
"begin": begin + 1, # We count from 1, not 0.
"end": end,
}

# Preload books
web.ctx.site.get_many([loan['book'] for loan in loans])

return render_template(
"admin/loans",
loans,
None,
pagecount=pagecount,
pageindex=pageindex,
stats=stats,
)

def POST(self):
i = web.input(action=None)

# Sanitize
action = None
actions = ['updateall']
if i.action in actions:
action = i.action

if action == 'updateall':
borrow.update_all_loan_status()
raise web.seeother(web.ctx.path) # Redirect to avoid form re-post on re-load


class inspect:
def GET(self, section):
if section == "/store":
Expand Down Expand Up @@ -925,7 +863,6 @@ def setup():
register_admin_page(
'/admin/attach_debugger', attach_debugger, label='Attach Debugger'
)
register_admin_page('/admin/loans', loans_admin, label='')
register_admin_page('/admin/inspect(?:(/.+))?', inspect, label="")
register_admin_page('/admin/graphs', _graphs, label="")
register_admin_page('/admin/logs', show_log, label="")
Expand Down
Loading
Loading