Source

django-timepiece / timepiece / templates / timepiece / time-sheet / people / view.html

Full commit
{% extends 'timepiece/time-sheet/base.html' %}
{% load timepiece_tags %}

{% block title %}{{ person }} Time Sheet{% endblock %}

{% block content %}
<h2>{{ person.first_name }} {{ person.last_name}}'s Time Sheet ({{ window.date|date:"N j" }} &mdash; {{ window.end_date|date:"N j" }})</h2>
<ul class='header-actions-left'>
    <li>
        {% if perms.timepiece.view_user %}
            <a href='{% url view_person person.pk %}'>User Information</a>
        {% endif %}
    </li>
    <li>
        {% if window.previous %}
            <a href='{% url view_person_time_sheet person.pk,window.period.pk,window.previous.pk %}'>Previous Time Sheet</a>
        {% else %}
            Previous Time Sheet
        {% endif %}
    </li>
    <li>
        {% if window.next %}
            <a href='{% url view_person_time_sheet person.pk,window.period.pk,window.next.pk %}'>Next Time Sheet</a>
        {% else %}
            Next Time Sheet
        {% endif %}
    </li>
    {% if perms.timepiece.export_project_time_sheet %}
    {# <li><a href='{% url export_project_time_sheet project.id,window.id %}'>Export as CSV</a></li> #}
    {% endif %}
    {% if show_verify %}<li><a href='{% url time_sheet_change_status 'verify',person.id,period.id,window.id %}'>Verify Time Sheet</a></li>{% endif %}
    {% if show_approve %}<li><a href='{% url time_sheet_change_status 'approve',person.id,period.id,window.id %}'>Approve Time Sheet</a></li>{% endif %}
</ul>

{% if entries %}
    <table>    
        <tr>
            <th>Date</th>
            <th>Project</th>
            <th>Activity</th>
            <th>Location</th>
            <th>Time In</th>
            <th>Time Out</th>
            <th>Breaks</th>
            <th>Hours</th>
        </tr>    
            
        {% for entry in entries %}            
            <tr>
                <td>{{ entry.start_time|date:"m/d/Y (D)" }}</td>
                <td>{{ entry.project.name }}</td>
                <td>{{ entry.activity.name }}</td>
                <td>{{ entry.location }}</td>
                <td>{{ entry.start_time|date:"P" }}</td>
                <td>{{ entry.end_time|date:"P" }}</td>
                <td>{{ entry.seconds_paused|seconds_to_hours }}</td>
                <td>{{ entry.hours }}</td>
                {% if entry.is_editable %}<td><a href="{% url timepiece-update entry.id %}">Edit</a></td>{% endif %}
            </tr>
        {% endfor %}
        <tr>
            <th colspan='7'>Total:</th>
            <td>{{ total|floatformat:2 }}</td>
        </tr>
    </table>
{% else %}
    <p>No entries exist for this time sheet.</p>
{% endif %}

{% if project_entries %}
    <table id='person-summary'>
        <caption>Project Summary</caption>
    {% for entry in project_entries %}
        <tr>
            <td>{{ entry.project__name}} </td>
            <td>{{ entry.sum }}</td>
        </tr>
    {% endfor %}        
    </table>
{% endif %}

<table id='activity-summary'>
    <caption>Billable Summary</caption>
    <tr>
        <td>Billable</td><td>{{summary.billable}}</td>
    </tr>
    <tr>
        <td>Non-billable</td><td>{{summary.non_billable}}</td>
    </tr>
    <tr>
        <td>Invoiced</td><td>{{summary.invoiced}}</td>
    </tr>
    <tr>
        <td>Uninvoiced</td><td>{{summary.uninvoiced}}</td>
    </tr>
</table>

<br style='clear: both' />

{% endblock %}