Rename CNC cert to Tormach, add Precix CNC cert

master
Tanner Collin 3 years ago
parent e1aea8efcf
commit 996e063014
  1. 3
      apiserver/apiserver/api/models.py
  2. 3
      apiserver/apiserver/api/serializers.py
  3. 9
      apiserver/apiserver/api/views.py
  4. 12
      webclient/src/AdminMembers.js
  5. 9
      webclient/src/Training.js

@ -51,7 +51,8 @@ class Member(models.Model):
mill_cert_date = models.DateField(blank=True, null=True, default=None)
wood_cert_date = models.DateField(blank=True, null=True, default=None)
wood2_cert_date = models.DateField(blank=True, null=True, default=None)
cnc_cert_date = models.DateField(blank=True, null=True, default=None)
tormach_cnc_cert_date = models.DateField(blank=True, null=True, default=None)
precix_cnc_cert_date = models.DateField(blank=True, null=True, default=None)
rabbit_cert_date = models.DateField(blank=True, null=True, default=None)
trotec_cert_date = models.DateField(blank=True, null=True, default=None)
paused_date = models.DateField(blank=True, null=True)

@ -180,7 +180,8 @@ class MemberSerializer(serializers.ModelSerializer):
'mill_cert_date',
'wood_cert_date',
'wood2_cert_date',
'cnc_cert_date',
'tormach_cnc_cert_date',
'precix_cnc_cert_date',
'rabbit_cert_date',
'trotec_cert_date',
]

@ -261,7 +261,11 @@ class TrainingViewSet(Base, Retrieve, Create, Update):
elif session.course.id == 283:
member.mill_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
elif session.course.id == 259:
member.cnc_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
member.tormach_cnc_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
elif session.course.id == 428:
member.precix_cnc_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
# TODO: change group membership
elif session.course.id == 247:
member.rabbit_cert_date = utils.today_alberta_tz() if status == 'Attended' else None
@ -477,7 +481,8 @@ class LockoutViewSet(viewsets.ViewSet, List):
authorization['mill'] = bool(member.mill_cert_date) and authorization['common']
authorization['wood'] = bool(member.wood_cert_date) and authorization['common']
authorization['wood2'] = bool(member.wood2_cert_date) and authorization['common']
authorization['cnc'] = bool(member.cnc_cert_date) and authorization['common']
authorization['tormach_cnc'] = bool(member.tormach_cnc_cert_date) and authorization['common']
authorization['precix_cnc'] = bool(member.precix_cnc_cert_date) and authorization['common']
active_member_cards[card.card_number] = authorization

@ -669,10 +669,16 @@ export function AdminMemberCertifications(props) {
<Table.Cell><AdminCert name='Mill' field='mill_cert_date' {...props} /></Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>CNC</Table.Cell>
<Table.Cell>{member.cnc_cert_date ? 'Yes, ' + member.cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell>Tormach CNC</Table.Cell>
<Table.Cell>{member.tormach_cnc_cert_date ? 'Yes, ' + member.tormach_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/259'>Tormach: CAM and Tormach Intro</Link></Table.Cell>
<Table.Cell><AdminCert name='CNC' field='cnc_cert_date' {...props} /></Table.Cell>
<Table.Cell><AdminCert name='Tormach CNC' field='tormach_cnc_cert_date' {...props} /></Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Precix CNC</Table.Cell>
<Table.Cell>{member.precix_cnc_cert_date ? 'Yes, ' + member.precix_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/428'>Basic CNC Wood Router</Link></Table.Cell>
<Table.Cell><AdminCert name='Precix CNC' field='precix_cnc_cert_date' {...props} /></Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Rabbit Laser</Table.Cell>

@ -53,10 +53,15 @@ export function CertList(props) {
<Table.Cell><Link to='/courses/283'>Metal: Manual Mill & Advanced Lathe</Link></Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>CNC {MoreCert('Tormach metal CNC, CNC wood router.')}</Table.Cell>
<Table.Cell>{member.cnc_cert_date ? 'Yes, ' + member.cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell>Tormach CNC</Table.Cell>
<Table.Cell>{member.tormach_cnc_cert_date ? 'Yes, ' + member.tormach_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/259'>Tormach: CAM and Tormach Intro</Link></Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Precix CNC</Table.Cell>
<Table.Cell>{member.precix_cnc_cert_date ? 'Yes, ' + member.precix_cnc_cert_date : 'No'}</Table.Cell>
<Table.Cell><Link to='/courses/428'>Basic CNC Wood Router</Link></Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Rabbit Laser</Table.Cell>
<Table.Cell>{member.rabbit_cert_date ? 'Yes, ' + member.rabbit_cert_date : 'No'}</Table.Cell>

Loading…
Cancel
Save