[ios] implement the website:menu to the PlacePage

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn 2024-05-12 16:17:42 +04:00 committed by Viktor Havaka
parent a800fb6b5a
commit 031356be63
7 changed files with 32 additions and 3 deletions

View file

@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly, nullable) NSString *capacity;
@property(nonatomic, readonly, nullable) NSString *wheelchair;
@property(nonatomic, readonly, nullable) NSString *driveThrough;
@property(nonatomic, readonly, nullable) NSString *websiteMenu;
@end

View file

@ -83,7 +83,7 @@ using namespace osm;
if (value == "yes")
_driveThrough = NSLocalizedString(@"drive_through", nil);
break;
case MetadataID::FMD_WEBSITE_MENU: _websiteMenu = ToNSString(value); break;
default:
break;
}

View file

@ -50,6 +50,7 @@ class InfoItemViewController: UIViewController {
protocol PlacePageInfoViewControllerDelegate: AnyObject {
func didPressCall()
func didPressWebsite()
func didPressWebsiteMenu()
func didPressKayak()
func didPressWikipedia()
func didPressWikimediaCommons()
@ -78,6 +79,7 @@ class PlacePageInfoViewController: UIViewController {
private var rawOpeningHoursView: InfoItemViewController?
private var phoneView: InfoItemViewController?
private var websiteView: InfoItemViewController?
private var websiteMenuView: InfoItemViewController?
private var kayakView: InfoItemViewController?
private var wikipediaView: InfoItemViewController?
private var wikimediaCommonsView: InfoItemViewController?
@ -158,7 +160,19 @@ class PlacePageInfoViewController: UIViewController {
self?.delegate?.didCopy(website)
})
}
if let websiteMenu = placePageInfoData.websiteMenu {
websiteView = createInfoItem(L("website_menu"),
icon: UIImage(named: "ic_placepage_website_menu"),
style: .link,
tapHandler: { [weak self] in
self?.delegate?.didPressWebsiteMenu()
},
longPressHandler: { [weak self] in
self?.delegate?.didCopy(websiteMenu)
})
}
if let wikipedia = placePageInfoData.wikipedia {
wikipediaView = createInfoItem(L("read_in_wikipedia"),
icon: UIImage(named: "ic_placepage_wiki"),

View file

@ -32,7 +32,11 @@ extension PlacePageInteractor: PlacePageInfoViewControllerDelegate {
func didPressWebsite() {
MWMPlacePageManagerHelper.openWebsite(placePageData)
}
func didPressWebsiteMenu() {
MWMPlacePageManagerHelper.openWebsiteMenu(placePageData)
}
func didPressKayak() {
let kUDDidShowKayakInformationDialog = "kUDDidShowKayakInformationDialog"

View file

@ -232,6 +232,10 @@ using namespace storage;
[self.ownerViewController openUrl:data.infoData.website];
}
- (void)openWebsiteMenu:(PlacePageData *)data {
[self.ownerViewController openUrl:data.infoData.websiteMenu];
}
- (void)openKayak:(PlacePageData *)data {
[self.ownerViewController openUrl:data.infoData.kayak];
}

View file

@ -8,6 +8,7 @@
+ (void)addBusiness;
+ (void)addPlace:(CLLocationCoordinate2D)coordinate;
+ (void)openWebsite:(PlacePageData *)data;
+ (void)openWebsiteMenu:(PlacePageData *)data;
+ (void)openKayak:(PlacePageData *)data;
+ (void)openWikipedia:(PlacePageData *)data;
+ (void)openWikimediaCommons:(PlacePageData *)data;

View file

@ -15,6 +15,7 @@
- (void)addBusiness;
- (void)addPlace:(CLLocationCoordinate2D)coordinate;
- (void)openWebsite:(PlacePageData *)data;
- (void)openWebsiteMenu:(PlacePageData *)data;
- (void)openKayak:(PlacePageData *)data;
- (void)openWikipedia:(PlacePageData *)data;
- (void)openWikimediaCommons:(PlacePageData *)data;
@ -72,6 +73,10 @@
[[MWMMapViewControlsManager manager].placePageManager openWebsite:data];
}
+ (void)openWebsiteMenu:(PlacePageData *)data {
[[MWMMapViewControlsManager manager].placePageManager openWebsiteMenu:data];
}
+ (void)openKayak:(PlacePageData *)data {
[[MWMMapViewControlsManager manager].placePageManager openKayak:data];
}