mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-22 07:52:15 +00:00
Refactor training status table down to the simplest elements so they can be included as needed.
This commit is contained in:
@@ -1,63 +1,9 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load training_extras %}
|
|
||||||
|
|
||||||
{% block title %}{{ profile }} Training{% endblock %}
|
{% block title %}{{ profile }} Training{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Training Profile for {{ profile }}</h2>
|
<h2>Training Profile for {{ profile }}</h2>
|
||||||
|
|
||||||
{% for category in categories %}
|
{% include "training/profile_detail_table.html" %}
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<h3>{{ category }}</h3>
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td>Item</td>
|
|
||||||
<td>Started</td>
|
|
||||||
<td>Complete</td>
|
|
||||||
<td>Assessed</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in category.trainingitem_set.all %}
|
|
||||||
{% with record=item|item_record:request.user %}
|
|
||||||
<tr class="
|
|
||||||
{% if record.assessed %}
|
|
||||||
success
|
|
||||||
{% elif record.complete %}
|
|
||||||
info
|
|
||||||
{% elif record.started %}
|
|
||||||
warning
|
|
||||||
{% else %}
|
|
||||||
danger
|
|
||||||
{% endif %}
|
|
||||||
">
|
|
||||||
<td>{{ record.training_item }}</td>
|
|
||||||
<td>
|
|
||||||
{{ record.started_date|default_if_none:"No" }} <em>{{ record.started_trainer|default_if_none:"" }}</em>
|
|
||||||
{% if record.started_notes %}
|
|
||||||
<pre>{{ record.started_notes }}</pre>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ record.completed_date|default_if_none:"No" }} <em>{{ record.completed_trainer|default_if_none:"" }}</em>
|
|
||||||
{% if record.completed_notes %}
|
|
||||||
<pre>{{ record.completed_notes }}</pre>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ record.assessed_date|default_if_none:"No" }} <em>{{ record.assessed_trainer|default_if_none:"" }}</em>
|
|
||||||
{% if record.assessed_notes %}
|
|
||||||
<pre>{{ record.assessed_notes }}</pre>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endwith %}
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
7
training/templates/training/profile_detail_table.html
Normal file
7
training/templates/training/profile_detail_table.html
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% for category in categories %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
{% include "training/trainingcategory_item_table.html" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
20
training/templates/training/trainingcategory_item_table.html
Normal file
20
training/templates/training/trainingcategory_item_table.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{% load training_extras %}
|
||||||
|
|
||||||
|
<h3>{{ category }}</h3>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td>Item</td>
|
||||||
|
<td>Started</td>
|
||||||
|
<td>Complete</td>
|
||||||
|
<td>Assessed</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for item in category.trainingitem_set.all %}
|
||||||
|
{% with record=item|item_record:request.user %}
|
||||||
|
{% include "training/trainingitem_detail_row.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
31
training/templates/training/trainingitem_detail_row.html
Normal file
31
training/templates/training/trainingitem_detail_row.html
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<tr class="
|
||||||
|
{% if record.assessed %}
|
||||||
|
success
|
||||||
|
{% elif record.complete %}
|
||||||
|
info
|
||||||
|
{% elif record.started %}
|
||||||
|
warning
|
||||||
|
{% else %}
|
||||||
|
danger
|
||||||
|
{% endif %}
|
||||||
|
">
|
||||||
|
<td>{{ record.training_item }}</td>
|
||||||
|
<td>
|
||||||
|
{{ record.started_date|default_if_none:"No" }} <em>{{ record.started_trainer|default_if_none:"" }}</em>
|
||||||
|
{% if record.started_notes %}
|
||||||
|
<pre>{{ record.started_notes }}</pre>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ record.completed_date|default_if_none:"No" }} <em>{{ record.completed_trainer|default_if_none:"" }}</em>
|
||||||
|
{% if record.completed_notes %}
|
||||||
|
<pre>{{ record.completed_notes }}</pre>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ record.assessed_date|default_if_none:"No" }} <em>{{ record.assessed_trainer|default_if_none:"" }}</em>
|
||||||
|
{% if record.assessed_notes %}
|
||||||
|
<pre>{{ record.assessed_notes }}</pre>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
Reference in New Issue
Block a user