[gnome-maps/wip/mlundblad/add-email-and-takeaway: 2/4] placeView: Show takeaway for eating & drinking places




commit 005e690cdcadf23c11527438a248f2c4a7133432
Author: Marcus Lundblad <ml update uu se>
Date:   Fri Apr 30 23:07:03 2021 +0200

    placeView: Show takeaway for eating & drinking places

 src/placeView.js | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
---
diff --git a/src/placeView.js b/src/placeView.js
index 30a9cdbb..e623388b 100644
--- a/src/placeView.js
+++ b/src/placeView.js
@@ -31,6 +31,7 @@ const Application = imports.application;
 const ContactPlace = imports.contactPlace;
 const Overpass = imports.overpass;
 const Place = imports.place;
+const PlaceIcons = imports.placeIcons;
 const PlaceViewImage = imports.placeViewImage;
 const PlaceButtons = imports.placeButtons;
 const PlaceFormatter = imports.placeFormatter;
@@ -304,6 +305,36 @@ var PlaceView = GObject.registerClass({
                            linkUrl: 'mailto:%s'.format(place.email) });
         }
 
+        if (place.isEatingAndDrinking) {
+            switch (place.takeaway) {
+                case 'yes':
+                    /* Translators:
+                     * The establishment offers customers to purchase meals
+                     * (or similar) to be consumed elsewhere
+                     */
+                    content.push({ info: _("Offers takeaway"),
+                                   icon: PlaceIcons.getIconForPlace(place) });
+                    break;
+                case 'no':
+                    /* Translators:
+                     * The establishment only offers customers to purchase
+                     * meals (or similar) to be consumed on-premise.
+                     */
+                    content.push({ info: _("Does not offer takeaway"),
+                                   icon: PlaceIcons.getIconForPlace(place) });
+                    break;
+                case 'only':
+                    /* Translators:
+                     * The establishment only offers customers to purchase
+                     * meals (or similar) to be consumed elsewhere. E.g.
+                     * there is no seating on-premise for eating/drinking
+                     */
+                    content.push({ info: _("Only offers takeaway"),
+                                   icon: PlaceIcons.getIconForPlace(place) });
+                    break;
+            }
+        }
+
         if (place.openingHours) {
             content.push({ label: _("Opening hours"),
                            icon: 'emoji-recent-symbolic',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]