diff --git a/.gitignore b/.gitignore index 004b085..1651a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ __pycache__/ app/uploads/** !app/uploads/cover app/mydatabase.db +pyrqlite/ +whoosh/ +sqlalchemy-rqlite/ +rqlite* diff --git a/1_Benjamin_Walter_Understanding_Brecht1.txt b/1_Benjamin_Walter_Understanding_Brecht1.txt new file mode 100644 index 0000000..e69de29 diff --git a/3_Thomas_Piketty_-_Capital_in_the_Twenty-First_Century_2014A.txt b/3_Thomas_Piketty_-_Capital_in_the_Twenty-First_Century_2014A.txt new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index d03d3bd..96085b4 100755 --- a/README.md +++ b/README.md @@ -36,3 +36,13 @@ brew install imagemagick@6 Create a symlink to this newly installed dylib file as mentioned in other answer to get things working. ln -s /usr/local/Cellar/imagemagick@6//lib/libMagickWand-6.Q16.dylib /usr/local/lib/libMagickWand.dylib +## install pyrqlite + +git clone https://github.com/rqlite/pyrqlite.git +pip install ./pyrqlite + +## install sqlalchemy-rqlite + +git clone https://github.com/rqlite/sqlalchemy-rqlite.git +cd sqlalchemy-rqlite +sudo python3 ./setup.py install diff --git a/app/__init__.py b/app/__init__.py index ceebaa6..1ecdd02 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -8,7 +8,7 @@ import os import click from werkzeug.utils import secure_filename from sqlalchemy.dialects import registry -import flask_whooshalchemyplus +# import flask_whooshalchemyplus not using whoosh anymore registry.register("rqlite.pyrqlite", "sqlalchemy_rqlite.pyrqlite", "dialect") @@ -27,9 +27,6 @@ app.config['SQLALCHEMY_DATABASE_URI'] = 'rqlite+pyrqlite://localhost:4001/' app.config['DEBUG'] = True app.config['PORT'] = 80 -# set the location for the whoosh index -app.config['WHOOSH_BASE'] = 'whoosh' - #app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'mydatabase.db') db = SQLAlchemy(app) @@ -38,5 +35,3 @@ socketio = SocketIO(app) app.config.from_object(__name__) from app import views - -flask_whooshalchemyplus.init_app(app) # initialize diff --git a/app/forms.py b/app/forms.py index 0db4fdf..c3aacd0 100755 --- a/app/forms.py +++ b/app/forms.py @@ -3,8 +3,10 @@ from wtforms import StringField, FileField, validators from wtforms.validators import InputRequired, DataRequired from wtforms import FieldList from wtforms import Form as NoCsrfForm -from wtforms.fields import StringField, FormField, SubmitField, SelectField +from wtforms.fields import StringField, FormField, SubmitField, SelectField, RadioField from app.models import Book, BookSchema, Author, Stack, StackSchema +from wtforms.fields.html5 import DecimalRangeField + # - - - Forms - - - class AuthorForm(NoCsrfForm): @@ -19,12 +21,28 @@ class UploadForm(FlaskForm): file = FileField() upload = SubmitField(label='Upload') wish = SubmitField(label='''I don't have the file, but wish I did.''') + message = StringField('message', default=None) + sameness = DecimalRangeField('sameness', default=0) + diversity = DecimalRangeField('diversity', default=0) + gender = DecimalRangeField('gender', default=50) + time = StringField('time', [validators.Length(max=5)],default=None) + choices = [('Student', 'Student'), + ('Librarian', 'Librarian'), + ('Pirate', 'Pirate'), + ('Teacher', 'Teacher'), + ('Institution', 'Institution'), + ('All of the above', 'All of the above'), + ('None of the above', 'None of the above')] + who = SelectField('', choices=choices, default='Student') + class EditForm(FlaskForm): title = StringField('title', validators=[InputRequired()]) author = FieldList(FormField(AuthorForm, default=lambda: Author()), min_entries=1) category = StringField('category', validators=[InputRequired()]) year_published = StringField('year published', [validators.Length(max=4)],default=None) + file = FileField() + message = StringField('message') class ChatForm(FlaskForm): message = StringField('message', validators=[InputRequired()]) @@ -33,6 +51,7 @@ class ChatForm(FlaskForm): class StackForm(FlaskForm): stack_name = StringField('Stack', validators=[InputRequired()]) stack_description = StringField('Description', validators=[InputRequired()]) + stack_author = StringField('Who made this', validators=[InputRequired()]) create = SubmitField(label='Create') class AddtoStackForm(FlaskForm): @@ -45,6 +64,11 @@ class EditStackForm(FlaskForm): class SearchForm(FlaskForm): choices = [('All', 'All'), ('Title', 'Title'), - ('Category', 'Category')] - select = SelectField('', choices=choices) + ('Author', 'Author'), + ('Category', 'Category'), + ('Stack', 'Stack')] + select = SelectField('', choices=choices, default='All') search = StringField('', validators=[InputRequired()]) + grid = SubmitField('Grid') + listview = SubmitField('List') + randomize = SubmitField('Order differently') diff --git a/app/models.py b/app/models.py index 57b4d49..68b7a23 100755 --- a/app/models.py +++ b/app/models.py @@ -22,7 +22,6 @@ instances = db.Table('books_instances', class Book(db.Model): __tablename__ = 'books' - __searchable__ = ['title', 'category', 'fileformat'] # these fields will be indexed by whoosh id = db.Column(db.Integer, primary_key = True) title = db.Column(db.String(255)) @@ -42,8 +41,15 @@ class Book(db.Model): backref=db.backref('books', lazy=True)) scapeX = db.Column(db.Numeric(10,2)) scapeY = db.Column(db.Numeric(10,2)) + message = db.Column(db.String(1000)) + sameness = db.Column(db.Numeric()) + diversity = db.Column(db.Numeric()) + gender = db.Column(db.Numeric()) + who = db.Column(db.String(255)) + time = db.Column(db.Numeric()) + - def __init__(self, title, file, cover, fileformat, category, year_published): + def __init__(self, title, file, cover, fileformat, category, year_published, message, sameness, diversity, gender, who, time): self.title = title self.file = file self.cover = cover @@ -53,6 +59,12 @@ class Book(db.Model): self.download = None self.scapeX = 0 self.scapeY = 0 + self.message = message + self.sameness = sameness + self.diversity = diversity + self.gender = gender + self.who = who + self.time = time def __repr__(self): @@ -107,20 +119,34 @@ class Chat(db.Model): self.message = message self.time = datetime.datetime.utcnow() - class Stack(db.Model): __tablename__ = 'stacks' id = db.Column(db.Integer, primary_key = True) stack_name = db.Column(db.String(50)) - stack_description = db.Column(db.String(500)) + stack_description = db.Column(db.String(1000)) + stack_author = db.Column(db.String(255)) + - def __init__(self, stack_name, stack_description): + def __init__(self, stack_name, stack_description, stack_author): self.stack_name = stack_name self.stack_description = stack_description + self.stack_author = stack_author def __repr__(self): return '' % self.stack_name + +class Potential(db.Model): + __tablename__ = 'potential' + id = db.Column(db.Integer, primary_key = True) + ptitle = db.Column(db.String(50)) + time = db.Column(DateTime, default=datetime.datetime.utcnow()) + + def __init__(self, ptitle): + self.ptitle = ptitle + self.time = datetime.datetime.utcnow() + + class AuthorSchema(Schema): id = fields.Int(dump_only=True) author_name = fields.Str() @@ -148,7 +174,6 @@ class BookSchema(Schema): stacks = fields.Nested(StackSchema, many=True) - def must_not_be_blank(data): if not data: raise ValidationError('You forgot to write stuff.') diff --git a/app/static/css/style.css b/app/static/css/style.css index 63d80ad..5573e85 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -1,15 +1,4 @@ @import url("../fonts/fonts_style.css"); -/* -Font-names: -junicoderegular -junicoderegularcondensed -junicodeitalic -junicodeitaliccondensed -junicodebold -junicodeboldcondensed -junicodebolditalic -junicodebolditaliccondensed -*/ *{ font-family: "Archivo Narrow"; @@ -18,6 +7,18 @@ font-family: "Archivo Narrow"; p{ font-size: 18px; + +} + +a{ + + text-decoration: none; + color: black; +} +a:hover{ + + text-decoration: underline; + color: #0000FF; } .navigation ul{ @@ -35,7 +36,7 @@ float: left; display: block; color: black; text-align: center; - padding: 14px 16px; + padding: 14px 18px; font-size: 18px; text-decoration: none; } @@ -52,14 +53,23 @@ font-style: italic; } .container{ -padding: 0px 8px; +padding: 0px 10px; } +#fileformat{ + text-align: center; +} + .lead{ font-size: 18px; +} + +.about{ +font-size: 16px; + } .library_table{ border-spacing:0; /* Removes the cell spacing via CSS */ @@ -73,6 +83,9 @@ border-spacing:0; /* Removes the cell spacing via CSS */ font-size: 20px; cursor: pointer; } +.library_table td{ +padding: 5px; +} th.headerSortUp{ background-color: #E8E8E8!important; @@ -88,7 +101,8 @@ background-color: #E8E8E8!important; .library_table .title_col{ font-size: 20px; - padding-left: 10px; + padding-left: 90px; + padding-right: 20px; } .library_table .author_col{ @@ -121,7 +135,7 @@ cursor: pointer; .header input{ height:40px; width: 500px; -font-size: 30px; +font-size: 24px; font-weight: bold; } @@ -136,10 +150,10 @@ margin: 0; float: left; width: 320px; height: 36px; -font-size: 20px; +font-size: 18px; font-weight: regular; padding: 2px; -background:rgba(50, 50, 50, 0.2); +background:rgb(240, 240, 240); border:0px; box-shadow: inset 0 0 5px rgba(000,000,000, 0.2); } @@ -150,7 +164,7 @@ font-size: 18px; padding:6px 15px; left:0px; border:0px solid #dbdbdb; -background-color: grey; +background-color: #686d72; color:#fafafa; } @@ -184,14 +198,18 @@ font-size: 12px; } .ui-tabs-vertical { width: 100em; border-top: 0;} -.ui-tabs-vertical .ui-tabs-nav { padding: .2em .2em .2em .2em; float: left; width: 15em; } -.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 0 !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; } +.ui-tabs-vertical a { text-decoration: none; color: black;} +.ui-tabs-vertical .ui-tabs-nav { padding: .2em .2em .2em .2em; float: left; width: 15em; -webkit-appearance: none;} +.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 0 !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; list-style-type: none; } .ui-tabs-vertical .ui-tabs-nav li a { display:block; } -.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 0; background-color: #A9A9A9 !important;} -.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: left; width: 50em; font-size: 12px;} -#draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; } -#droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; } +.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 0; background-color: yellow !important; list-style-type: none;} +.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: left; width: 50em; font-size: 12px; list-style-type: none;} + +#creator{ + font-size: 12px; + color: grey; +} #newstext{ width: 100%; @@ -200,7 +218,7 @@ font-size: 12px; top:0; left:0; position: fixed; - font-size: 20px; + font-size: 18px; background-color: yellow; } @@ -236,7 +254,7 @@ div.marquee > div.marquee-text { padding: 10px; margin: 0px; height: 100%; - background-color: #551A8B; + background-color: #b4b9be; overflow-y: scroll; overflow-x: hidden; color: white; @@ -273,7 +291,7 @@ z-index: 100000; margin:0px!important; padding:0px!important; height: 40px; - font-size: 20px; + font-size: 16px; word-wrap: break-word; word-break: break-all; float: left; @@ -298,7 +316,7 @@ box-sizing: border-box; margin-top: 20px; } .messages .msg{ - font-size: 30px; + font-size: 24px; margin: 0px; margin-top: -15px; margin-bottom: 10px; @@ -312,9 +330,11 @@ box-sizing: border-box; .widget { resize: both; overflow: hidden; - width: 300px; - height: 300px; + width: 800px; + height: 200px; display: inline-block; + position: relative; + left: 400px; } @@ -324,3 +344,77 @@ box-sizing: border-box; height: 100%; border: none; } + +.grid { + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr; + grid-gap: 2px; + align-items: top; + justify-items: center; +} + +@media screen and (max-width: 900px) { +.grid{ + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + grid-gap: 2px; + align-items: top; + justify-items: center; +} +} +@media screen and (max-width: 400px) { +.grid{ + display: grid; + grid-template-columns: 1fr; + align-items: center; + justify-items: center; +} +} + +.gridbox { + display: inline-block; + padding-left: 5px; + align-items: center; + justify-items: center; +} +.gridbox:hover{ + opacity: 0.5; +} + +/* The Modal (background) */ +.modal { + display: none; /* Hidden by default */ + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + left: 0; + top: 0; + width: 100%; /* Full width */ + height: 100%; /* Full height */ + overflow: auto; /* Enable scroll if needed */ + background-color: rgb(0,0,0); /* Fallback color */ + background-color: rgba(0,0,0,0.5); /* Black w/ opacity */ +} + +/* Modal Content/Box */ +.modal-content { + background-color: yellow; + margin: 15% auto; /* 15% from the top and centered */ + padding: 15px; + border: 1px solid #888; + width: 40%; /* Could be more or less, depending on screen size */ +} + +/* The Close Button */ +.close { + color: grey; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: red; + text-decoration: none; + cursor: pointer; +} diff --git a/app/static/img/default_cover.gif b/app/static/img/default_cover.gif new file mode 100644 index 0000000..500390c Binary files /dev/null and b/app/static/img/default_cover.gif differ diff --git a/app/static/js/app.js b/app/static/js/app.js index b920178..1fef356 100755 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -209,4 +209,30 @@ $(document).ready(function() this.value = terms.join( " " ); return false; } - }); +}); + +// Get the modal +var modal = document.getElementById('myModal'); + +// Get the button that opens the modal +var btn = document.getElementById("myBtn"); + +// Get the element that closes the modal +var span = document.getElementsByClassName("close")[0]; + +// When the user clicks on the button, open the modal +btn.onclick = function() { + modal.style.display = "block"; +} + +// When the user clicks on (x), close the modal +span.onclick = function() { + modal.style.display = "none"; +} + +// When the user clicks anywhere outside of the modal, close it +window.onclick = function(event) { + if (event.target == modal) { + modal.style.display = "none"; + } +} diff --git a/app/templates/about.html b/app/templates/about.html index 802a4dc..67aae18 100755 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -2,12 +2,29 @@ {% block main %}

About

-

+

XPPL is a project aimed at people who are studying the field of media culture, or as we like to call them: knowledge comrades.
-This digital library gathers all the books and articles floating around on PZI shelves and our hard drives and memory sticks, so that they can be shared. +
+This digital library gathers all the books and articles floating around on the shelves of the Piet Zwart Institute, and our hard drives and memory sticks, so that they can be shared, annotated and grouped together into stacks... +

Its web interface hosts a curated catalogue of books and articles, and its distributed architecture provides instances for uploading and downloading. +

It starts at XPUB, but can go anywhere we want it to.

+ + +

What's the deal with the stacks?

+

+ A stack is a number of books that are read at a certain point in time, alternating between them. They usually have a topic in common, or follow a certain study path that can bring you to a point of knowledge. Rather than a bookshelf, where books are lined up and often forgotten, the stack on your table/nightstand/toilet consists of books prone to be opened and reopened at any time. +

+ +

Who's behind this?

+

+We're Angeliki, Alex, Alice, Joca, Natasha and Zalán, helped and supported by Femke, Aymeric, Michael, Steve, Andre, Leslie and many more. +
+
+XPUB is a study path within the Piet Zwart Institute masters program. +

{% endblock %} diff --git a/app/templates/add_book.html b/app/templates/add_book.html index c01dc37..6326174 100755 --- a/app/templates/add_book.html +++ b/app/templates/add_book.html @@ -1,7 +1,24 @@ {% extends 'base.html' %} {% block main %} -
+{% from "_formhelpers.html" import render_field %} + + + + +
+
+

Add Book

{% with messages = get_flashed_messages() %} {% if messages %} @@ -16,11 +33,10 @@ {% endwith %}
{{ form.csrf_token }} -
{{ form.title.label }} {{ form.title(size=20, class="form-control") }}
+
Title:*
{{ form.title (size=50, class="form-control") }}

- {{ form.author.label }} + Author(s):* @@ -28,21 +44,91 @@ {% for author in form.author %} - + {% endfor %}
{{ author.author_name }}{{ author.author_name (size=50)}}

-
{{ form.category.label }} {{ form.category(size=20, class="form-control") }}
+ Category:*
{{ form.category(size=50, class="form-control") }}

+ Year published:
{{ form.year_published(size=8, class="form-control") }}

+ +How different is this item to the rest of the collection? +Or is it more of the same?
+{{ form.sameness(min=0, max=100, oninput="outputUpdate(value)") }}   +{{ form.sameness.data }} % different + +


+ +Check the bibliography. How diverse are the references in this book?
+{{ form.diversity(min=0, max=100, oninput="outputUpdate2(value)") }}   +{{ form.diversity.data }} % diverse + +


+ +Check the writing. Who is speaking? Is the voice more often male or female?
+{{ form.diversity(min=1, max=100, oninput="outputUpdate3(value)") }}   +{{ form.gender.data }} % female + +


+Who are you? {{ render_field(form.who) }} + +


+How much time have you spent with this item? +Include the time spent looking for it, and uploading it.
+{{ form.time (size = 50, class="form-control")}} hours
-
{{ form.year_published.label }} {{ form.year_published(size=4, class="form-control") }}
+


+ +
+ Add a message for future readers: {{ form.message(size=90, class="form-control") }} +

{{ form.file }} {{ form.upload }} {{ form.wish }} + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Titles: {{ books_all }}
Authors: {{ authors_all }}
Categories: {{ categories|replace('[', '')|replace(']', '') }}
Stacks: {{ stacks_all|replace('[', '')|replace(']', '') }}
From the years: {{earliest}} –– {{latest}}
Gaps in the collection: At least {{ books_potential }} potential books missing
+
+ {% endblock %} diff --git a/app/templates/add_stack.html b/app/templates/add_stack.html index 0fe1e5f..c960eb3 100644 --- a/app/templates/add_stack.html +++ b/app/templates/add_stack.html @@ -16,14 +16,14 @@ {% endif %} - {% endwith %} + {% endwith %}
{{form.hidden_tag()}}
{{ render_field(form.stack_name)}} {{ render_field(form.stack_description)}} - +{{ render_field(form.stack_author)}} diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html index c2ed248..2e7ab09 100644 --- a/app/templates/add_to_stacks.html +++ b/app/templates/add_to_stacks.html @@ -6,7 +6,7 @@
Chosen book:

{{ book.title }}

- +

These are all the stacks that have been built so far.

diff --git a/app/templates/edit_book_detail.html b/app/templates/edit_book_detail.html index c936ff4..2fa5268 100755 --- a/app/templates/edit_book_detail.html +++ b/app/templates/edit_book_detail.html @@ -7,12 +7,12 @@ - + {{ form.csrf_token }}

{{ form.title.label }} {{ form.title(size=20, class="form-control") }}

- +

@@ -31,11 +31,23 @@ {% endfor %}

-
- {{ form.category.label }} {{ form.category(size=20, class="form-control") }} -

-
- {{ form.year_published.label }} {{ form.year_published(size=4, class="form-control") }} +
+ Category: {{ form.category(size=20, + class="form-control") }} +
+
+ Year published: {{ form.year_published(size=8, class="form-control") }} +
+
+ Current file: {{ book.file }} +
+
+ Upload new file: {{form.file}} +
+
+ + If uploading, write a new message: {{form.message(size=150, class="form-control") }} +

diff --git a/app/templates/header.html b/app/templates/header.html index 52f22d4..0d8b33d 100755 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -4,6 +4,7 @@
  • Catalogue
  • Stacks
  • Add Book
  • +
  • Add Stack
  • About
  • Instances
  • diff --git a/app/templates/potential_pdf.html b/app/templates/potential_pdf.html new file mode 100644 index 0000000..866acec --- /dev/null +++ b/app/templates/potential_pdf.html @@ -0,0 +1,43 @@ + + + + + + + + + + + XPPL + + +
    +

    A Potential PDF

    + +

    Every book ever requested in the XPPL library:

    +
    +

    {% for pbook in pbooks %}"{{ pbook.ptitle }}" requested on: {{ pbook.time|string|truncate(17,true," ")}} +

    {% endfor %} +
    +
    +
    +   ,   ,
    +  /////|
    + ///// |
    +|~~~|  |
    +|===|  |
    +|x  |  |
    +| p |  |
    +|p l| /
    +|===|/
    +'---'
    +
    + + +
    +
    + diff --git a/app/templates/red_link.html b/app/templates/red_link.html index 43a331a..22f101d 100755 --- a/app/templates/red_link.html +++ b/app/templates/red_link.html @@ -1,18 +1,14 @@ {% extends "base.html" %} -{% block title %}Red link page{% endblock %} {% block css %} {% endblock %} -{% block header %}{% endblock %} - {% block main %} -

    We don't have any results for: {{ title }}

    -

    upload?

    -

    go back home?

    - - +

    Nothing in the library yet with: {{ title }}

    +
    -

    Add Book

    {% with messages = get_flashed_messages() %} {% if messages %}
    @@ -42,12 +32,19 @@
    {% endif %} {% endwith %} +
    + +
    +
    +
    +

    Add this book:

    + {{ form.csrf_token }} -
    {{ form.title.label }} {{ form.title(size=20, class="form-control") }}
    +
    Title: {{ form.title (size=34, class="form-control") }}

    - {{ form.author.label }} @@ -56,17 +53,83 @@ {% for author in form.author %} - + {% endfor %}
    {{ author.author_name }}{{ author.author_name (size=40)}}
    +
    +
    + Category: {{ form.category(size=27, class="form-control") }} +
    +
    + Year published: {{ form.year_published(size=8, class="form-control") }} +

    -
    {{ form.category.label }} {{ form.category(size=20, class="form-control") }}
    {{ form.file }} {{ form.upload }} {{ form.wish }} +
    +

    go back home

    +
    +
    +
    +

    More potential books

    + + + + + + + + + + + + + + {% for book in books %} + + + + + + + + + + + + {% endfor %} + +
    + + + + {{ book.title }} {% for author in book.authors %} + +
  • {{ author.author_name }}
  • + + {% endfor %}
    {{ book.year_published }}{{ book.category}} + {% for stack in book.stacks %} + +
  • + + {{ stack.stack_name }} +
  • + + {% endfor %} + + +
    + + ===> +
    + {% endblock %} diff --git a/app/templates/results.html b/app/templates/results.html index aa1acf7..296dc8e 100644 --- a/app/templates/results.html +++ b/app/templates/results.html @@ -1,18 +1,24 @@ {% extends 'base.html' %} {% block main %} -
    {% from "_formhelpers.html" import render_field %}
    {{ form.select(style="width: 100px; margin: 10px; float: left; font-size: 20px") }}
    - -
    - -
    -

    Search Results for: {{ query }}

    + +


    + {{ form.grid(style="font-size:20px")}}{{ form.listview(style="font-size:20px")}}

    + +
    + +
    +

    Results: "{{ query }}" included in {{ count }} out of {{ whole }} items

    +
    +
    +
    +
    {% with messages = get_flashed_messages() %} {% if messages %}
    @@ -25,20 +31,21 @@ {% endif %} {% endwith %} - +
    - + - - - - - + + + + + {% for book in books %} - + - + - - - {% endfor %} + {% endfor %} +
    + {{ book.title }} {% for author in book.authors %} @@ -46,40 +53,40 @@
  • {{ author.author_name }}
  • {% endfor %}
    {{ book.fileformat }}{{ book.year_published or '––'}} {{ book.category}} {% for stack in book.stacks %}
  • {{ stack.stack_name }}
  • {% endfor %}
    + ==>
    +
    -
    -
    -

    Other books

    +
    +

    More books

    - + - - - - - + + + + + {% for book in books_all %} - + - + - + {% endfor %}
    {{ book.title }} {% for author in book.authors %} @@ -87,16 +94,18 @@
  • {{ author.author_name }}
  • {% endfor %}
    {{ book.fileformat }}{{ book.year_published or '––'}} {{ book.category}} {% for stack in book.stacks %}
  • {{ stack.stack_name }}
  • - {% endfor %} + {% endfor %} +
    + ==>

    diff --git a/app/templates/results_grid.html b/app/templates/results_grid.html new file mode 100644 index 0000000..228f7db --- /dev/null +++ b/app/templates/results_grid.html @@ -0,0 +1,87 @@ +{% extends 'base.html' %} + +{% block main %} +

    + {% from "_formhelpers.html" import render_field %} +
    +
    {{ form.select(style="width: 100px; margin: 10px; float: left; font-size: 20px") }}
    + + +


    + {{ form.grid(style="font-size:20px")}}{{ form.listview(style="font-size:20px")}}

    +
    +
    + +
    +

    Results: "{{ query }}" included in {{ count }} out of {{ whole }} items

    +
    +
    +
    +
    + {% with messages = get_flashed_messages() %} + {% if messages %} +
    +
      + {% for message in messages %} +
    • {{ message }}
    • + {% endfor %} +
    +
    + {% endif %} + {% endwith %} +
    + + {% for book in books|sort(attribute='title', reverse = False) %} + + +
    + + +

    + + +{{ book.title }} ({{ book.year_published or '?' }}) +
    + +{% for author in book.authors %} +{{ author.author_name }}
    {% endfor %}
    + +

    +
    + {% endfor %} +
    + +
    +

    More books

    + +
    + +{% for book in books_all|sort(attribute='title', reverse = False) %} + +
    + + +

    + + +{{ book.title }} ({{ book.year_published or '?' }}) +
    + +{% for author in book.authors %} +{{ author.author_name }}
    {% endfor %}
    + +

    +
    + {% endfor %} +
    +
    + + +

    + See all books +

    + +
    + +{% endblock %} diff --git a/app/templates/scape.html b/app/templates/scape.html index 96848b2..3adea7a 100644 --- a/app/templates/scape.html +++ b/app/templates/scape.html @@ -3,7 +3,7 @@ - +