event_templates_sponsor.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template name="Sponsors" id="event_sponsor" inherit_id="website_event.layout">
  4. <xpath expr="//div[@id='wrap']" position="inside">
  5. <section class="o_wevent_sponsor_wrapper d-none d-md-block d-print-none mt-auto">
  6. <div class="container pt32 pb16" t-if="event.sponsor_ids">
  7. <div t-attf-class="d-flex flex-wrap mb-5 #{'' if (len(event.sponsor_ids) > 10) else 'justify-content-md-center'}">
  8. <t t-foreach="event.sponsor_ids.sorted(
  9. lambda sponsor: (not sponsor.website_published, sponsor.sponsor_type_id.sequence, sponsor.sequence)
  10. )" t-as="sponsor">
  11. <t t-set="popover_content">
  12. <div t-field="sponsor.name" class="h5"/>
  13. <div t-if="sponsor.url" class="d-flex align-items-baseline">
  14. <i class="fa fa-home me-2"/><a t-att-href="sponsor.url" t-field="sponsor.url" class="text-truncate"/>
  15. </div>
  16. </t>
  17. <a class="o_wevent_sponsor o_wevent_sponsor_card h-100" tabindex="0" role="button"
  18. t-att-data-publish="'on' if sponsor.website_published else 'off'"
  19. t-att-data-bs-content="popover_content"
  20. data-bs-html="true" data-bs-trigger="focus" data-bs-toggle="popover" data-bs-placement="bottom">
  21. <t t-call="website_event_exhibitor.event_sponsor_thumb_details"/>
  22. </a>
  23. </t>
  24. </div>
  25. </div>
  26. </section>
  27. </xpath>
  28. </template>
  29. <!-- Common template for sponsor images and 'Unpublished' badge -->
  30. <template id="event_sponsor_thumb_details">
  31. <div class="h-100 shadow-sm p-2">
  32. <span t-field="sponsor.image_128"
  33. t-options='{"widget": "image", "class": "img img-fluid", "filename-field": "partner_name"}'/>
  34. <span t-if="sponsor.sponsor_type_id.display_ribbon_style and sponsor.sponsor_type_id.display_ribbon_style != 'no_ribbon'"
  35. t-field="sponsor.sponsor_type_id" t-attf-class="o_ribbon o_ribbon_right ribbon_#{sponsor.sponsor_type_id.display_ribbon_style}"/>
  36. </div>
  37. <span t-if="not sponsor.website_published"
  38. class="d-flex justify-content-center badge text-bg-danger o_wevent_online_badge_unpublished">Unpublished</span>
  39. </template>
  40. </odoo>