From c1b2a59686768b61ae1b933e3d7e4a5bb77ae8e9 Mon Sep 17 00:00:00 2001 From: Pablo Date: Thu, 27 Dec 2018 08:50:32 +0100 Subject: [PATCH] [ADD] Actions on fa-icons --- hotel_calendar/static/src/css/view.css | 18 +++++------ .../calendar/hotel_calendar_controller.js | 30 +++++++++++++++++-- .../src/xml/hotel_calendar_templates.xml | 17 +++++------ 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/hotel_calendar/static/src/css/view.css b/hotel_calendar/static/src/css/view.css index 2f6b084d7..6bcf10640 100644 --- a/hotel_calendar/static/src/css/view.css +++ b/hotel_calendar/static/src/css/view.css @@ -182,22 +182,20 @@ input#bookings_search { .popover header { font-size: 1.3em; } - -.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { - padding-top: 3px; - padding-bottom: 3px; -} .popover .fa-border { padding: .25em; border: solid 0.1em #777777; border-radius: .2em; } -.popover .fa-border > text-primary { - padding: .25em; - border: solid 0.1em #777777; - border-radius: .2em; -} +.fa-text-inside { + font-family: Garuda, sans-serif; + font-size: 14px; +} +.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + padding-top: 3px; + padding-bottom: 3px; +} /* Spacing in Bootstrap v4.0 */ .mt-3 { margin-top: 3px; diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js index 4033acd15..1b3f68524 100644 --- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js +++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js @@ -381,8 +381,8 @@ var PMSCalendarController = AbstractController.extend({ var qdict = self._generate_reservation_tooltip_dict(tp); $(".marked-as-having-a-popover").popover('destroy'); $(ev.detail.reservationDiv).addClass('marked-as-having-a-popover'); - $(ev.detail.reservationDiv).popover({ - trigger: 'manual', + var $reservationPopover = $(ev.detail.reservationDiv).popover({ + trigger: 'click focus', container: 'body', animation: false, html: true, @@ -390,6 +390,30 @@ var PMSCalendarController = AbstractController.extend({ /* title: "Come'n popovers!", */ content: QWeb.render('HotelCalendar.TooltipReservation', qdict) }).popover('show'); + /* add actions */ + $reservationPopover.data('bs.popover').tip().find(".btn_popover_open_folio").on('click', + {folio_id: ev.detail.reservationObj._userData.folio_id}, function(ev){ + $(".marked-as-having-a-popover").popover('destroy'); + self.do_action({ + type: 'ir.actions.act_window', + res_model: 'hotel.folio', + res_id: ev.data.folio_id, + views: [[false, 'form']] + }); + }); + $reservationPopover.data('bs.popover').tip().find(".btn_popover_open_reservation").on('click', + {reservation_id: ev.detail.reservationObj.id}, function(ev){ + $(".marked-as-having-a-popover").popover('destroy'); + self.do_action({ + type: 'ir.actions.act_window', + res_model: 'hotel.reservation', + res_id: ev.data.reservation_id, + views: [[false, 'form']] + }); + }); + $reservationPopover.data('bs.popover').tip().find(".btn_popover_close").on('click', function(ev){ + $(".marked-as-having-a-popover").popover('destroy'); + }); } }); this._multi_calendar.on_calendar('hcalOnSplitReservation', function(ev){ @@ -415,7 +439,7 @@ var PMSCalendarController = AbstractController.extend({ }); this._multi_calendar.on_calendar('hcalOnDblClickReservation', function(ev){ //var res_id = ev.detail.reservationObj.getUserData('folio_id'); - $(ev.detail.reservationDiv).tooltip('destroy'); + $(ev.detail.reservationDiv).popover('destroy'); self.do_action({ type: 'ir.actions.act_window', res_model: 'hotel.reservation', diff --git a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml index b8c2b75d3..9c123b221 100644 --- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml @@ -95,14 +95,13 @@ -
-
+
+
-

+ title="View Folio Details">
-
- +
@@ -114,11 +113,11 @@ title="Send Reservation Email" />
-
-
- +