[IMP]pms: pms portal templates improvements

This commit is contained in:
Darío Lodeiros
2022-11-20 15:13:56 +01:00
parent dc77b35f9f
commit 174d5bec54
2 changed files with 204 additions and 172 deletions

View File

@@ -196,10 +196,23 @@
<!-- Sidebar --> <!-- Sidebar -->
<t t-call="portal.portal_record_sidebar"> <t t-call="portal.portal_record_sidebar">
<t t-set="classes" t-value="'col-lg-auto d-print-none'" /> <t t-set="classes" t-value="'col-lg-auto d-print-none'" />
<t t-set="title"> <t t-set="title">
<h2 class="mb-0"><b t-field="folio.amount_total" /> </h2> <h2 class="mb-0">
<b
t-if="folio.pending_amount > 0"
t-field="folio.pending_amount"
/>
<b t-else="1" t-field="folio.amount_total" />
</h2>
<div
class="small"
t-if="folio.payment_state not in ('paid', 'in_payment')"
><i class="fa fa-clock-o" /><span
class="o_portal_sidebar_timeago ml4"
t-att-datetime="folio.last_checkout"
/></div>
</t> </t>
<t t-set="entries"> <t t-set="entries">
<ul <ul
class="list-group list-group-flush flex-wrap flex-row flex-lg-column" class="list-group list-group-flush flex-wrap flex-row flex-lg-column"
@@ -241,7 +254,6 @@
/> Guests to Precheckin /> Guests to Precheckin
</a> </a>
</div> </div>
</li> </li>
<li <li
@@ -284,7 +296,7 @@
</t> </t>
<!-- main content--> <!-- main content-->
<div id="folio_content" class="col-12 col-lg"> <div id="folio_content" class="col-12 col-lg">
<t t-if="error or warning" t-call="pms.folio_invoice_error" /> <t t-if="error or warning" t-call="pms.portal_folio_error" />
<t <t
t-if="success and (not error and not warning)" t-if="success and (not error and not warning)"
t-call="pms.portal_folio_success" t-call="pms.portal_folio_success"
@@ -296,18 +308,21 @@
class="fa fa-circle-o-notch fa-spin fa-2x fa-fw text-black-50" class="fa fa-circle-o-notch fa-spin fa-2x fa-fw text-black-50"
/> />
</div> </div>
<!-- TODO: real values: height="100%" and scrolling="no",
temp -> fixed height, review why dont launch
autoresize FolioPortalSidebar.js-->
<iframe <iframe
id="folio_html" id="folio_html"
class="mt8 mb8" class="mt8 mb8"
width="100%" width="100%"
height="100%" height="800px"
frameborder="0" frameborder="0"
scrolling="no" scrolling="yes"
t-att-src="folio.get_portal_url(report_type='html')" t-att-src="folio.get_portal_url(report_type='html')"
/> />
</div> </div>
<!-- chatter --> <!-- chatter -->
<div id="folio_communication" class="mt-4"> <div id="invoice_communication" class="mt-4">
<h2>History</h2> <h2>History</h2>
<t t-call="portal.message_thread"> <t t-call="portal.message_thread">
<t t-set="object" t-value="folio" /> <t t-set="object" t-value="folio" />
@@ -318,7 +333,7 @@
</xpath> </xpath>
</template> </template>
<template id="folio_invoice_error" name="Folio error/warning display"> <template id="portal_folio_error" name="Folio error/warning display">
<div class="row mr16"> <div class="row mr16">
<div <div
t-attf-class="'col-lg-12 mr16 ml16 alert alert-dismissable' #{'alert-danger' if error else 'alert-warning'}" t-attf-class="'col-lg-12 mr16 ml16 alert alert-dismissable' #{'alert-danger' if error else 'alert-warning'}"

View File

