website_customer_templates.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="index" name="Our References">
  4. <t t-call="website.layout">
  5. <div id="wrap">
  6. <div class="oe_structure">
  7. <section>
  8. <h1 class="text-center">
  9. Our References
  10. </h1><h2 class="text-center text-muted">
  11. Trusted by millions worldwide
  12. </h2>
  13. </section>
  14. </div>
  15. <div class="container">
  16. <div class="row">
  17. <div class="col-lg-3 mb32" id="ref_left_column">
  18. </div>
  19. <div class="col-lg-8 offset-lg-1" id="ref_content">
  20. <div class='d-flex m-2'>
  21. <t t-call="website.pager">
  22. <t t-set="classname" t-value="'float-start'"/>
  23. </t>
  24. <form action="" method="get" class="navbar-search ms-auto pagination">
  25. <div class="mb-3">
  26. <input type="text" name="search" class="search-query form-control"
  27. placeholder="Search" t-att-value="post.get('search', '')"/>
  28. </div>
  29. </form>
  30. </div>
  31. <div>
  32. <p t-if="not partners">No result found</p>
  33. <t t-foreach="partners" t-as="partner">
  34. <div class="d-flex mt-3">
  35. <a t-attf-href="/customers/#{slug(partner)}"
  36. t-field="partner.avatar_128"
  37. class="d-block me-3 text-center o_width_128"
  38. t-options='{"widget": "image", "qweb_img_responsive": False, "class": "o_image_128_max"}'
  39. ></a>
  40. <div class="flex-grow-1" style="min-height: 64px;">
  41. <a t-attf-href="/customers/#{slug(partner)}">
  42. <span t-field="partner.display_name"/>
  43. </a>
  44. <t t-if="partner.industry_id">
  45. <a class="badge text-bg-secondary" t-attf-href="/customers/#{ 'industry/%s/' % slug(partner.industry_id) }#{ current_country_id and 'country/%s' % slug(current_country) or '' }" t-esc="partner.industry_id.name"/>
  46. </t>
  47. <div t-field="partner.website_short_description"/>
  48. </div>
  49. </div>
  50. </t>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="oe_structure"/>
  56. </div>
  57. </t>
  58. </template>
  59. <!-- Option: left column: World Map -->
  60. <template id="opt_country" inherit_id="website_customer.index" name="Show Map">
  61. <xpath expr="//div[@id='ref_left_column']" position="inside">
  62. <t t-if="google_maps_api_key">
  63. <!-- modal for large map -->
  64. <div role="dialog" class="modal fade customer_map_modal" tabindex="-1">
  65. <div class="modal-dialog modal-lg">
  66. <div class="modal-content">
  67. <header class="modal-header">
  68. <h4 class="modal-title">World Map</h4>
  69. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  70. </header>
  71. <iframe t-attf-src="/google_map/?width=898&amp;height=485&amp;partner_ids=#{ google_map_partner_ids }&amp;partner_url=/customers/"
  72. style="width:898px; height:485px; border:0; padding:0; margin:0;"></iframe>
  73. </div>
  74. </div>
  75. </div>
  76. <!-- modal end -->
  77. <h3>World Map<button class="btn btn-link" data-bs-toggle="modal" data-bs-target=".customer_map_modal"><span class="fa fa-external-link" role="img" aria-label="External link" title="External link"/></button></h3>
  78. <ul class="nav">
  79. <iframe t-attf-src="/google_map?width=260&amp;height=240&amp;partner_ids=#{ google_map_partner_ids }&amp;partner_url=/customers/"
  80. style="width:260px; height:240px; border:0; padding:0; margin:0;" scrolling="no"></iframe>
  81. </ul>
  82. </t>
  83. </xpath>
  84. </template>
  85. <template id="opt_industry_list" inherit_id="website_customer.index" name="Filter on Industry" priority="20">
  86. <xpath expr="//div[@id='ref_left_column']" position="inside">
  87. <h3>References by Industries</h3>
  88. <ul class="nav nav-pills flex-column mt16 mb32">
  89. <t t-foreach="industries" t-as="industry_dict">
  90. <t t-if="industry_dict['industry_id']">
  91. <li class="nav-item">
  92. <a t-attf-href="/customers/#{ industry_dict['industry_id'][0] and 'industry/%s/' % slug(industry_dict['industry_id']) or '' }#{ current_country_id and 'country/%s' % current_country_id or '' }#{ search_path }"
  93. t-attf-class="nav-link#{industry_dict['industry_id'][0] == current_industry_id and ' active' or ''}">
  94. <span class="badge rounded-pill float-end" t-esc="industry_dict['industry_id_count'] or '0'"/>
  95. <t t-esc="industry_dict['industry_id'][1]"/>
  96. </a>
  97. </li>
  98. </t>
  99. </t>
  100. </ul>
  101. </xpath>
  102. </template>
  103. <template id="opt_country_list" inherit_id="website_customer.index" name="Filter on Countries" priority="30">
  104. <xpath expr="//div[@id='ref_left_column']" position="inside">
  105. <h3>References by Country</h3>
  106. <ul class="nav nav-pills flex-column mt16 mb32">
  107. <t t-foreach="countries" t-as="country_dict">
  108. <t t-if="country_dict['country_id']">
  109. <li class="nav-item">
  110. <a t-attf-href="/customers/#{ current_industry_id and 'industry/%s/' % slug(current_industry) or '' }#{ country_dict['country_id'][0] and 'country/%s' % slug(country_dict['country_id']) or '' }#{ search_path }"
  111. t-attf-class="nav-link#{country_dict['country_id'][0] == current_country_id and ' active' or ''}">
  112. <span class="badge rounded-pill float-end" t-esc="country_dict['country_id_count'] or '0'"/>
  113. <t t-esc="country_dict['country_id'][1]"/>
  114. </a>
  115. </li>
  116. </t>
  117. </t>
  118. </ul>
  119. </xpath>
  120. </template>
  121. <template id="opt_tag_list" inherit_id="website_customer.index" name="Filter on Tags" priority="40">
  122. <xpath expr="//div[@id='ref_left_column']" position="inside">
  123. <h3 t-if="len(tags)">References by Tag</h3>
  124. <ul class="nav nav-pills flex-column mt16 mb32" t-if="len(tags)">
  125. <li class="nav-item"><a class="nav-link mr8" t-attf-href="/customers/#{ current_industry_id and 'industry/%s/' % slug(current_industry) or '' }#{ current_country_id and 'country/%s' % slug(current_country) or '' }">
  126. <span class="fa fa-1x fa-tags"/> All </a></li>
  127. <li t-foreach="tags" t-as="o_tag" class="nav-item">
  128. <a t-attf-class="nav-link badge bg-#{o_tag.classname}" t-esc="o_tag.name" t-att-style="tag and tag.id==o_tag.id and 'text-decoration: underline'"
  129. t-attf-href="/customers/#{ current_industry_id and 'industry/%s/' % slug(current_industry) or '' }#{ current_country_id and 'country/%s' % slug(current_country) or '' }?tag_id=#{slug(o_tag)}"/>
  130. </li>
  131. </ul>
  132. </xpath>
  133. </template>
  134. <template id="details" name="Customer Detail">
  135. <t t-call="website.layout">
  136. <div id="wrap">
  137. <div class="oe_structure" id="oe_structure_website_customer_details_1"/>
  138. <div class="container mt16">
  139. <div class="row">
  140. <div class="col-lg-5">
  141. <ol t-if="not edit_page" class="breadcrumb">
  142. <li class="breadcrumb-item"><a href="/customers">Our References</a></li>
  143. <li class="breadcrumb-item active"><span t-field="partner.display_name"/></li>
  144. </ol>
  145. </div>
  146. <t t-call="website_partner.partner_detail">
  147. <t t-set="left_column">
  148. <div id="left_column"><t t-call="website_customer.implemented_by_block"/></div>
  149. </t>
  150. <t t-set="right_column">
  151. <div id="right_column"><t t-call="website_customer.references_block"/></div>
  152. </t>
  153. </t>
  154. </div>
  155. </div>
  156. <div class="oe_structure" id="oe_structure_website_customer_details_2"/>
  157. </div>
  158. </t>
  159. </template>
  160. <template id="partner_details" inherit_id="website_partner.partner_page" name="Partner Detail Columns">
  161. <xpath expr="//t[@t-call='website_partner.partner_detail']" position="inside">
  162. <t t-set="left_column"><div id="left_column"><t t-call="website_customer.implemented_by_block"/></div></t>
  163. <t t-set="right_column"><div id="right_column"><t t-call="website_customer.references_block"/></div></t>
  164. </xpath>
  165. </template>
  166. <template id="partner_detail" inherit_id="website_partner.partner_detail" name="Partner Details">
  167. <xpath expr="//address" position="inside">
  168. <t t-if="partner.industry_id">
  169. <span class="badge text-bg-secondary"><t t-esc="partner.industry_id.name"/></span>
  170. </t>
  171. </xpath>
  172. </template>
  173. <template id="implemented_by_block" name="Partner Implemented By Block">
  174. <t t-if="partner.assigned_partner_id and partner.assigned_partner_id.website_published">
  175. <div class="card">
  176. <div class="card-header">
  177. <h4>Implemented By</h4>
  178. </div>
  179. <div class="card-body text-center">
  180. <h4>
  181. <a t-attf-href="/partners/#{slug(partner.assigned_partner_id)}">
  182. <span t-field="partner.assigned_partner_id"/>
  183. <span class="small"> (<t t-esc="len([p for p in partner.assigned_partner_id.implemented_partner_ids if p.website_published])"/> reference(s))</span>
  184. </a>
  185. </h4>
  186. <div><a t-attf-href="/partners/#{slug(partner.assigned_partner_id)}"
  187. t-field="partner.assigned_partner_id.avatar_128"
  188. class="d-block"
  189. t-options='{"widget": "image", "qweb_img_responsive": False, "class": "o_image_128_max"}'
  190. />
  191. </div>
  192. <address class="text-start">
  193. <div t-field="partner.assigned_partner_id" t-options='{
  194. "widget": "contact",
  195. "fields": ["address", "website", "phone", "email"]
  196. }'/>
  197. </address>
  198. </div>
  199. </div>
  200. </t>
  201. </template>
  202. <template id="references_block" name="Partner References Block">
  203. <t t-if="any(p.website_published for p in partner.implemented_partner_ids)">
  204. <h3 id="references">References</h3>
  205. <div t-foreach="partner.implemented_partner_ids" t-as="reference" class="d-flex mt-3">
  206. <t t-if="reference.website_published">
  207. <a t-attf-href="/customers/#{slug(reference)}">
  208. <span t-field="reference.avatar_128" class="d-block me-3 text-center o_width_128" t-options='{"widget": "image", "qweb_img_responsive": False, "class": "o_image_128_max"}'/>
  209. </a>
  210. <div class="flex-grow-1" style="min-height: 64px;">
  211. <a t-attf-href="/customers/#{slug(reference)}">
  212. <span t-field="reference.self"/>
  213. </a>
  214. <t t-if="reference.industry_id">
  215. <span class="badge text-bg-secondary"><t t-esc="reference.industry_id.name"/></span>
  216. </t>
  217. <div t-field='reference.website_short_description'/>
  218. </div>
  219. </t>
  220. </div>
  221. </t>
  222. </template>
  223. <template id="references_block_href" inherit_id="website_crm_partner_assign.references_block" name="Partner References Block">
  224. <xpath expr="//div/span" position="replace">
  225. <a t-attf-href="/customers/#{slug(reference)}">$0</a>
  226. </xpath>
  227. <xpath expr="//div[hasclass('flex-grow-1')]/span" position="replace">
  228. <a t-attf-href="/customers/#{slug(reference)}">$0</a>
  229. </xpath>
  230. </template>
  231. </odoo>