mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-18 14:02:15 +00:00
Much template wrangling
This commit is contained in:
@@ -146,19 +146,31 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col mb-2">
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col col-lg-6 mb-2">
|
||||
<div class="card">
|
||||
<div class="card-header">Training Record</div>
|
||||
<div class="card-body">
|
||||
<a href="{% url 'trainee_detail' object.pk %}" class="btn btn-primary"><span class="fas fa-eye"></span> View Training Record</a>
|
||||
<a href="{% url 'trainee_detail' object.pk %}" class="btn btn-primary"><span class="fas fa-eye"></span> View Training Record</a>
|
||||
{% include 'partials/add_qualification.html' %}
|
||||
<ul class="list-group pt-3">
|
||||
<li class="list-group-item active">Achieved Levels:</li>
|
||||
{% for qual in completed_levels %}
|
||||
<a href="{% url 'level_detail' qual.level.pk %}"class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">{{ qual.level }}<span class='badge badge-{{qual.level.department_colour}} badge-pill'><span class='fas fa-{{qual.level.icon|default:"question"}}'></span></span></a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">Events</div>
|
||||
{% with object.latest_events as events %}
|
||||
{% include 'partials/event_table.html' %}
|
||||
{% endwith %}
|
||||
<div class="col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-header">Events</div>
|
||||
{% with object.latest_events as events %}
|
||||
{% include 'partials/event_table.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -5,6 +5,7 @@ from django.views import generic
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
from RIGS import models
|
||||
from training.models import Trainee
|
||||
|
||||
|
||||
# This view should be exempt from requiring CSRF token.
|
||||
@@ -42,6 +43,7 @@ class ProfileDetail(generic.DetailView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(ProfileDetail, self).get_context_data(**kwargs)
|
||||
context['page_title'] = "Profile: {}".format(self.object)
|
||||
context["completed_levels"] = Trainee.objects.get(pk=self.object.pk).level_qualifications()
|
||||
return context
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user