[ADD] Actions on fa-icons

This commit is contained in:
Pablo
2018-12-27 08:50:32 +01:00
parent be04654722
commit c1b2a59686
3 changed files with 43 additions and 22 deletions

View File

@@ -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;

View File

@@ -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',

View File

@@ -95,14 +95,13 @@
</t>
<t t-name="HotelCalendar.TooltipReservation.Footer">
<div class="row row-eq-height mt-25">
<div class="col-sm-4">
<div class="row row-eq-height mt-10">
<div class="col-sm-4 btn_popover_open_folio">
<i class="fa fa-file-text-o fa-2x fa-pull-left fa-border" role="button"
title="View Reservation Folio" />
<p class="mt-10"><t t-esc="folio_name"/></p>
title="View Folio Details"> <span class="fa-text-inside"><t t-esc="folio_name"/></span></i>
</div>
<div class="col-sm-2">
<span class="fa fa-external-link fa-2x fa-border" role="button"
<div class="col-sm-2 btn_popover_open_reservation">
<span class="fa fa-suitcase fa-2x fa-border" role="button"
title="View Reservation Details" />
</div>
<div class="col-sm-2">
@@ -114,11 +113,11 @@
title="Send Reservation Email" />
</div>
<div class="col-sm-2">
<span class="fa fa-money fa-2x fa-border text-primary" role="button"
<span class="fa fa-money fa-2x fa-border" role="button"
title="Payments" />
</div>
<div class="col-sm-2">
<span class="fa fa-window-close fa-2x fa-border text-danger" role="button"
<div class="col-sm-2 btn_popover_close">
<span class="fa fa-window-close fa-2x fa-border" role="button"
title="Close" />
</div>
</div>