-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial front-end * Remove unnecessary form.submit() * Little Fixes * Overhaul wind, clouds displaying * Fix url for airport page in favorite airports * Move redundant code outside of a function * Revert "Move redundant code outside of a function" This reverts commit d0dcee1. * Add airport name search * Add airport name filter * Add edge cases handling for lists in index.html * Add 404 and 500 .html * Add custom error handlers * Add correct descriptions * Add error 476 * Add metar error handling * Move favicon to external server * Move error image to external site * Add image handlers * Close #5 * Add reset_password sites layouts and some global fixes * Move error pages to their own directory * Add "forgot the password" button in login.html * Last fixes * Add new favicon * Button bugfixes Co-authored-by: DayWD <[email protected]> Co-authored-by: Artur Michałek <[email protected]>
- Loading branch information
1 parent
bc84646
commit f77eecf
Showing
39 changed files
with
967 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
venv/ | ||
__pycache__/ | ||
|
||
.idea | ||
htmlcov | ||
.coverage | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from avw.airport import bp | ||
|
||
|
||
@bp.app_template_filter() | ||
def decode_clouds(code): | ||
d = { | ||
'FEW': 'Few', | ||
'SCT': 'Scattered', | ||
'BKN': 'Broken', | ||
'OVC': 'Overcast', | ||
'CLR': 'Clear', | ||
'CAVOK': 'Clear' | ||
} | ||
print(code) | ||
return d.get(code, code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from avw.models import User | ||
from flask import current_app, render_template | ||
from flask_mailman import EmailMessage | ||
from threading import Thread | ||
|
||
|
||
def send_reset_password_email(email: str) -> None: | ||
user = User.query.filter_by(email=email).first() | ||
|
@@ -13,5 +15,10 @@ def send_reset_password_email(email: str) -> None: | |
from_email='[email protected]', | ||
body=render_template('mail/reset_password.html', token=token) | ||
) | ||
with current_app.app_context(): | ||
msg.send() | ||
Thread(target=send_email, args=[ | ||
current_app._get_current_object(), msg]).start() | ||
|
||
|
||
def send_email(app_object, email: EmailMessage): | ||
with app_object.app_context(): | ||
email.send() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from flask import Blueprint | ||
|
||
bp = Blueprint('errors', __name__) | ||
|
||
from avw.errors import routes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from avw.errors import bp | ||
from flask import render_template, current_app | ||
from os import environ | ||
|
||
|
||
@bp.app_errorhandler(404) | ||
def not_found_error(error): | ||
img = environ.get('ERROR_IMG') | ||
return render_template('errors/404.html', img=img), 404 | ||
|
||
|
||
@bp.app_errorhandler(500) | ||
def internal_server_error(error): | ||
img = environ.get('ERROR_IMG') | ||
return render_template('errors/500.html', img=img), 500 | ||
|
||
|
||
@bp.route('/476', methods=('GET',)) | ||
def no_metar_for_this_airport_error(): | ||
img = environ.get('476_IMG') | ||
return render_template('errors/476.html', img=img), 476 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from avw.main import bp | ||
from avw.search import get_airport_name | ||
|
||
|
||
@bp.app_template_filter('airport_name') | ||
def airport_name(code): | ||
return get_airport_name(code) or code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tbody#airport td { | ||
vertical-align: middle; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.button { | ||
background: rgb(117, 242, 231); | ||
background: linear-gradient(180deg, rgba(117, 242, 231, 1) 0%, rgba(58, 143, 225, 1) 80%); | ||
border-radius: 20px; | ||
border: none; | ||
color: white; | ||
padding: 10px 18px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 15px; | ||
margin: 2px 1px; | ||
cursor: pointer; | ||
transition: all 0.3s; | ||
} | ||
|
||
.login_button { | ||
background: rgb(58, 143, 225); | ||
background: linear-gradient(180deg, rgba(58, 143, 225, 1) 1%, rgba(117, 242, 231, 1) 100%); | ||
border-radius: 20px; | ||
border: none; | ||
color: white; | ||
padding: 10px 18px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 15px; | ||
margin: 2px 1px; | ||
cursor: pointer; | ||
transition: all 0.3s; | ||
} | ||
|
||
.list_fav { | ||
background: rgb(117, 242, 231); | ||
background: linear-gradient(180deg, rgba(117, 242, 231, 1) 0%, rgba(58, 143, 225, 1) 84%); | ||
border: black; | ||
} | ||
|
||
.button span { | ||
cursor: pointer; | ||
display: inline-block; | ||
position: relative; | ||
transition: 0.5s; | ||
} | ||
|
||
.button span:after { | ||
content: '\00bb'; | ||
position: absolute; | ||
opacity: 0; | ||
top: 0; | ||
right: -20px; | ||
transition: 0.5s; | ||
} | ||
|
||
.button:hover span { | ||
padding-right: 25px; | ||
} | ||
|
||
.button:hover span:after { | ||
opacity: 1; | ||
right: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.pass { | ||
width: 22%; | ||
padding: 8px 20px; | ||
border-radius: 20px; | ||
-webkit-border-radius: 20px; | ||
-moz-border-radius: 20px; | ||
display: inline-block; | ||
border: 1px solid #ccc; | ||
box-sizing: border-box; | ||
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='50px' width='200px'><text x='20' y='22' fill='gray' font-size='16'>Password</text></svg>"); | ||
background-repeat: no-repeat; | ||
outline: none; | ||
} | ||
|
||
.login { | ||
width: 22%; | ||
padding: 8px 20px; | ||
border-radius: 20px; | ||
-webkit-border-radius: 20px; | ||
-moz-border-radius: 20px; | ||
display: inline-block; | ||
border: 1px solid #ccc; | ||
box-sizing: border-box; | ||
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='50px' width='200px'><text x='20' y='22' fill='gray' font-size='16'>Login</text></svg>"); | ||
background-repeat: no-repeat; | ||
outline: none; | ||
} | ||
|
||
input:valid { | ||
background-image: none; | ||
} | ||
|
||
input:focus { | ||
background-image: none; | ||
} | ||
|
||
::-webkit-input-placeholder { /* Chrome/Opera/Safari */ | ||
color: transparent; | ||
} | ||
|
||
::-moz-placeholder { /* Firefox 19+ */ | ||
color: transparent; | ||
} | ||
|
||
:-ms-input-placeholder { /* IE 10+ */ | ||
color: transparent; | ||
} | ||
|
||
:-moz-placeholder { /* Firefox 18- */ | ||
color: transparent; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.