forked from mozilla/zamboni
/
home.html
150 lines (137 loc) · 4.78 KB
/
home.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
{% extends "base_side_categories.html" %}
{% block title %}{{ _('Add-ons for {0}')|f(request.APP.pretty) }}{% endblock %}
{% block site_stats %}
{% if downloads and pings %}
<ul class="stats">
<li>
<a href="{{ url('statistics.dashboard') }}">
{% trans plural=downloads.count, count=downloads.count|numberfmt %}
<strong>{{ count }}</strong><span>add-on downloaded</span>
{% pluralize %}
<strong>{{ count }}</strong><span>add-ons downloaded</span>
{% endtrans %}
</a>
</li>
<li>
<a href="{{ url('statistics.dashboard') }}">
{% trans plural=pings.count, count=pings.count|numberfmt %}
<strong>{{ count }}</strong><span>add-on in use</span>
{% pluralize %}
<strong>{{ count }}</strong><span>add-ons in use</span>
{% endtrans %}
</a>
</li>
</ul>
{% endif %}
{% endblock %}
{% set view_all = {
'featured': {
'text': _('View all featured add-ons'),
'link': '/featured',
'feed': '/recommended/format:rss',
},
'popular': {
'text': _('View all popular add-ons'),
'link': '/extensions/?sort=downloads',
'feed': '/browse/type:1/cat:all/format:rss?sort=popular',
},
'new': {
'text': _('View all newly created add-ons'),
'link': '/extensions/?sort=created',
'feed': '/browse/type:1/cat:all/format:rss?sort=newest',
},
'updated': {
'text': _('View all recently updated add-ons'),
'link': '/extensions/?sort=updated',
'feed': '/browse/type:1/cat:all/format:rss?sort=updated',
}
}
%}
{% block content %}
{% include "addons/collections_teaser.html" %}
{% if is_mobile(request.APP) %}
<h2>{{ _('Browse Mobile Add-ons') }}</h2>
{% else %}
<h2>{{ _('Browse Add-ons') }}</h2>
{% endif %}
<div class="primary" id="homepage">
<div class="featured listing compact">
<div class="featured-inner">
<div class="listing-header">
<ul>
{% for value, title in filter.opts %}
<li {{ value|class_selected(filter.field) }} id="{{ value }}">
<a href="{{ url('home')|urlparams(browse=value) }}" data-target="{{ value }}">
{{ title }}</a>
</li>
{% endfor %}
</ul>
</div>
<div class="addon-listing addon-listing-{{ filter.field }}">
{% for key, addons in addon_sets.items() %}
<div id="list-{{ key }}">
{{ addon_listing_items_compact(addons, show_added_date=(key=='new'),
src='homepagebrowse') }}
<div class="listing-footer">
{# TODO: reverse URLs #}
<a class="subscribe" href="{{ remora_url(view_all[key]['feed']) }}">
{{ _('Subscribe', 'addons_home_browse_subscribe') }}</a>
<a class="more-info" href="{{ remora_url(view_all[key]['link'])
}}">{{ view_all[key]['text'] }}</a>
</div>
</div> {# listing-{{ key }} #}
{% endfor %}
</div> {# addon-listing #}
</div> {# featured-inner #}
</div>
</div>
<div class="secondary collections-sidebar">
<img alt="" width="100" height="125"
src="{{ MEDIA_URL }}img/amo2009/illustrations/logo-collections-100x125.png">
{# TODO(jbalogh): reverse #}
<h3><a href="{{ remora_url('/collections') }}">{{ _('Collections', 'addons_home_collections') }}</a></h3>
<p>
{% trans %}
Collections are a way for you to categorize, mix, match and mingle add-ons.
Subscribe to collections created by other users or create your own.
{% endtrans %}
</p>
<h4>{{ _('Popular Collections') }}</h4>
{% include "addons/collections_sidebar.html" %}
</div>
{% endblock content %}
{% block js %}
<script src="{{ MEDIA_URL }}js/zamboni/homepage.js"></script>
{% endblock %}
{% block under_categories %}
{% cache top_tags %}
{% if top_tags %}
{% set max_tag_count = top_tags[0].popularity or 1 %}
{% set min_tag_count = (top_tags|last).popularity or 1 %}
<div class="highlight" id="tag-box">
<h3>{{ _('Popular Tags') }}</h3>
<div>
{% for tag in top_tags|list|shuffle if tag.tagstat %}
{{ tag_link(tag, min_tag_count, max_tag_count)|safe }}
{% endfor %}
</div>
<p class="more">
<a href="{{ remora_url('/tags/top', app='') }}" class="more-link">{{
_('View Top 100 Tags') }}</a>
</p>
</div>
{% endif %}
{% endcache %}
<div class="highlight">
<h3>{{ _('Build a {0} Add-on')|f(request.APP.pretty) }}</h3>
<p>{{ _('Find all the tools and resources you need to make your first add-on.') }}</p>
{# TODO(jbalogh): reverse #}
<p><strong><a href="/developers">{{ _('Visit the Developer Hub') }}</a></strong></p>
</div>
{% endblock %}
{% block extrahead %}
{% for feed in view_all.itervalues() %}
<link rel="alternate" type="application/rss+xml" title="{{ feed['text'] }}"
href="{{ remora_url(feed['feed']) }}"/>
{% endfor %}
{% endblock %}