Browse Source

Merge branch 'master' of git.xpub.nl:/var/www/git.xpub.nl/repos/xpub-lib

ansible-setup-and-deploy
ange 6 years ago
parent
commit
822747f428
  1. 60
      app/static/css/style.css
  2. 2
      app/templates/about.html
  3. 8
      app/templates/show_book_detail.html
  4. 10
      app/views.py

60
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 }
}
}

2
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.
<br>
<br>
Are you interested in how this library works? Have a look at the source code in <a href 'https://git.xpub.nl/xpub-lib/log.html'> our git. </a>
Are you interested in how this library works? Have a look at the source code in <a href= 'https://git.xpub.nl/xpub-lib/log.html'> our git. </a>
</p>
<h2> What's the deal with the stacks? </h2>
<p class='about'>

8
app/templates/show_book_detail.html

@ -109,7 +109,7 @@
<br><br>
{%endif%}
{%if res %}
<div style="padding-bottom:20px;">
<h2>Annotations for <i>{{book.title}}</i>:</h4>
{% for row in res%}
@ -128,6 +128,8 @@
{% endif %}
{% endfor %}
{%else%}<div style="padding-bottom:50px;"><i> No annotations yet for this book </i></div>
{%endif%}
</div>
<hr>
{% if previousbook %}
@ -137,8 +139,4 @@
</div>
{% endblock %}

10
app/views.py

@ -113,14 +113,14 @@ def annotations():
rstr=('http://' + server+'/uploads/','')
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('/myannotations.pdf')
@ -149,7 +149,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():
@ -217,7 +217,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)
@ -776,7 +776,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'])

Loading…
Cancel
Save