Debian Codegraph @

addons/marketing_card/views/card_frontend_templates.xml

raw
1 <?xml version="1.0"?>
2 <odoo>
3 <template id="card_campaign_preview" name="Share campaign">
4 <t t-call="web.frontend_layout">
5 <t t-set="title" t-value="card.display_name"/>
6 <t t-set="body_classname" t-value="'o_card_campaign_preview_frontend'"/>
7 <t t-set="no_header" t-value="1"/>
8 <t t-set="no_footer" t-value="1"/>
9 <t t-set="no_livechat" t-value="1"/>
10 <t t-set="share_url" t-value="card._get_redirect_url()"/>
11 <t t-set="share_url_quoted" t-value="quote(share_url)"/>
12 <div class="d-flex flex-column align-items-center justify-content-center h-100">
13 <div class="mb-5 d-flex flex-column align-items-center justify-content-center">
14 <h1 t-out="campaign.request_title">Share with your community!</h1>
15 <p t-out="campaign.request_description or None" class="mb-5"/>
16 <a t-att-href="card._get_card_url()" class="border border-3"
17 style="max-width: 80%; height: auto; max-height: 80%;">
18 <img t-att-src="card._get_card_url()" class="w-100"/>
19 </a>
20 <a t-att-href="share_url" target="_blank"><small>Where does this link to?</small></a>
21 </div>
22 <div class="d-flex flex-column align-items-center">
23 <h4>Select where to share</h4>
24 <div class="text-start o_no_link_popover">
25 <div id="url-div">
26 <a class="fa fa-2x fa-facebook rounded m-2" t-attf-href="https://www.facebook.com/sharer/sharer.php?u={{share_url_quoted}}" target="_blank"/>
27 <a class="fa fa-2x fa-twitter rounded m-2" t-attf-href="https://twitter.com/intent/tweet?url={{share_url_quoted}}{{'&amp;text=%s' % quote(campaign.post_suggestion) if campaign.post_suggestion else ''}}" target="_blank"/>
28 <a class="fa fa-2x fa-linkedin rounded m-2" t-attf-href="https://www.linkedin.com/sharing/share-offsite/?url={{share_url_quoted}}" target="_blank"/>
29 <a class="fa fa-2x fa-whatsapp rounded m-2" t-attf-href="https://wa.me/?text={{share_url_quoted}}" target="_blank"/>
30 <a class="fa fa-2x fa-pinterest rounded m-2" t-attf-href="https://pinterest.com/pin/create/button/?url={{share_url_quoted}}" target="_blank"/>
31 </div>
32 </div>
33 </div>
34 <br/>
35 <div id="thanks-section" t-if="not is_html_empty(campaign.reward_message) or campaign.reward_target_url" style="width: 50%;"
36 t-attf-class="alert alert-info d-flex flex-column align-items-center {{'d-none' if not card.share_status == 'shared' else ''}}">
37 <p t-if="campaign.reward_message" t-out="campaign.reward_message"/>
38 <p t-if="campaign.reward_target_url"><a t-att-href="campaign.reward_target_url">Click here for your reward!</a></p>
39 </div>
40 </div>
41 <footer class="d-flex flex-column align-items-center fixed-bottom">
42 <span>Powered By <a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth" style="color: #875A7B;">Odoo</a></span>
43 </footer>
44 <script>
45 document.querySelectorAll("#url-div a").forEach((anchor) =&gt; {
46 anchor.addEventListener("click", (event) =&gt; {
47 event.preventDefault();
48 event.stopPropagation();
49 window.open(
50 event.target.href,
51 event.target.target,
52 "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600",
53 );
54 const thanksSection = document.getElementById("thanks-section")
55 if (thanksSection) {
56 thanksSection.classList.remove("d-none");
57 }
58 });
59 });
60 </script>
61 </t>
62 </template>
63
64 <template id="card_campaign_crawler" name="Share campaign Crawler View">
65 <t t-call="web.frontend_layout">
66 <t t-set="head">
67 <meta name="twitter:card" content="summary_large_image"/>
68 <meta property="og:image" t-att-content="image_url"/>
69 <meta property="og:image:alt" t-attf-content="{{ target_name }}"/>
70 <meta property="og:title" t-att-content="target_name"/>
71 <meta property="og:type" content="website"/>
72 <meta property="og:description" t-att-content="post_suggestion"/>
73 </t>
74 <t t-set="title" t-value="target_name"/>
75 <t t-set="no_header" t-value="1"/>
76 <t t-set="no_footer" t-value="1"/>
77 </t>
78 </template>
79 </odoo>