~openerp-dev/openobject-addons/saas-4-fixes-tde

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<!-- Layout add nav and footer -->
<template id="footer_custom" inherit_id="website.layout" name="Footer Partners Link">
    <xpath expr="//footer//div[@name='info']/ul" position="inside">
        <li><a href="/partners">Resellers</a></li>
    </xpath>
</template>

<!-- Page --> 
<template id="layout" name="Partners Layout">
    <t t-call="website.layout">
        <t t-set="additional_title">Resellers</t>
        <div id="wrap">
            <div class="oe_structure"/>
            <div class="container">
                <div class="row">
                    <t t-raw="ref_content" />
                </div>
            </div>
            <div class="oe_structure"/>
        </div>
    </t>
</template>

<template id="index" name="Find Resellers">
    <t t-call="website_crm_partner_assign.layout">
        <t t-set="ref_content">
            <div class="col-md-12">
                <h1 class="text-center">
                    Looking For a Local Store?
                </h1><h2 class="text-center text-muted">
                    Contact a reseller
                </h2>
            </div>

            <div class="col-md-3 mb32" id="partner_left">

                <ul id="reseller_grades" class="nav nav-pills nav-stacked mt16">
                    <li class="nav-header"><h3>Filter by Grade</h3></li>
                    <t t-foreach="grades" t-as="grade">
                        <li t-att-class="grade['active'] and 'active' or ''">
                            <a t-attf-href="/partners/#{ grade['grade_id'][0] and 'grade/%s/' % grade['grade_id'][0] or '' }#{ current_country and 'country/%s/' % slug(current_country) or '' }#{ search_path }">
                                <span class="badge pull-right" t-esc="grade['grade_id_count'] or ''"/>
                                <t t-esc="grade['grade_id'][1]"/> 
                            </a>
                        </li>
                    </t>
                </ul>

                <ul id="reseller_countries" class="nav nav-pills nav-stacked mt16">
                    <li class="nav-header"><h3>Filter by Country</h3></li>
                    <t t-foreach="countries" t-as="country">
                        <li t-if="country['country_id']" t-att-class="country['active'] and 'active' or ''">
                            <a t-attf-href="/partners/#{ current_grade and 'grade/%s/' % slug(current_grade) or ''}#{country['country_id'][0] and 'country/%s/' % country['country_id'][0] or '' }#{ search_path }">
                                <span class="badge pull-right" t-esc="country['country_id_count'] or ''"/>
                                <t t-esc="country['country_id'][1]"/> 
                            </a>
                        </li>
                    </t>
                </ul>

            </div>
            
            <div class="col-md-8 col-md-offset-1" id="ref_content">
                <div class='navbar'>
                    <div>
                        <t t-call="website.pager"/>
                        <form action="" method="get" class="navbar-search pull-right pagination form-inline">
                            <div class="form-group pull-right">
                                <input type="text" name="search" class="search-query col-md-2 mt4 form-control" placeholder="Search" t-att-value="searches.get('search', '')"/>
                            </div>
                        </form>
                    </div>
                </div>
                <div>
                    <p t-if="not partners">No result found</p>
                    <t t-foreach="partners" t-as="partner">
                        <t t-if="last_grade != partner.grade_id.id">
                            <h3 class="text-center">
                                <span t-field="partner.grade_id"/> Partners
                            </h3>
                            <t t-set="last_grade" t-value="partner.grade_id.id"/>
                        </t>
                        <div class="media">
                            <a class="pull-left" t-attf-href="/partners/#{slug(partner)}"
                               t-field="partner.image_small"
                               t-field-options='{"widget": "image", "class": "media-object"}'
                            ></a>
                            <div class="media-body o_partner_body" style="min-height: 64px;">
                                <a class="media-heading" t-attf-href="/partners/#{slug(partner)}">
                                    <span t-field="partner.display_name"/>
                                </a>
                                <div t-field="partner.website_short_description"/>
                                <t t-if="any([p.website_published for p in partner.implemented_partner_ids])">
                                    <small><a t-attf-href="/partners/#{slug(partner)}#right_column">
                                        <t t-raw="len([p for p in partner.implemented_partner_ids if p.website_published])"/> reference(s)
                                    </a></small>
                                </t>
                            </div>
                        </div>
                    </t>
                </div>
                <div class='navbar'>
                    <t t-call="website.pager">
                       <t t-set="classname">pull-left</t>
                    </t>
                </div>
            </div>
        </t>
    </t>
</template>

<template id="ref_country" inherit_id="website_crm_partner_assign.index" inherit_option_id="website_crm_partner_assign.index" name="Left World Map">
    <xpath expr="//ul[@id='reseller_countries']" position="after">
        <h3>World Map</h3>
        <ul class="nav">
            <iframe t-attf-src="/google_map/?width=260&amp;height=240&amp;partner_ids=#{ google_map_partner_ids }&amp;partner_url=/partners"
                style="width:260px; height:260px; border:0; padding:0; margin:0;"></iframe>
        </ul>
    </xpath>
</template>

<template id="partner" name="Partner Detail">
    <t t-call="website_crm_partner_assign.layout">
        <t t-set="ref_content">
            <t t-call="website_partner.partner_detail">
                <t t-set="right_column">
                    <div id="right_column" class="mb16"><t t-call="website_crm_partner_assign.references_block"/></div>
                </t>
            </t>
        </t>
    </t>
</template>

<template id="grade_in_detail" inherit_id="website_partner.partner_detail">
  <xpath expr="//*[@id='partner_name']" position="after">
    <h3 class="col-md-12 text-center text-muted" t-if="partner.grade_id and partner.grade_id.website_published">
      <span t-field="partner.grade_id"/> Partner</h3>
  </xpath>
</template>

<template id="references_block" name="Partner References Block">
    <t t-if="any([p.website_published for p in partner.implemented_partner_ids])">
        <h3 id="references">References</h3>
        <div t-foreach="partner.implemented_partner_ids" t-as="reference" class="media">
          <t t-if="reference.website_published">
            <a class="pull-left" t-attf-href="/customers/#{slug(reference)}">
                <span t-field="reference.image_small" t-field-options='{"widget": "image", "class": "center-block"}'/>
            </a>
            <div class="media-body" style="min-height: 64px;">
                <a class="media-heading" t-attf-href="/customers/#{slug(reference)}">
                    <span t-field="reference.self"/>
                </a>
                <div t-field='reference.website_short_description'/>
            </div>
          </t>
        </div>
    </t>
</template>

</data>
</openerp>