commit 66df8169f0bd68922a4ed2a96a8321d28b0c9ce6
parent 8113f0ec0451f38211e67ef24a8c0b8153096f43
Author: Brennen T. Mazur <brennen@madis.cool>
Date: Sat, 10 Dec 2022 01:58:41 -0700
Prototyping for Punchclock, Fleet, and Active Users Templates
Diffstat:
6 files changed, 86 insertions(+), 25 deletions(-)
diff --git a/app.py b/app.py
@@ -5,7 +5,7 @@ app = Flask(__name__)
@app.route('/')
def hello():
- return render_template('index.html', currenttime=datetime.datetime.utcnow())
+ return render_template('index.html',currenttime=datetime.datetime.utcnow())
@app.route("/signup")
def signup():
diff --git a/templates/activeusers/widget.html b/templates/activeusers/widget.html
@@ -0,0 +1,31 @@
+<section class="activeusers">
+ <h3>Clocked in Crew List</h3>
+ <form>
+ <input type="submit" value="Clock Crew Out">
+ <table><!-- replace w/ function getUserHours(username) -->
+ <tr><!-- FOR EACH clocked in user iterate user ...does each user need to be its own form? -->
+ <td><input type="button" onclick="alert('route to /changehours<user1>')" value="user1.name"></td>
+ <td><input type="checkbox" name="onCrew" checked><label for="onCrew">On Crew</label></td>
+ <td><input type="checkbox" name="perdium"><label for="perdium">Perdium</label></td>
+ <td><input type="button" onclick="alert('route to /changehours<user1>')" value="user1.timeIn"></td>
+ <td><input type="submit" value="Clock Out"></td>
+ </tr>
+ <tr><!-- FOR EACH clocked in user iterate user ...does each user need to be its own form? -->
+ <td><input type="button" onclick="alert('route to /changehours<user2>')" value="user2.name"></td>
+ <td><input type="checkbox" name="onCrew" checked><label for="onCrew">On Crew</label></td>
+ <td><input type="checkbox" name="perdium"><label for="perdium">Perdium</label></td>
+ <td><input type="button" onclick="alert('route to /changehours<user2>')" value="user2.timeIn"></td>
+ <td><input type="submit" value="Clock Out"></td>
+ </tr>
+ </form>
+ <form>
+ <tr><!-- clock in clocked out user -->
+ <th><select><option value="user3.name" selected>user3.name</option><option value="user4.name">user4.name</option><option value="user5.name">user5.name</option></select></th>
+ <td><input type="checkbox" name="onCrew" checked><label for="onCrew">On Crew</label></td>
+ <td><input type="checkbox" name="perdium"><label for="perdium">Perdium</label></td>
+ <td><input type="time" value="12:12"/></td>
+ <td><input type="submit" value="Clock in New Member"></td>
+ </tr>
+ </table>
+ </form>
+</section>
diff --git a/templates/base.html b/templates/base.html
@@ -7,19 +7,19 @@
</head>
<body>
<section class="appview">
+ <!-- start temp full page blocks -->
+ {% block hours %} {% endblock %}
+ <!-- end temp full page blocks -->
+
<!-- functioncall for checking role -->
<!-- while/for loop adding blocks for permissive widgets -->
- <!-- this is calling extended block {% block content %} {% endblock %} -->
<!-- temporary call all blocks for general 'wireframing' -->
- <!-- start temp widget blocks -->
- {% block punchclock %} {% endblock %}
- {% block punchedin %} {% endblock %}
- {% block fleet %} {% endblock %}
+ <!-- start temp widget blocks WHEN DONE MOVE TO DASHBOARD/INDEX PAGE-->
+ {% include 'punchclock/widget.html' %}
+ {% include 'activeusers/widget.html' %}
+ {% include 'fleet/widget.html' %}<!-- might need to be block to allow changing between check out and check in vehicle buttons... Or Ifstatements... -->
<!-- end temp widget blocks -->
- <!-- start temp full page blocks -->
- {% block hours %} {% endblock %}
- <!-- end temp full page blocks -->
</section>
<nav>
<!-- functioncall for inserting <a> for permissive pages -->
diff --git a/templates/fleet/widget.html b/templates/fleet/widget.html
@@ -0,0 +1,23 @@
+<section class="fleet">
+ <h2>Fleet</h2>
+ <form>
+ <select name="Vehicle ID"><!--replace w/ selectVehicle() or FOR EACH loop for array passed as available Vehicle... Leaning towards latter -->
+ <option value="vehicle1">vehicle1</option><!-- for/while loop displaying each $vehicleID user has permission for -->
+ <option value="vehicle2" selected>vehicle2</option>
+ <option value="vehicle3">vehicle3</option>
+ </select>
+ <label for="startMileage">Starting Mileage</label>
+ <input type="number" id="startMileage" name="startMileage" value="102416" min="102416" required><!-- min is last vehicleID.endMileage ask about potential maximum value? -->
+ <!-- Should safety checks be a seperate form? -->
+ <label for="safetyItem1">Safety Check 1</label>
+ <input type="checkbox" name="safetyItem1" value="safetyItem1" required>
+ <label for="safetyItem2">Safety Check 2</label>
+ <input type="checkbox" name="safetyItem2" value="safetyItem2" required>
+ <label for="safetyItem3">Safety Check 3</label>
+ <input type="checkbox" name="safetyItem3" value="safetyItem3" required>
+ <label for="safetyItem4">Safety Check 4</label>
+ <input type="checkbox" name="safetyItem4" value="safetyItem4" required>
+ <input type="text" value="Additonal Inspection Notes">
+ <input type="submit" value="Checkout Vehicle">
+ </form>
+</section>
diff --git a/templates/punchclock/index.html b/templates/punchclock/index.html
@@ -2,11 +2,13 @@
{% block hours %}
<div class="hours-grid">
- <h3>username</h3><!-- abstract to 'welcome' function -->
+ <h3>username</h3><!-- abstract to 'welcome' function more like python var insert. IF logged in user has permission allow this username section to be a dropdown for modifying user time sheets. -->
<div><!-- abstract to payPeriod() -->
<h6>$payperiod range</h6>
- <button>Request Changes</button>
</div>
+ <form>
+ <input type="submit" value="Request Changes">
+ <input type="reset">
<table><!-- replace w/ function getUserHours(username) -->
<tr>
<th>Day</th>
@@ -17,20 +19,20 @@
<th>Add Project</th>
<th>Remove Time</th>
</tr>
- <tr>
- <th>Wednesday Jan 3rd</th>
- <th>Project #1(dropdown)</th>
- <th><input type="text" value="12:12"/></th>
- <th><input type="text" value="1:11"/></th>
+ <tr><!-- for loop iterating over document entries -->
+ <th><input type="date"value="2023-01-03"min="2023-01-01"max="2023-01-15">or Wednesday Jan 3rd?</th>
+ <th><select><option selected>Project #1</option><option>Project #2</option><option>Project #3</option></select></th>
+ <th><input type="time" value="12:12"/></th>
+ <th><input type="time" value="01:11"/></th>
<th><input type="checkbox"></input></th>
<th><button>+</button></th>
<th><button>-</button></th>
</tr>
<tr>
<th>Wednesday Jan 2rd</th>
- <th>Project #2(dropdown)</th>
- <th><input type="text" value="12:12"/></th>
- <th><input type="text" value="1:11"/></th>
+ <th><select><option>Project #1</option><option selected>Project #2</option><option>Project #3</option></select></th>
+ <th><input type="time" value="12:12"/></th>
+ <th><input type="time" value="01:11"/></th>
<th><input type="checkbox"></input></th>
<th><button>+</button></th>
<th><button>-</button></th>
@@ -40,5 +42,6 @@
<th>note:<input type="text" value="reason for requested change"/></th>
</tr>
</table>
+ </form>
</div>
{% endblock %}
diff --git a/templates/punchclock/widget.html b/templates/punchclock/widget.html
@@ -1,11 +1,15 @@
-{% extends 'index.html' %}
-
-{% block items %}
+<section class="punchclock">
<h2>{{ currenttime }}</h2>
- <button href="#">Modify Hours</button><!--routes to userhours.html-->
+ <button href="{{ url_for('changeHours') }}">Modify Hours</button><!--routes to userhours.html-->
<form>
- <select name="Project Name">
+ <select name="Project Name"><!--replace w/ selectProject() or FOR EACH loop for array passed as available Projects... Leaning towards latter -->
<option value="#">$#</option><!-- for/while loop displaying each $projectName user has permission for -->
+ <option value="2" selected>second project</option>
+ <option value="3" selected>third project</option>
</select>
+ <input type="submit" value="Clock In"><!--if user.isClockedIn()returns true value="Clock Out" elseif user.isClockedIn() returns true AND Project Name = isClockedIn().projectname CLOCK OUT and CLOCK IN with new PROJECT NAME -->
+ <input type="checkbox" name="Perdium" value="perdium">
+ <label for="Perdium">Perdium</label>
</form>
-{% endblock %}
+ <h2>User.name</h2><!-- something like currenttime above -->
+</section>