Files
PyRIGS/training/templates/trainee_detail.html
Arona Jones ee9be86465 Do not display items on trainee detail
That's what the detailed view is for...

And definitely nowt to do with my horrifically optimised SQL
2021-12-28 22:23:17 +00:00

88 lines
3.3 KiB
HTML

{% extends 'base_training.html' %}
{% load static %}
{% load percentage_complete from tags %}
{% load markdown_tags %}
{% block css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/selects.css' %}"/>
{% endblock %}
{% block preload_js %}
<script src="{% static 'js/selects.js' %}"></script>
{% endblock %}
{% block js %}
<script src="{% static 'js/autocompleter.js' %}"></script>
<script src="{% static 'js/tooltip.js' %}"></script>
<script>
$('document').ready(function(){
$('#add_record,#add_external').click(function (e) {
e.preventDefault();
var url = $(this).attr("href");
$.ajax({
url: url,
success: function(){
$link = $(this);
// Anti modal inception
if ($link.parents('#modal').length === 0) {
modaltarget = $link.data('target');
modalobject = "";
$('#modal').load(url, function (e) {
$('#modal').modal();
$(".selectpicker").selectpicker().each(function(){initPicker($(this))});
});
}
}
});
});
});
</script>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-sm-12 text-right">
{% include 'partials/add_qualification.html' %}
<a href="{% url 'trainee_item_detail' object.pk %}" class="btn btn-info"><span class="fas fa-info-circle"></span> View Detailed Record</a><br/>
</div>
</div>
<div class="row mb-3">
<h2 class="col-12">Training Levels</h2>
<ul class="list-group col-12">
{% for qual in completed_levels %}
<li class="list-group-item">
<a href="{% url 'level_detail' qual.level.pk %}">{{ qual.level }}</a>
{% if qual.confirmed_by is None %}
{% if request.user.pk != object.pk and request.user.is_supervisor %}
<span class="badge badge-warning">Awaiting Confirmation</span> <a class="btn btn-info" href="{% url 'confirm_level' object.pk qual.level.pk %}">Confirm</a>
{% else %}
<button class="btn btn-warning" disabled>Awaiting Confirmation</button>
{% endif %}
{% else %}
<button class="btn btn-success active">Confirmed <small>by {{ qual.confirmed_by }}</small></button>
{% endif %}
</li>
{% empty %}
<div class="alert alert-warning mx-auto">No qualifications in any levels yet...did someone forget to fill out the paperwork?</div>
{% endfor %}
</ul>
<div class="card-columns">
{% for level in started_levels %}
{% percentage_complete level object as completion %}
<div class="card my-3 border-warning">
<h3 class="card-header"><a href="{{ level.get_absolute_url }}">{{ level }}</a></h3>
<div class="card-body">
{{ level.description|markdown }}
</div>
<div class="card-footer">
<div class="progress">
<div class="progress-bar progress-bar-striped" role="progressbar" style="width: {{completion}}%" aria-valuenow="{{completion}}" aria-valuemin="0" aria-valuemax="100">{{completion}}% complete</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}