@@ -363,7 +363,7 @@
</div> </div>
<div t-attf-class="form-group col-md-4"> <div t-attf-class="form-group col-md-4">
<select <select
class="form-control #{error.get('address') and 'is-invalid' or ''}" t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"
id="residence-country" id="residence-country"
name='residence_country_id' name='residence_country_id'
onclick="changeCountryFormClass()" onclick="changeCountryFormClass()"
@@ -385,7 +385,7 @@
</div> </div>
<div t-attf-class="form-group col-md-12 pb-md-3"> <div t-attf-class="form-group col-md-12 pb-md-3">
<select <select
class="form-control" t-attf-class="form-control #{error.get('address') and 'is-invalid' or ''}"
id="residence-state" id="residence-state"
name='residence_state_id' name='residence_state_id'
onclick="changeFormClass()" onclick="changeFormClass()"
@@ -556,15 +556,6 @@
var access_token = document.getElementById("input_access_token").value var access_token = document.getElementById("input_access_token").value
var checkin_pos = document.getElementById("input_checkin_pos").value; var checkin_pos = document.getElementById("input_checkin_pos").value;
window.history.pushState(null, '', '/my/precheckin/'+folio_id+'/checkin/'+checkin_partner_id +'?access_token='+ access_token); window.history.pushState(null, '', '/my/precheckin/'+folio_id+'/checkin/'+checkin_partner_id +'?access_token='+ access_token);
document.getElementById("btnPrev1").addEventListener("click", myFunction);
function myFunction() {
if (checkin_pos >= 0){
checkin_pos = checkin_pos -2
checkin_partner_id = parseInt(checkin_partner_id) - 1
url = document.referrer + '\u0026'+'checkin_pos='+ checkin_pos + '\u0026'+ 'back=1';
window.location = url;
}
}
function launchSnackBar(element) { function launchSnackBar(element) {
var x = document.getElementById("snackbar"); var x = document.getElementById("snackbar");
if (checkin_pos == -1){ if (checkin_pos == -1){
@@ -586,116 +577,126 @@
</template> </template>
<template id="portal_my_reservation_precheckin" name="Precheckin Reservation"> <template id="portal_my_reservation_precheckin" name="Precheckin Reservation">
<t t-call="portal.portal_layout"> <t t-call="portal.portal_layout">
<thead style="background-color: white;"> <wrap>
<tr class="active"> <div
<center> class="oe_structure"
<h4>PreCheckin in <span id="oe_structure_website_form_reservation_precheckin_1"
t-field="folio.pms_property_id.name" />
/></h4> <thead style="background-color: white;">
</center> <tr class="active">
</tr> <center>
</thead> <h4>PreCheckin in <span
<center> t-field="folio.pms_property_id.name"
<h5 style="margin-top:20px;"> /></h4>
Hi, </center>
<span t-field="folio.sudo().partner_name" />.<br /> </tr>
Do your check-in now and save time. </thead>
</h5> <center>
<h5 style="margin-top:20px;">
Hi,
<span t-field="folio.sudo().partner_name" />.<br />
Do your check-in now and save time.
</h5>
<br /> <br />
This is our<strong This is our<strong
> quick registration system</strong>. In a few steps you will be able to register your data in an agile, simple and secure way,<strong > quick registration system</strong>. In a few steps you will be able to register your data in an agile, simple and secure way,<strong
> avoiding queues at reception</strong>. > avoiding queues at reception</strong>.
If you register your data in our system, <strong If you register your data in our system, <strong
> your passage through reception will be much faster</strong>, being able to enjoy the comfort of your room right away. > your passage through reception will be much faster</strong>, being able to enjoy the comfort of your room right away.
</center> </center>
<div class="col-12" style="margin-top:40px;"> <div class="col-12" style="margin-top:40px;">
<form <form
class="col-6 float-right" class="col-6 float-right"
style="margin-bottom:50px" style="margin-bottom:50px"
t-att-action="folio.get_portal_url()" t-att-action="folio.get_portal_url()"
method="get" method="get"
>
<button
type="submit"
class="btn btn-primary"
style="width:-webkit-fill-available"
> >
<span class="fa fa-info" /> <button
Reservation Info type="submit"
</button> class="btn btn-primary"
<input style="width:-webkit-fill-available"
type="text" >
name="access_token" <span class="fa fa-info" />
t-attf-class="d-none" Reservation Info
t-att-value="folio.access_token" </button>
/> <input
<input type="text"
name="folio_id" name="access_token"
t-attf-class="d-none" t-attf-class="d-none"
t-att-value="folio.id" t-att-value="folio.access_token"
/> />
</form> <input
<form name="folio_id"
class="col-6 float-right" t-attf-class="d-none"
style="margin-bottom:50px" t-att-value="folio.id"
t-att-action="'/my/precheckin/'+str(folio.id)+'/checkin/'+str(checkin_partner_id.id)" />
method="post" </form>
> <form
<input class="col-6 float-right"
type="text" style="margin-bottom:50px"
name="access_token" t-att-action="'/my/precheckin/'+str(folio.id)+'/checkin/'+str(checkin_partner_id.id)"
t-attf-class="d-none" method="post"
t-att-value="checkin_partner_id.access_token"
/>
<input
name="checkin_partner_id"
t-attf-class="d-none"
t-att-value="checkin_partner_id.id"
/>
<input
type="text"
name="checkin_pos"
t-attf-class="form-control d-none"
value="0"
/>
<input
type="number"
name="first"
t-attf-class="form-control d-none"
value="1"
/>
<button
type="submit"
class="btn btn-primary"
style="width:-webkit-fill-available"
> >
<span class="fa fa-wpforms" /> <input
CHECK IN NOW! type="text"
</button> name="access_token"
</form> t-attf-class="d-none"
</div> t-att-value="checkin_partner_id.access_token"
<!-- <center>--> />
<!-- <t t-if="len(folio.checkin_partner_ids) &gt; 1">--> <input
<!-- <div>--> name="checkin_partner_id"
<!-- If you wish, you can share with the rest of the guests the access to their check-in so that they can fill it out.--> t-attf-class="d-none"
<!-- <a--> t-att-value="checkin_partner_id.id"
<!-- role="button"--> />
<!-- t-att-href="folio.get_portal_url(suffix='/invitations')"--> <input
<!-- >--> type="text"
<!-- <button--> name="checkin_pos"
<!-- type="submit"--> t-attf-class="form-control d-none"
<!-- class="btn btn-primary"--> value="0"
<!-- style="margin-top:40px;"--> />
<!-- >--> <input
<!-- <span class="fa fa-share-square" />--> type="number"
<!-- Send Invitations--> name="first"
<!-- </button>--> t-attf-class="form-control d-none"
<!-- </a>--> value="1"
<!-- </div>--> />
<!-- </t>--> <button
type="submit"
class="btn btn-primary"
style="width:-webkit-fill-available"
>
<span class="fa fa-wpforms" />
CHECK IN NOW!
</button>
</form>
</div>
<!-- <center>-->
<!-- <t t-if="len(folio.checkin_partner_ids) &gt; 1">-->
<!-- <div>-->
<!-- If you wish, you can share with the rest of the guests the access to their check-in so that they can fill it out.-->
<!-- <a-->
<!-- role="button"-->
<!-- t-att-href="folio.get_portal_url(suffix='/invitations')"-->
<!-- >-->
<!-- <button-->
<!-- type="submit"-->
<!-- class="btn btn-primary"-->
<!-- style="margin-top:40px;"-->
<!-- >-->
<!-- <span class="fa fa-share-square" />-->
<!-- Send Invitations-->
<!-- </button>-->
<!-- </a>-->
<!-- </div>-->
<!-- </t>-->
<!-- </center>--> <!-- </center>-->
<div
class="oe_structure"
id="oe_structure_website_form_reservation_precheckin_2"
/>
</wrap>
</t> </t>
<style> <style>
@@ -978,57 +979,73 @@
</template> </template>
<template id="portal_my_precheckin_end" name="Precheckin End"> <template id="portal_my_precheckin_end" name="Precheckin End">
<t t-call="portal.portal_layout"> <t t-call="portal.portal_layout">
<center> <wrap>
<h5 style="margin-top:20px;"> <div
Thank you! class="oe_structure"
Your check-in has been successful. id="oe_structure_website_form_precheckin_success_1"
</h5> />
<br /> <center>
<form <h5 style="margin-top:20px;">
style="margin-bottom:50px" Thank you!
t-att-action="folio.get_portal_url()" Your check-in has been successful.
method="get" </h5>
> <br />
<button <span t-if="folio">
type="submit" <form
class="btn btn-primary" style="margin-bottom:50px"
style="width:-webkit-fill-available" t-att-action="folio.get_portal_url()"
> method="get"
<span
t-if="folio.payment_state in ['paid','nothing_to_pay','overpayment']"
class="fa fa-info"
> >
Reservation Info <button
</span> type="submit"
<span t-else="" class="fa fa-money"> class="btn btn-primary"
Pay Now style="width:-webkit-fill-available"
</span> >
</button> <span
<input t-if="folio.payment_state in ['paid','nothing_to_pay','overpayment']"
type="text" class="fa fa-info"
name="access_token" >
t-attf-class="d-none" Reservation Info
t-att-value="folio.access_token" </span>
/> <span t-else="" class="fa fa-money">
<input Pay Now
name="folio_id" </span>
t-attf-class="d-none" </button>
t-att-value="folio.id" <input
/> type="text"
</form> name="access_token"
</center> t-attf-class="d-none"
t-att-value="folio.access_token"
/>
<input
name="folio_id"
t-attf-class="d-none"
t-att-value="folio.id"
/>
</form>
</span>
</center>
<div
class="oe_structure"
id="oe_structure_website_form_precheckin_success_2"
/>
</wrap>
</t> </t>
<style /> <style />
</template> </template>
<template id="portal_not_checkin" name="Not Checkin"> <template id="portal_not_checkin" name="Not Checkin">
<t t-call="portal.portal_layout"> <wrap>
<center> <div class="oe_structure" id="oe_structure_website_form_no_precheckin_1" />
The quick registration system is not available.<br /> <t t-call="portal.portal_layout">
If you have any questions, you can contact us: <br /><br />Phone: <span <center>
><t t-esc="folio.pms_property_id.phone" /></span> <br /> Email: <span><t The quick registration system is not available for this reservation.<br
t-esc="folio.pms_property_id.email" />
/></span> If you have any questions, you can contact us: <br /><br
</center> />Phone: <span><t t-esc="folio.pms_property_id.phone" /></span> <br
</t> /> Email: <span><t t-esc="folio.pms_property_id.email" /></span>
</center>
</t>
<div class="oe_structure" id="oe_structure_website_form_no_precheckin_2" />
</wrap>
</template> </template>
</odoo> </odoo>