-
Notifications
You must be signed in to change notification settings - Fork 3
Education and Training Updates
To create new fiscal year training records for https://tnris.org/education, follow these steps below (updated June 3, 2020):
- It is very important that OLD training records are either deleted within https://api.tnris.org, or the Open Registration AND the Public checkbox is unchecked before creating new education/training records. Otherwise there will be old training records visible on the Education page.
- When you are ready to create new Education records on https://api.tnris.org, click Website Content --> Tnris Trainings --> then click Add Tnris Trainings in the top right of the page.
- You are now presented with a simple form to fill out pertaining to the training class you want to add. The bold fields are required. Make sure and read the helper text if you are not sure of the format to input to the form.
- example: Accepted date input formats: '10/25/06', '10/25/2006', '2006-10-25'
- example: Accepted time input formats: '13:30' (military hour & minute), '02:00 PM' (12 hour clock & minute with AM/PM)
- be sure an input the date and time as the helper text instructs. military time is the accepted format due to benefits within the database. 12 hour time is accepted as well when 'AM' or 'PM' is included
- When you are finished, click Save or Save and continue editing
- You should receive feedback if there are any issues with creating the new training record
The javascript pulls all the records from the Tnris Training table/API that have Public = true (checkbox checked). This is why it is important for all of the old training records to be deleted or updated in the api.tnris.org admin console to reflect the current training desired.
Training Registration for users is handled through an external service provider. When filling out the form for a new training record, or updating an existing one, there is an input to hold a url for that training service providers registration page. This input is required to be filled out in order to create a new record. The url populated in the form is sent to the tnris.org/education page front end (if its set to Public == True
), and used to send the user to that web page if they click the green 'Register' button for any training record.
The registration link used can be the same for many records or different, depending upon how many training providers TNRIS has partnered with for that training season, and depending on how the training provider has setup their registration website.
A training discount code is provided for students wishing to sign up for training through the TNRIS website. This discount code may change periodically. To change the discount code, navigate to the tnris.org code repository and follow these instructions:
- The discount code resides in the javascript file located at
./static/js/training.js
. - Find
line 258
and change the string value forvar discountValue
to whatever the new discount code is.
-
commit
changes and push to deploy via continuous integration.
Note: the discount code only shows up on the education page front-end if there are public records with registration_open = True in the api.
There is currently logic in the ./static/js/training.js
file (lines 36-79) that uses today's date compared to the trianing end date, as well as the registration_open status/value coming from the api, to determine the button that should be used for each training record on the education page front-end. The following lists what this logic covers:
- if registration is open and today is prior (less than) to the training end date, set html variable to an active enabled register button with proper link to external registration page.
- if registration is open and today is equal to or past (greater than) the training end date, set html variable to closed disabled button with no link to registration page.
- this catches any training records that may have registration open status equal to True, but the training has already past or is currently happening.
- ideally, the registration status should be set to False in the api
- if registration is closed and today is prior to training end date, set html variable to disabled register button with no link to registration page
- if registration is closed and today is equal to or past (greater than) the training end date, set html variable to disabled closed button with no link