From 215f2676673b216dfaa5be1040d6dd844c25f63d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 8 Jul 2024 21:33:08 +0300 Subject: [PATCH] Refactor(web): "search authors" is a form; "list authors" is the result [skip ci] --- m_librarian/web/app.py | 20 +++++++++++++++++-- m_librarian/web/views/search_authors_form.py | 8 ++++---- .../web/views/search_authors_form.tmpl | 2 +- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/m_librarian/web/app.py b/m_librarian/web/app.py index 7885d46..72f9104 100644 --- a/m_librarian/web/app.py +++ b/m_librarian/web/app.py @@ -28,9 +28,25 @@ def search_authors_get(): return {} -@route('/search_authors/', method='POST') +@route('/list_authors', method='GET') +def _list_authors(): + return redirect('/list_authors/') + + +@route('/list_authors/', method='GET') +@cheetah_view('list_authors.tmpl') +def list_authors_get(): + value = request.query.get('search_authors') + if not value: + return redirect('/search_authors/') + search_type = request.query.get('search_type') + case_sensitive = request.query.get('case_sensitive') + return search_authors_raw(value, search_type, case_sensitive) + + +@route('/list_authors/', method='POST') @cheetah_view('list_authors.tmpl') -def search_authors_post(): +def list_authors_post(): value = request.forms.get('search_authors') if not value: return redirect('/search_authors/') diff --git a/m_librarian/web/views/search_authors_form.py b/m_librarian/web/views/search_authors_form.py index ab02908..78a1c36 100644 --- a/m_librarian/web/views/search_authors_form.py +++ b/m_librarian/web/views/search_authors_form.py @@ -35,10 +35,10 @@ VFN=valueForName currentTime=time.time __CHEETAH_version__ = '3.3.1' __CHEETAH_versionTuple__ = (3, 3, 1, 'final', 0) -__CHEETAH_genTime__ = 1704845598.452284 -__CHEETAH_genTimestamp__ = 'Wed Jan 10 03:13:18 2024' +__CHEETAH_genTime__ = 1720463312.154712 +__CHEETAH_genTimestamp__ = 'Mon Jul 8 21:28:32 2024' __CHEETAH_src__ = 'search_authors_form.tmpl' -__CHEETAH_srcLastModified__ = 'Wed Jan 10 03:02:59 2024' +__CHEETAH_srcLastModified__ = 'Mon Jul 8 21:28:30 2024' __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: @@ -141,7 +141,7 @@ class search_authors_form(Template): ######################################## ## START - generated method body - write(u'''
+ write(u'''
+
-- 2.39.5