/
view.pt
330 lines (298 loc) · 20.1 KB
/
view.pt
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="tdf.extensionuploadcenter">
<head>
<metal:block fill-slot="top_slot">
<link rel="stylesheet" type="text/css"
tal:define="navroot context/@@plone_portal_state/navigation_root_url"
tal:attributes="href string:${navroot}/++resource++tdf.extensionuploadcenter/extuploadcenter.css"
/>
<tal:noborder condition="python:not user.has_permission('Modify portal content', context)">
<tal:noborderset tal:define="dummy python:request.set('disable_border', 1)" />
</tal:noborder>
</metal:block>
</head>
<body>
<metal:main fill-slot="main">
<tal:main-macro metal:define-macro="main"
tal:define="catalog nocall:context/portal_catalog;
toLocalizedTime nocall:context/@@plone/toLocalizedTime;
currentCategory request/getCategories |string:;
currentVersion request/getCompatibility |view/get_latest_program_release;
SearchableText request/SearchableText | string:;
sort_on request/sort_on | string:positive_ratings;
isAnon context/@@plone_portal_state/anonymous;
herePath python:'/'.join(context.getPhysicalPath());
getCategoryName nocall:view/category_name;
show_search_form view/show_search_form">
<span tal:replace="structure context/@@authenticator/authenticator"/>
<div class="row">
<div class="col-xs-12 col-sm-8">
<div tal:condition="not: show_search_form">
<div class="" id="mostpopular">
<h2 i18n:translate="">Most popular <span tal:content="context/product_title" i18n:name="product_title" /></h2>
<div tal:define="results python:view.get_most_popular_products();
Batch python:modules['Products.CMFPlone'].Batch;
b_size python:10;b_start python:0;b_start request/b_start | b_start;
">
<tal:results condition="results"
define="batch python:Batch(results, b_size, int(b_start), orphan=1);">
<ul class="popularproducts">
<li tal:repeat="result batch">
<tal:entry
define="project result/getObject;
url result/getURL;
projectURL project/absolute_url;
result_type result/portal_type;
zoomid python:project.id.replace('.', '_');
screenshot project/screenshot">
<h3 style="border-top: none">
<a href="" tal:attributes="href projectURL;" tal:content="project/pretty_title_or_id">
<tal:comment replace="nothing">Extension One</tal:comment></a>
</h3>
<div tal:content="structure project/@@rate-if-you-dare" />
<div class="project-thumb thumbzoom"
tal:condition="screenshot">
<a tal:attributes="href projectURL">
<img tal:condition="screenshot"
tal:replace="structure project/@@images/screenshot/thumb" />
</a>
</div>
<span class="project-thumb"
tal:condition="python: not screenshot and project.project_logo">
<img tal:define="scales project/@@images;
projectlogo project/@@images/project_logo;
scale python:scales.scale('project_logo', 'tile')"
tal:replace="structure python:scale and scale.tag(css_class='eupcenterprojectlogo') or None" />
</span>
<div class="product-details">
<span class="product-leadin">
<span tal:condition="project/view/latest_release_date">
<span tal:define="LatestReleaseDate project/view/latest_release_date;"
tal:replace="python:toLocalizedTime(LatestReleaseDate , long_format=0)">
Jan. 22, 2016
</span>
</span>
<span i18n:translate="">in</span>
<span tal:replace="python:', '.join(result.getObject().category_choice)"></span>
</span>
<p class="product-description"
tal:content="structure project/description">
<tal:comment replace="nothing">Project Description.</tal:comment>
</p>
</div>
</tal:entry>
</li>
</ul>
</tal:results>
</div>
</div>
</div>
<div tal:condition="show_search_form">
<div class="paneeuc">
<h2 tal:condition="context/product_title" i18n:translate="">Search
<span tal:content="context/product_title" i18n:name="product_title" />
</h2>
<div tal:condition="context/information_oldversions">
<span tal:content="structure context/information_oldversions/output" />
</div>
<div id="sort-by">
<form id="product_select" style="margin-bottom: 1em" tal:attributes="action string:${context/absolute_url}">
<label class="hiddenStructure" i18n:translate="">Show</label>
<select name="getCategories" onchange="this.form.submit()">
<option value="" i18n:translate="">All categories</option>
<tal:block tal:repeat="category context/available_category">
<option tal:content="category" tal:attributes="value category; selected python: 'selected' if currentCategory==category else ''" />
</tal:block>
</select>
<select class="sortby-compatibility" name="getCompatibility" onchange="this.form.submit()">
<tal:block tal:repeat="version context/available_versions">
<option tal:content="version"
tal:attributes="value version; selected python: 'selected' if currentVersion==version else ''" />
</tal:block>
<option value="any" tal:attributes="selected python: 'selected' if currentVersion in ['', 'any'] else ''"
i18n:translate=""> Any version</option>
</select>
<label for="project-sort" i18n:translate="">Sort On</label>
<select name="sort_on" id="project-sort" onchange="this.form.submit()">
<tal:comment replace="nothing">Featured items are sorted by rating</tal:comment>
<option value="positive_ratings" tal:attributes="selected python:sort_on == 'positive_ratings' and 'selected' ''" i18n:translate="">Highest Rated</option>
<option value="created" tal:attributes="selected python:sort_on == 'created' and 'selected' or ''" i18n:translate="">Newest</option>
</select>
<input type="hidden" name="path" tal:attributes="value python:'/'.join(context.getPhysicalPath())" />
<input type="hidden" name="portal_type" value="tdf.extensionsuploadcenter.eupproject" />
<div class="input-group">
<input class="searchPage form-control" name="SearchableText" type="text" size="25" title="Search Site" value=""
tal:attributes="value SearchableText" />
<span class="input-group-btn">
<input class="searchPage allowMultiSubmit btn btn-primary" type="submit" value="Search" i18n:attributes="value" />
</span>
</div>
</form>
</div>
<div class="" id="categories"
tal:define="results python:view.get_products(currentCategory, currentVersion, sort_on, SearchableText);
Batch python:modules['Products.CMFPlone'].Batch;
b_size python:10;b_start python:0;b_start request/b_start | b_start;
">
<p tal:condition="not: results">
<strong i18n:translate="">No results were found.</strong>
</p>
<p id="numreleases" i18n:translate="">
<span tal:replace="python:len(results)" i18n:name="results_eupprojects">234</span> projects matching your criteria.
</p>
<tal:results condition="results"
define="batch python:Batch(results, b_size, int(b_start), orphan=1);">
<ul class="downloads">
<li tal:repeat="result batch">
<tal:entry
define="project result/getObject;
url result/getURL;
projectURL project/absolute_url;
result_type result/portal_type;
zoomid python:project.id.replace('.', '_');
screenshot project/screenshot">
<h3 style="border-top: none">
<a href=""
tal:attributes="href projectURL;"
tal:content="project/pretty_title_or_id">
<tal:comment replace="nothing">Product One</tal:comment>
</a>
</h3>
<div tal:content="structure project/@@rate-if-you-dare"/>
<div class="project-thumb thumbzoom" tal:condition="screenshot">
<a tal:attributes="href projectURL">
<img tal:condition="screenshot"
tal:replace="structure project/@@images/screenshot/thumb" />
</a>
</div>
<span class="project-thumb" tal:condition="python: not screenshot and project.project_logo">
<img tal:define="scales project/@@images;
projectlogo project/@@images/project_logo;
scale python:scales.scale('project_logo', 'tile')"
tal:replace="structure python:scale and scale.tag(css_class='eupcenterprojectlogo') or None" />
</span>
<div class="product-details">
<span class="product-leadin">
<span tal:condition="project/view/latest_release_date">
<span tal:define="LatestReleaseDate project/view/latest_release_date;"
tal:replace="python:toLocalizedTime(LatestReleaseDate , long_format=0)">
Jan. 22, 2016
</span>
</span>
<span i18n:translate="">in</span>
<span tal:replace="python:', '.join(result.getObject().category_choice)"></span>
</span>
<p class="product-description"
tal:content="structure project/description">
<tal:comment replace="nothing">Project Description.</tal:comment>
</p>
</div>
<div class="visualClear" ></div>
</tal:entry>
</li>
</ul>
<div metal:use-macro="here/batch_macros/macros/navigation" />
</tal:results>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-4">
<div class="splash pullout" id="sidebar-downloads">
<h1 tal:condition="context/product_title" i18n:translate="">
<span tal:content="context/product_title" i18n:name="product_title" />
</h1>
<h1 tal:condition="not:context/product_title" i18n:translate="">Extensions</h1>
<span tal:content="structure context/product_description | nothing"/>
<p class="current-projects"><span i18n:translate="">Currently there are</span>
<span tal:content="view/eupproject_count" /> <span i18n:translate="">project(s) with</span>
<span tal:content="view/euprelease_count" /> <span i18n:translate="">release(s) available.</span></p>
<p>
<a class="pointer" tal:attributes="href string:${context/absolute_url}/++add++tdf.extensionuploadcenter.eupproject">
<img src="++resource++tdf.extensionuploadcenter/yellowarrow.png" alt=""/><span i18n:translate=""> Submit your </span>
<span tal:content="context/product_title | string:extension_project" />
</a><br /> or <br />
<a class="pointer" tal:attributes="href string:${context/absolute_url}/++add++tdf.extensionuploadcenter.eupsmallproject">
<img src="++resource++tdf.extensionuploadcenter/yellowarrow.png" alt=""/><span i18n:translate=""> Submit easy and fast a small </span>
<span tal:content="context/product_title | string:extension_project" /> Project
</a>
</p>
</div>
<div tal:condition="not: isAnon" tal:replace="structure provider:plone.abovecontenttitle" />
<div id="mostrecent">
<h2><span i18n:translate="">Most recent</span> <span tal:content="context/product_title" i18n:name="" /></h2>
<div class=""
tal:define="results python:view.get_newest_products();
Batch python:modules['Products.CMFPlone'].Batch;
b_size python:5;b_start python:0;b_start request/b_start | b_start;
">
<tal:results condition="results"
define="batch python:Batch(results, b_size, int(b_start), orphan=1);">
<ul class="newestproducts">
<li tal:repeat="result batch">
<tal:entry define="project result/getObject;
url result/getURL;
projectURL project/absolute_url;
result_type result/portal_type;
zoomid python:project.id.replace('.', '_');
screenshot project/screenshot | nothing">
<span style="border-top: none">
<a href="" tal:attributes="href projectURL;" tal:content="project/pretty_title_or_id">
<tal:comment replace="nothing">Extension One</tal:comment></a>
</span>
</tal:entry>
</li>
</ul>
</tal:results>
</div>
</div>
<div id="by-category">
<h2 tal:condition="here/product_title" i18n:translate="">
Browse <span tal:content="context/product_title" i18n:name="product_title" /> by Category
</h2>
<h2 tal:condition="not:context/product_title" i18n:translate="">Browse Extensions by Category</h2>
<ol id="add-on-categories">
<tal:categories repeat="category context/available_category">
<li><a href=""
tal:attributes="href string:${context/absolute_url}?getCategories=${category}&getCompatibility=any"
tal:content="category"
><tal:comment replace="nothing">Extension releases</tal:comment></a></li>
</tal:categories>
</ol>
</div>
<div class="installinstructions" tal:condition="context/install_instructions">
<h3 i18n:translate="">Install Instructions</h3>
<p tal:replace="structure context/install_instructions/output" />
</div>
<div class="bugreporting" tal:condition="context/reporting_bugs">
<h3>Reporting Extension-Bugs</h3>
<p tal:replace="structure context/reporting_bugs/output" />
</div>
<div class="aboutproduct" tal:condition="context/product_description">
<h3 i18n:translate="">About</h3>
<p tal:content="structure context/product_description" />
</div>
<div class="aboutproduct">
<h3>Contact A Project Author</h3>
<p>You can send a message to a project author and
give her/him feedback by following the link and fill in your information
into the displayed mail form:<br />
<a class="pointer" tal:attributes="href
string:${context/portal_url}/@@mail-to-extensionauthor">
Get in contact with a project author
</a>.<br />
You could instead go to the project page and use
the linked mail form on that page.
</p>
</div>
</div>
</div>
</tal:main-macro>
</metal:main>
</body>
</html>