From 720e8d84690379e74088aa94e92002b4ef510c75 Mon Sep 17 00:00:00 2001 From: Jocavdh Date: Sun, 3 Jun 2018 16:36:43 +0200 Subject: [PATCH 01/15] Autocomplete for search on the books page. Code is functional, prints to console now. Need to fix the css on the front end still Required libraries added to the pip requirements file. --- app/static/js/app.js | 96 ++++++++++++++++++++++++++++++++++++++++++++ app/views.py | 26 +++++++++++- requirements.txt | 2 + 3 files changed, 123 insertions(+), 1 deletion(-) diff --git a/app/static/js/app.js b/app/static/js/app.js index 5236b0f..460c9ee 100755 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -157,3 +157,99 @@ $(document).ready(function() } ); + +// Autocomplete for search - Contact Joca in case of trouble + +$('#search').on("input", function() { + var query = this.value; + + + $.ajax({ + url: "/autocomplete_suggestions", + data: $('form').serialize(), + type: "POST", + success: function(response) { + //console.log("Got your query!"); + } + }); + + function getData() { + var deferredData = new jQuery.Deferred(); + + $.ajax({ + type: "GET", + url: "/autocomplete_suggestions", + dataType: "json", + success: function(data) { + deferredData.resolve(data); + } + }); + return deferredData; // contains the passed data + }; + + var dataDeferred = getData(); + + $.when(dataDeferred).done( function( data ) { + var suggestion_list = data; + console.log(suggestion_list); + $().ready(function() { + // search only, if the regexp matches + var suggestions = data; + + // Defines for the example the match to take which is any word (with Umlauts!!). + function _leftMatch(string, area) { + //return string.substring(0, area.selectionStart).match(/[\wäöüÄÖÜß]+$/) + //console.log(string.substring(string.lastIndexOf(" ")+1).match(/[\wäöüÄÖÜß]+$/)) + return string.substring(string.lastIndexOf(" ")+1).match(/[\wäöüÄÖÜß]+$/) + + } + + function _setCursorPosition(area, pos) { + if (area.setSelectionRange) { + area.setSelectionRange(pos, pos); + } else if (area.createTextRange) { + var range = area.createTextRange(); + range.collapse(true); + range.moveEnd('character', pos); + range.moveStart('character', pos); + range.select(); + } + } + + + + $("#search").autocomplete({ + position: { my : "right top", at: "right bottom" }, + source: function(request, response) { + var str = _leftMatch(request.term, $("#search")[0]); + str = (str != null) ? str[0] : ""; + console.log(str); + response($.ui.autocomplete.filter( + suggestions, str)); + }, + minLength: 1, // does have no effect, regexpression is used instead + focus: function() { + // prevent value inserted on focus + return false; + }, + // Insert the match inside the ui element at the current position by replacing the matching substring + select: function(event, ui) { + //alert("completing "+ui.item.value);}, + var m = _leftMatch(this.value, this)[0]; + var beg = this.value.substring(0, this.selectionStart - m.length); + this.value = beg + ui.item.value + this.value.substring(this.selectionStart, this.value.length); + var pos = beg.length + ui.item.value.length; + _setCursorPosition(this, pos); + return false; + }, + search:function(event, ui) { + var m = _leftMatch(this.value, this); + return (m != null ) + } + + }); + }) + + }); + +}); diff --git a/app/views.py b/app/views.py index ba0c01c..768342a 100755 --- a/app/views.py +++ b/app/views.py @@ -6,7 +6,7 @@ This file creates your application. """ from app import app, db, socketio, DOMAIN -from flask import Flask, render_template, request, redirect, url_for, flash, send_from_directory, jsonify, abort +from flask import Flask, Response, render_template, request, redirect, url_for, flash, send_from_directory, jsonify, abort import json from sqlalchemy.sql.expression import func, select from app.forms import UploadForm, EditForm, SearchForm, ChatForm @@ -16,6 +16,8 @@ from os import environ from flask_socketio import SocketIO, emit import datetime import time +import autocomplete +import sys import os from werkzeug.utils import secure_filename @@ -308,6 +310,28 @@ def search_results(searchtype, query): return render_template('results.html', form=search, books=results, books_all=random_order, searchtype=search.select.data, query=query) +## Search - autocomplete +autocomplete_suggestions = [] + +@app.route('/autocomplete_suggestions', methods=['GET', 'POST']) +def test1(): + if request.method == 'POST': + autocomplete.load() + query = request.form['search'] + query_tokenized = query.lower().split() + print(query_tokenized) + word_1 = query_tokenized[-2] + word_2 = query_tokenized[-1] + #print(word_1) + autocomplete_output = autocomplete.predict(word_1 , word_2) + autocomplete_suggestions.clear() + for suggestion, score in autocomplete_output: + autocomplete_suggestions.append(suggestion) + + print(autocomplete_suggestions) + + return Response(json.dumps(autocomplete_suggestions), mimetype='application/json') + ### # The API diff --git a/requirements.txt b/requirements.txt index a4faeb4..4af1a1c 100755 --- a/requirements.txt +++ b/requirements.txt @@ -16,4 +16,6 @@ WTForms==2.1 flask-marshmallow==0.9.0 Wand==0.4.4 PyPDF2==1.26.0 +autocomplete==0.0.104 + From cc191859bd18c479513e20e12175a04e0acefdba Mon Sep 17 00:00:00 2001 From: Alice Date: Sun, 3 Jun 2018 14:01:59 +0200 Subject: [PATCH 02/15] test commit --- app/forms.py | 7 ++++-- app/templates/show_stack_detail.html | 5 ++-- app/templates/show_stacks.html | 27 +++++++-------------- app/views.py | 35 +++++++++++++++++++++++++++- import_csv.py | 2 +- xpublibrary.csv | 3 +-- 6 files changed, 51 insertions(+), 28 deletions(-) diff --git a/app/forms.py b/app/forms.py index e3b74cc..f652c5c 100755 --- a/app/forms.py +++ b/app/forms.py @@ -4,7 +4,7 @@ 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 app.models import Book, BookSchema, Author +from app.models import Book, BookSchema, Author, Stack, StackSchema # - - - Forms - - - class AuthorForm(NoCsrfForm): @@ -25,11 +25,14 @@ class EditForm(FlaskForm): 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) - class ChatForm(FlaskForm): message = StringField('message', validators=[InputRequired()]) send = SubmitField(label='Send') +class StackForm(FlaskForm): + stack_name = StringField('Stack', validators=[InputRequired()]) + stack_description = StringField('Description', validators=[InputRequired()]) + create = SubmitField(label='Create') class SearchForm(FlaskForm): choices = [('All', 'All'), diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 816bbc2..8cee949 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -1,4 +1,3 @@ -{% extends 'base.html' %} {% block main %}
@@ -9,7 +8,7 @@

