2022-07-13 06:51:28 +00:00
import React from 'react' ;
import { Link } from 'react-router-dom' ;
2020-01-10 00:29:52 +00:00
import './light.css' ;
2022-07-13 06:51:28 +00:00
import { Container , Header , Popup , Table } from 'semantic-ui-react' ;
2022-01-14 00:32:21 +00:00
import moment from 'moment-timezone' ;
2022-07-13 06:51:28 +00:00
import { getInstructor } from './utils.js' ;
2020-01-10 00:29:52 +00:00
2020-08-13 21:31:59 +00:00
export function CertList ( props ) {
const { member } = props ;
const MoreCert = ( tools ) => ( < Popup content = {
< >
< p > Allows access to : < / p >
< p > { tools } < / p >
< / >
} trigger = { < a > [ more ] < /a>} / > ) ;
return (
< Table basic = 'very' >
< Table . Header >
< Table . Row >
< Table . HeaderCell > Name < / T a b l e . H e a d e r C e l l >
< Table . HeaderCell > Certification < / T a b l e . H e a d e r C e l l >
< Table . HeaderCell > Course < / T a b l e . H e a d e r C e l l >
< / T a b l e . R o w >
< / T a b l e . H e a d e r >
< Table . Body >
< Table . Row >
< Table . Cell > Common { MoreCert ( 'Anything larger than a screwdriver.' ) } < / T a b l e . C e l l >
< Table . Cell > { member . vetted _date || member . orientation _date ? 'Yes' : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/249' > New Members : Orientation and Basic Safety < / L i n k > < / T a b l e . C e l l >
< / T a b l e . R o w >
< Table . Row >
2020-08-13 22:23:54 +00:00
< Table . Cell > Wood 1 { MoreCert ( 'Table saw, band saw, chop saw, router.' ) } < / T a b l e . C e l l >
2020-08-13 21:31:59 +00:00
< Table . Cell > { member . wood _cert _date ? 'Yes, ' + member . wood _cert _date : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/261' > Woodworking Tools 1 : Intro to Saws < / L i n k > < / T a b l e . C e l l >
< / T a b l e . R o w >
< Table . Row >
< Table . Cell > Wood 2 { MoreCert ( 'Jointer, thickness planer, drum sander.' ) } < / T a b l e . C e l l >
< Table . Cell > { member . wood2 _cert _date ? 'Yes, ' + member . wood2 _cert _date : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/401' > Woodworking Tools 2 : Jointer , Thickness Planer , Drum Sander < / L i n k > < / T a b l e . C e l l >
< / T a b l e . R o w >
< Table . Row >
< Table . Cell > Lathe { MoreCert ( 'Manual metal lathe.' ) } < / T a b l e . C e l l >
< Table . Cell > { member . lathe _cert _date ? 'Yes, ' + member . lathe _cert _date : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/281' > Metal : Metal Cutting & Manual Lathe < / L i n k > < / T a b l e . C e l l >
< / T a b l e . R o w >
< Table . Row >
< Table . Cell > Mill { MoreCert ( 'Manual metal mill.' ) } < / T a b l e . C e l l >
< Table . Cell > { member . mill _cert _date ? 'Yes, ' + member . mill _cert _date : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/283' > Metal : Manual Mill & Advanced Lathe < / L i n k > < / T a b l e . C e l l >
< / T a b l e . R o w >
< Table . Row >
2021-09-08 05:24:05 +00:00
< Table . Cell > Tormach CNC < / T a b l e . C e l l >
< Table . Cell > { member . tormach _cnc _cert _date ? 'Yes, ' + member . tormach _cnc _cert _date : 'No' } < / T a b l e . C e l l >
2020-08-13 21:31:59 +00:00
< Table . Cell > < Link to = '/courses/259' > Tormach : CAM and Tormach Intro < / L i n k > < / T a b l e . C e l l >
2021-09-08 05:24:05 +00:00
< / T a b l e . R o w >
< Table . Row >
< Table . Cell > Precix CNC < / T a b l e . C e l l >
< Table . Cell > { member . precix _cnc _cert _date ? 'Yes, ' + member . precix _cnc _cert _date : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/428' > Basic CNC Wood Router < / L i n k > < / T a b l e . C e l l >
2020-08-13 21:31:59 +00:00
< / T a b l e . R o w >
2020-09-15 19:21:32 +00:00
< Table . Row >
< Table . Cell > Rabbit Laser < / T a b l e . C e l l >
< Table . Cell > { member . rabbit _cert _date ? 'Yes, ' + member . rabbit _cert _date : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/247' > Laser : Cutting and Engraving < / L i n k > < / T a b l e . C e l l >
< / T a b l e . R o w >
< Table . Row >
< Table . Cell > Trotec Laser < / T a b l e . C e l l >
< Table . Cell > { member . trotec _cert _date ? 'Yes, ' + member . trotec _cert _date : 'No' } < / T a b l e . C e l l >
< Table . Cell > < Link to = '/courses/321' > Laser : Trotec Course < / L i n k > < / T a b l e . C e l l >
< / T a b l e . R o w >
2020-08-13 21:31:59 +00:00
< / T a b l e . B o d y >
< / T a b l e >
) ;
} ;
2020-08-08 22:49:03 +00:00
export function TrainingList ( props ) {
const { training } = props ;
return (
< Table basic = 'very' >
< Table . Header >
< Table . Row >
< Table . HeaderCell > Course / Event Name < / T a b l e . H e a d e r C e l l >
< Table . HeaderCell > Class Date < / T a b l e . H e a d e r C e l l >
< Table . HeaderCell > Status < / T a b l e . H e a d e r C e l l >
< Table . HeaderCell > Instructor < / T a b l e . H e a d e r C e l l >
< / T a b l e . R o w >
< / T a b l e . H e a d e r >
< Table . Body >
{ training . slice ( ) . sort ( ( a , b ) => a . session . datetime < b . session . datetime ? 1 : - 1 ) . map ( x =>
< Table . Row key = { x . id } >
2021-10-23 07:28:34 +00:00
< Table . Cell > { x . session . course _data . name } < / T a b l e . C e l l >
2020-08-08 22:49:03 +00:00
< Table . Cell >
2022-01-14 00:32:21 +00:00
< Link to = { '/classes/' + x . session . id } > { moment ( x . session . datetime ) . tz ( 'America/Edmonton' ) . format ( 'll' ) } < / L i n k >
2020-08-08 22:49:03 +00:00
< / T a b l e . C e l l >
< Table . Cell > { x . attendance _status } < / T a b l e . C e l l >
2020-08-17 21:04:19 +00:00
< Table . Cell > { getInstructor ( x . session ) } < / T a b l e . C e l l >
2020-08-08 22:49:03 +00:00
< / T a b l e . R o w >
) }
< / T a b l e . B o d y >
< / T a b l e >
) ;
} ;
2020-01-10 00:29:52 +00:00
export function Training ( props ) {
const { user } = props ;
return (
< Container >
2021-12-22 05:59:34 +00:00
< Header size = 'large' > Your Training < / H e a d e r >
2020-01-10 00:29:52 +00:00
{ user . training . length ?
2020-08-08 22:49:03 +00:00
< TrainingList training = { user . training } / >
2020-01-10 00:29:52 +00:00
:
< p > No training yet ! Sign up for a course to take a class . < / p >
}
2022-01-14 00:32:21 +00:00
< Header size = 'large' > Your Certifications < / H e a d e r >
< CertList member = { user . member } / >
< p > Certifications are based on the courses you 've taken. If there' s any errors , please email < a href = 'mailto:directors@protospace.ca' > directors @ protospace . ca < / a > . < / p >
2020-01-10 00:29:52 +00:00
< / C o n t a i n e r >
) ;
} ;