X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_librarian%2Fweb%2Fapp.py;h=5d9285e2254912b1f01404d9afaa4cebb41f6489;hb=ecd2349c26418c8b55ec9e0d17009321b6472236;hp=9991bb714f6fc9ea0653152f60a71929c4b2c0cd;hpb=8fdf6aab492482fcacad9ce2ec764bdc5bf76590;p=m_librarian.git diff --git a/m_librarian/web/app.py b/m_librarian/web/app.py index 9991bb7..5d9285e 100644 --- a/m_librarian/web/app.py +++ b/m_librarian/web/app.py @@ -59,11 +59,13 @@ def search_authors_post(): )] authors = search_authors(search_type, case_sensitive, {}, expressions, orderBy=('surname', 'name', 'misc_name')) + columns = get_config().getlist('columns', 'author', ['fullname']) return { 'authors': list(authors), 'search_authors': value, 'search_type': search_type, 'case_sensitive': case_sensitive, + 'columns': columns, } @@ -71,6 +73,7 @@ def search_authors_post(): @cheetah_view('books_by_author.tmpl') def books_by_author(id): use_filters = get_config().getint('filters', 'use_in_books_list', 1) + columns = get_config().getlist('columns', 'book', ['title']) if use_filters: join_expressions = [] join_expressions.append(Book.j.authors) @@ -81,6 +84,7 @@ def books_by_author(id): return { 'author': Author.get(id), 'books': books, + 'columns': columns, } else: return { @@ -88,7 +92,8 @@ def books_by_author(id): 'books': Book.select( Book.j.authors & (Author.q.id == id), orderBy=['series', 'ser_no', 'title'], - ) + ), + 'columns': columns, } @@ -106,7 +111,7 @@ def send_static(filename): @cheetah_view('download.tmpl') def download_books(): books_ids = request.forms.getall('books') - download_path = get_config().get('download', 'path') or '.' + download_path = get_config().getpath('download', 'path') if books_ids: for id in books_ids: book = Book.get(int(id)) @@ -157,9 +162,11 @@ def search_books_post(): else: books_by_author = books_by_authors[author] = [] books_by_author.append(book) + columns = get_config().getlist('columns', 'book', ['title']) return { 'books_by_author': books_by_authors, 'search_books': value, 'search_type': search_type, 'case_sensitive': case_sensitive, + 'columns': columns, }