-
Notifications
You must be signed in to change notification settings - Fork 71
Template/ngee ann polytechnic #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d93706d
Added templates from NP
yehjxraymond f1c7be6
Restructured files into NP folder and refactored common functions int…
yehjxraymond f1d56d8
WIP: Generalised template for joint certificate
yehjxraymond 56ad9be
Converted all joint cert
yehjxraymond 03e7c59
Refactored transcripts files
yehjxraymond ed10a25
Refactored options cert
yehjxraymond e80232c
Moved main certificate
yehjxraymond c707da3
Fixed lint issues with transcripts
yehjxraymond 982f596
Removed accidental commit of coverage
yehjxraymond 66ee16e
Refactored different cert
yehjxraymond 5f6c971
Refactored templates
yehjxraymond ef5848c
Refactored date function
yehjxraymond 96110c0
Fixed date function
yehjxraymond File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-BMS(CLT)/certificate.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { | ||
| IMG_LOGO_NUH, | ||
| IMG_SIG_TANG_KIN_FEI, | ||
| IMG_SIG_TI_BOON_WEE, | ||
| IMG_SIG_LIU_HERN_CHOON_EUGENE, | ||
| Certificate | ||
| } from "../common"; | ||
|
|
||
| const Template = Certificate({ | ||
| logo: IMG_LOGO_NUH, | ||
| signatories: [ | ||
| { | ||
| signature: IMG_SIG_TI_BOON_WEE, | ||
| name: "Ti Boon Wee", | ||
| position: "Principal", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| }, | ||
| { | ||
| signature: IMG_SIG_LIU_HERN_CHOON_EUGENE, | ||
| name: "A/Prof. Liu Hern Choon Eugene", | ||
| position: "Chief Executive Officer", | ||
| organisation: "National University Hospital" | ||
| }, | ||
| { | ||
| signature: IMG_SIG_TANG_KIN_FEI, | ||
| name: "Tang Kin Fei", | ||
| position: "Council Chairman", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| } | ||
| ] | ||
| }); | ||
|
|
||
| export default Template; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-ECH/certificate.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { | ||
| IMG_LOGO_SEED, | ||
| IMG_SIG_TANG_KIN_FEI, | ||
| IMG_SIG_TI_BOON_WEE, | ||
| IMG_SIG_CHAN_TEE_SENG, | ||
| Certificate | ||
| } from "../common"; | ||
|
|
||
| const Template = Certificate({ | ||
| logo: IMG_LOGO_SEED, | ||
| signatories: [ | ||
| { | ||
| signature: IMG_SIG_TI_BOON_WEE, | ||
| name: "Ti Boon Wee", | ||
| position: "Principal", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| }, | ||
| { | ||
| signature: IMG_SIG_CHAN_TEE_SENG, | ||
| name: "Chan Tee Seng", | ||
| position: "Chief Executive Officer", | ||
| organisation: | ||
| "NTUC First Campus Co-operative Ltd & Director, SEED Institute Pte Ltd" | ||
| }, | ||
| { | ||
| signature: IMG_SIG_TANG_KIN_FEI, | ||
| name: "Tang Kin Fei", | ||
| position: "Council Chairman", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| } | ||
| ] | ||
| }); | ||
|
|
||
| export default Template; |
20 changes: 20 additions & 0 deletions
20
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-ECH/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { approvedAddresses } from "../common"; | ||
| import NPCert from "./certificate"; | ||
| import NPTranscript from "../common/transcript"; | ||
|
|
||
| const templates = [ | ||
| { | ||
| id: "certificate", | ||
| label: "Certificate", | ||
| template: NPCert | ||
| }, | ||
| { | ||
| id: "transcript", | ||
| label: "Transcript", | ||
| template: NPTranscript | ||
| } | ||
| ]; | ||
|
|
||
| const addresses = approvedAddresses; | ||
|
|
||
| export default { templates, addresses }; |
33 changes: 33 additions & 0 deletions
33
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-LDH/certificate.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { | ||
| IMG_NATIONAL_PARKS, | ||
| IMG_SIG_TANG_KIN_FEI, | ||
| IMG_SIG_TI_BOON_WEE, | ||
| IMG_SIG_KENNETH_ER, | ||
| Certificate | ||
| } from "../common"; | ||
|
|
||
| const Template = Certificate({ | ||
| logo: IMG_NATIONAL_PARKS, | ||
| signatories: [ | ||
| { | ||
| signature: IMG_SIG_TI_BOON_WEE, | ||
| name: "Ti Boon Wee", | ||
| position: "Principal", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| }, | ||
| { | ||
| signature: IMG_SIG_KENNETH_ER, | ||
| name: "Kenneth Er", | ||
| position: "Chief Executive Officer", | ||
| organisation: "National Parks Board" | ||
| }, | ||
| { | ||
| signature: IMG_SIG_TANG_KIN_FEI, | ||
| name: "Tang Kin Fei", | ||
| position: "Council Chairman", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| } | ||
| ] | ||
| }); | ||
|
|
||
| export default Template; |
20 changes: 20 additions & 0 deletions
20
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-LDH/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { approvedAddresses } from "../common"; | ||
| import NPCert from "./certificate"; | ||
| import NPTranscript from "../common/transcript"; | ||
|
|
||
| const templates = [ | ||
| { | ||
| id: "certificate", | ||
| label: "Certificate", | ||
| template: NPCert | ||
| }, | ||
| { | ||
| id: "transcript", | ||
| label: "Transcript", | ||
| template: NPTranscript | ||
| } | ||
| ]; | ||
|
|
||
| const addresses = approvedAddresses; | ||
|
|
||
| export default { templates, addresses }; |
24 changes: 24 additions & 0 deletions
24
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-MAIN/certificate.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { | ||
| IMG_SIG_TANG_KIN_FEI, | ||
| IMG_SIG_TI_BOON_WEE, | ||
| Certificate | ||
| } from "../common"; | ||
|
|
||
| const Template = Certificate({ | ||
| signatories: [ | ||
| { | ||
| signature: IMG_SIG_TANG_KIN_FEI, | ||
| name: "Tang Kin Fei", | ||
| position: "Council Chairman", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| }, | ||
| { | ||
| signature: IMG_SIG_TI_BOON_WEE, | ||
| name: "Ti Boon Wee", | ||
| position: "Principal", | ||
| organisation: "Ngee Ann Polytechnic" | ||
| } | ||
| ] | ||
| }); | ||
|
|
||
| export default Template; |
20 changes: 20 additions & 0 deletions
20
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-MAIN/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { approvedAddresses } from "../common"; | ||
| import NPCert from "./certificate"; | ||
| import NPTranscript from "../common/transcript"; | ||
|
|
||
| const templates = [ | ||
| { | ||
| id: "certificate", | ||
| label: "Certificate", | ||
| template: NPCert | ||
| }, | ||
| { | ||
| id: "transcript", | ||
| label: "Transcript", | ||
| template: NPTranscript | ||
| } | ||
| ]; | ||
|
|
||
| const addresses = approvedAddresses; | ||
|
|
||
| export default { templates, addresses }; |
170 changes: 170 additions & 0 deletions
170
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-OPTION/certificate.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| import { IMG_LOGO_NP, IMG_SIG_MAH_BEE_WENG } from "../common"; | ||
|
|
||
| const fullWidthStyle = { | ||
| width: "100%", | ||
| height: "auto" | ||
| }; | ||
|
|
||
| const printTextStyle = { | ||
| fontWeight: "500!important", | ||
| fontWize: "1.2rem", | ||
| color: "#555", | ||
| textAlign: "center" | ||
| }; | ||
|
|
||
| const nameTextStyle = { | ||
| fontSize: "3rem", | ||
| textAlign: "center" | ||
| }; | ||
|
|
||
| const titleTextStyle = { | ||
| color: "rgb(30,93,200)", | ||
| fontSize: "3rem", | ||
| textAlign: "center" | ||
| }; | ||
|
|
||
| export const formatDate = dateString => { | ||
| if (!dateString) return null; | ||
| const date = new Date(dateString); | ||
| const months = [ | ||
| "January", | ||
| "February", | ||
| "March", | ||
| "April", | ||
| "May", | ||
| "June", | ||
| "July", | ||
| "August", | ||
| "September", | ||
| "October", | ||
| "November", | ||
| "December" | ||
| ]; | ||
|
|
||
| const day = date.getDay(); | ||
| let daySup = ""; | ||
| switch (day % 10 === 1) { | ||
| case 1: | ||
| daySup = "st"; | ||
| break; | ||
| case 2: | ||
| daySup = "nd"; | ||
| break; | ||
| case 3: | ||
| daySup = "rd"; | ||
| break; | ||
| default: | ||
| daySup = "th"; | ||
| } | ||
|
|
||
| const month = date.getMonth(); | ||
| const year = date.getUTCFullYear(); | ||
|
|
||
| return ( | ||
| <p> | ||
| Dated this {day} | ||
| <sup>{daySup}</sup> day of {months[month]} {year} | ||
| </p> | ||
| ); | ||
| }; | ||
|
|
||
| export const formatCertName = (certName, meritFlag) => { | ||
| let certDipDisplay = ""; | ||
| if (meritFlag === "Y") { | ||
| certDipDisplay = "Diploma with Merit"; | ||
| } else { | ||
| certDipDisplay = "Diploma"; | ||
| } | ||
|
|
||
| return ( | ||
| <p> | ||
| {certDipDisplay} | ||
| <br /> | ||
| in | ||
| <br /> | ||
| {certName} | ||
| </p> | ||
| ); | ||
| }; | ||
|
|
||
| export const formatCertID = certId => { | ||
| if (!certId) return null; | ||
| const arrayCertId = certId.split(":"); | ||
| return arrayCertId.length > 0 ? arrayCertId[0] : null; | ||
| }; | ||
|
|
||
| const Template = certificate => ( | ||
| <div> | ||
| <div | ||
| className="container" | ||
| style={{ border: 5, borderColor: "#AAA", borderStyle: "solid" }} | ||
| > | ||
| <div className="row d-flex justify-content-center"> | ||
| <div className="col-2" /> | ||
| <div className="col-8"> | ||
| <img style={fullWidthStyle} src={IMG_LOGO_NP} /> | ||
| </div> | ||
| <div className="col-2" /> | ||
| </div> | ||
| <div | ||
| className="row d-flex justify-content-center" | ||
| style={{ marginTop: "3rem" }} | ||
| > | ||
| <p style={printTextStyle}>This is to certify that</p> | ||
| </div> | ||
| <div className="row d-flex justify-content-center"> | ||
| <p style={nameTextStyle}>{certificate.recipient.name}</p> | ||
| </div> | ||
| <div className="row d-flex justify-content-center"> | ||
| <p style={printTextStyle}>has fulfilled an option in</p> | ||
| </div> | ||
| <div className="row d-flex justify-content-center"> | ||
| <p style={printTextStyle}> | ||
| <p style={titleTextStyle}>{certificate.additionalData.optionName}</p> | ||
| </p> | ||
| </div> | ||
| <div className="row d-flex justify-content-center"> | ||
| <p style={printTextStyle}>as part of the course of study in the</p> | ||
| </div> | ||
| <div className="row d-flex justify-content-center"> | ||
| <p style={titleTextStyle}> | ||
| {" "} | ||
| Diploma | ||
| <br /> | ||
| in | ||
| <br /> | ||
| {certificate.name} | ||
| </p> | ||
| </div> | ||
| <div | ||
| className="row d-flex justify-content-center align-items-end" | ||
| style={{ marginTop: "8rem", marginBottom: "2rem" }} | ||
| > | ||
| <div className="col-1" /> | ||
| <div className="col-5"> | ||
| <div className="px-5"> | ||
| <div>{formatDate(certificate.issuedOn)}</div> | ||
| </div> | ||
| <br /> | ||
| <br /> | ||
| </div> | ||
| <div className="col-5"> | ||
| <div className="px-5"> | ||
| <img style={fullWidthStyle} src={IMG_SIG_MAH_BEE_WENG} /> | ||
| <hr /> | ||
| </div> | ||
| <div className="text-center">Mah Wee Beng</div> | ||
| <div className="text-center">Registrar</div> | ||
| </div> | ||
| <div className="col-1" /> | ||
| </div> | ||
| </div> | ||
| <div className="container"> | ||
| <div className="row d-flex justify-content-center"> | ||
| <div className="col-12 text-right">{formatCertID(certificate.id)}</div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
|
|
||
| export default Template; | ||
14 changes: 14 additions & 0 deletions
14
src/components/CertificateTemplates/NgeeAnnPolytechnic/NP-AA2018-OPTION/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { approvedAddresses } from "../common"; | ||
| import NPCert from "./certificate"; | ||
|
|
||
| const templates = [ | ||
| { | ||
| id: "certificate", | ||
| label: "Certificate", | ||
| template: NPCert | ||
| } | ||
| ]; | ||
|
|
||
| const addresses = approvedAddresses; | ||
|
|
||
| export default { templates, addresses }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.