Stack description: {% for stack in stacks %} - {{stack.stack_description}} + {{ stack.stack_description }} {% endfor %}

@@ -22,7 +21,7 @@

- +

Go back to stacks

{% endblock %} diff --git a/app/templates/show_stacks.html b/app/templates/show_stacks.html index 27a01ce..613f971 100644 --- a/app/templates/show_stacks.html +++ b/app/templates/show_stacks.html @@ -7,36 +7,25 @@ - -
- -
-

Stack description

-

This stack is nice.

-
- +
+

Build a stack

+

Add Stack

+

List of books

diff --git a/app/views.py b/app/views.py index 768342a..2d04837 100755 --- a/app/views.py +++ b/app/views.py @@ -9,7 +9,7 @@ from app import app, db, socketio, DOMAIN from flask import Flask, Response, render_template, request, redirect, url_for, flash, send_from_directory, jsonify, abort import json from sqlalchemy.sql.expression import func, select -from app.forms import UploadForm, EditForm, SearchForm, ChatForm +from app.forms import UploadForm, EditForm, SearchForm, ChatForm, StackForm from app.models import Book, BookSchema, Author, AuthorSchema, Stack, StackSchema, UserIns, Chat, ChatSchema from app.cover import get_cover from os import environ @@ -263,6 +263,39 @@ def show_stacks(): stacks = db.session.query(Stack).all() return render_template('show_stacks.html', stacks=stacks) +@app.route('/stacks/add_stack', methods=['POST', 'GET']) +def add_stack(): + form = StackForm() + stacks = db.session.query(Stack).all() + #if request.method == 'GET': + # return render_template('add_stack.html', stacks=stacks, form=form) + if request.method == 'POST': + stack_name = form.stack_name.data + stack_description = form.stack_description.data + stack = Stack(stack_name, stack_description) + if form.stack_name.data: + stack = Stack(stack_name, stack_description) + db.session.add(stack) + stacks = db.session.query(Stack).all() +#this potentially deals with the connection between books and stacks + #book = Book(title, filename, cover, file_extension, category,year_published) + + #for book in books: + # book_title = book.get("title") + + # if book_title: + # a = db.session.query(Book).filter_by(book_title=book_title).first() + # if a == None: + # a = Book(book_title=book_title) + # db.session.add(a) + # stacks.book.append(a) + #db.session.commit() + + flash("%s stack created" % (stack_name)) + return render_template('add_stack.html', stacks=stacks, form=form) + + + @app.route('/stacks/', methods=['POST', 'GET']) def show_stack_by_id(id): stack = Stack.query.get(id) diff --git a/import_csv.py b/import_csv.py index b0a178e..e3dd830 100644 --- a/import_csv.py +++ b/import_csv.py @@ -20,7 +20,7 @@ with open(args.csv) as f: print ('get_cover', fullpath, name) cover = get_cover(fullpath, name) - book = Book(row['Title'], row['Filename'], cover, row['Format'], row['Shelf'], None) + book = Book(row['Title'], row['Filename'], cover, row['Format'], row['Category'], None) db.session.add(book) authors = row['Author'].split(',') diff --git a/xpublibrary.csv b/xpublibrary.csv index acd4299..54f8003 100644 --- a/xpublibrary.csv +++ b/xpublibrary.csv @@ -1,5 +1,4 @@ -Title,Author,Shelf,Format,OCR,Downloaded,Origin,Filename,Stack -Mac OS X Leopard Edition,David Pogue,Technical,pdf,1,1,LibGen,, +Title,Author,Category,Format,OCR,Downloaded,Origin,Filename,Stack The Qmail Handbook,Dave Sill,Technical,pdf,1,1,LibGen,, Hardening Network Infrastructure: Bulletproof Your Systems Before You Are Hacked!,Wes Noonan,Technical,"chm, pdf",1,1,LibGen,,Make a library Cocoa Programming for Mac OS X Second Edition,Aaron Hillegaas,Technical,pdf,1,1,LibGen,, From ba58a895fb7ab1196238773fc156f17b5896578d Mon Sep 17 00:00:00 2001 From: Alice Date: Sun, 3 Jun 2018 16:30:16 +0200 Subject: [PATCH 03/15] added description next to each stack tab --- app/templates/show_stack_detail.html | 9 ++------- app/templates/show_stacks.html | 3 +-- app/views.py | 11 +++++++++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 8cee949..1fc8779 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -1,3 +1,4 @@ +{% extends 'base.html' %} {% block main %}
@@ -5,13 +6,7 @@

