Commit ddb0bd2b authored by Zach Knox's avatar Zach Knox
Browse files

Merge branch '33-abbreviations' into 'dev-0.0'

Resolve "Add Building Abbreviations field and show when needed"

See merge request !23
parents ee1083c1 1395e35b
...@@ -61,6 +61,7 @@ class Locations: Object, Mappable { ...@@ -61,6 +61,7 @@ class Locations: Object, Mappable {
@objc dynamic var address = "" @objc dynamic var address = ""
@objc dynamic var campus = "" @objc dynamic var campus = ""
@objc dynamic var onCampus = false @objc dynamic var onCampus = false
@objc dynamic var abbreviation = ""
required convenience init?(map: Map){ required convenience init?(map: Map){
self.init() self.init()
...@@ -74,6 +75,7 @@ class Locations: Object, Mappable { ...@@ -74,6 +75,7 @@ class Locations: Object, Mappable {
address <- map["address"] address <- map["address"]
campus <- map["campus_region"] campus <- map["campus_region"]
onCampus <- map["on_campus"] onCampus <- map["on_campus"]
abbreviation <- map["friendly_building"]
} }
func equals(_ another: Locations) -> Bool { func equals(_ another: Locations) -> Bool {
......
...@@ -41,6 +41,7 @@ class AboutScreenViewController: UIViewController, UITableViewDelegate, UITableV ...@@ -41,6 +41,7 @@ class AboutScreenViewController: UIViewController, UITableViewDelegate, UITableV
"Eyad Hasan", "Eyad Hasan",
"Zach Knox", "Zach Knox",
"Patrick Murray", "Patrick Murray",
"Jesse Scearce",
"Zac Wood", "Zac Wood",
"Jason Yeomans" "Jason Yeomans"
] ]
......
...@@ -345,6 +345,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate, ...@@ -345,6 +345,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
filtered = filteredFacilities.filter({(facility: Facility) -> Bool in filtered = filteredFacilities.filter({(facility: Facility) -> Bool in
let hasName = facility.facilityName.lowercased().contains(searchText.lowercased()) let hasName = facility.facilityName.lowercased().contains(searchText.lowercased())
let hasBuilding = facility.facilityLocation?.building.lowercased().contains(searchText.lowercased()) ?? false let hasBuilding = facility.facilityLocation?.building.lowercased().contains(searchText.lowercased()) ?? false
let hasAbbreviation = facility.facilityLocation?.abbreviation.lowercased().contains(searchText.lowercased()) ?? false
let hasCategory = facility.category?.categoryName.lowercased().contains(searchText.lowercased()) ?? false let hasCategory = facility.category?.categoryName.lowercased().contains(searchText.lowercased()) ?? false
var hasTag = false var hasTag = false
for tag in facility.facilityTags! { for tag in facility.facilityTags! {
...@@ -364,7 +365,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate, ...@@ -364,7 +365,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
hasLabel = true hasLabel = true
} }
} }
return hasName || hasBuilding || hasCategory || hasTag return hasName || hasBuilding || hasCategory || hasTag || hasAbbreviation
}) })
LocationsList.reloadData() LocationsList.reloadData()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment