-
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.
- Loading branch information
Showing
6 changed files
with
100 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"zipcode": "{{ zipcode }}" | ||
} |
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,2 @@ | ||
SPDX-FileCopyrightText: 2023 Alec Delaney | ||
SPDX-License-Identifier: MIT |
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,19 @@ | ||
# SPDX-FileCopyrightText: 2023 Alec Delaney | ||
# SPDX-License-Identifier: MIT | ||
|
||
""" | ||
WTForms used in the Flask application | ||
Author: Alec Delaney | ||
""" | ||
|
||
from flask_wtf import FlaskForm | ||
from wtforms import StringField, SubmitField | ||
from wtforms.validators import DataRequired | ||
|
||
|
||
class MenorahSetupForm(FlaskForm): | ||
"""Form for menorah information""" | ||
|
||
zipcode = StringField("Zip Code", validators=[DataRequired()]) | ||
submit = SubmitField("Generate file...") |
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 @@ | ||
# SPDX-FileCopyrightText: 2023 Alec Delaney | ||
# SPDX-License-Identifier: MIT | ||
|
||
""" | ||
Helper functions used by the Flask application | ||
Author: Alec Delaney | ||
""" | ||
|
||
import json | ||
|
||
|
||
def generate_settings_json(zipcode: str): | ||
"""Generate a settings file for the CircuiyPythonukiah""" | ||
return json.dumps({"zipcode": zipcode}) |
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,25 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2023 Alec Delaney | ||
SPDX-License-Identifier: MIT | ||
--> | ||
|
||
{% from 'bootstrap5/form.html' import render_form %} | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
{{ bootstrap.load_css() }} | ||
</head> | ||
<body> | ||
<h1>Hello, world!</h1> | ||
<br/> | ||
{{ render_form(input_form) }} | ||
<br/> | ||
{% if download_file %} | ||
{ render_form(download_form) } | ||
{% endif %} | ||
{{ bootstrap.load_js() }} | ||
</body> | ||
</html> |