Skip to content

Commit

Permalink
hide buttons if user is not coach
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurice Breit committed Aug 6, 2017
1 parent 7ebe791 commit a937bfb
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions CoachPlus/app/events/EventDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class EventDetailViewController: CoachPlusViewController, UITableViewDelegate, U
case news = 0
case participation = 1
}


var event:Event?
var news = [News]()
Expand Down Expand Up @@ -46,8 +45,7 @@ class EventDetailViewController: CoachPlusViewController, UITableViewDelegate, U

override func viewDidLoad() {
super.viewDidLoad()



self.view.heroID = self.heroId

self.nameLbl.heroID = "\(self.heroId)/name"
Expand All @@ -61,9 +59,11 @@ class EventDetailViewController: CoachPlusViewController, UITableViewDelegate, U
if (self.membership?.isCoach())! {
self.editBtn.setIcon(icon: .googleMaterialDesign(.modeEdit), iconSize: 20, color: .coachPlusLightGrey, backgroundColor: .clear, forState: .normal)
self.sendReminderBtn.setIcon(icon: .googleMaterialDesign(.alarm), iconSize: 20, color: .coachPlusLightGrey, backgroundColor: .clear, forState: .normal)
} else {
self.editBtn.isHidden = true
self.sendReminderBtn.isHidden = true
}


self.tableView.rowHeight = UITableViewAutomaticDimension
self.tableView.estimatedRowHeight = 70

Expand All @@ -73,7 +73,6 @@ class EventDetailViewController: CoachPlusViewController, UITableViewDelegate, U
}

override func viewWillAppear(_ animated: Bool) {

super.viewWillAppear(animated)

self.nameLbl.text = self.event?.name
Expand All @@ -88,11 +87,7 @@ class EventDetailViewController: CoachPlusViewController, UITableViewDelegate, U
}
self.descriptionLbl.text = description


self.locationLbl.text = self.event?.getLocationString()



}

func loadParticipations() {
Expand Down

0 comments on commit a937bfb

Please sign in to comment.