Skip to content

Commit

Permalink
Merge pull request #45 from Zolon-DOL/swt2023_17_initial_training_for…
Browse files Browse the repository at this point in the history
…_new_employee

Enforcement changes done.
  • Loading branch information
te-chetan authored Jul 13, 2023
2 parents 4afff52 + a4a89f5 commit d6c1b69
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 136 deletions.
43 changes: 23 additions & 20 deletions Child Labor/EnforceTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class EnforceTableViewController: UITableViewController {
setEnforcement(self.laborRoutineTargetedLabel, text: enforcements["Labor_Routine_Inspections_Targeted"].element?.text)
setEnforcement(self.laborUnannouncedPremittedLabel, text: enforcements["Labor_Unannounced_Inspections_Premitted"].element?.text)
setEnforcement(self.laborUnannouncedConductedLabel, text: enforcements["Labor_Unannounced_Inspections_Conducted"].element?.text)
setEnforcement(self.laborEmployeeTrainingLabel, text: enforcements["Labor_New_Employee_Training"].element?.text)
setEnforcement(self.laborLawTrainingLabel, text: enforcements["Labor_New_Law_Training"].element?.text)
// setEnforcement(self.laborEmployeeTrainingLabel, text: enforcements["Labor_New_Employee_Training"].element?.text)
// setEnforcement(self.laborLawTrainingLabel, text: enforcements["Labor_New_Law_Training"].element?.text)
// setEnforcement(self.laborRefresherCoursesLabel, text: enforcements["Labor_Refresher_Courses"].element?.text)
setEnforcement(self.laborComplaintMechanismLabel, text: enforcements["Labor_Complaint_Mechanism"].element?.text)
setEnforcement(self.laborReferralMechanismLabel, text: enforcements["Labor_Referral_Mechanism"].element?.text)
Expand Down Expand Up @@ -163,36 +163,36 @@ class EnforceTableViewController: UITableViewController {

override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 9
return 8
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
if state == 0 {
switch section {
case 0:
return 4
return 5
// case 1:
// return 0//1
case 1:
return 1
case 2:
return 1
case 3:
return 3
case 3:
return 2
case 4:
return 2
case 5:
return 2
case 6:
return 2
default:
return 0
}
}
else {
switch section {
case 7:
case 6:
return 1
case 8:
case 7:
return 5
default:
return 0
Expand All @@ -206,55 +206,58 @@ class EnforceTableViewController: UITableViewController {
}

override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if (state == 0 && section <= 6) {
if (state == 0 && section <= 5) {
if section == 0 {
return 0
}
return UITableViewAutomaticDimension;
}

if (state == 1 && section >= 7) {
if (state == 1 && section >= 6) {
return UITableViewAutomaticDimension;
}

return CGFloat.leastNormalMagnitude
}

override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if (state == 0 && section <= 6) {
return UITableViewAutomaticDimension;
if (state == 0 && section <= 5) {
return UITableViewAutomaticDimension;

}



if (state == 1 && section > 6) {
if (state == 1 && section > 5) {
return UITableViewAutomaticDimension;
}

return CGFloat.leastNormalMagnitude
}

override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
if (state == 0 && section <= 6) {
if (state == 0 && section <= 5) {
return super.tableView(tableView, titleForHeaderInSection: section)
}

if (state == 1 && section > 6) {
if (state == 1 && section > 5) {
return super.tableView(tableView, titleForHeaderInSection: section)
}

return nil
}

override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
if (state == 0 && section <= 6) {
if (state == 0 && section <= 5) {
if (section == 6 && self.hasLaborFooter) {
// return "*The government does not publish this information";
return " ";
}
return super.tableView(tableView, titleForFooterInSection: section)
}

if (state == 1 && section > 6) {
if (section == 8 && self.hasCriminalFooter) {
if (state == 1 && section > 5) {
if (section == 7 && self.hasCriminalFooter) {
// return "*The government does not publish this information";
return " ";
}
Expand Down
Loading

0 comments on commit d6c1b69

Please sign in to comment.