diff --git a/.DS_Store b/.DS_Store index caf0f17..ad16089 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/__init__.py b/app/__init__.py index 1ecdd02..15afa74 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -15,7 +15,7 @@ registry.register("rqlite.pyrqlite", "sqlalchemy_rqlite.pyrqlite", "dialect") basedir = os.path.abspath(os.path.dirname(__file__)) UPLOAD_FOLDER = os.path.join(basedir, 'uploads') -UPLOAD_FOLDER_COVER = os.path.join(basedir, 'uploads/cover') +UPLOAD_FOLDER_COVER = os.path.join(basedir, 'cover') #ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) load_dotenv(find_dotenv()) app = Flask(__name__) @@ -29,7 +29,7 @@ app.config['PORT'] = 80 #app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'mydatabase.db') db = SQLAlchemy(app) - +light = not os.path.isdir(UPLOAD_FOLDER) DOMAIN = environ.get('DOMAIN') socketio = SocketIO(app) diff --git a/app/cover.py b/app/cover.py index ef1bccc..19de8e1 100755 --- a/app/cover.py +++ b/app/cover.py @@ -37,8 +37,8 @@ def get_cover(file_path, filename): # Convert each page to a png image. for page in pages: - big_filename = "app/uploads/cover/"+page["filename"] + "_cover.png" - small_filename = "app/uploads/cover/"+page["filename"] + "cover_small" + ".png" + big_filename = "app/cover/"+page["filename"] + "_cover.png" + small_filename = "app/cover/"+page["filename"] + "cover_small" + ".png" img = pdf_page_to_png(src_pdf, pagenum = page["pagenum"], resolution = 200) img.save(filename = big_filename) diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html index 2e7ab09..6cece35 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/header.html b/app/templates/header.html index 0d8b33d..fc9abe5 100755 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -3,10 +3,16 @@
  • Home
  • Catalogue
  • Stacks
  • + {%if light%} + {%else%}
  • Add Book
  • Add Stack
  • + {%endif%}
  • About
  • + {%if light%} + {%else%}
  • Instances
  • + {%endif%}
    diff --git a/app/templates/home.html b/app/templates/home.html index 80eb66d..f406a4e 100755 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -15,6 +15,8 @@ Feel free to browse our catalogue, interfaced in many different ways.


    +{%if light%} +{%else%}
    @@ -23,6 +25,7 @@ Feel free to browse our catalogue, interfaced in many different ways. +{%endif%}
    diff --git a/app/templates/red_link.html b/app/templates/red_link.html index 77883b0..74c58b2 100755 --- a/app/templates/red_link.html +++ b/app/templates/red_link.html @@ -32,10 +32,13 @@
    {% endif %} {% endwith %} + {%if light%} + {%else%}

    +

    Add this book:

    @@ -72,6 +75,7 @@

    + {%endif%}

    More potential books

    @@ -83,7 +87,10 @@ + {%if light%} + {%else%} + {%endif%} @@ -91,7 +98,7 @@
    Year Category StackAdd to a stack
    - +