Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/apps/addons/templates/addons/details.html
blob: 45fc3ef10fa7284fef89321b6269e607802ae217 (plain)
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
{% extends "base.html" %}

{% block title %}{{ page_title(addon.name) }}{% endblock %}

{% block bodyclass %}inverse{% endblock %}

{% block content %}
{{ breadcrumbs([(addon.type_url(), amo.ADDON_TYPES[addon.type]),
                (None, addon.name)]) }}

{% set version = addon.current_version %}
{% set previews = addon.previews.all() %}

<hgroup>
  <h2 class="addon"{{ addon.name|locale_html }}>
    <img src="{{ addon.icon_url }}" class="icon"/>
    <span>
      {{ addon.name }}
    </span>
    {% if version and not addon.is_selfhosted() %}
      <span class="version">{{ version.version }}</span>
    {% endif %}
  </h2>
  <h4 class="author">{{ _('by') }} {{ users_list(addon.listed_authors) }}</h4>
</hgroup>

{# TODO(fwenzel): "add-on has been added to collection" notification #}

<div id="addon" class="primary" role="main" data-id="{{ addon.id }}">
  <div class="featured">
    <div class="featured-inner object-lead inverse">

      <div id="addon-summary-wrapper">
        <div id="addon-summary" class="primary">
          <p{{ addon.summary|locale_html }}>{{ addon.summary|nl2br }}</p>

          {{ big_install_button(addon, show_warning=False) }}

          {% if addon.takes_contributions %}
            {{ contribution(addon=addon, src='addon-detail',
                text=_('The developer of this add-on asks that you help '
                       'support its continued development by making a small '
                       'contribution.')) }}
          {% endif %}

          <table itemscope itemtype="http://data-vocabulary.org/Review-aggregate">
            {% with addon_name='<span itemprop="itemreviewed">{0}</span>'|f(addon.name) %}
              <caption>{{ _('Add-on Information for {0}')|f(addon_name)|safe }}</caption>
            {% endwith %}
            <tbody>
              <tr>
                <th>{{ _('Updated') }}</th>
                <td>
                  <time datetime="{{ addon.last_updated|isotime }}">{{
                    addon.last_updated|datetime }}</time>
                </td>
              </tr>
              {% if addon.homepage %}
                <tr>
                  <th>{{ _('Website') }}</th>
                  <td>
                    <strong><a href="{{ addon.homepage|external_url }}">{{
                      addon.homepage }}</a></strong>
                  </td>
                </tr>
              {% endif %}
              {% if addon.compatible_apps[APP] %}
                <tr>
                  <th>{{ _('Works with') }}</th>
                  <td>{{ addon.compatible_apps[APP] }}</td>
                </tr>
              {% endif %}
              {# XXX future feature: 'Depends on' ... #}
              {# XXX future feature: 'Localizations' ... #}
              <tr>
                <th>{{ _('Rating', 'advanced_search_form_rating') }}</th>
                <td>{{ addon|reviews_link }}</td>
              </tr>
              {% if not addon.is_selfhosted() %}
                <tr class="meta-stats">
                  <th>{{ _('Downloads', 'list_sortby_downloads') }}</th>
                  <td>
                    <strong class="downloads">{{
                      addon.total_downloads|numberfmt }}</strong>
                    {% if addon.public_stats %}
                      {# TODO real reverse URL #}
                      <a href="{{ locale_url('/statistics/addon/{0}'|f(addon.id)) }}">
                        {{ _('View Statistics') }}</a>
                    {% endif %}
                  </td>
                </tr>
              {% endif %}
            </tbody>
          </table>

        </div>{# /addon-summary #}
      </div>{# /addon-summary-wrapper #}

      <div class="secondary">
        {% if previews %}
          {% with preview=previews[0] %}
            <a class="screenshot thumbnail" rel="jquery-lightbox"
              href="{{ preview.image_url }}" title="{{ preview.caption }}">
                <img alt="" src="{{ preview.thumbnail_url }}" />
            </a>
          {% endwith %}
        {% else %}
          <img class="screenshot thumbnail" src="{{ addon.thumbnail_url }}"
            alt="" width="200" height="150" />
        {% endif %}

        {% if settings.NEW_COLLECTIONS %}
        <div class="widgets">
          {{ favorites_widget(addon) }}
          {% include 'addons/includes/collection_add_widget.html' %}
          {{ sharing_widget(addon) }}
        </div>
        {% endif %}
      </div>{# /secondary #}

    </div>{# /featured-inner #}
  </div>{# /featured #}

   {% if addon.description or previews|length > 1 or addon.developer_comments or
         (addon.show_beta and addon.current_beta_version)  %}
    <h3 id="more-about">{{ _('More about this add-on') }}</h3>
    <div class="article userinput">
      <p{{ addon.description|locale_html }}>{{ addon.description|nl2br }}</p>

      {% if previews|length > 1 %}
        <h4>{{ _('Image Gallery') }}</h4>
        {% for preview in previews[1:] %}
          <a class="screenshot thumbnail" rel="jquery-lightbox"
            href="{{ preview.image_url }}" title="{{ preview.caption }}">
              <img src="{{ preview.thumbnail_url }}" alt="" />
          </a>
        {% endfor %}
      {% endif %}

      {% if addon.developer_comments %}
      <h4>{{ _('Developer Comments', 'addons_display_developer_comments') }}</h4>
        <div class="prose userinput">
          <p{{ addon.developer_comments|locale_html }}>{{
            addon.developer_comments|nl2br }}</p>
        </div>
      {% endif %}

      {# beta channel #}
      {% if addon.show_beta and addon.current_beta_version %}
        <h4 id="beta-channel">{{ _('Beta Channel') }}</h4>
        <div>
          <p>
            {% trans %}
            The Beta Channel lets you test an experimental new version of this
            add-on before it's released to the general public. Once you install
            the beta version, you will continue to get updates from this channel.
            {% endtrans %}
            <a href="#install-beta">{{ _('Install beta version') }}</a>
          </p>
          <div class="install-beta" id="install-beta">
            <p>
              {% trans %}
              <strong>Caution:</strong> Beta versions of this add-on have not
              been reviewed by Mozilla. Once you install a beta version you will
              continue to receive beta updates from this developer. To stop
              receiving beta updates, reinstall the default version from the
              link above.
              {% endtrans %}
            </p>
            <dl>
              <dt class="beta-version">{{ _('Version {0}:')|f(
                addon.current_beta_version.version) }}</dt>
              <dd>{{ install_button(addon, version=addon.current_beta_version,
                                    show_warning=False) }}</dd>
            </dl>
          </div>{# /install-beta #}
        </div>
      {% endif %}
      {# /beta #}
    </div>{# /article #}
    {% endif %}
  {{ review_list_box(addon=addon, reviews=reviews) }}

  {% if request.user.is_authenticated() %}
    {{ review_add_box(addon=addon) }}
  {% endif %}


  {% if not addon.is_selfhosted() and version %}
  <h3 id="releasenotes">{{ _('Release Notes', 'addons_display_release_notes') }}</h3>
  {{ version_detail(addon, version, src="addon-detail-version") }}
  {% endif %}

</div>{# /primary #}

<div class="secondary" role="navigation">

  {% if addon.the_reason and addon.the_future and addon.listed_authors %}
  <div class="highlight">
    {% with single_dev = addon.listed_authors|random %}
      <h3 class="compact-bottom">
        {% trans count=addon.listed_authors|length %}
        Meet the Developer
        {% pluralize %}
        Meet the Developers
        {% endtrans %}
      </h3>
      <img class="avatar" alt="{{ single_dev.name }}" height="64"
           width="64" src="{{ single_dev.picture_url }}"/>
      <p>{{ _("Learn why {0} was created and find out what's next for this "
              'add-on.')|f(addon.name) }}</p>
      <p>
        <a class="more-info" href="{{ addon.meet_the_dev_url() }}">
        {% if addon.listed_authors|length > 1 %}
          {{ _('Meet the Developers') }}
        {% else %}
          {{ _('Meet {0}')|f(single_dev.name) }}
        {% endif %}
        </a>
      </p>
    {% endwith %}
  </div>
  {% endif %}{# /meet the devs #}

  {# categories and other add-ons #}
  {% with categories = addon.categories.filter(application=APP.id) %}
    {% if categories or author_addons %}
    <div class="highlight">
      {% if categories %}
        <ul>
          {# TODO reverse URL #}
          {% for category in categories %}
          <li>
            <a href="{{ category.get_url_path() }}" class="more-info">
              {{ _('See All {0} Add-ons')|f(category) }}
            </a>
          </li>
          {% endfor %}
        </ul>
      {% endif %}

      {% if author_addons %}
        {% with multi_as_select = True %}
          {% include "addons/author_other_addons.html" %}
        {% endwith %}
      {% endif %}
    </div>
    {% endif %}
  {% endwith %}
  {# /categories #}


  {# support box #}
  {% if addon.support_email or addon.support_url or addon.has_satisfaction %}
  <div id="support" class="highlight">
    <h3 class="compact-bottom">{{ _('Need help with this add-on?') }}</h3>
    <ul class="xoxo">
      {% if addon.has_satisfaction %}
        {# get satisfaction only supports en-US so no L10n here #}
        <li>Ask others on
          <a href="#" id="feedback_btn" class="feedback_btn"
            data-company="{{ addon.get_satisfaction_company }}"
            data-product="{{ addon.get_satisfaction_product }}"
             >Get Satisfaction</a>
        </li>
      {% endif %}
      {% if addon.support_email %}
        <li><a href="mailto:{{ addon.support_email }}">{{
          _('E-mail your question') }}</a></li>
      {% endif %}
      {% if addon.support_url %}
        <li><a href="{{ addon.support_url|external_url }}">{{
          _('Visit the support site') }}</a></li>
      {% endif %}
    </ul>

    {% if addon.has_satisfaction %}
    <div id="get_satisfaction_container"></div>
    {% endif %}

  </div>
  {% endif %}
  {# /support #}

  {{ tags_box(addon=addon, dev_tags=dev_tags, user_tags=user_tags,
              current_user_tags=current_user_tags) }}

  {# addon recommendations #}
  {% if recommendations %}
  <div>
    <h3 class="compact-bottom">{{ _('Often used with&hellip;')|safe }}</h3>
    <ul class="addon-otheraddons">
      {% for rec in recommendations %}
      <li>
      <a href="{{ url('addons.detail', addon_id=rec.id) }}?src=oftenusedwith"
         class="addonitem">{{ rec.name }}</a>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  {# /recommendations #}

  {# related collections #}
  <div class="collections-add">
    <h3 class="compact-bottom">{{ _('Related Collections') }}</h3>

    {% if not collections %}
      <p>{{ _('This add-on is not yet in any collections.') }}</p>
    {% else %}
      <ul class="addon-collections">
        {% for coll in collections %}
        <li><a href="{{ coll.get_url_path() }}"
               class="collectionitem">{{ coll.name }}</a></li>
        {% endfor %}
      </ul>
    {% endif %}

  </div>
  {# /collections #}

</div>{# /secondary #}
{% endblock content %}