mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 21:42:14 +00:00
item ui vaguely working
This commit is contained in:
@@ -6,7 +6,7 @@ from RIGS.models import Profile
|
||||
class SessionLogForm(forms.Form):
|
||||
pass
|
||||
|
||||
|
||||
# TODO Validation that dates cannot be in the future
|
||||
class QualificationForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.TrainingItemQualification
|
||||
@@ -18,3 +18,4 @@ class QualificationForm(forms.ModelForm):
|
||||
super(QualificationForm, self).__init__(*args, **kwargs)
|
||||
self.fields['trainee'].initial = Profile.objects.get(pk=pk)
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ class TrainingItem(models.Model):
|
||||
return "{}.{} {}".format(self.category.reference_number, self.reference_number, self.name)
|
||||
|
||||
|
||||
# TODO Validation that dates cannot be in the future
|
||||
class TrainingItemQualification(models.Model):
|
||||
STARTED = 0
|
||||
COMPLETE = 1
|
||||
@@ -44,10 +43,13 @@ class TrainingItemQualification(models.Model):
|
||||
supervisor = models.ForeignKey('Trainee', related_name='qualifications_granted', on_delete=models.RESTRICT)
|
||||
notes = models.TextField(blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return "{} in {} on {}".format(self.depth, self.item, self.date)
|
||||
|
||||
|
||||
# Levels
|
||||
# FIXME Common Competencies...
|
||||
class TrainingLevel(models.Model, RevisionMixin):
|
||||
description = models.CharField(max_length=120)
|
||||
CHOICES = (
|
||||
(0, 'Technical Assistant'),
|
||||
(1, 'Technician'),
|
||||
@@ -55,7 +57,8 @@ class TrainingLevel(models.Model, RevisionMixin):
|
||||
)
|
||||
department = models.CharField(max_length=50, null=True) # N.B. Technical Assistant does not have a department
|
||||
level = models.IntegerField(choices=CHOICES)
|
||||
|
||||
|
||||
# FIXME Common Competencies... have levels able to depend on other ones - but supervisors need to depend on both common and technican?
|
||||
|
||||
class TrainingLevelQualification(models.Model):
|
||||
trainee = models.ForeignKey('Trainee', related_name='levels', on_delete=models.RESTRICT)
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
{% extends 'base_rigs.html' %}
|
||||
|
||||
{% block content %}
|
||||
<button type="button" class="btn btn-success btn-sm item-add"
|
||||
data-toggle="modal"
|
||||
data-target="#record_modal">
|
||||
<a type="button" class="btn btn-success" href="{% url 'edit_record' pk=request.user.pk %}">
|
||||
<i class="fas fa-plus"></i> Add New Training Record
|
||||
</button>
|
||||
</a>
|
||||
<div class="row mb-3">
|
||||
<h2 class="col-12">Training Levels</h2>
|
||||
<p>{{ user.name }} is a...<br></p>
|
||||
<div class="col">
|
||||
<h2><div class="badge badge-success">Sound Supervisor <span class="fas fa-volume-up"></span></div><h2>
|
||||
<h3><div class="badge badge-danger">Power Technician <span class="fas fa-plug"></span></div></h3>
|
||||
<h4><div class="badge badge-primary">Technical Assistant <span class="fas fa-wrench"></span></div></h4>
|
||||
</div>
|
||||
{% for level in levels %}
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<h2 class="col-12">Training Items</h2><br>
|
||||
@@ -24,7 +19,11 @@
|
||||
<div class="list-group list-group-flush">
|
||||
{% for depth in depths %}
|
||||
<li class="list-group-item {% if depth.0 == 0 %}list-group-item-warning{%elif depth.0 == 1%}list-group-item-success{%else%}list-group-item-info{%endif%}">{{depth.1}}</li>
|
||||
<li class="list-group-item">Dummy Item</li>
|
||||
{% for q in object.qualifications_obtained.all %}
|
||||
{% if q.depth == depth.0 and q.item.category == category %}
|
||||
<li class="list-group-item">{{q.item}} ({{q.date}})</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user