stc

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

widget.html (5819B)


      1 <section class="agreements">
      2 	{% with messages = get_flashed_messages() %}
      3 	{% if messages %}
      4 	{% for message in messages %}
      5 	<div id='messagebanner'><p>{{ message }}</p></div>
      6 	{% endfor %}
      7 	{% endif %}
      8 	{% endwith %}
      9 	<section class="employee-overlook">
     10 		<!--{#<div class="employee-hours">
     11 			<table>
     12 				<tr>
     13 					<th>Employee</th>
     14 					<th>Total(hrs)</th>
     15 					<th>Lunch(#)</th>
     16 					<th>Per Diem(#)</th>
     17 					<th>Billable(hrs)</th>
     18 				</tr>
     19 			{% for entry in allhours %}
     20 				<tr>
     21 					<td><a href="{{url_for('hours',username=entry._id)}}">{{ entry['_id'] }}</a></td>
     22 					<td><a href="{{url_for('hours',username=entry._id)}}">{{ (entry['totalTime']/(1000*60*60))|round(2) }}</a></td>
     23 					<td><a href="{{url_for('hours',username=entry._id)}}">{{ entry['lunchCount'] }}</a></td>
     24 					<td><a href="{{url_for('hours',username=entry._id)}}">{{ entry['perdiemCount'] }}</a></td>
     25 					<td><a href="{{url_for('hours',username=entry._id)}}">{{ (entry['totalHoursWorked']/(1000*60*60))|round(2) }}</a></td>
     26 				</tr>
     27 			{% endfor %}
     28 			</table>
     29 		</div>#}-->
     30 		<!--{#<div>Test Div</br>
     31 			{% for elmnt in usors %}
     32 			{{elmnt}}</br>
     33 			{% endfor %}
     34 
     35 		</div>#}-->
     36 		<!--{#<div>Projours Div</br>
     37 			{% for elmnt in projours %}
     38 			{{elmnt}}</br>
     39 			{% endfor %}
     40 		</div>#}-->
     41 		<!--{#<div>Project Lookup Div</br>
     42 			{% for elmnt in projectlookup %}
     43 			{{elmnt['modified_by'][0]}}
     44 			{{elmnt['date']}}
     45 			{{elmnt['project_data'][0]['project_name']}}
     46 			{{elmnt}}</br></br>
     47 			{% endfor %}
     48 		</div>#}-->
     49 		<div class="pagebreak"><h2>Reports by User</h2></div>
     50 		<!-- <div class="pagebreak"></div> -->
     51 			{% for user, times in by_user.items() %}
     52 			<div class="pagebreak">
     53 			<dl class="user-summary">
     54 				<dt><h3>{{ user }}</h3></dt>
     55 				<dd>Total Hours(hrs):<a href="{{url_for('hours',username=user)}}">{{ (times['totalHoursWorked']/(1000*60*60))|round(2) }}</a></dd>
     56 				<dd>Total Lunches:<a href="{{url_for('hours',username=user)}}">{{ times['lunchCount'] }}</a></dd>
     57 				<dd>Total Per Diem:<a href="{{url_for('hours',username=user)}}">{{ times['perdiemCount'] }}</a></dd>
     58 			</dl>
     59 			<table>
     60 				<tr>
     61 					<th>Date</th>
     62 					<th>Project</th>
     63 					<th>Clocked In</th>
     64 					<th>Clocked Out</th>
     65 					<th>Lunch</th>
     66 					<th>Per Diem</th>
     67 					<th>Time(hrs)</th>
     68 				</tr>
     69 			{% for time in times['times'] %}
     70 			<!-- {# <a href="{{url_for('hours',username=time['modified_by'][0])}}#{{time['_id']}}"> #} -->
     71 				<tr>
     72 					<td><a href="{{url_for('updateDate',mod_username=current_user.username,timeid=time._id)}}">{{time['date'].date().isoformat()}}</a></td>
     73 					<td><a href="{{url_for('updateProjectTime',mod_username=current_user.username,timeid=time._id)}}">{{time['project_data'][0]['project_name']}}</a></td>
     74 					<td><a href="{{url_for('updateStartTime',mod_username=current_user.username,timeid=time._id)}}">{{time['clock_in'][-1].time().isoformat(timespec="minutes")}}</a></td>
     75 					{% if time['clock_out'] is defined %}
     76 						<td><a href="{{url_for('updateEndTime',mod_username=current_user.username,timeid=time._id)}}">{{time['clock_out'][-1].time().isoformat(timespec="minutes")}}</a></td>
     77 					{% else %}
     78 						<td><a href="{{url_for('updateEndTime',mod_username=current_user.username,timeid=time._id)}}">Clocked In</a></td>
     79 					{% endif %}
     80 					<td><a href="{{url_for('toggle_lunch',timeid=time._id)}}">{{time['lunchCount']}}</a></td>
     81 					<td><a href="{{url_for('toggle_per_diem',timeid=time._id)}}">{{time['perdiemCount']}}</a></td>
     82 					<td><a href="{{url_for('hours',username=time['modified_by'][0])}}">{{ (time['totalHoursWorked']/(1000*60*60))|round(2) }}</a></td>
     83 				</tr>
     84 			{% endfor %}
     85 			</table></div>
     86 			<table>
     87 				<tr>
     88 					<th>Date</th>
     89 					<th>Note</th>
     90 				</tr>
     91 				{% for item in times['times'] %}
     92 				{% if item['note'] %}
     93 				<tr>
     94 					<td>{{item['date'].date().isoformat()}}</td>
     95 					<td>{{item['note']}}</td>
     96 				</tr>
     97 				{% endif %}
     98 				{% endfor %}
     99 			</table>
    100 			{% endfor %}
    101 		
    102 	<!-- </section>
    103 	<section class="project-overlook"> -->
    104 		<div class="pagebreak"><h2>Reports by Project</h2></div>
    105 		<!-- <div class="pagebreak"></div> -->
    106 			{% for project, times in by_project.items() %}
    107 			<div class="pagebreak">
    108 			<dl class="user-summary">
    109 				<dt><h3>{{ project }}</h3></dt>
    110 				<dd>Total Hours(hrs):<a href="{{url_for('hours',username='brennentmazur')}}">{{ (times['totalHoursWorked']/(1000*60*60))|round(2) }}</a></dd>
    111 				<dd>Total Lunches:<a href="{{url_for('hours',username='brennentmazur')}}">{{ times['lunchCount'] }}</a></dd>
    112 				<dd>Total Per Diem:<a href="{{url_for('hours',username='brennentmazur')}}">{{ times['perdiemCount'] }}</a></dd>
    113 			</dl>
    114 			<table>
    115 				<tr>
    116 					<th>Date</th>
    117 					<th>Employee</th>
    118 					<th>Clocked In</th>
    119 					<th>Clocked Out</th>
    120 					<th>Lunch</th>
    121 					<th>Per Diem</th>
    122 					<th>Time(hrs)</th>
    123 				</tr>
    124 			{% for time in times['times'] %}
    125 				<tr>
    126 					<td>{{time['date'].date().isoformat()}}</td>
    127 					<td>{{time['modified_by'][0]}}</td>
    128 					<td>{{time['clock_in'][-1].time().isoformat(timespec="minutes")}}</td>
    129 					{% if time['clock_out'] is defined %}
    130 						<td>{{time['clock_out'][-1].time().isoformat(timespec="minutes")}}</td>
    131 					{% else %}
    132 						<td>Clocked In</td>
    133 					{% endif %}
    134 					<td>{{time['lunchCount']}}</td>
    135 					<td>{{time['perdiemCount']}}</td>
    136 					<td><a href="{{url_for('hours',username=time['modified_by'][0])}}">{{ (time['totalHoursWorked']/(1000*60*60))|round(2) }}</a></td>
    137 				</tr>
    138 			{% endfor %}
    139 			</table></div>
    140 			<table>
    141 				<tr>
    142 					<th>Date</th>
    143 					<th>Employee</th>
    144 					<th>Note</th>
    145 				</tr>
    146 				{% for item in times['times'] %}
    147 				{% if item['note'] %}
    148 				<tr>
    149 					<td>{{item['date'].date().isoformat()}}</td>
    150 					<td>{{item['modified_by'][0]}}</td>
    151 					<td>{{item['note']}}</td>
    152 				</tr>
    153 				{% endif %}
    154 				{% endfor %}
    155 			</table>
    156 			{% endfor %}
    157 
    158 	</section>
    159 </section>