diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbdc1ed..8c0e19a 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,4 +28,4 @@ repos: rev: stable hooks: - id: black - language_version: python3.7 + language_version: python3.8 diff --git a/frontend/db.sqlite3 b/frontend/db.sqlite3 new file mode 100755 index 0000000..c5afa57 Binary files /dev/null and b/frontend/db.sqlite3 differ diff --git a/frontend/frontend/urls.py b/frontend/frontend/urls.py index b5ae4bd..650ad43 100755 --- a/frontend/frontend/urls.py +++ b/frontend/frontend/urls.py @@ -14,10 +14,9 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path +from django.urls import path, re_path from interface import views -urlpatterns = [ - path("admin/", admin.site.urls), - path("", views.index, name="index"), -] +path("admin/", admin.site.urls), +path("", views.index, name="index"), +re_path(r"^download/$/", views.download, name="download") diff --git a/frontend/interface/static/css/main.css b/frontend/interface/static/css/main.css index a72a6a3..3fc06c9 100755 --- a/frontend/interface/static/css/main.css +++ b/frontend/interface/static/css/main.css @@ -44,6 +44,8 @@ body{ } .app_footer{ grid-area: app_footer; + position: fixed; + bottom: 0px; } .left_col{ grid-area: left_col @@ -73,11 +75,20 @@ body{ display: grid; grid-template-columns: 25% 25% 25% 25%; list-style-type: none; + font-family: 'Audiowide', cursive; + font-size: 25px; } .shelf_item{ - + background-color: burlywood; + margin: 10px 0px; + max-width: 300px; + max-height: 375px; + text-align: center; } .book_thumb{ width: 300px; height: 375px; } +a.book_link{ + text-decoration: none; +} diff --git a/frontend/interface/templates/index.html b/frontend/interface/templates/index.html index d91d361..d608f3f 100755 --- a/frontend/interface/templates/index.html +++ b/frontend/interface/templates/index.html @@ -17,13 +17,13 @@
- left_col + Navigation and page controls will go here
    {% for book in Books %} -
  • {{ book.title }}
  • +
  • {{ book.title }}
  • {% endfor %}
diff --git a/frontend/interface/views.py b/frontend/interface/views.py index d657069..69a8a53 100755 --- a/frontend/interface/views.py +++ b/frontend/interface/views.py @@ -1,4 +1,5 @@ from django.shortcuts import render +from xsendfile import XSendfileApplication from .models import Books @@ -7,6 +8,10 @@ def index(request): return render(request, "index.html", {"Books": Books.objects.all()}) +def download(request): + return XSendfileApplication(file_name) + + def book_set(_set): r = 20 x = _set * r diff --git a/pyproject.toml b/pyproject.toml index 050adcf..cbefe56 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,4 +7,4 @@ use_parentheses = true # NOTE: the known_third_party setting is managed by # seed-isort-config and should not be modified directly. # Any changes made to this setting will be overwritten. -known_third_party = ["PIL", "bs4", "django", "interface", "lib", "requests"] +known_third_party = ["PIL", "bs4", "django", "interface", "lib", "requests", "xsendfile"] diff --git a/requirements.txt b/requirements.txt index cecb42d..d695bcc 100755 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ websockets pre-commit isort django +xsendfile