-
Notifications
You must be signed in to change notification settings - Fork 530
/
list.html
350 lines (334 loc) Β· 13.7 KB
/
list.html
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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
{% extends "devhub/base.html" %}
{% set title = _('Status & Versions') %}
{% block title %}{{ dev_page_title(title, addon) }}{% endblock %}
{% macro version_details(version, full_info=False) %}
<tr{% if version_disabled(version) %} class="version-disabled"{% endif %}>
<td>
<strong>
<a href="{{ url('devhub.versions.edit', addon.slug, version.id) }}"
title="{{ _('Edit this version') }}">
{{ _('Version {0}', 'addon_display_header_version')|f(version.version) }}</a>
</strong>
<span title="{{ version.created|isotime }}" class="note">
{{ version.created|datetime }}
</span>
</td>
<td class="file-status">
{% for count, status in dev_files_status(version.all_files, addon) %}
<div>
{# L10n: {0} is the number of files #}
{{ status }} ({{ ngettext('{0} file', '{0} files', count)|f(count) }})
</div>
{% else %}
{{ _('0 files') }}
{% endfor %}
{% if display_position %}
{% with position = get_position(addon) %}
{% if position.pos and position.total %}
<span class="note queue-position" title="{{ _('Queues are not reviewed strictly in order') }}">
{% trans pos=position.pos|numberfmt, total=position.total|numberfmt %}
Queue position: {{ pos }} of {{ total }}
{% endtrans %}
</li>
{% endif %}
{% endwith %}
{% endif %}
</td>
<td class="file-validation">
<ul>
{% for file in version.all_files %}
<li>{{ file.get_platform_display() }}
<ul>
{% if file.has_been_validated %}
<li><a href="{{ url('devhub.file_validation', addon.slug, file.id) }}">
{{ summarize_validation(file.validation) }}</a></li>
{% else %}
<li>{{ _('Not validated.') }}
<a href="{{ url('devhub.file_validation', addon.slug, file.id) }}">
{{ _('Validate now.') }}</a>
</li>
{% endif %}
</ul>
</li>
{% endfor %}
</ul>
</td>
{% if waffle.flag('perf-tests') %}
<td class="perf-tests">
{% include "devhub/addons/listing/perf_file_listing.html" %}
</td>
{% endif %}
<td class="version-delete">
<a href="#" class="remove" data-version="{{ version.id }}" data-is-current="{{ (version == addon.current_version)|int }}">x</a>
</td>
</tr>
{% set request_reviews=addon.can_request_review() %}
{% set days = addon.days_until_full_nomination() %}
{% set can_cancel=(not addon.is_disabled and addon.is_under_review) %}
{% if full_info and check_addon_ownership(request, addon, dev=True) and (request_reviews or days or can_cancel) %}
<tr>
<td colspan="0" class="version-status-actions item-actions">
{% set req = {amo.STATUS_PUBLIC: _('Request Full Review'),
amo.STATUS_LITE: _('Request Preliminary Review')} %}
{% for status in request_reviews %}
<form method="post"
action="{{ url('devhub.request-review', addon.slug, status) }}">
{{ csrf() }}
<button class="link" type="submit">{{ req[status] }}</button> ·
</form>
{% endfor %}
{% if days != 0 %}
<span class="warning">{{ ngettext('Full nomination will be available in {0} day',
'Full nomination will be available in {0} days',
days)|f(days) }}</span>
{% endif %}
{% if can_cancel %}
<a href="#" id="cancel-review">{{ _('Cancel Review Request') }}</a>
{% endif %}
</td>
</tr>
{% endif %}
{% endmacro %}
{% block content %}
<header>
{{ dev_breadcrumbs(addon, items=[(None, title)]) }}
<h2>{{ addon.name }}</h2>
</header>
<section id="edit-addon" class="primary devhub-form" role="main">
<h3>{{ _('Addon visibility') }}</h3>
<div class="item" id="addon-current-state">
<div class="item_wrapper">
{% set owner = check_addon_ownership(request, addon, dev=True) %}
<label><input name="addon-state" value="listed" type="radio"
{% if not owner or addon.status == amo.STATUS_DISABLED or not addon.is_listed %}disabled="disabled"{% endif %}
{% if not addon.is_disabled and addon.is_listed %}checked="checked"{% endif %}
data-url="{{ addon.get_dev_url('enable') }}"
class="enable-addon">
<strong>{{ _('Listed:') }}</strong> {{ _('Visible to everyone on {0} and included in search results and listing pages')|f(settings.SITE_URL) }}</label>
<br><br>
<label><input name="addon-state" value="hidden" type="radio"
{% if not owner or not addon.is_listed %}disabled="disabled"{% endif %}
{% if addon.is_disabled and addon.is_listed %}checked="checked"{% endif %}
class="disable-addon">
<strong>{{ _('Hidden:') }}</strong> {{ _('Hosted on {0}, but hidden to anyone but authors. Used to temporarily hide listings or discontinue them.')|f(settings.SITE_URL) }}</label>
<br><br>
<label><input name="addon-state" value="unlisted" type="radio"
{% if not owner or addon.status == amo.STATUS_DISABLED %}disabled="disabled"{% endif %}
{% if not addon.is_listed %}checked="checked"{% endif %}
class="unlist-addon">
<strong>{{ _('Unlisted:') }}</strong> {{ _('Not distributed on {0}. Developers will upload new versions for signing and distribute the add-ons on their own.')|f(settings.SITE_URL) }}</label>
<br><br>
{% if check_addon_ownership(request, addon) and addon.can_be_deleted() %}
<a class="delete-button delete-addon" href="{{ addon.get_dev_url('versions') }}#delete-addon">{{ _('Delete Add-on') }}</a>
{% endif %}
</div>
</div>
<h3>{{ _('Current versions') }}</h3>
{% if addon.current_version %}
<div class="item" id="current-version-status">
<div class="item_wrapper">
<table>
<tr>
<th>{{ _('Currently on AMO') }}</th>
<th>{{ _('Status') }}</th>
<th>{{ _('Validation') }}</th>
{% if waffle.flag('perf-tests') %}
<th>{{ _('Performance') }}</th>
{% endif %}
<th class="version-delete">{{ _('Delete') }}</th>
</tr>
{{ version_details(addon.current_version,
full_info=(not addon.latest_version
or addon.latest_version == addon.current_version)) }}
</table>
</div>
</div>
{% endif %}
{% if addon.latest_version and addon.latest_version != addon.current_version %}
<div class="item" id="next-version-status">
<div class="item_wrapper">
<table>
<tr>
<th>{{ _('Next version of this add-on') }}</th>
<th>{{ _('Status') }}</th>
<th>{{ _('Validation') }}</th>
{% if waffle.flag('perf-tests') %}
<th>{{ _('Performance') }}</th>
{% endif %}
<th class="version-delete">{{ _('Delete') }}</th>
</tr>
{{ version_details(addon.latest_version, full_info=True) }}
</table>
</div>
</div>
{% endif %}
<h3>{{ _('Older versions') }}</h3>
<div class="item" id="version-list"
data-stats="{{ url('devhub.versions.stats', addon.slug) }}">
<div class="item_wrapper">
<table>
<tr>
<th>{{ _('Version') }}</th>
<th>{{ _('Status') }}</th>
<th>{{ _('Validation') }}</th>
{% if waffle.flag('perf-tests') %}
<th>{{ _('Performance') }}</th>
{% endif %}
<th class="version-delete">{{ _('Delete') }}</th>
</tr>
<tr>
<td colspan="0">
<a href="#" class="button version-upload">{{ _('Upload a New Version') }}</a>
</td>
</tr>
{% for version in versions.object_list %}
{% if version != addon.current_version and version != addon.latest_version %}
{{ version_details(version) }}
{% endif %}
{% endfor %}
</table>
</div>
{% if versions.paginator.num_pages > 1 %}
<div class="listing-footer">
{{ versions|paginator }}
</div>
{% endif %}
</div>
</section>
<div id="modals">
{% if addon.can_be_deleted() %}
<div id="modal-delete" class="modal modal-delete">
{% include "devhub/addons/listing/delete_form.html" %}
</div>
{% endif %}
<div id="modal-delete-version" class="modal modal-delete">
<form method="post" action="{{ url('devhub.versions.delete', addon.slug) }}">
<h3 data-tmpl="{{ _('Delete Version {version}') }}"></h3>
<p class="current-version-warning highlight">{{ _('You are about to delete the current version of your add-on. This may cause your add-on status to change, or your listing to lose public visibility, if this is the only public version of your add-on.') }}</p>
<p>{{ _('Deleting this version will permanently delete:') }}</p>
<ul>
<li id="del-files"></li>
<li id="del-reviews"></li>
</ul>
<p>
{% trans %}
<strong>Important:</strong>
Once a version has been deleted, you may not upload a new
version with the same version number.
{% endtrans %}
<p>{{ _('Deleting a version which has already been reviewed
may also cause a significant delay in the review of
your next update.') }}</p>
<p>{{ _('Are you sure you wish to delete this version?') }}</p>
{{ csrf() }}
<div class="modal-actions">
<input type="hidden" name="version_id" class="version_id">
<input type="hidden" name="addon_id" class="addon_id" value="{{ addon.id }}">
<button type="submit" class="delete-button">{{ _('Delete Version') }}</button>
<button type="submit" class="disable-button" name="disable_version">
{{ _('Disable Version') }}
</button>
{{ _('or') }} <a href="#" class="close">{{ _('Cancel') }}</a>
</div>
</form>
</div>
{{ add_version_modal(_("Add a new Version"),
url('devhub.versions.add', addon.slug),
url('devhub.upload_for_addon', addon.slug), _("Add Version") )}}
{% if not addon.disabled_by_user and not addon.is_disabled %}
<div id="modal-disable" class="modal">
<form method="post" action="{{ addon.get_dev_url('disable') }}">
<h3>
{{ _('Hide Add-on') }}
</h3>
<p>
{% trans %}
Hiding your add-on will prevent it from appearing anywhere in our
gallery and will stop users from receiving automatic updates.
{% endtrans %}
</p>
<p>
{% trans %}
Are you sure you wish to hide your add-on?
{% endtrans %}
</p>
{{ csrf() }}
<input type="hidden" name="version_id" class="version_id">
<input type="hidden" name="addon_id" class="addon_id" value="{{ addon.id }}">
<p>
<button type="submit">
{{ _('Hide Add-on') }}
</button>
{{ _('or') }} <a href="#" class="close">{{ _('Cancel') }}</a>
</p>
</form>
</div>
{% endif %}
{% if addon.is_listed %}
<div id="modal-unlist" class="modal">
<form method="post" action="{{ addon.get_dev_url('unlist') }}">
<h3>
{{ _('Unlist Add-on') }}
</h3>
<p>
{% trans update_url='https://developer.mozilla.org/docs/Mozilla/Add-ons/Install_Manifests#updateURL' %}
Unlisting your add-on will make it (and each of its versions/files)
invisible on this website. It won't show up in searches, won't have a
public facing page, and won't be updated automatically for current
users. It is recommended for unlisted add-ons to provide a custom
<a href="{{ update_url }}" target="_blank">updateURL</a> in their
install.rdf file for automatic updates.
{% endtrans %}
</p>
<p>
{% trans %}
Are you sure you wish to unlist your add-on?
{% endtrans %}
</p>
{{ csrf() }}
<input type="hidden" name="addon_id" class="addon_id" value="{{ addon.id }}">
<p>
<button type="submit">
{{ _('Unlist Add-on') }}
</button>
{{ _('or') }} <a href="#" class="close">{{ _('Cancel') }}</a>
</p>
</form>
</div>
{% endif %}
{% if not addon.is_disabled and addon.is_under_review %}
<div id="modal-cancel" class="modal">
<form method="post" action="{{ url('devhub.addons.cancel', addon.slug) }}">
<h3>{{ _('Cancel Review Request') }}</h3>
<p>
{% if addon.status == amo.STATUS_LITE_AND_NOMINATED %}
{% trans %}
Canceling your review request will leave your
add-on as preliminarily reviewed.
{% endtrans %}
{% else %}
{% trans %}
Canceling your review request will mark your add-on incomplete.
If you do not complete your add-on after several days
by re-requesting review, it will be deleted.
{% endtrans %}
{% endif %}
</p>
<p>
{% trans %}
Are you sure you wish to cancel your review request?
{% endtrans %}
</p>
{{ csrf() }}
<input type="hidden" name="addon_id" class="addon_id" value="{{ addon.id }}">
<p>
<button type="submit">{{ _('Cancel Review Request') }}</button>
{{ _('or') }} <a href="#" class="cancel close">{{ _('Close') }}</a>
</p>
<a href="#" class="close">{{ _('Close') }}</a>
</form>
</div>
{% endif %}
</div>
{% include "devhub/includes/addons_edit_nav.html" %}
{% endblock %}