Redid the index to use flask forms. Removed un-needed html pages. Started adding database.

This commit is contained in:
dan
2022-01-20 02:22:36 -05:00
parent fa58df3f43
commit 2cbed43b29
7 changed files with 127 additions and 83 deletions

18
templates/base.html Normal file
View File

@@ -0,0 +1,18 @@
<html>
<head>
<title>Hydro</title>
</head>
<body>
<div>Hydro: <a href="index.html">home</a></div>
<br>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
{{ message }}
{% endfor %}
{% endif %}
{% endwith %}
<br>
{% block content %}{% endblock %}
</body>
</html>

View File

@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@@ -1,41 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<script src="../static/scripts.js"></script>
{% extends "base.html" %}
{% block content %}
<body>
<h1>Information</h1>
<form method="post">
<label>Plant Date</label>
<input type="date" name="plantDate"
value= {{ plant.plant }}>
<br>
<label>Last Feed Date</label>
<input type="date" name="lastDate"
value= {{ plant.last }}>
<br>
<label>Next Feed Date</label>
<input type="date" name="nextDate"
value= {{ plant.next }}>
<br>
Feed Frequency: {{ plant.freq }} days
<br>
<button type="submit">Update</button>
</form>
<head>
<meta charset="UTF-8">
<title>Hydro</title>
</head>
<body>
<h1>Information</h1>
<div>
Plant Date:
1/19/2022
<a href="plantdate.html">Change</a>
</div>
<div>
Last Feed Date:
<a href="lastfeeddate.html">Change</a>
</div>
<div>
Next Feed Date:
<a href="nextfeeddate.html">Change</a>
</div>
<div>
Feed Frequency:
<a href="freedfreq.html">Change</a>
</div>
<h1>Alerts</h1>
<div>
<input type="checkbox" id="alert_text" name="AlertText" value=true>
<label for="alert_text">Text Message</label>
<input type="checkbox" id="alert_email" name="AlertEmail" value=true>
<label for="alert_email">Email</label><br>
<button class=button onclick="updateAlerts()">Save</button>
</div>
<br><br>
<div>
<button class=button onclick="updateFeed()">Update Feed</button>
</div>
</body>
</html>
<h1>Alerts</h1>
<div>
<form method="post">
<input type="checkbox" id="alert_text" name="AlertText" value=alerts.text {{ "checked" if alerts.text else "" }}>
<label for="alert_text">Text Message</label>
<input type="checkbox" id="alert_email" name="AlertEmail" value=alerts.email {{ "checked" if alerts.email else "" }}>
<label for="alert_email">Email</label><br>
<button type="submit">Save</button>
</form>
</div>
<br><br>
<div>
<button class=button onclick="updateFeed()">Update Feed</button>
</div>
{% endblock %}

View File

@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>