{{ stack.stack_name }}

-

Stack description: -{% for stack in stacks %} - - {{ stack.stack_description }} - -{% endfor %} -

+

Stack description: {{ stack.stack_description }}

Books in this stack: {% for book in stack.books %}

  • {{book.title}}
  • diff --git a/app/templates/show_stacks.html b/app/templates/show_stacks.html index 613f971..898fa10 100644 --- a/app/templates/show_stacks.html +++ b/app/templates/show_stacks.html @@ -11,8 +11,7 @@
      {% for stack in stacks %} - -
    • {{ stack.stack_name }} +
    • {{ stack.stack_name }} diff --git a/app/views.py b/app/views.py index 2d04837..37598db 100755 --- a/app/views.py +++ b/app/views.py @@ -294,15 +294,22 @@ def add_stack(): flash("%s stack created" % (stack_name)) return render_template('add_stack.html', stacks=stacks, form=form) +@app.route('/stacks/tab/', methods=['POST', 'GET']) +def show_stack_in_tab(id): + return show_stack_by_id(id, is_tab=True) @app.route('/stacks/', methods=['POST', 'GET']) -def show_stack_by_id(id): +def show_stack_by_id(id, is_tab=False): + stack = Stack.query.get(id) if not stack: abort (404) else: - return render_template('show_stack_detail.html', stack=stack) + if is_tab == False: + return render_template('show_stack_detail.html', stack=stack) + else: + return render_template('show_stack_detail_tab.html', stack=stack) ## search From 11f82645bf4a2cc1f35c5a39c1bdc783272777ea Mon Sep 17 00:00:00 2001 From: Alice Date: Sun, 3 Jun 2018 18:50:05 +0200 Subject: [PATCH 04/15] edited css of tabs --- app/static/css/style.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/static/css/style.css b/app/static/css/style.css index 023daa4..35ad7b1 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -177,11 +177,11 @@ font-size: 12px; } .ui-tabs-vertical { width: 55em; } -.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; } -.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; } +.ui-tabs-vertical .ui-tabs-nav { padding: .2em .2em .2em .2em; float: left; width: 12em; } +.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 .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: 1px; } -.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;} +.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 0; background-color: #EEC2C2} +.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: left; width: 40em; 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; } From 7beca18eb7fb0dab1bea82933bd43f29f880133f Mon Sep 17 00:00:00 2001 From: Alice Date: Sun, 3 Jun 2018 23:33:16 +0200 Subject: [PATCH 05/15] added add to stack first part --- app/forms.py | 3 ++ app/static/css/style.css | 7 ++++ app/templates/add_stack.html | 36 +++++++++++++++++++ app/templates/add_to_stacks.html | 44 ++++++++++++++++++++++++ app/templates/show_books.html | 14 +++++++- app/templates/show_stack_detail_tab.html | 18 ++++++++++ app/views.py | 13 +++++-- 7 files changed, 131 insertions(+), 4 deletions(-) create mode 100644 app/templates/add_stack.html create mode 100644 app/templates/add_to_stacks.html create mode 100644 app/templates/show_stack_detail_tab.html diff --git a/app/forms.py b/app/forms.py index f652c5c..5db22e4 100755 --- a/app/forms.py +++ b/app/forms.py @@ -34,6 +34,9 @@ class StackForm(FlaskForm): stack_description = StringField('Description', validators=[InputRequired()]) create = SubmitField(label='Create') +class AddtoStackForm(FlaskForm): + select = SelectField('Stacks', validators=[InputRequired()]) + class SearchForm(FlaskForm): choices = [('All', 'All'), ('Title', 'Title'), diff --git a/app/static/css/style.css b/app/static/css/style.css index 35ad7b1..e91c4a7 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -97,10 +97,17 @@ background-color: #E8E8E8!important; .library_table li{ list-style-type:none; +text-align: center; padding-right: 5px; display: inline-block; } +#plus { + text-align: center; + font-size: 10px; +} + + .library_table tr:nth-child(even){ background-color: #fafafa; } diff --git a/app/templates/add_stack.html b/app/templates/add_stack.html new file mode 100644 index 0000000..9638f91 --- /dev/null +++ b/app/templates/add_stack.html @@ -0,0 +1,36 @@ +{% extends 'base.html' %} + +{% block main %} +
      + + + +
      + {{form.hidden_tag()}} +
      +{{ render_field(form.stack_name)}} +{{ render_field(form.stack_description)}} + + + + + + + + + +
      +{% endblock %} diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html new file mode 100644 index 0000000..7576cbd --- /dev/null +++ b/app/templates/add_to_stacks.html @@ -0,0 +1,44 @@ +{% extends 'base.html' %} + +{% block main %} +
      + +
      Chosen book: + +

      {{ book.title }}

      + + +
      +

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

      + +
    + + + + + +
    +
    +

    Build a stack

    + +

    Add Stack

    + +
    +

    List of books

    +
    + +
    +

    Stack

    +
    + + + +{% endblock %} diff --git a/app/templates/show_books.html b/app/templates/show_books.html index 7aa0a2c..27f539a 100755 --- a/app/templates/show_books.html +++ b/app/templates/show_books.html @@ -32,6 +32,7 @@ + @@ -58,7 +59,18 @@
  • {{ stack.stack_name }}
  • {% endfor %} - + + + {% endfor %} diff --git a/app/templates/show_stack_detail_tab.html b/app/templates/show_stack_detail_tab.html new file mode 100644 index 0000000..c8f703a --- /dev/null +++ b/app/templates/show_stack_detail_tab.html @@ -0,0 +1,18 @@ +{% block main %} +
    + +

    {{ stack.stack_name }}

    + + +

    Stack description: {{ stack.stack_description }}

    + +

    Books in this stack: {% for book in stack.books %} + +

  • {{book.title}}
  • + + {% endfor %}

    + + + +
    +{% endblock %} diff --git a/app/views.py b/app/views.py index 37598db..862bd12 100755 --- a/app/views.py +++ b/app/views.py @@ -9,7 +9,7 @@ from app import app, db, socketio, DOMAIN from flask import Flask, Response, render_template, request, redirect, url_for, flash, send_from_directory, jsonify, abort import json from sqlalchemy.sql.expression import func, select -from app.forms import UploadForm, EditForm, SearchForm, ChatForm, StackForm +from app.forms import UploadForm, EditForm, SearchForm, ChatForm, StackForm, AddtoStackForm from app.models import Book, BookSchema, Author, AuthorSchema, Stack, StackSchema, UserIns, Chat, ChatSchema from app.cover import get_cover from os import environ @@ -267,8 +267,7 @@ def show_stacks(): def add_stack(): form = StackForm() stacks = db.session.query(Stack).all() - #if request.method == 'GET': - # return render_template('add_stack.html', stacks=stacks, form=form) + if request.method == 'POST': stack_name = form.stack_name.data stack_description = form.stack_description.data @@ -372,6 +371,14 @@ def test1(): return Response(json.dumps(autocomplete_suggestions), mimetype='application/json') +@app.route('/add_to_stack/') + +def add_to_stack(id): + stacks = db.session.query(Stack).all() + book = Book.query.get(id) + add = AddtoStackForm(request.form) + + return render_template('add_to_stacks.html', id=id, stacks=stacks, book=book, add=add) ### # The API From cd0edeca925b6b8c601c36db8591199a7b6b3776 Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 4 Jun 2018 23:40:12 +0200 Subject: [PATCH 06/15] add to stacks --- app/forms.py | 4 ++-- app/models.py | 2 +- app/templates/add_to_stacks.html | 17 +++++------------ app/views.py | 31 ++++++++++++------------------- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/app/forms.py b/app/forms.py index 5db22e4..6eeb292 100755 --- a/app/forms.py +++ b/app/forms.py @@ -35,8 +35,8 @@ class StackForm(FlaskForm): create = SubmitField(label='Create') class AddtoStackForm(FlaskForm): - select = SelectField('Stacks', validators=[InputRequired()]) - + select_stack = SelectField('Stacks', validators=[InputRequired()]) + class SearchForm(FlaskForm): choices = [('All', 'All'), ('Title', 'Title'), diff --git a/app/models.py b/app/models.py index 0b281fd..d2361e5 100755 --- a/app/models.py +++ b/app/models.py @@ -97,7 +97,7 @@ class Stack(db.Model): self.stack_description = stack_description def __repr__(self): - return '' % self.stack + return '' % self.stack_name class AuthorSchema(Schema): id = fields.Int(dump_only=True) diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html index 7576cbd..144b15b 100644 --- a/app/templates/add_to_stacks.html +++ b/app/templates/add_to_stacks.html @@ -10,21 +10,14 @@

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

    +{% from "_formhelpers.html" import render_field %} +
    + + + -
    Filetype Category StackAdd to stack
    + + \│/
    + ─ ─
    + /│\
    + + + + +
    - - -

    Build a stack

    diff --git a/app/views.py b/app/views.py index 862bd12..39ea8e6 100755 --- a/app/views.py +++ b/app/views.py @@ -276,19 +276,6 @@ def add_stack(): stack = Stack(stack_name, stack_description) db.session.add(stack) stacks = db.session.query(Stack).all() -#this potentially deals with the connection between books and stacks - #book = Book(title, filename, cover, file_extension, category,year_published) - - #for book in books: - # book_title = book.get("title") - - # if book_title: - # a = db.session.query(Book).filter_by(book_title=book_title).first() - # if a == None: - # a = Book(book_title=book_title) - # db.session.add(a) - # stacks.book.append(a) - #db.session.commit() flash("%s stack created" % (stack_name)) return render_template('add_stack.html', stacks=stacks, form=form) @@ -371,14 +358,20 @@ def test1(): return Response(json.dumps(autocomplete_suggestions), mimetype='application/json') -@app.route('/add_to_stack/') - +@app.route('/add_to_stack/', methods=['GET', 'POST']) def add_to_stack(id): stacks = db.session.query(Stack).all() - book = Book.query.get(id) - add = AddtoStackForm(request.form) - - return render_template('add_to_stacks.html', id=id, stacks=stacks, book=book, add=add) + add_form = AddtoStackForm(request.form) + add_form.select_stack.choices = [(stack.id, stack.stack_name) for stack in stacks] + if request.method == 'GET': + book = Book.query.get(id) + return render_template('add_to_stacks.html', id=id, stacks=stacks, book=book, add_form=add_form) + else: + stack = Stack.query.get(int(add_form.select_stack.data)) + book = Book.query.get(id) + stack.books.append(book) + db.session.commit() + return render_template('show_stack_detail.html', stack=stack) ### # The API From 23ad268c0b4d70fd549cf3ab831fc03dc937c414 Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 4 Jun 2018 23:44:40 +0200 Subject: [PATCH 07/15] fix --- whoosh/Book/_MAIN_1.toc | Bin 1985 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 whoosh/Book/_MAIN_1.toc diff --git a/whoosh/Book/_MAIN_1.toc b/whoosh/Book/_MAIN_1.toc deleted file mode 100644 index 0e87a0a34dec83468112dd59c6879560a9380d3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1985 zcmZ`)TX)+;5Oxx$ag>w>DEC{rD=ipk=!I)3ZCZkx&^m#rZCqs~t-VX7U5|E^*e#;z zLpaGfdf_1c1OI~u9(m?p@DIXhWw$vg^^0fcoBigpGoxy)y0`cDUweCdzm85+|C!zz z^*5Q6iq+ekhJmt{eMTck#Vt`7OQC8zHPrY-(~gY$Fn)kwW!_n_ z;1FJ)NTF656G6iM9U8;r(Aa1cSM?#JtP3*gO2sujKd`pILYAo%rk!#0h)AU1a0{NW zA7Rn*HWeH_D62_3w6`)mTW|z9W>R?4b}S^Jy>3jE;!?mcFFe+K zSg! zx=|4UZ*M!vYk&!f`aMJi;WP`$-5jEoqJ~lW845v!E zHk>Y1RKuB4rQqx!M$O<8BVtJ+_|(8e!)F6N6hAjQkHQz_T>)PjIucVjXH;6kS4O}x zoTuCHbrUWalZXqr*cdHk(u4UW)9x`9N#tP%U)uSf28d+bW!5q_=Hj#!)b;AWY7VdcV_ zGlM2kg57L})rExO_GlS@0c{gR;FhVi@?}iCkb=82s2&y~fc0H-+MvG1M9~)l=)UTI^xjdU(om-}zhzgzmme1bL)7;J`xd>=akcj44b@BYdQl5<~+TlT- z&2&%4XC)0Z(Pv2i>z6*LhJg2@Eyn- zW2oQ)JDCnFMiMWZbOY)8GQp4_g@rum{hl35QMI&a*~#?33|i`Pbz#3S|p E0D^XetN;K2 From 2ff2b6e9f0c177fff1cc0c0bb6d034524f2be479 Mon Sep 17 00:00:00 2001 From: Alice Date: Tue, 5 Jun 2018 12:22:09 +0200 Subject: [PATCH 08/15] added delete stack --- app/static/css/style.css | 6 +++--- app/templates/about.html | 9 ++++++++- app/templates/add_stack.html | 4 ++-- app/templates/show_stack_detail.html | 5 ++++- app/templates/show_stacks.html | 8 +++++--- app/views.py | 10 ++++++++-- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/static/css/style.css b/app/static/css/style.css index e91c4a7..36c021f 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -183,12 +183,12 @@ font-family:'Courier New'; font-size: 12px; } -.ui-tabs-vertical { width: 55em; } +.ui-tabs-vertical { width: 100em; border-top: 0;} .ui-tabs-vertical .ui-tabs-nav { padding: .2em .2em .2em .2em; float: left; width: 12em; } .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 .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: #EEC2C2} -.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: left; width: 40em; font-size: 12px;} +.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 0; background-color: #A9A9A9} +.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; } diff --git a/app/templates/about.html b/app/templates/about.html index 657081d..802a4dc 100755 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -2,5 +2,12 @@ {% block main %}

    About

    -

    This an interface to the XPUB Library.

    +

    +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. +
    + 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.

    {% endblock %} diff --git a/app/templates/add_stack.html b/app/templates/add_stack.html index 9638f91..0fe1e5f 100644 --- a/app/templates/add_stack.html +++ b/app/templates/add_stack.html @@ -3,7 +3,7 @@ {% block main %}
    - + {% endwith %}
    {{form.hidden_tag()}} diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 1fc8779..01551de 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -6,7 +6,7 @@

    {{ stack.stack_name }}

    -

    Stack description: {{ stack.stack_description }}

    +

    {{ stack.stack_description }}

    Books in this stack: {% for book in stack.books %}

  • {{book.title}}
  • @@ -16,6 +16,9 @@

    +

    + Delete

    +

    Go back to stacks

    diff --git a/app/templates/show_stacks.html b/app/templates/show_stacks.html index 898fa10..27fd207 100644 --- a/app/templates/show_stacks.html +++ b/app/templates/show_stacks.html @@ -21,10 +21,12 @@

    -

    Build a stack

    -

    Add Stack

    +

    Add Stack

    + + + {% endblock %} diff --git a/app/views.py b/app/views.py index 39ea8e6..3ff00d6 100755 --- a/app/views.py +++ b/app/views.py @@ -268,7 +268,7 @@ def add_stack(): form = StackForm() stacks = db.session.query(Stack).all() - if request.method == 'POST': + if form.validate_on_submit(): stack_name = form.stack_name.data stack_description = form.stack_description.data stack = Stack(stack_name, stack_description) @@ -276,7 +276,7 @@ def add_stack(): stack = Stack(stack_name, stack_description) db.session.add(stack) stacks = db.session.query(Stack).all() - + return redirect(url_for('show_stacks')) flash("%s stack created" % (stack_name)) return render_template('add_stack.html', stacks=stacks, form=form) @@ -297,6 +297,12 @@ def show_stack_by_id(id, is_tab=False): else: return render_template('show_stack_detail_tab.html', stack=stack) +@app.route('/stacks//delete', methods=['POST', 'GET']) +def remove_stack_by_id(id): + Stack.query.filter_by(id=id).delete() + db.session.commit() + return redirect(url_for('show_stacks')) + ## search ## search From b1371fdb3ebd567d96952e39cfc1ef60b87e861c Mon Sep 17 00:00:00 2001 From: Jocavdh Date: Tue, 5 Jun 2018 15:05:09 +0200 Subject: [PATCH 09/15] Added autocomplete as part of a user session. Hooray, no more autocomplete based on other users!! --- app/__init__.py | 1 - app/static/js/app.js | 80 ++++------------------------------- app/templates/base.html | 1 + app/templates/show_books.html | 1 + app/views.py | 14 ++++-- 5 files changed, 21 insertions(+), 76 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index b2dc543..ceebaa6 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -40,4 +40,3 @@ app.config.from_object(__name__) from app import views flask_whooshalchemyplus.init_app(app) # initialize - diff --git a/app/static/js/app.js b/app/static/js/app.js index 460c9ee..29adeff 100755 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -160,10 +160,10 @@ $(document).ready(function() // Autocomplete for search - Contact Joca in case of trouble + $('#search').on("input", function() { var query = this.value; - $.ajax({ url: "/autocomplete_suggestions", data: $('form').serialize(), @@ -173,83 +173,21 @@ $('#search').on("input", function() { } }); - function getData() { - var deferredData = new jQuery.Deferred(); $.ajax({ type: "GET", url: "/autocomplete_suggestions", dataType: "json", success: function(data) { - deferredData.resolve(data); - } - }); - return deferredData; // contains the passed data - }; - - var dataDeferred = getData(); - - $.when(dataDeferred).done( function( data ) { - var suggestion_list = data; - console.log(suggestion_list); - $().ready(function() { - // search only, if the regexp matches - var suggestions = data; - - // Defines for the example the match to take which is any word (with Umlauts!!). - function _leftMatch(string, area) { - //return string.substring(0, area.selectionStart).match(/[\wäöüÄÖÜß]+$/) - //console.log(string.substring(string.lastIndexOf(" ")+1).match(/[\wäöüÄÖÜß]+$/)) - return string.substring(string.lastIndexOf(" ")+1).match(/[\wäöüÄÖÜß]+$/) - - } - - function _setCursorPosition(area, pos) { - if (area.setSelectionRange) { - area.setSelectionRange(pos, pos); - } else if (area.createTextRange) { - var range = area.createTextRange(); - range.collapse(true); - range.moveEnd('character', pos); - range.moveStart('character', pos); - range.select(); - } - } - - - - $("#search").autocomplete({ - position: { my : "right top", at: "right bottom" }, - source: function(request, response) { - var str = _leftMatch(request.term, $("#search")[0]); - str = (str != null) ? str[0] : ""; - console.log(str); - response($.ui.autocomplete.filter( - suggestions, str)); - }, - minLength: 1, // does have no effect, regexpression is used instead - focus: function() { - // prevent value inserted on focus - return false; - }, - // Insert the match inside the ui element at the current position by replacing the matching substring - select: function(event, ui) { - //alert("completing "+ui.item.value);}, - var m = _leftMatch(this.value, this)[0]; - var beg = this.value.substring(0, this.selectionStart - m.length); - this.value = beg + ui.item.value + this.value.substring(this.selectionStart, this.value.length); - var pos = beg.length + ui.item.value.length; - _setCursorPosition(this, pos); - return false; - }, - search:function(event, ui) { - var m = _leftMatch(this.value, this); - return (m != null ) - } - - }); - }) + // Start autocomplete + var availableTags = data; + console.log(availableTags); + $( "#search" ).autocomplete({ + source: availableTags + }); + // End of autocomplete + } }); }); diff --git a/app/templates/base.html b/app/templates/base.html index cae3d58..9af5ed1 100755 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -15,6 +15,7 @@ + {% block css %} {% endblock%} diff --git a/app/templates/show_books.html b/app/templates/show_books.html index 27f539a..4171fef 100755 --- a/app/templates/show_books.html +++ b/app/templates/show_books.html @@ -3,6 +3,7 @@ {% block main %}
    {% from "_formhelpers.html" import render_field %} +
    {{ form.select(style="width: 100px; margin: 10px; float: left; font-size: 20px") }}
    + + + {{ render_field(form.edit_stack_name)}} + {{ render_field(form.edit_stack_description)}} + +
    + + + + +{% endblock %} diff --git a/app/templates/results.html b/app/templates/results.html index 8114fcd..aa1acf7 100644 --- a/app/templates/results.html +++ b/app/templates/results.html @@ -33,6 +33,8 @@ + + {% for book in books %} @@ -51,6 +53,10 @@
  • {{ stack.stack_name }}
  • {% endfor %} + + {% endfor %}
    Filetype Category StackAdd to stack
    + ==> +
    @@ -68,6 +74,8 @@ Filetype Category Stack + Add to stack + {% for book in books_all %} @@ -86,6 +94,9 @@
  • {{ stack.stack_name }}
  • {% endfor %} + + ==> + {% endfor %}

    diff --git a/app/templates/show_books.html b/app/templates/show_books.html index 27f539a..101ce54 100755 --- a/app/templates/show_books.html +++ b/app/templates/show_books.html @@ -62,15 +62,8 @@ - \│/
    - ─ ─
    - /│\
    - - - - + ==>
    - {% endfor %} diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 01551de..9f8dbca 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -18,6 +18,8 @@

    Delete

    + Edit

    +

    Go back to stacks

    diff --git a/app/templates/show_stack_detail_tab.html b/app/templates/show_stack_detail_tab.html index c8f703a..c82d9ba 100644 --- a/app/templates/show_stack_detail_tab.html +++ b/app/templates/show_stack_detail_tab.html @@ -1,7 +1,12 @@ {% block main %}
    -

    {{ stack.stack_name }}

    +

    + + + {{ stack.stack_name }} +

    +

    Stack description: {{ stack.stack_description }}

    diff --git a/app/templates/show_stacks.html b/app/templates/show_stacks.html index 27fd207..15daff3 100644 --- a/app/templates/show_stacks.html +++ b/app/templates/show_stacks.html @@ -11,7 +11,11 @@
      {% for stack in stacks %} -
    • {{ stack.stack_name }} +
    • + + {{ stack.stack_name }} + + diff --git a/app/views.py b/app/views.py index 3ff00d6..4317969 100755 --- a/app/views.py +++ b/app/views.py @@ -9,7 +9,7 @@ from app import app, db, socketio, DOMAIN from flask import Flask, Response, render_template, request, redirect, url_for, flash, send_from_directory, jsonify, abort import json from sqlalchemy.sql.expression import func, select -from app.forms import UploadForm, EditForm, SearchForm, ChatForm, StackForm, AddtoStackForm +from app.forms import UploadForm, EditForm, SearchForm, ChatForm, StackForm, AddtoStackForm, EditStackForm from app.models import Book, BookSchema, Author, AuthorSchema, Stack, StackSchema, UserIns, Chat, ChatSchema from app.cover import get_cover from os import environ @@ -303,6 +303,18 @@ def remove_stack_by_id(id): db.session.commit() return redirect(url_for('show_stacks')) +@app.route('/stacks//edit', methods=['POST', 'GET']) +def edit_stack_by_id(id): + stack = Stack.query.filter_by(id=id).first() + form = EditStackForm() + + if request.method == 'POST': + if edit_stack_form.validate_on_submit(): + stack_name = form.stack_name.data + stack_description = form.stack_description.data + db.session.commit() + return redirect(url_for('show_stack_by_id', id=id)) + return render_template('edit_stack_detail.html', stack=stack, form=form) ## search ## search diff --git a/import_csv.py b/import_csv.py index e3dd830..9aa06d1 100644 --- a/import_csv.py +++ b/import_csv.py @@ -39,7 +39,7 @@ with open(args.csv) as f: if stack: b = db.session.query(Stack).filter_by(stack_name=stack).first() if b == None: - b = Stack(stack_name=stack, stack_description="test") + b = Stack(stack_name=stack, stack_description=stack_description) db.session.add(b) book.stacks.append(b) From 85d0dba0b42fa363793986c4898736f26621b086 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 6 Jun 2018 11:39:38 +0200 Subject: [PATCH 11/15] edited css of tabs --- app/forms.py | 4 ++-- app/static/css/style.css | 2 +- app/views.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/forms.py b/app/forms.py index ed1404b..0db4fdf 100755 --- a/app/forms.py +++ b/app/forms.py @@ -39,8 +39,8 @@ class AddtoStackForm(FlaskForm): select_stack = SelectField('Stacks', validators=[InputRequired()]) class EditStackForm(FlaskForm): - edit_stack_name = SelectField('Stack', validators=[InputRequired()]) - edit_stack_description = SelectField('Description', validators=[InputRequired()]) + edit_stack_name = StringField('Stack', validators=[InputRequired()]) + edit_stack_description = StringField('Description', validators=[InputRequired()]) class SearchForm(FlaskForm): choices = [('All', 'All'), diff --git a/app/static/css/style.css b/app/static/css/style.css index 36c021f..abc3102 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -184,7 +184,7 @@ 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: 12em; } +.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; } .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} diff --git a/app/views.py b/app/views.py index 4317969..788d76e 100755 --- a/app/views.py +++ b/app/views.py @@ -309,9 +309,9 @@ def edit_stack_by_id(id): form = EditStackForm() if request.method == 'POST': - if edit_stack_form.validate_on_submit(): - stack_name = form.stack_name.data - stack_description = form.stack_description.data + if form.validate_on_submit(): + stack_name = form.edit_stack_name.data + stack_description = form.edit_stack_description.data db.session.commit() return redirect(url_for('show_stack_by_id', id=id)) return render_template('edit_stack_detail.html', stack=stack, form=form) From e151495683e85ee7b82787ec0107c09c6c326cce Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 6 Jun 2018 13:27:01 +0200 Subject: [PATCH 12/15] default form entries --- app/templates/edit_stack_detail.html | 19 +++++++++++-------- app/views.py | 5 ++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/templates/edit_stack_detail.html b/app/templates/edit_stack_detail.html index 8dd6ea8..6390e23 100644 --- a/app/templates/edit_stack_detail.html +++ b/app/templates/edit_stack_detail.html @@ -2,18 +2,21 @@ {% block main %}
      - - {% from "_formhelpers.html" import render_field %} - + +
      {{ form.csrf_token }}

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

      +
      + {{ form.edit_stack_description.label }} {{ form.edit_stack_description(size=20, class="form-control") }} +
      - {{ render_field(form.edit_stack_name)}} - {{ render_field(form.edit_stack_description)}} -
      diff --git a/app/views.py b/app/views.py index 788d76e..ccedbb1 100755 --- a/app/views.py +++ b/app/views.py @@ -306,13 +306,16 @@ def remove_stack_by_id(id): @app.route('/stacks//edit', methods=['POST', 'GET']) def edit_stack_by_id(id): stack = Stack.query.filter_by(id=id).first() - form = EditStackForm() + form = EditStackForm(edit_stack_name = stack.stack_name, edit_stack_description = stack.stack_description) if request.method == 'POST': if form.validate_on_submit(): stack_name = form.edit_stack_name.data stack_description = form.edit_stack_description.data + stack.stack_name = stack_name + stack.stack_description = stack_description db.session.commit() + return redirect(url_for('show_stack_by_id', id=id)) return render_template('edit_stack_detail.html', stack=stack, form=form) ## search From ca91e2e37afa65835ae4eaf6b75a27652cc44b48 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 6 Jun 2018 14:32:18 +0200 Subject: [PATCH 13/15] connect stacks and edit stacks and add covers --- app/templates/add_to_stacks.html | 16 ---------------- app/templates/show_stack_detail.html | 2 +- app/templates/show_stack_detail_tab.html | 6 +++++- app/templates/show_stacks.html | 14 ++------------ 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html index 144b15b..c2ed248 100644 --- a/app/templates/add_to_stacks.html +++ b/app/templates/add_to_stacks.html @@ -16,22 +16,6 @@ - - -
      -
      -

      Build a stack

      - -

      Add Stack

      - -
      -

      List of books

      -
      - -
      -

      Stack

      -
      - {% endblock %} diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 9f8dbca..39f5539 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -5,11 +5,11 @@

      {{ stack.stack_name }}

      -

      {{ stack.stack_description }}

      Books in this stack: {% for book in stack.books %}

    • {{book.title}}
    • + {% endfor %}

      diff --git a/app/templates/show_stack_detail_tab.html b/app/templates/show_stack_detail_tab.html index c82d9ba..029d5a9 100644 --- a/app/templates/show_stack_detail_tab.html +++ b/app/templates/show_stack_detail_tab.html @@ -13,8 +13,12 @@

      Books in this stack: {% for book in stack.books %} -

    • {{book.title}}
    • +
    • {{book.title}}
    • +

      + + Add to another stack +

      {% endfor %}

      diff --git a/app/templates/show_stacks.html b/app/templates/show_stacks.html index 15daff3..f1388a5 100644 --- a/app/templates/show_stacks.html +++ b/app/templates/show_stacks.html @@ -4,6 +4,8 @@

      Stacks

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

      +

      Add a new stack

      +
      @@ -26,19 +28,7 @@

      -

      Add Stack

      - - - {% endblock %} From 2b49e98fdd6f3bf8a57bb0182b6761d00e407771 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 6 Jun 2018 16:07:39 +0200 Subject: [PATCH 14/15] removed tab styling --- app/static/css/style.css | 19 ++++++++++++++++++- app/templates/base.html | 1 - app/templates/show_stack_detail.html | 5 ++++- app/templates/show_stack_detail_tab.html | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/app/static/css/style.css b/app/static/css/style.css index abc3102..be7e00f 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -187,11 +187,12 @@ font-size: 12px; .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; } .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} +.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; } + #newstext{ width: 100%; margin: 0; @@ -307,3 +308,19 @@ box-sizing: border-box; font-size: 16px; font-style: italic; } + +.widget { + resize: both; + overflow: hidden; + width: 300px; + height: 300px; + display: inline-block; + +} + +.widget iframe { + + width: 100%; + height: 100%; + border: none; +} diff --git a/app/templates/base.html b/app/templates/base.html index cae3d58..76a7e06 100755 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -14,7 +14,6 @@ - {% block css %} {% endblock%} diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 39f5539..af144cd 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -10,7 +10,9 @@
    • {{book.title}}
    • - +
      + +
      {% endfor %}

      @@ -21,6 +23,7 @@ Edit

      +

      Go back to stacks

      diff --git a/app/templates/show_stack_detail_tab.html b/app/templates/show_stack_detail_tab.html index 029d5a9..d074c2c 100644 --- a/app/templates/show_stack_detail_tab.html +++ b/app/templates/show_stack_detail_tab.html @@ -9,7 +9,7 @@ -

      Stack description: {{ stack.stack_description }}

      +

      {{ stack.stack_description }}

      Books in this stack: {% for book in stack.books %} From 3d3180e138d5803e07911a7eb05d7e1bcbdecada Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 6 Jun 2018 16:56:37 +0200 Subject: [PATCH 15/15] css --- app/static/css/style.css | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/static/css/style.css b/app/static/css/style.css index 36c021f..63d80ad 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -184,14 +184,15 @@ 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: 12em; } +.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 .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} +.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; } + #newstext{ width: 100%; margin: 0; @@ -307,3 +308,19 @@ box-sizing: border-box; font-size: 16px; font-style: italic; } + +.widget { + resize: both; + overflow: hidden; + width: 300px; + height: 300px; + display: inline-block; + +} + +.widget iframe { + + width: 100%; + height: 100%; + border: none; +}