always show 6 featured add-ons at a time (bug 653306)
This commit is contained in:
Родитель
a689881920
Коммит
c69843e527
|
@ -1,8 +1,8 @@
|
|||
{% macro addon_list(list, limit=5, sidebar=False) %}
|
||||
{% macro addon_list(list, sidebar=False) %}
|
||||
<ul>
|
||||
{% set src = 'discovery-upandcoming' if sidebar else 'discovery-featured' %}
|
||||
{# These are JSON add-ons from the API, not Addon objects. #}
|
||||
{% for addon in list[:limit] %}
|
||||
{% for addon in list %}
|
||||
<li data-guid="{{ addon.guid }}" data-summary="{{ addon.summary }}">
|
||||
<a href="{{ services_url('discovery.addons.detail', addon.id, src=src) }}"
|
||||
target="_self" class="addon-title">
|
||||
|
@ -19,9 +19,9 @@
|
|||
</ul>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro persona_list(list, limit=5) %}
|
||||
{% macro persona_list(list) %}
|
||||
<ul class="persona-list">
|
||||
{% for addon in list[:limit] %}
|
||||
{% for addon in list[:5] %}
|
||||
<li>{{ disco_persona_preview(addon.persona, title=True, src='discovery-featured') }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -43,7 +43,7 @@ data-account-url="{{ services_url('discovery.pane_account') }}"
|
|||
<section id="featured-addons">
|
||||
<h2>{{ _('Featured Add-ons') }}</h2>
|
||||
<div class="addons">
|
||||
{{ addon_list(featured_addons, limit=6) }}
|
||||
{{ addon_list(featured_addons) }}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
@ -76,7 +76,7 @@ data-account-url="{{ services_url('discovery.pane_account') }}"
|
|||
<section class="featured" id="up-and-coming">
|
||||
<h2><a class="all" href="{{ url('browse.extensions') }}">{{ _('See all') }}</a>
|
||||
{{ _('Up & Coming') }}</h2>
|
||||
{{ addon_list(top_addons, 5, sidebar=True) }}
|
||||
{{ addon_list(top_addons, sidebar=True) }}
|
||||
</section>
|
||||
{% endif %}
|
||||
{% if featured_personas %}
|
||||
|
|
|
@ -684,6 +684,12 @@ ul.addons {
|
|||
margin-right: 0;
|
||||
}
|
||||
|
||||
/* Limit to 6 Featured and 5 Up & Coming add-ons at a time. */
|
||||
#featured-addons li:nth-child(n+7),
|
||||
#up-and-coming li:nth-child(n+6) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.addons li > a,
|
||||
.rec-addons li > a,
|
||||
#monthly > div,
|
||||
|
|
|
@ -74,18 +74,12 @@ function initSidebar() {
|
|||
|
||||
function hideInstalled() {
|
||||
// Do not show installed extensions in the promo modules or sidebar.
|
||||
$('li[data-guid]').each(function() {
|
||||
var $el = $(this),
|
||||
guid = $el.attr('data-guid');
|
||||
if ($el.siblings().length > 1) {
|
||||
for (key in z.guids) {
|
||||
if (z.guids[key] == guid) {
|
||||
$el.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (key in z.guids) {
|
||||
var $el = $('li[data-guid=' + z.guids[key] + ']');
|
||||
if ($el.length && $el.siblings().length) {
|
||||
$el.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче