commit ae25b01a4a94e857589e8aa18533e5a742ac27e3
parent 0c9b8eafb0d2fb902e8af29ad0831f3e3b2808af
Author: Brennen T. Mazur <brennen@madis.cool>
Date: Sun, 19 Mar 2023 13:05:11 -0600
implement changehours form with more refined styling
Diffstat:
2 files changed, 26 insertions(+), 41 deletions(-)
diff --git a/app/static/css/main.css b/app/static/css/main.css
@@ -100,7 +100,14 @@ header {
background-color: var(--widgetbg);
border-radius:.5em;
}
-
+.hours-grid table tr:nth-child(even) {
+ background-color:var(--maincolor);
+}
+.hours-grid table,.hours-grid tr,.hours-grid td{
+ border:1px;
+ border-color:var(--accent);
+ padding:1rem;
+}
/********** (In)Active Users PAGE **********/
.activeusers-grid {
grid-auto-columns:auto;
diff --git a/app/templates/dashboard/punchclock/index.html b/app/templates/dashboard/punchclock/index.html
@@ -9,50 +9,28 @@
<div><!-- abstract to payPeriod() -->
<h6>$payperiod range</h6>
</div>
- {% for entry in hours %} <!-- for hours, print either form w/ entry data, or <a href="url_for('houredit',entry=[entry._id])>-->
- {%- print(entry) %}
- </br>
- </br>
+ {% for choice in choices %}
+ {%- print(choice) %}
{% endfor %}
<form action="" method="POST" novalidate>
- <input type="submit" value="Request Changes">
- <input type="reset">
- <table><!-- replace w/ function getUserHours(username) -->
- <tr>
- <th>Day</th>
- <th>Project</th>
- <th>Start</th>
- <th>Finish</th>
- <th>Lunch</th>
- <th>Per Diem</th>
- <th>Add Project</th>
- <th>Remove Time</th>
- </tr>
- <tr><!-- for loop iterating over document entries -->
- <td><input type="date"value="2023-01-03"min="2023-01-01"max="2023-01-15">or Wednesday Jan 3rd?</td>
- <td><select><option selected>Project #1</option><option>Project #2</option><option>Project #3</option></select></td>
- <td><input type="time" value="12:12"/></td>
- <td><input type="time" value="01:11"/></td>
- <td><input type="checkbox"></input></td>
- <td><input type="checkbox"></input></td>
- <td><button>+</button></td>
- <td><button>-</button></td>
- </tr>
+ <table><tr>
+ {% for field in form %}{% if field.widget.input_type != 'hidden' %}
+ <th>{{ field.label }}</th>
+ {% endif %}{% endfor %}</tr>
+
+ {% for entry in hours %}
<tr>
- <td>Wednesday Jan 2rd</td>
- <td><select><option>Project #1</option><option selected>Project #2</option><option>Project #3</option></select></td>
- <td><input type="time" value="12:12"/></td>
- <td><input type="time" value="01:11"/></td>
- <td><input type="checkbox"></input></td>
- <td><input type="checkbox"></input></td>
- <td><button>+</button></td>
- <td><button>-</button></td>
- </tr>
- <tr><!-- getUserHours(username) if note present returns following tr -->
- <td></td><!-- date space -->
- <td>note:<input type="text" value="reason for requested change"/></td>
+ <td>{{ entry.project }}{{ form.projectChg(default=entry.project) }}</td>
+ <td>{{ entry.clock_in.0 }}{{ form.startTiChg() }}</td>
+ <td>{{ entry.clock_out }}{{ form.endTimeChg() }}</td>
+ <td>{{ entry.lunch }}{% if entry.lunch %}{{ form.lunchBxChg(default="checked")}}{%else%}{{ form.lunchBxChg() }}{% endif %} </td>
+ <td>{{ entry.per_diem }}{{ form.perDiemChg(default='checked') }}</td>
+ <td>{{ form.updateEntr() }}</td>
+ <td>{{ form.removeEntr() }}</td>
+ {{ form.hidden_tag() }}
</tr>
- </table>
+ {% endfor %}
+ </table>
</form>
</section>
{% endblock %}