Skip to content

Commit a937bfb

Browse files
author
Maurice Breit
committed
hide buttons if user is not coach
1 parent 7ebe791 commit a937bfb

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

CoachPlus/app/events/EventDetailViewController.swift

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class EventDetailViewController: CoachPlusViewController, UITableViewDelegate, U
1515
case news = 0
1616
case participation = 1
1717
}
18-
1918

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

4746
override func viewDidLoad() {
4847
super.viewDidLoad()
49-
50-
48+
5149
self.view.heroID = self.heroId
5250

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

66-
6767
self.tableView.rowHeight = UITableViewAutomaticDimension
6868
self.tableView.estimatedRowHeight = 70
6969

@@ -73,7 +73,6 @@ class EventDetailViewController: CoachPlusViewController, UITableViewDelegate, U
7373
}
7474

7575
override func viewWillAppear(_ animated: Bool) {
76-
7776
super.viewWillAppear(animated)
7877

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

91-
9290
self.locationLbl.text = self.event?.getLocationString()
93-
94-
95-
9691
}
9792

9893
func loadParticipations() {

0 commit comments

Comments
 (0)