stc

a simple time card webapp
git clone _git@git.brennen.work:stc.git
Log | Files | Refs | README

index.html (3584B)


      1 {% extends 'base.html' %}
      2 
      3 {% block title %}Hours{% endblock %}
      4 
      5 {% block content %}{# change table to div structure https://css-tricks.com/complete-guide-table-element/ #}
      6 	<section class="hours-grid">
      7 		<h3>{{ user.fname }} {{ user.lname }}</h3><!-- IF logged in user has permission allow this username section to be a dropdown for modifying user time sheets. -->
      8 		<h1 id="clock"></h1>
      9 		<div><!-- abstract to payPeriod() -->
     10 			<h6>$payperiod range</h6>
     11 			<!--<h5>Total:{# {{ statement_hours }} #}</h5> -->
     12 			{{availableProjects}}
     13 		</div>
     14 		<a href="{{url_for('new_time',usernm=user.username)}}" style="  border: none;
     15 			  background: var(--accent);
     16 			    cursor: pointer;
     17 			      border-radius: 3px;
     18 			        padding: 6px;
     19 				  width: 200px;
     20 				    color: white;
     21 				      margin-left: 25px;
     22 				        box-shadow: 0 3px 6px 0 rgba(0,0,0,0.2);">New Time</a>
     23 		<form action="" method="POST" novalidate>
     24 			<table><tr>
     25 			{% for field in form %}{% if field.widget.input_type != 'hidden' and field.widget.input_type != 'submit' %}
     26 				<th>{{ field.label }}</th>
     27 			{% endif %}{% endfor %}</tr>
     28 			<!--{#	<tr>
     29 				<td>{{ form.dateSel() }}</td>
     30 				<td>{{ form.projectSel() }}</td>
     31 				<td>{{ form.startTime() }}</td>
     32 				<td>{{ form.endTime() }}</td>
     33 				<td>{{ form.lunchSel() }}</td>
     34 				<td>{{ form.perDiemSel() }}</td>
     35 				<td>{{ form.note() }}</td>
     36 				<td>{{ form.submitEntr() }}</td>
     37 				</tr>   #}-->
     38 
     39 			{% for entry in hours %}
     40 			<tr>
     41 				<td><a href="{{url_for('updateDate',mod_username=current_user.username,timeid=entry._id)}}">{{ entry.date.date().isoformat() }}</a></td>
     42 				{% if entry.project[0] %}
     43 					<td><a href="{{url_for('updateProjectTime',mod_username=current_user.username,timeid=entry._id)}}">{{ entry.project[0]['project_name'] }}</a></td>
     44 				{% else %}
     45 					<td><a href="{{url_for('updateProjectTime',mod_username=current_user.username,timeid=entry._id)}}">Project not Found</a></td>
     46 				{% endif %}
     47 				<td><a href="{{url_for('updateStartTime',mod_username=current_user.username,timeid=entry._id)}}">{{ entry.clock_in[-1].time().isoformat(timespec='minutes') }}</a></td>
     48 				{% if entry.clock_out %}
     49 					<td><a href="{{url_for('updateEndTime',mod_username=current_user.username,timeid=entry._id)}}">{{ entry.clock_out[-1].time().isoformat(timespec='minutes') }}</a></td>
     50 				{% else %}
     51 					<td><a href="{{url_for('updateEndTime',mod_username=current_user.username,timeid=entry._id)}}">Clocked In</a></td>
     52 				{% endif %}
     53 				{% if entry.lunch %}
     54 				<td><a href="{{url_for('toggle_lunch',timeid=entry._id)}}">Yes</a></td>
     55 				{% else %}
     56 				<td><a href="{{url_for('toggle_lunch',timeid=entry._id)}}">No</a></td>
     57 				{% endif %}
     58 				{% if entry.per_diem %}
     59 				<td><a href="{{url_for('toggle_per_diem',timeid=entry._id)}}">Yes</a></td>
     60 				{% else %}
     61 				<td><a href="{{url_for('toggle_per_diem',timeid=entry._id)}}">No</a></td>
     62 				<td><a href="{{url_for( 'removetime',timeid=entry._id) }}" class="action-button">Remove</a></td>
     63 			</tr>
     64 			<tr>
     65 				{% endif %}
     66 				{% if entry.note %}
     67 				<td colspan='6'><a href="{{url_for('updateNote',mod_username=current_user.username,timeid=entry._id)}}">{{ entry.note }}</a></td>
     68 				{% else %}
     69 				<td colspan='6'><a href="{{url_for('updateNote',mod_username=current_user.username,timeid=entry._id)}}">Add Note</a></td>
     70 				{% endif %}
     71 			</tr>
     72 			{# {{entry}} #}
     73 			{% endfor %}
     74 			</table>
     75 		</form>
     76 		<a href="{{url_for('all_user_hours',username=user.username)}}"class="action-button">Past Hours</a>
     77 	</section>
     78 	{#
     79 	{% for time in tspp %}
     80 		{{ time }}
     81 		</br>
     82 	{% endfor %}
     83 	#}
     84 {% endblock %}