mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-26 09:52:16 +00:00
Simpler training level list display
This commit is contained in:
@@ -3,60 +3,6 @@
|
|||||||
{% load markdown_tags %}
|
{% load markdown_tags %}
|
||||||
{% load get_supervisor from tags %}
|
{% load get_supervisor from tags %}
|
||||||
|
|
||||||
{% block css %}
|
|
||||||
<style>
|
|
||||||
.tree ul {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree li {
|
|
||||||
list-style-type: none;
|
|
||||||
margin:10px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree li::before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top:-7px;
|
|
||||||
left:-20px;
|
|
||||||
border-left: 1px solid #ccc;
|
|
||||||
border-bottom:1px solid #ccc;
|
|
||||||
border-radius:0 0 0 0px;
|
|
||||||
width:20px;
|
|
||||||
height:15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree li::after {
|
|
||||||
position:absolute;
|
|
||||||
content:"";
|
|
||||||
top:8px;
|
|
||||||
left:-20px;
|
|
||||||
border-left: 1px solid #ccc;
|
|
||||||
border-top:1px solid #ccc;
|
|
||||||
border-radius:0px 0 0 0;
|
|
||||||
width:20px;
|
|
||||||
height:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree li:last-child::after {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree li:last-child:before{
|
|
||||||
border-radius: 0 0 0 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tree>li:first-child::before {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.tree>li:first-child::after {
|
|
||||||
border-radius:5px 0 0 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="alert alert-info" role="alert">
|
<div class="alert alert-info" role="alert">
|
||||||
<p>Please Note:</p>
|
<p>Please Note:</p>
|
||||||
@@ -67,19 +13,10 @@ ul.tree>li:first-child::after {
|
|||||||
</ul>
|
</ul>
|
||||||
<sup>Correct as of 3rd September 2021, check the Training Policy.</sup>
|
<sup>Correct as of 3rd September 2021, check the Training Policy.</sup>
|
||||||
</div>
|
</div>
|
||||||
<ul class="tree">
|
{% for level in object_list %}
|
||||||
<li><div class="card"><div class="card-header">{{ta}}</div><div class="card-body">{{ta.description|markdown}}</div></div>
|
<div class="card mb-2">
|
||||||
<ul>
|
<div class="card-header">{{level}}</div>
|
||||||
{% for level in tech %}
|
<div class="card-body">{{level.description|markdown}}</div>
|
||||||
<li><div class="card"><div class="card-header"><a href="{{level.get_absolute_url}}">{{level}}</a></div><div class="card-body">{{level.description|markdown}}</div></div>
|
</div>
|
||||||
<ul>
|
{% endfor %}
|
||||||
{% with level|get_supervisor as super %}
|
|
||||||
<li><div class="card"><div class="card-header"><a href="{{super.get_absolute_url}}">{{super}}</a></div><div class="card-body">{{super.description|markdown}}</div></div></li>
|
|
||||||
{% endwith %}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -85,9 +85,6 @@ class LevelList(generic.ListView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
context["page_title"] = "All Training Levels"
|
context["page_title"] = "All Training Levels"
|
||||||
context["ta"] = models.TrainingLevel.objects.get(level=models.TrainingLevel.TA)
|
|
||||||
context["tech"] = models.TrainingLevel.objects.filter(level=models.TrainingLevel.TECHNICIAN).order_by('department')
|
|
||||||
context["sup"] = models.TrainingLevel.objects.filter(level=models.TrainingLevel.SUPERVISOR).order_by('department')
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user