Files
odoo_source/addons/website_event_booth/views/event_booth_templates.xml
T
Romain Estievenart 98a97d0fea [IMP] *: removes .form-group
this commit removes the usage of .form-group class which is deprecated
since BS5.

Here is the css rules that was used:

a) https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/dist/css/bootstrap.css#L1997
As we can see, it simply adds a `margin-bottom` of `1rem` which
corresponds to the `.mb-3` BS class.

b) https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/dist/css/bootstrap.css#L2326
As we already checked all `form-inline` in [1] and [2], we don't have to
do anything about these rules.

'''Breaking change: Dropped form-specific layout classes for our grid
system.
Use our grid and utilities instead of .form-group, .form-row, or
.form-inline.'''

https://getbootstrap.com/docs/5.0/migration/#forms

Notes:
- `position: relative` is already on `#new-password-group`.
- `.field-db`, `#editor-media-image`, `.unsplash_img_container` and
`#url-form-group` seems unused.
- Sometimes margins are unnecessary because of blocks overlapping.
  (e.g. `margin-bottom` is not needed if margin-top is set on the
  following node)
- CSS rules applied on `.s_website_form_rows > .form-group` are now in
the XML by adding `mb-0 py-2` BS classes.

Follow-up of:
[1] https://github.com/odoo/odoo/pull/97967
[2] https://github.com/odoo/enterprise/pull/30343

closes odoo/odoo#100052

Related: odoo/enterprise#31261
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-16 20:51:56 +02:00

124 lines
7.7 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo><data>
<template id="event_booth_layout" name="Event Booth Layout">
<t t-call="website_event.layout">
<div class="o_wbooth_registration" t-att-data-event-id="event.id"
itemscope="itemscope" itemtype="http://schema.org/Event">
<t t-call="website.record_cover">
<t t-set="_record" t-value="event"/>
<t t-set="use_filters" t-value="True"/>
<t t-set="use_text_align" t-value="True"/>
<t t-set="additionnal_classes" t-value="'pb128'"/>
<div class="container d-flex flex-column flex-grow-1">
<h1 class="text-white my-5">Get A Booth</h1>
</div>
</t>
<section class="mt-n5">
<div class="container overflow-hidden">
<div class="o_wevent_theme_bg_base row mb64 g-0 rounded shadow-sm">
<t t-out="0"/>
</div>
</div>
</section>
<div t-if="event.is_finished" class="container d-flex flex-column flex-grow-1">
<span class="alert alert-info">This event is finished. It's no longer possible to book a booth.</span>
</div>
<div t-elif="not event_booths" class="container d-flex flex-column flex-grow-1">
<span class="alert alert-info">This event is not open to exhibitors registration,
<span t-if="request.env.user.has_group('event.group_event_manager')">
you can
<a class="text-nowrap" t-attf-href="/web#id=#{event.id}&amp;view_type=form&amp;model=event.event">
<i class="fa fa-gear me-1" role="img" aria-label="Configure" title="Configure event booths"/><em>Configure Booths</em>
</a>
for this event.
</span>
<span t-else="">
check our <a href="/event">list of future events</a>.
</span>
</span>
</div>
</div>
</t>
</template>
<template id="event_booth_registration" name="Event Booth Registration">
<t t-call="website_event_booth.event_booth_layout">
<t t-if="event_booths and not event.is_finished">
<div t-attf-class="#{'col-lg-9' if available_booth_category_ids else 'col-lg-12'} p-4">
<form method="post" class="form-horizontal justify-content-center mt32 js_website_submit_form o_wbooth_registration_form"
t-attf-action="/event/#{slug(event)}/booth/register" t-att-data-event-id="event.id">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="row mb-3 justify-content-center">
<t t-foreach="event.event_booth_category_ids" t-as="booth_category">
<t t-set="booth_category_unavailable" t-value="booth_category not in available_booth_category_ids"/>
<div class="col-md-4">
<label t-attf-class="d-block #{'o_wbooth_category_unavailable' if booth_category_unavailable else ''}">
<input type="radio" name="booth_category_id" t-att-value="booth_category.id"
t-att-disabled="booth_category_unavailable"/>
<div>
<h5 name="booth_category_name" class="m-0 text-truncate" t-out="booth_category.name"/>
<span class="img img-responsive">
<div t-field="booth_category.image_1920" t-options="{'widget': 'image', 'preview_image': 'image_256', 'class': 'mt-2'}"/>
</span>
</div>
<div t-if="booth_category_unavailable" class="o_ribbon_right bg-danger">
<span class="text-nowrap">Sold Out</span>
</div>
</label>
</div>
</t>
</div>
<t t-if="available_booth_category_ids">
<div t-if="event.exhibition_map" class="row">
<div class="d-grid col-sm-6 offset-sm-3 mb-4">
<button type="button" class="btn btn-info" data-bs-toggle="modal" data-bs-target="#mapModal">View Floor Plan</button>
<div role="dialog" id="mapModal" class="modal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<div t-field="event.exhibition_map" t-options="{'widget': 'image'}" class="img img-responsive"/>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2 offset-sm-1">
<label for="booth_id" class="control-label">Booths</label>
</div>
<div class="col-sm-6 o_wbooth_booths"/>
</div>
<div class="row">
<div class="alert alert-danger col-12 o_wbooth_unavailable_booth_alert d-none" role="alert">
<i class="fa fa-exclamation-triangle"/>
<span>Sorry, several booths are now sold out. Please change your choices before validating again.</span>
</div>
</div>
<div class="row" name="booth_registration_submit">
<div class="col-sm-6 offset-sm-3 mt-5">
<button type="submit" class="btn btn-primary btn-block fw-bold o_wbooth_registration_submit" disabled="true">
<span>Book my Booths</span>
</button>
</div>
</div>
</t>
<div t-else="" class="alert alert-info">
<span>Sorry, all the booths are sold out. <a href="/contactus">Contact Us</a> if you have any question.</span>
</div>
</form>
</div>
<div t-if="available_booth_category_ids" class="o_wevent_booth_category col-lg-3 hidden-sm hidden-xs p-4">
<t t-foreach="event.event_booth_category_ids" t-as="booth_category">
<div t-attf-id="o_wbooth_booth_description_#{booth_category.id}"
class="o_wbooth_booth_description d-none" t-field="booth_category.description"/>
</t>
</div>
</t>
</t>
</template>
</data></odoo>