diff --git a/CalibreWebCompanion/CalibreWebCompanion/settings.py b/CalibreWebCompanion/CalibreWebCompanion/settings.py index 40a5ea8..5e06eef 100644 --- a/CalibreWebCompanion/CalibreWebCompanion/settings.py +++ b/CalibreWebCompanion/CalibreWebCompanion/settings.py @@ -15,6 +15,19 @@ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) CALIBRE_DIR = os.path.abspath("C:\\Users\\MassiveAtoms\\Documents\\Calibre Library") +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.0/howto/static-files/ + +STATICFILES_DIRS = [ + os.path.abspath(CALIBRE_DIR), + # '/static/', +] + +STATIC_URL = '/static/' + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ @@ -22,11 +35,20 @@ CALIBRE_DIR = os.path.abspath("C:\\Users\\MassiveAtoms\\Documents\\Calibre Libra # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'u(8^+rb%rz5hsx4v^^y(ul7g(4n7a8!db@s*9(m5cs*2_ppy8+' -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True ALLOWED_HOSTS = [] +#### Don't change things beyond this + + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + + + + + +LOGIN_REDIRECT_URL = '/books' # Application definition @@ -127,12 +149,3 @@ USE_L10N = True USE_TZ = True -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/3.0/howto/static-files/ - -STATICFILES_DIRS = [ - os.path.abspath(CALIBRE_DIR), - # '/static/', -] - -STATIC_URL = '/static/' diff --git a/CalibreWebCompanion/CalibreWebCompanion/urls.py b/CalibreWebCompanion/CalibreWebCompanion/urls.py index 64829d1..813db69 100644 --- a/CalibreWebCompanion/CalibreWebCompanion/urls.py +++ b/CalibreWebCompanion/CalibreWebCompanion/urls.py @@ -21,7 +21,8 @@ from django.views.generic import RedirectView urlpatterns = [ path('admin/', admin.site.urls), - path('library/', include('library.urls')), - path('', RedirectView.as_view(url='library/', permanent=True)), + path('accounts/', include('django.contrib.auth.urls')), + path('', include('library.urls')), + path('', RedirectView.as_view(url='books/', permanent=True)), ] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \ No newline at end of file diff --git a/CalibreWebCompanion/db.sqlite3 b/CalibreWebCompanion/db.sqlite3 index b92ca61..a609fcd 100644 Binary files a/CalibreWebCompanion/db.sqlite3 and b/CalibreWebCompanion/db.sqlite3 differ diff --git a/CalibreWebCompanion/library/static/css/styles.css b/CalibreWebCompanion/library/static/css/styles.css index 2a56dc8..2d8332c 100644 --- a/CalibreWebCompanion/library/static/css/styles.css +++ b/CalibreWebCompanion/library/static/css/styles.css @@ -1,78 +1,112 @@ - /* Fixed sidenav, full height */ - .sidenav { - height: 100%; - width: 200px; - position: fixed; - z-index: 1; - top: 0; - left: 0; - background-color: #111; - overflow-x: hidden; - padding-top: 20px; - } - - /* Style the sidenav links and the dropdown button */ - .sidenav a, .dropdown-btn { - padding: 6px 8px 6px 16px; - text-decoration: none; - font-size: 20px; - color: #818181; - display: block; - border: none; - background: none; - width:100%; - text-align: left; - cursor: pointer; - outline: none; - } - - /* On mouse-over */ - .sidenav a:hover, .dropdown-btn:hover { - color: #f1f1f1; - } - - /* Main content */ - .main { - margin-left: 200px; /* Same as the width of the sidenav */ - font-size: 20px; /* Increased text to enable scrolling */ - padding: 0px 10px; - } - - /* Add an active class to the active dropdown button */ - .active { - background-color: green; - color: white; - } - - /* Dropdown container (hidden by default). Optional: add a lighter background color and some left padding to change the design of the dropdown content */ - .dropdown-container { - display: none; - background-color: #262626; - padding-left: 8px; - } - - /* Optional: Style the caret down icon */ - .fa-caret-down { - float: right; - padding-right: 8px; - } +/* sidenav */ - table { - border-spacing: 0; - width: 100%; - border: 1px solid #ddd; - } - - th { - cursor: pointer; - } - - th, td { - text-align: left; - padding: 16px; - } - - tr:nth-child(even) { - background-color: #f2f2f2 - } \ No newline at end of file +/* Fixed sidenav, full height */ +.sidenav { + height: 100%; + width: 200px; + position: fixed; + z-index: 1; + top: 0; + left: 0; + background-color: #111; + overflow-x: hidden; + padding-top: 20px; +} + +/* Style the sidenav links and the dropdown button */ +.sidenav a, +.dropdown-btn { + padding: 6px 8px 6px 16px; + text-decoration: none; + font-size: 20px; + color: #818181; + display: block; + border: none; + background: none; + width: 100%; + text-align: left; + cursor: pointer; + outline: none; +} + +/* On mouse-over */ +.sidenav a:hover, +.dropdown-btn:hover { + color: #f1f1f1; +} + +/* Main content */ +.main { + margin-left: 200px; + /* Same as the width of the sidenav */ + font-size: 20px; + /* Increased text to enable scrolling */ + padding: 0px 10px; +} + +/* Add an active class to the active dropdown button */ +.active { + background-color: green; + color: white; +} + +/* Dropdown container (hidden by default). Optional: add a lighter background color and some left padding to change the design of the dropdown content */ +.dropdown-container { + display: none; + background-color: #262626; + padding-left: 8px; +} + +/* Optional: Style the caret down icon */ +.fa-caret-down { + float: right; + padding-right: 8px; +} + + +ul.topnav { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + background-color: #333; +} + +.topnav li { + float: right; +} + +.topnav li a { + display: block; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +.topnav li a:hover { + background-color: #111; +} + + +/* Table */ +table { + border-spacing: 0; + width: 100%; + border: 1px solid #ddd; +} + +th { + cursor: pointer; +} + +th, +td { + text-align: left; + padding: 16px; +} + +tr:nth-child(even) { + background-color: #f2f2f2 +} \ No newline at end of file diff --git a/CalibreWebCompanion/library/templates/base.html b/CalibreWebCompanion/library/templates/base.html index a1bc9ab..9199e18 100644 --- a/CalibreWebCompanion/library/templates/base.html +++ b/CalibreWebCompanion/library/templates/base.html @@ -13,6 +13,20 @@
+ {% block topnav%} +