matejak/estimagus

View on GitHub
estimage/webapp/templates/workload.html

Summary

Maintainability
Test Coverage
{% import "utils.j2" as utils with context %}

{% if mode == "retro" %}
{% extends "general_retro.html" %}
{% else %}
{% extends "general_plan.html" %}
{% endif %}

{% macro render_epic_workload(epic, points, percentage) -%}
<div>
    {{ "%.2g" % points }} &nbsp; pts., {{ "%i" % percentage }} &nbsp; % &mdash;
    {{ utils.truncate_text_to(epic.title, "350pt") }}
        {{ utils.epic_external_link(epic) }}
</div>
{%- endmacro %}

{% block content %}
<div class="container">
    <div class="row">
    <h1>Workloads</h1>
    <h2>Summary</h2>
    <ul>
    <li>Average effort of a full-potential person: {{ "%.2g" % simple_summary.expected_effort_of_full_potential }} pts</li>
    </ul>
    <h2>Distribution</h2>
    {% for name in all_persons %}
    {% set workload = simple.of_person(name) %}
    <h3>{{ name }}</h3>
    <p>
    Expected work potential: {{ ("%i&nbsp;%%" % (simple.persons_potential[name] * 100)) | safe }}
    </p>
    <div class="col">
    <h4>Simple distribution of work</h4>
    <p>
    Proportion of the work: {{ "%.2g" % workload.points }}
    </p>
    <ul>
    {% for epic in (workload.cards | sort(attribute="name")) %}
    <li>{{ render_epic_workload(epic, workload.point_parts[epic.name], 100 * workload.proportions[epic.name]) }}</li>
    {% endfor %}
    </ul>
    </div>
    {% if optimized %}
    {% set workload = optimized.of_person(name) %}
    <div class="col">
    <h4>Equalized distribution of work</h4>
    <p>
    Proportion of the work: {{ "%.2g" % workload.points }}
    </p>
    <ul>
    {% for epic in (workload.cards | sort(attribute="name")) %}
    <li>{{ render_epic_workload(epic, workload.point_parts[epic.name], 100 * workload.proportions[epic.name]) }}</li>
    {% endfor %}
    </ul>
    </div>
    {% endif %}
    {% endfor %}
    </div>
</div>
{% endblock %}