<commit_before>{% extends 'timepiece/time-sheet/base.html' %}
{% load timepiece_tags %}

{% block title %}Timepiece Entries{% endblock %}

{% block content %}
<h2>My Time Sheet</h2>
<ul class='header-actions-left'>
    <li><a href="{% url timepiece-clock-in %}">Clock In</a></li>
    <li><a href="{% url timepiece-add %}">Add Entry</a></li>
</ul>

<h3>My Projects</h3>
<table class='my-projects'>
	<tr><th>Project</th><th>My Hours</th><th>Hours Worked</th><th>Hours Remaining</th><th>Due Date</th><th></th></tr>
	{% regroup assignments by contract.project.type as type_list %}
	{% for type in type_list %}
	<tr><th colspan='6'>{{ type.grouper }}s</th></tr>
	{% for assignment in type.list %}
	<tr>
	   <td>{{ assignment.contract.project }}</td>
       <td class='hours'>{{ assignment.num_hours }}</td>
       <td class='hours'>{{ assignment.hours_worked|floatformat:2 }} ({% widthratio assignment.hours_worked assignment.num_hours 100 %}%)</td>
       <td class='hours'>{{ assignment.hours_remaining|floatformat:2 }}</td>
       <td>{{ assignment.end_date }}</td>
       <td> 
			<ul class='actions'>
			    <li><a href="{% url timepiece-clock-in %}?project={{ assignment.contract.project.pk }}">Clock In</a></li>
			    <li><a href="{% url timepiece-add %}?project={{ assignment.contract.project.pk }}">Add Entry</a></li>
			</ul>
       </td>
	</tr>
	{% endfor %}
	{% endfor %}
</table>

<h3>
    {% with entries.count as num_entries %}
        My Active Entries
    {% endwith %}
</h3>

{% with my_active_entries as entries %}
{% include 'timepiece/time-sheet/_entry_list.html' %}
{% endwith %}

{% if project_entries %}
    <table id='project-summary' class='timepiece-summary'>
        <caption>My work this week:</caption>
    {% for entry in project_entries %}
        <tr>
            <td>{{ entry.project__name }} </td>
            <td>{{ entry.sum }}</td>
        </tr>
    {% endfor %}
    {% for row in activity_entries %}
        <tr>
            <th>Total {% if row.billable %}billable{% else %}non-billable{% endif %} time:</th>
            <td>{{ row.sum }}</td>
        </tr>
    {% endfor %}    
    </table>
{% endif %}

{% if others_active_entries %}
    <table id='active-entries' class='timepiece-summary'>
        <caption>Others are working on:</caption>
    {% for entry in others_active_entries %}
        <tr class='{% if entry.is_paused %}paused{% endif %}'>
            <td>{{ entry.user.first_name }} {{ entry.user.last_name }}</td>
            <td>{{ entry.project.name }}</td>
            <td>{{ entry.start_time|date:"P" }}</td>
        </tr>
    {% endfor %}        
    </table>
{% endif %}

<br style='clear: both;' />

<h3>
    {% with entries.count as num_entries %}
        Time Detail This Week ({{ num_entries }} entr{{ num_entries|pluralize:"y,ies" }})
    {% endwith %}
</h3>

{% with this_weeks_entries as entries %}
{% include 'timepiece/time-sheet/_entry_list.html' %}
{% endwith %}

{% endblock %}
<commit_msg>fix missing num_entries for this week on dashboard<commit_after>{% extends 'timepiece/time-sheet/base.html' %}
{% load timepiece_tags %}

{% block title %}Timepiece Entries{% endblock %}

{% block content %}
<h2>My Time Sheet</h2>
<ul class='header-actions-left'>
    <li><a href="{% url timepiece-clock-in %}">Clock In</a></li>
    <li><a href="{% url timepiece-add %}">Add Entry</a></li>
</ul>

<h3>My Projects</h3>
<table class='my-projects'>
	<tr><th>Project</th><th>My Hours</th><th>Hours Worked</th><th>Hours Remaining</th><th>Due Date</th><th></th></tr>
	{% regroup assignments by contract.project.type as type_list %}
	{% for type in type_list %}
	<tr><th colspan='6'>{{ type.grouper }}s</th></tr>
	{% for assignment in type.list %}
	<tr>
	   <td>{{ assignment.contract.project }}</td>
       <td class='hours'>{{ assignment.num_hours }}</td>
       <td class='hours'>{{ assignment.hours_worked|floatformat:2 }} ({% widthratio assignment.hours_worked assignment.num_hours 100 %}%)</td>
       <td class='hours'>{{ assignment.hours_remaining|floatformat:2 }}</td>
       <td>{{ assignment.end_date }}</td>
       <td> 
			<ul class='actions'>
			    <li><a href="{% url timepiece-clock-in %}?project={{ assignment.contract.project.pk }}">Clock In</a></li>
			    <li><a href="{% url timepiece-add %}?project={{ assignment.contract.project.pk }}">Add Entry</a></li>
			</ul>
       </td>
	</tr>
	{% endfor %}
	{% endfor %}
</table>

<h3>
    {% with entries.count as num_entries %}
        My Active Entries
    {% endwith %}
</h3>

{% with my_active_entries as entries %}
{% include 'timepiece/time-sheet/_entry_list.html' %}
{% endwith %}

{% if project_entries %}
    <table id='project-summary' class='timepiece-summary'>
        <caption>My work this week:</caption>
    {% for entry in project_entries %}
        <tr>
            <td>{{ entry.project__name }} </td>
            <td>{{ entry.sum }}</td>
        </tr>
    {% endfor %}
    {% for row in activity_entries %}
        <tr>
            <th>Total {% if row.billable %}billable{% else %}non-billable{% endif %} time:</th>
            <td>{{ row.sum }}</td>
        </tr>
    {% endfor %}    
    </table>
{% endif %}

{% if others_active_entries %}
    <table id='active-entries' class='timepiece-summary'>
        <caption>Others are working on:</caption>
    {% for entry in others_active_entries %}
        <tr class='{% if entry.is_paused %}paused{% endif %}'>
            <td>{{ entry.user.first_name }} {{ entry.user.last_name }}</td>
            <td>{{ entry.project.name }}</td>
            <td>{{ entry.start_time|date:"P" }}</td>
        </tr>
    {% endfor %}        
    </table>
{% endif %}

<br style='clear: both;' />

<h3>
    {% with this_weeks_entries.count as num_entries %}
        Time Detail This Week ({{ num_entries }} entr{{ num_entries|pluralize:"y,ies" }})
    {% endwith %}
</h3>

{% with this_weeks_entries as entries %}
{% include 'timepiece/time-sheet/_entry_list.html' %}
{% endwith %}

{% endblock %}

{'fraction_non_alphanumeric': 0.2029520295202952, 'fraction_numerical': 0.004696410600469641, 'mean_word_length': 3.095467032967033, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5827986', 'n_tokens_mistral': 2250, 'n_tokens_neox': 1993, 'n_words': 451}