From ada4bce0ebf32f8f51c388b8354e7c5a6dad9a3d Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 1 Apr 2021 14:27:40 -0500 Subject: [PATCH] Applied new layout --- stashr/routes.py | 61 ++-- stashr/static/css/stashr.css | 110 +++---- stashr/static/js/stashr.js | 12 +- stashr/templates/all_collections_page.html | 26 +- stashr/templates/all_publishers_page.html | 26 +- stashr/templates/all_volumes_page.html | 74 +++-- stashr/templates/base.html | 256 ++++++++-------- stashr/templates/first_run_page.html | 110 ++++--- stashr/templates/login_page.html | 89 ++++-- stashr/templates/new_releases_page.html | 42 +-- stashr/templates/read_issue_page.html | 6 +- stashr/templates/reading_list_page.html | 71 +++-- stashr/templates/register_page.html | 45 --- stashr/templates/scrape_page.html | 53 ++-- stashr/templates/search_page.html | 49 ++-- stashr/templates/settings_page.html | 228 +++++++++++---- stashr/templates/settings_page_all_users.html | 16 +- stashr/templates/settings_page_app.html | 13 +- .../templates/settings_page_directories.html | 13 +- stashr/templates/settings_page_mail.html | 13 +- stashr/templates/settings_page_new_user.html | 86 +++--- stashr/templates/settings_page_plugins.html | 15 +- .../templates/settings_page_single_user.html | 16 +- stashr/templates/settings_page_tasks.html | 64 ++-- stashr/templates/single_collection_page.html | 153 ++++------ stashr/templates/single_publisher_page.html | 74 +++-- stashr/templates/single_volume_page.html | 274 ++++++++---------- 27 files changed, 1038 insertions(+), 957 deletions(-) delete mode 100644 stashr/templates/register_page.html diff --git a/stashr/routes.py b/stashr/routes.py index a626717..4fc51e8 100644 --- a/stashr/routes.py +++ b/stashr/routes.py @@ -116,6 +116,10 @@ def index_page(): flash('First Run') return redirect(url_for('first_run_page')) + if not current_user.is_authenticated: + flash('Please Log IN', 'Info') + return redirect(url_for('login_page')) + return render_template( 'index_page.html', title='Home', @@ -156,28 +160,6 @@ def login_page(): ) -# REGISTER -@app.route('/register', methods=['GET', 'POST']) -def register_page(): - - if not stashrconfig['APP']['open_registration']: - flash('Registration Closed', 'error') - return redirect(url_for('login_page')) - - registration_form = forms.registration_form() - - if registration_form.validate_on_submit() and registration_form.register_button.data: - utils.register_new_user(registration_form) - return redirect(url_for('login_page')) - - return render_template( - 'register_page.html', - registration_form=registration_form, - title='Register', - open_registration=stashrconfig['APP']['open_registration'] - ) - - # FORGOT PASSWORD @app.route('/forgot', methods=['GET', 'POST']) def forgot_page(): @@ -211,7 +193,7 @@ def logout_page(): logout_user() # identity_changed.send(current_app._get_current_object(), identity=AnonymousIdentity()) flash('Logged Out', 'info') - return redirect(url_for('index_page')) + return redirect(url_for('login_page')) """ --- SETTINGS --- """ @@ -477,21 +459,21 @@ def settings_plugins_page(): # FIRST RUN @app.route('/firstrun', methods=['GET', 'POST']) def first_run_page(): - + if current_user.is_authenticated: flash('App Configured', 'info') - return redirect(url_for('index_page')) + return redirect(url_for('login_page')) if not stashrconfig['APP']['first_run']: flash('App Configured', 'info') - return redirect(url_for('index_page')) - + return redirect(url_for('login_page')) + first_run_form = forms.app_first_run_form() - if request.method == 'POST' and first_run_form.first_run_button.data: + if request.method == 'POST' and first_run_form.first_run_button.data and first_run_form.validate(): utils.complete_first_run(first_run_form) flash('Setup Complete', 'success') - return redirect(url_for('index_page')) + return redirect(url_for('login_page')) return render_template( 'first_run_page.html', @@ -709,6 +691,27 @@ def custom_image_static(foldername, filename): def custom_service_worker(): return app.send_static_file('js/service-worker.js') + +""" --- v TEST AREA v --- """ + +@app.route('/test_login') +def test_login(): + + login_form = forms.login_form() + + return render_template( + 'test_login.html', + login_form = login_form + ) + +@app.route('/test_base') +def test_base(): + return render_template( + 'test_base.html' + ) + +""" --- ^ TEST AREA ^ --- """ + """------------------------------------------------------------------------------------------- -- DEVELOPMENT -------------------------------------------------------------------------------------------""" diff --git a/stashr/static/css/stashr.css b/stashr/static/css/stashr.css index 34d4690..1c7ed61 100644 --- a/stashr/static/css/stashr.css +++ b/stashr/static/css/stashr.css @@ -1,72 +1,50 @@ -/* START NEW STASHR CLASSES */ - -body { background:#444444; } +body { display: flex; flex-wrap: nowrap; height: 100vh; height: -webkit-fill-available; overflow-x: auto; overflow-y: hidden; background-color:#2c2d35 !important; } ul { list-style-type: none; } -.center { text-align:center; } +.login { align-items: center !important; } -@media screen and (max-width: 800px) { - .stashr-cover_size {max-width:100px;min-width:20px;min-height:150px;} +@media screen and (max-width: 768px) { + .stashr-menu { margin-left:-280px; } + .stashr-item_container {max-width:100px;min-width:20px;min-height:150px;} } -@media screen and (min-width: 800px) { - .stashr-cover_size {max-width:160px;min-width:100px;min-height:150px;} +@media screen and (min-width: 768px) { + .stashr-menu { margin-left:0px; } + .stashr-item_container {max-width:160px;min-width:100px;min-height:150px;} } -#app {margin:0;padding:0;} - -body .stashrRead { margin:0;background-color:black; } - -.stashr-project_title { font-family: 'Grand Hotel', cursive;font-size:xx-large;line-height:40px;vertical-align: middle; } -.stashr-series_title { font-family: 'Oswald', sans-serif;font-weight:bold; } - -.stashr-series_info {min-width:30%;max-width:60%;} - -.stashr-poster_wrapper {position:relative;background-color:pink;z-index:5;} -.stashr-badge_tl {position:absolute;top:-5;left:-5;z-index:4;} -.stashr-badge_tr {position:absolute;top:-5;right:-5;z-index:4;} -.stashr-badge_bl {position:absolute;bottom:-5;left:-5;z-index:4;} -.stashr-badge_br {position:absolute;bottom:-5;right:-5;z-index:4;} -.stashr-poster_container {position:relative;overflow:hidden;} -.stashr-overlay_top {position:absolute;top:0;background-color:rgba(220,220,220,.9);z-index:5;} -.stashr-overlay_bottom {position:absolute;bottom:0;background-color:rgba(220,220,220,.9);z-index:5;} -.stashr-poster_background {z-index:0;} -.stashr-poster_link {position:absolute;top:0;left:0;width:100%;height:100%;} -.stashr-poster_image {margin: 0 auto;display: block;vertical-align: middle;} - -.stashr-test_display {position:relative;display:inline-block;vertical-align:middle;} -.stashr-test-image {margin:0 auto;display:block;vertical-align:middle;width:100%;} - -.swiper-container { width:100%;height:100%;padding:0px;margin:0px; } -.swiper-wrapper { padding:0px;margin:0px; } -.swiper-slide { width:100%;height:100%;background: black; } -.swiper-slide img { height:100%; } - +.bg-mine { background: #3e3e44; } + +.stashr-menu { transition: 0.5s; } +.stashr-footer { position:fixed; bottom:0; z-index:6; } +.stashr-item_container { overflow: hidden; } +.stashr-poster_container { position:relative; overflow: hidden; } +.stashr-poster_info { position:absolute; top:0; left:0; z-index:3; border-bottom-right-radius: 25%; } +.stashr-badge_top_left { position:absolute; top:0; left:0; z-index:3; border-bottom-right-radius: 25%; } +.stashr-badge_bottom_left { position:absolute; bottom:0; left:0; z-index:3; border-top-right-radius: 25%; } +.stashr-badge_top_right { position:absolute; top:0; right:0; z-index:3; border-bottom-left-radius: 25%; } +.stashr-badge_bottom_right { position:absolute; bottom:0; right:0; z-index:3; border-top-left-radius: 25%; } +.stashr-poster_tag { position: absolute; height:0; right:0; width:25%; padding-bottom:25%; transform: rotate(45deg); z-index:3; margin-top:-12.5%; margin-right:-12.5%; } +.stashr-poster { position:absolute; top:0; left:0; } +.stashr-overlay_top { position:absolute; top:0; background-color:rgba(220,220,220,.9); z-index:4; } +.stashr-overlay_bottom { position:absolute; bottom:0; background-color:rgba(220,220,220,.9); z-index:4; } +.stashr-progress_wrapper { position:absolute; bottom:0; z-index:3; } +.stashr-poster_wrapper { position:relative; overflow:hidden; } +.stashr-link { text-decoration: none; } .stashr-button_container {position:fixed;bottom:10;right:10;opacity:.7;z-index:999;} -.stashr-button_container_reader {position:fixed;bottom:0;right:0;opacity:.7;z-index:999;} -.stashr-button { display:table-cell;vertical-align:middle;width:60px;height:60px; } - -.stashr-check_box {position:absolute;top:0;right:0;z-index:5;} - -.btn-circle.btn-sm { - width: 30px; - height: 30px; - padding: 6px 0px; - border-radius: 15px; - font-size: 8px; - text-align: center; -} -.btn-circle.btn-md { - width: 50px; - height: 50px; - padding: 7px 10px; - border-radius: 25px; - font-size: 10px; - text-align: center; -} -.btn-circle.btn-xl { - width: 70px; - height: 70px; - padding: 10px 16px; - border-radius: 35px; - font-size: 12px; - text-align: center; -} \ No newline at end of file +.stashr-menu_button_container {position:fixed;bottom:10;left:10;opacity:.7;z-index:999;} +.stashr-reader { background:black; } +.new-stashr-button_container { opacity:.7; } + +.btn-circle.btn-sm { width: 30px; height: 30px; padding: 6px 0px; border-radius: 15px; font-size: 8px; text-align: center; margin:2px; } +.btn-circle.btn-md { width: 50px; height: 50px; padding: 7px 10px; border-radius: 25px; font-size: 10px; text-align: center; margin:2px; } +.btn-circle.btn-xl { width: 70px; height: 70px; padding: 10px 16px; border-radius: 35px; font-size: 12px; text-align: center; margin:2px; } + +.stashr-signin { width: 100%; max-width: 330px; padding: 15px; margin: auto; } +.stashr-signin .checkbox { font-weight: 400; } +.stashr-signin .form-floating:focus-within { z-index: 2; } +.stashr-signin input[type="username"] { margin-bottom: -1px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } +.stashr-signin input[type="password"] { margin-bottom: 10px; border-top-left-radius: 0; border-top-right-radius: 0; } +.stashr-logo { position:relative; top:-85px; width:170px; height:170px; border-radius: 50%; border: 10px solid #2c2d35; margin-bottom:-70px; } + +.stashr-firstrun { width: 100%; max-width: 330px; padding: 15px; margin: auto; } +.stashr-firstrun .form-floating:focus-within { z-index: 2; } +.stashr-firstrun input { margin-bottom: 5px; } \ No newline at end of file diff --git a/stashr/static/js/stashr.js b/stashr/static/js/stashr.js index 376d7c7..1632e9c 100644 --- a/stashr/static/js/stashr.js +++ b/stashr/static/js/stashr.js @@ -2,7 +2,17 @@ function stashrToast(message, type) { Vue.$toast.open({ message: message, type: type, - position: 'bottom-left', + position: 'bottom-right', dismissable: true }); +} + +function toggleMenu() { + console.log('Toggle MENU') + var margin = getComputedStyle(document.querySelector('#sideMenu')).marginLeft; + if(margin == '0px') { + document.getElementById('sideMenu').style.marginLeft = "-280px"; + } else { + document.getElementById('sideMenu').style.marginLeft = "0px" + } } \ No newline at end of file diff --git a/stashr/templates/all_collections_page.html b/stashr/templates/all_collections_page.html index 591f2ff..289eab1 100644 --- a/stashr/templates/all_collections_page.html +++ b/stashr/templates/all_collections_page.html @@ -30,8 +30,10 @@ Vue.component('collections', { props: ['collections'], template: `
-
- +
+
+ +
    -
    -
    - - - - + > + diff --git a/stashr/templates/all_publishers_page.html b/stashr/templates/all_publishers_page.html index e3112c4..807bdf6 100644 --- a/stashr/templates/all_publishers_page.html +++ b/stashr/templates/all_publishers_page.html @@ -47,8 +47,10 @@ Vue.component('publishers', { props: ['publishers'], template: `
    -
    - +
    +
    + +
      -
      -
      - - - - + > + diff --git a/stashr/templates/all_volumes_page.html b/stashr/templates/all_volumes_page.html index e08877e..2554ce9 100644 --- a/stashr/templates/all_volumes_page.html +++ b/stashr/templates/all_volumes_page.html @@ -51,40 +51,57 @@ Vue.component('volume-item', { props: ['volume'], template: ` -
    • -
      -
      [[ volume.age_rating[0].rating_short ]]
      -
      [[ volume.volume_have ]]/[[ volume.volume_total ]]
      -
      [[ statusWord ]]
      -
    • `, computed: { - statusClass() { - let classname = 'bg-danger'; - if(this.volume.volume_status) { - classname = 'bg-success'; - }; - return classname; + volumeTag() { + let cornertag = ''; + if(!this.volume.volume_status) { + cornertag = "stashr-poster_tag bg-danger shadow"; + } + return cornertag; + }, + progressWidth() { + return (this.volume.volume_have / this.volume.volume_total)*100; }, - statusWord() { - let status = 'ENDED'; + progressColor() { + let classname = 'bg-success'; if(this.volume.volume_status) { - status = 'ONGOING'; - }; - return status; + classname = 'bg-info'; + } + if(this.progressWidth < 100) { + classname = 'bg-danger'; + } + return classname + }, + progressStyle() { + return "width: " + this.progressWidth + "%;" } }, data() { return { hover: false } }, @@ -95,8 +112,10 @@ Vue.component('volumes', { props: ['volumes'], template: `
      -
      - +
      +
      + +
      -
      `, data() { return { loading: true, search: '', } }, diff --git a/stashr/templates/base.html b/stashr/templates/base.html index ace2700..afca03c 100644 --- a/stashr/templates/base.html +++ b/stashr/templates/base.html @@ -1,5 +1,6 @@ + @@ -26,186 +27,161 @@ - - - - {% block header_script_files %}{% endblock %} {{ emit_tep('base_page_header_script_files') }} - - - -
    +
    +
    - +
    - + + - -
    -{% block header %}{% endblock %} -
    - + + {% block content %}{% endblock %} + + + +
    + +
    - -
    -{% block content %}{% endblock %} +
    + +
    + + +
    - - + {% block modals %}{% endblock %} {{ emit_tep('base_page_modals') }} - + - -
    -{% block button_container %}{% endblock %} -
    - - - + {% block footer_script_files %}{% endblock %} {{ emit_tep('base_page_footer_script_files') }} - + - + - + \ No newline at end of file diff --git a/stashr/templates/first_run_page.html b/stashr/templates/first_run_page.html index 1921c6d..ef2b8e1 100644 --- a/stashr/templates/first_run_page.html +++ b/stashr/templates/first_run_page.html @@ -1,52 +1,92 @@ -{% extends "base.html" %} - -{% block content %} -
    -
    - -
    -
    -
    First Run
    -
    -
    - + + + +Stashr - {{ title }} + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + {{ first_run_form.csrf_token }} + -
    - {{ first_run_form.username.label }} + {% if first_run_form.errors %} + + {% endif %} +
    {{ first_run_form.username(class_='form-control', placeholder=first_run_form.username.label.text) }} + {{ first_run_form.username.label }}
    -
    - {{ first_run_form.email.label }} +
    {{ first_run_form.email(class_='form-control', placeholder=first_run_form.email.label.text) }} + {{ first_run_form.email.label }}
    -
    - {{ first_run_form.password.label }} +
    {{ first_run_form.password(type='password', class_='form-control', placeholder=first_run_form.password.label.text) }} + {{ first_run_form.password.label }}
    -
    - {{ first_run_form.confirm_password.label }} +
    {{ first_run_form.confirm_password(type='password', class_='form-control', placeholder=first_run_form.confirm_password.label.text) }} + {{ first_run_form.confirm_password.label }}
    -
    -
    - {{ first_run_form.comicvine_api_key.label }} +
    {{ first_run_form.comicvine_api_key(class_='form-control', placeholder=first_run_form.comicvine_api_key.label.text) }} + {{ first_run_form.comicvine_api_key.label }}
    -
    -
    - {{ first_run_form.open_registration }} - {{ first_run_form.open_registration.label }} -
    -
    - {{ first_run_form.logging_level.label }} +
    {{ first_run_form.logging_level(class_='form-control') }} + {{ first_run_form.logging_level.label }}

    -
    - {{ first_run_form.first_run_button(class_='btn btn-success') }} -
    + + {{ first_run_form.first_run_button(class_='btn btn-success') }} +
    -
    -{% endblock %} \ No newline at end of file +
    + + + + + \ No newline at end of file diff --git a/stashr/templates/login_page.html b/stashr/templates/login_page.html index d95e7e8..b03c4c0 100644 --- a/stashr/templates/login_page.html +++ b/stashr/templates/login_page.html @@ -1,15 +1,37 @@ -{% extends "base.html" %} - -{% block content %} - -
    -
    - -
    -
    -
    Login
    -
    -
    + + + +Stashr - {{ title }} + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + {{ login_form.csrf_token }} + + {% if login_form.errors %}
{% endfor %}
- {% else %} {% endif %} - {{ login_form.csrf_token }} -
- {{ login_form.username(class_='input form-control', placeholder='Username') }} +
+ {{ login_form.username(class_='input form-control', type='username', placeholder='Username') }} + {{ login_form.username.label }}
-
+
{{ login_form.password(class_='input form-control', type='password', placeholder='Password') }} + {{ login_form.password.label }}
-
- {{ login_form.remember_me() }} Remember Me -
-
- {{ login_form.login_button(class_='btn btn-outline-success') }} - Forgot Password + +
+
+ + {{ login_form.login_button(class_='w-100 btn btn-lg btn-success shadow') }} + Forgot your password? +
-
+ + + -{% endblock %} \ No newline at end of file + + \ No newline at end of file diff --git a/stashr/templates/new_releases_page.html b/stashr/templates/new_releases_page.html index a9567ac..626fc88 100644 --- a/stashr/templates/new_releases_page.html +++ b/stashr/templates/new_releases_page.html @@ -73,33 +73,34 @@ Vue.component('modals', { Vue.component('release-item', { props: ['release'], template: ` -
  • -
    - -
    #[[ release.new_release_issue_number ]]
    -
    [[ subText ]]
    - -
    -
    - [[ release.new_release_comic_name ]] + > +
    +
    + #[[ release.new_release_issue_number ]] +
    +
    + + + + +
    + + +
    + [[ release.new_release_comic_name ]]
    - - - -
    -
  • `, computed: { className() { - let classname = 'bg-danger'; + let classname = 'text-danger'; try { if (this.release.status) { - classname = 'bg-success'; + classname = 'text-success'; } } finally { return classname; @@ -152,9 +153,16 @@ Vue.component('releases', { props: ['releases'], template: `
    +
    +
    + +
    +
    +
      Stashr - Reading - {{ comic_name }} - + @@ -18,14 +18,14 @@ - +
      -
      +
      diff --git a/stashr/templates/reading_list_page.html b/stashr/templates/reading_list_page.html index b393329..cd0f726 100644 --- a/stashr/templates/reading_list_page.html +++ b/stashr/templates/reading_list_page.html @@ -53,7 +53,7 @@ Vue.component('modals', {
      -