diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm index 3a7996b7f8..4ff2d74550 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm @@ -533,7 +533,7 @@ map const kMetaInfoCells = { auto c = static_cast( [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); auto ugc = data.ugc; - [c configWithReviewsCount:[ugc totalReviewsCount] + [c configWithReviewsCount:[ugc numberOfRatings] summaryRating:[ugc summaryRating] ratings:[ugc ratings]]; return c; diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm index 0f76d88e6e..52149aa21b 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm @@ -239,6 +239,7 @@ std::array const kPreviewCells = {{[_MWMPPPTitle class], canAddReview:NO isReviewedByUser:NO reviewsCount:0 + ratingsCount:0 price:data.bookingPricing discount:data.bookingDiscount smartDeal:data.isSmartDeal @@ -253,7 +254,8 @@ std::array const kPreviewCells = {{[_MWMPPPTitle class], [reviewCell configWithRating:data.ugc.summaryRating canAddReview:YES isReviewedByUser:!data.ugc.isUGCUpdateEmpty - reviewsCount:data.ugc.totalReviewsCount + reviewsCount:data.ugc.numberOfReviews + ratingsCount:data.ugc.numberOfRatings price:@"" discount:0 smartDeal:NO diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift index 78c593a243..a03dd881f7 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/PPPReview.swift @@ -34,6 +34,7 @@ final class PPPReview: MWMTableViewCell { canAddReview: Bool, isReviewedByUser: Bool, reviewsCount: UInt, + ratingsCount: UInt, price: String, discount: Int, smartDeal: Bool, @@ -74,18 +75,13 @@ final class PPPReview: MWMTableViewCell { } else { ratingSummaryView.noValueImage = #imageLiteral(resourceName: "ic_12px_rating_normal") ratingSummaryView.noValueColor = UIColor.blackSecondaryText() - reviewsLabel.text = L("placepage_no_reviews") + reviewsLabel.text = reviewsCount == 0 ? L("placepage_no_reviews") : "" } } else { ratingSummaryView.defaultConfig() - if reviewsCount > 0 { - reviewsLabel.text = String(format:L("placepage_summary_rating_description"), reviewsCount) - reviewsLabel.isHidden = false - } else { - reviewsLabel.text = "" - reviewsLabel.isHidden = true - } + reviewsLabel.text = ratingsCount > 0 + ? String(format:L("placepage_summary_rating_description"), ratingsCount) : "" pricingLabel.isHidden = false } } diff --git a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h index 7bb78616b3..f70dc1b212 100644 --- a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h +++ b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h @@ -42,7 +42,7 @@ enum class ReviewRow - (NSUInteger)addReviewCellsCount; - (std::vector const &)reviewRows; -- (NSUInteger)totalReviewsCount; +- (NSUInteger)numberOfRatings; - (MWMUGCRatingValueType *)summaryRating; - (NSArray *)ratings; diff --git a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm index b521f387e9..05f405bd94 100644 --- a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm +++ b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm @@ -79,7 +79,7 @@ MWMUGCRatingValueType * ratingValueType(float rating) - (BOOL)isAggregatedRatingEmpty { return m_ugc.m_totalRating == kIncorrectRating; } - (NSUInteger)ratingCellsCount { return 1; } - (NSUInteger)addReviewCellsCount { return 1; } -- (NSUInteger)totalReviewsCount { return static_cast(m_ugc.m_basedOn); } +- (NSUInteger)numberOfRatings { return static_cast(m_ugc.m_basedOn); } - (MWMUGCRatingValueType *)summaryRating { return ratingValueType(m_ugc.m_totalRating); } - (NSArray *)ratings { return starsRatings(m_ugc.m_ratings); } - (std::vector const &)reviewRows { return m_reviewRows; }