Skip to content

Commit

Permalink
[MIG] website_event_require_login_itpp: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Medeeet committed Nov 11, 2024
1 parent 732ebb9 commit e3e0795
Showing 1 changed file with 3 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,17 @@
>
<!-- due to odoo framework restrictions we cannot add attribute depending on condition.
Workaround: add attribute and remove it by JS when page is loaded -->
<xpath expr="//select" position="attributes">
<attribute name="disabled">1</attribute>
</xpath>
<xpath expr="//select[@class='w-auto custom-select']" position="attributes">
<attribute name="disabled">1</attribute>
</xpath>
<xpath expr="//form" position="before">
<xpath expr="//div" position="before">
<t
t-set="is_user_public"
t-value="website.env.user == request.website.user_id"
/>
</xpath>
<xpath expr="//form" position="after">
<t t-if="not is_user_public">
<script type="text/javascript">
let elements = document.querySelectorAll('.custom-select');
Array.prototype.forEach.call(elements, function(el, i){
el.removeAttribute('disabled')
});
</script>
</t>
</xpath>
<xpath expr="//button[@type='submit']" position="replace">
<t t-if="is_user_public">
<a
t-attf-href="/web/login?redirect=#{quote_plus(request.httprequest.full_path)}"
class="btn btn-primary btn-lg pull-right"
>Sign in (Sign up) to proceed</a>
</t>
<t t-else="">$0</t>
</xpath>
<xpath
expr="//div[@class='o_wevent_registration_single']/div/div/button[@type='submit']"
position="replace"
>
<xpath expr="//button[@type='button']" position="replace">
<t t-if="is_user_public">
<a
t-attf-href="/web/login?redirect=#{quote_plus(request.httprequest.full_path)}"
class="btn btn-primary btn-lg pull-right"
class="btn btn-primary w-100"
>Sign in (Sign up) to proceed</a>
</t>
<t t-else="">$0</t>
Expand Down

0 comments on commit e3e0795

Please sign in to comment.