From 90b8585027a43a134fe8732fa89d778298731605 Mon Sep 17 00:00:00 2001 From: Jocavdh Date: Wed, 13 Jun 2018 16:57:31 +0200 Subject: [PATCH 1/4] CSS for autocomplete extracted from jquery-ui css and included in general css --- app/static/css/style.css | 60 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/app/static/css/style.css b/app/static/css/style.css index a6191f4..06ad59b 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -176,6 +176,64 @@ background-color:red; color: #fafafa; } +.ui-autocomplete { +position: absolute; +top: 100%; +left: 0; +z-index: 1000; +float: left; +display: none; +min-width: 160px; +padding: 4px 0; +margin: 0 0 10px 25px; +list-style: none; +background-color: #ffffff; +border-color: #ccc; +border-color: rgba(0, 0, 0, 0.2); +border-style: solid; +border-width: 1px; +-webkit-border-radius: 5px; +-moz-border-radius: 5px; +border-radius: 5px; +-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +-webkit-background-clip: padding-box; +-moz-background-clip: padding; +background-clip: padding-box; +*border-right-width: 2px; +*border-bottom-width: 2px; +} + +.ui-menu-item > a.ui-corner-all { +display: block; +padding: 3px 15px; +clear: both; +font-weight: normal; +line-height: 18px; +color: #555555; +white-space: nowrap; +text-decoration: none; +} + +.ui-menu-item { + margin: 3px 15px; +} + +.ui-state-hover, .ui-state-active { +color: #ffffff; +text-decoration: none; +background-color: #0088cc; +border-radius: 0px; +-webkit-border-radius: 0px; +-moz-border-radius: 0px; +background-image: none; +} + +.ui-helper-hidden-accessible { + display: none; +} + .footer{ @@ -489,4 +547,4 @@ nav { font-size: .7em } @page { size: A5; margin: 1cm } @media print { nav { display: none } -} \ No newline at end of file +} From be4142601842bd7183c93677fa7b7797cfc48bdb Mon Sep 17 00:00:00 2001 From: nberting Date: Wed, 13 Jun 2018 18:17:59 +0200 Subject: [PATCH 2/4] fixed light=light missing in some routes --- app/templates/about.html | 2 +- app/templates/show_book_detail.html | 8 +++----- app/views.py | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/templates/about.html b/app/templates/about.html index d57fb58..8ed8990 100755 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -13,7 +13,7 @@ This digital library gathers all the books and articles floating around on the s It starts at XPUB, but can go anywhere we want it to.

-Are you interested in how this library works? Have a look at the source code in our git. +Are you interested in how this library works? Have a look at the source code in our git.

What's the deal with the stacks?

diff --git a/app/templates/show_book_detail.html b/app/templates/show_book_detail.html index 93438c3..b381c99 100755 --- a/app/templates/show_book_detail.html +++ b/app/templates/show_book_detail.html @@ -109,7 +109,7 @@

{%endif%} - +{%if res %}

Annotations for {{book.title}}:

{% for row in res%} @@ -128,6 +128,8 @@ {% endif %} {% endfor %} +{%else%}
No annotations yet for this book
+{%endif%}

{% if previousbook %} @@ -137,8 +139,4 @@ - - - - {% endblock %} diff --git a/app/views.py b/app/views.py index 3160d42..3687aee 100755 --- a/app/views.py +++ b/app/views.py @@ -111,14 +111,14 @@ def annotations(): # id = book.id annot = get_annotations() print(annot) - return render_template('annotations.html', annot=annot, books=books) + return render_template('annotations.html', annot=annot, books=books, light=light) # PDF from annotations @app.route('/annotations.pdf') def annotations_pdf(): annot = get_annotations() # Make a PDF straight from HTML in a string. - html = render_template(('annotations.html'), annot=annot) + html = render_template(('annotations.html'), annot=annot, light=light) return render_pdf(HTML(string=html)) @app.route('/viewpdf/') @@ -204,7 +204,7 @@ def show_book_by_id(id): if not book: return render_template('red_link.html', id=id, light=light) else: - return render_template('show_book_detail.html', book=book, previousbook = previousbook, nextbook = nextbook, all_instances=all_instances, name=name, annot=annot, res=res) + return render_template('show_book_detail.html', book=book, previousbook = previousbook, nextbook = nextbook, all_instances=all_instances, name=name, annot=annot, res=res, light=light) From 74db0e3a574a51d8a73655334ffb617daea943e8 Mon Sep 17 00:00:00 2001 From: nberting Date: Wed, 13 Jun 2018 19:33:27 +0200 Subject: [PATCH 3/4] got rid of id in import_csv --- app/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views.py b/app/views.py index 3687aee..c552b7d 100755 --- a/app/views.py +++ b/app/views.py @@ -762,7 +762,7 @@ def import_csv(): name, file_extension = os.path.splitext(row['file']) print ('get_cover', fullpath, name) cover = get_cover(fullpath, name) - file = str(id) + "_" + row['file'] + file = row['file'] if row['year_published']: year_published = int(row['year_published']) From e158a23f4e3423c0e795f65a5a1109c05332dd7d Mon Sep 17 00:00:00 2001 From: nberting Date: Wed, 13 Jun 2018 19:37:13 +0200 Subject: [PATCH 4/4] latest upload >> latest entry --- app/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views.py b/app/views.py index c552b7d..6b78eaa 100755 --- a/app/views.py +++ b/app/views.py @@ -136,7 +136,7 @@ def get_updates(): allbooks = db.session.query(Book).all() id = len(allbooks) latest_upload = allbooks[-1] - return "This is the XPPL ~ Library XPUB ~ Updates / / / / / / / Last viewed: " + userin.info + " / / / / / / / " + str(len(allbooks)) + " Books online "+ " / / / / / / / " + "Latest upload: " + latest_upload.title + return "This is the XPPL ~ Library XPUB ~ Updates / / / / / / / Last viewed: " + userin.info + " / / / / / / / " + str(len(allbooks)) + " Books online "+ " / / / / / / / " + "Latest entry: " + latest_upload.title @app.route('/scape', methods=['POST', 'GET']) def scape():