Switched from sqlite to mysql database. Moved feeding frequency to the settings table. Got the alert checkboxes working correctly. Started to add update feed method and button to site.

This commit is contained in:
dan
2022-02-05 14:52:29 -05:00
parent 92578b53ae
commit 3e3daf9a98
4 changed files with 69 additions and 53 deletions

View File

@@ -1,38 +1,26 @@
{% extends "base.html" %}
{% block content %}
<body>
<h1>Information</h1>
<form method="post">
<label>Plant Date</label>
<input type="date" name="plantDate"
value= {{ plant.plant }}>
<input type="date" name="plantDate" value= {{ plant.plant }}>
<br>
<label>Last Feed Date</label>
<input type="date" name="lastDate"
value= {{ plant.last }}>
<input type="date" name="lastDate" value= {{ plant.last }}>
<br>
<label>Next Feed Date</label>
<input type="date" name="nextDate"
value= {{ plant.next }}>
<input type="date" name="nextDate" value= {{ plant.next }}>
<br>
Feed Frequency: {{ plant.freq }} days
<br>
<button type="submit">Update</button>
<br>
<h1>Alerts</h1>
<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>
<input type="submit" id="DateSubmitForm" name="DateSubmitForm" value="Save">
</form>
<button class=button onclick="updateFeed()">Update Feed</button>
<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 %}