WorkLogs / templates / worklogs / report.html

{% extends "base.html" %}
{% load worklogs_tags i18n static %}

{% block extrahead %}
    <link rel="stylesheet" href="{% static "themes/base/jquery.ui.all.css" %}">
    <link rel="stylesheet" href="{% static "styles/demos.css" %}">
    <script src="{% static "scripts/jquery-1.7.2.js" %}"></script>
    <script src="{% static "scripts/jquery.cookie.js" %}"></script>
    <script src="{% static "ui/jquery.ui.core.js" %}"></script>
    <script src="{% static "ui/jquery.ui.widget.js" %}"></script>
    <script src="{% static "ui/jquery.ui.mouse.js" %}"></script>
    <script src="{% static "ui/jquery.ui.sortable.js" %}"></script>
    <script src="{% static "ui/jquery.ui.tabs.js" %}"></script>
    <script src="{% static "ui/jquery.ui.datepicker.js" %}"></script>
    <script>
        $(function() {
            var tabs = $( "#reports" ).tabs({
                cookie: {expires: 1}
            });
            tabs.tabs().find( ".ui-tabs-nav" ).sortable({
                axis: "x"
	    });
            var dates = $( "#from, #to" ).datepicker({
                changeMonth: true,
                changeYear: true,
                maxDate: "+0D",
                firstDay: 1,
                dateFormat: 'yy-mm-dd',
                onSelect: function( selectedDate ) {
                    var option = this.id == "from" ? "minDate" : "maxDate",
                    instance = $( this ).data( "datepicker" ),
                    date = $.datepicker.parseDate(
                            instance.settings.dateFormat ||
                            $.datepicker._defaults.dateFormat,
                            selectedDate, instance.settings );
                    dates.not( this ).datepicker( "option", option, date );
                }
            });
            $("textarea.copy").each(function(){
                var rows = this.value.split("\n").length;
                this.setAttribute('rows', rows + 1);
            });
        });
    </script>
    <style>
        textarea.copy {
            font-family: monospace;
            font-size: 12px;
            border: none;
        }
    </style>
{% endblock %}

{% block content %}
<div class="demo">
<form method="GET">
    <label for="from">From</label>
    <input type="text" id="from" name="from" value="{{ from.isoformat }}"/>
    <label for="to">to</label>
    <input type="text" id="to" name="to" value="{{ to.isoformat }}"/>
    <input type="submit" />
</form>
{% if time_per_worklog %}
<div id="reports">
    <ul>
        <li><a href="#time_per_worklog">{% trans "time per worklog" %}</a></li>
        <li><a href="#worklogs_per_day">{% trans "worklogs per day" %}</a></li>
        <li><a href="#time_per_project">{% trans "time per project" %}</a></li>
    </ul>
    <div id="time_per_worklog">
    <textarea class="copy" rows="24" cols="80">{% if from != to %}{{ from }} - {{ to }}
{% endif %}{% for worklog, duration in time_per_worklog %}
{{ worklog.description }} ({{duration|seconds_to_time}}) - {{ worklog.get_state_display }}
{{ worklog.bugtracker_url }}
{% endfor %}</textarea>
    </div>
    <div id="worklogs_per_day">
    <textarea class="copy" rows="24" cols="80">{% if from != to %}{{ from }} - {{ to }}
{% endif %}{% for date, data in worklogs_per_day.items %}
{{ date }} ({{ data.time|seconds_to_time }}):
    {% for worklog, duration in data.worklogs %}
    {{ worklog.description }} ({{duration|seconds_to_time}})
    {{ worklog.bugtracker_url }}
    {% endfor %}{% endfor %}</textarea>
    </div>
    <div id="time_per_project">
    <textarea class="copy" rows="24" cols="80">{% if from != to %}{{ from }} - {{ to }}
{% endif %}{% for project, data in time_per_project.items %}
{{ project }}: {{ data.time|seconds_to_hours:2|floatformat }}h{% endfor %}</textarea>
    </div>
</div>{% else %}{% trans "No worklogs in selected date range" %}{% endif %}
</div>

{% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.