fix themes on discovery pane (bug 885606)

This commit is contained in:
Kevin Ngo 2013-06-21 10:43:10 -07:00
Родитель 06ddcc5920
Коммит d6125145fd
6 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -284,8 +284,9 @@ def new_context(context, **kw):
@register.inclusion_tag('addons/persona_preview.html')
@jinja2.contextfunction
def persona_preview(context, persona, size='large', linked=True, extra=None,
details=False, title=False, caption=False, url=None):
def persona_preview(context, persona, size='large', linked=True,
extra=None, details=False, title=False, caption=False,
url=None, request=None):
preview_map = {'large': persona.preview_url,
'small': persona.thumb_url}
addon = persona.addon
@ -293,7 +294,7 @@ def persona_preview(context, persona, size='large', linked=True, extra=None,
c.update({'persona': persona, 'addon': addon, 'linked': linked,
'size': size, 'preview': preview_map[size], 'extra': extra,
'details': details, 'title': title, 'caption': caption,
'url_': url})
'url_': url, 'request': request or context['request']})
return c

Просмотреть файл

@ -43,7 +43,7 @@
<span class="persona-install">
<button class="add">
<div>
<img src="{{ media('img/impala/add-small.png') }}">
<img src="{{ MEDIA_URL }}img/impala/add-small.png">
<span class="disabled-icon">+</span>
<span>{{ _('Add') }}</span>
</div>
@ -54,7 +54,7 @@
{% if request.check_ownership(addon, require_owner=True, admin=False) %}
<span class="artist-tools">
<a href="{{ addon.get_dev_url() }}"><img src="{{ media('img/admin/icon_changelink.gif') }}"></a>
<a href="{{ addon.get_dev_url() }}"><img src="{{ MEDIA_URL }}img/admin/icon_changelink.gif"></a>
</span>
{% endif %}

Просмотреть файл

@ -13,8 +13,8 @@ from addons.helpers import persona_preview
@register.function
@jinja2.contextfunction
def disco_persona_preview(context, persona, size='large', linked=True,
extra=None, details=False, title=False, caption=False,
src=None):
extra=None, details=False, title=False,
caption=False, src=None, request=None):
url = None
if linked:
url = reverse('discovery.addons.detail', args=[persona.addon.slug])
@ -23,4 +23,5 @@ def disco_persona_preview(context, persona, size='large', linked=True,
url = urlparams(url, src=src)
return persona_preview(context, persona, size=size, linked=linked,
extra=extra, details=details, title=title,
caption=caption, url=url)
caption=caption, url=url,
request=request or context['request'])

Просмотреть файл

@ -25,10 +25,10 @@
</ul>
{% endmacro %}
{% macro persona_list(list, limit=5) %}
{% macro persona_list(request, list, limit=5) %}
<ul class="persona-list">
{% for addon in list[:limit] %}
<li class="featured-themes">{{ disco_persona_preview(addon.persona, title=True, src='discovery-featured') }}</li>
<li class="featured-themes">{{ disco_persona_preview(addon.persona, title=True, src='discovery-featured', request=request) }}</li>
{% endfor %}
</ul>
{% endmacro %}

Просмотреть файл

@ -95,7 +95,7 @@ data-upandcoming-url="{{ services_url('discovery.pane.more_addons', 'up-and-comi
<section class="featured featured-themes" id="featured-themes">
<h2><a class="all" href="{{ url('browse.personas') }}">{{ _('See all') }}</a>
{{ _('Featured Themes') }}</h2>
{{ persona_list(featured_personas) }}
{{ persona_list(request, featured_personas) }}
</section>
{% endif %}
<section id="more-ways">

Просмотреть файл

@ -733,7 +733,7 @@ section#featured-addons {
padding: 7px 10px;
position: absolute;
}
.detail .persona-hover.persona-large .caption {
.detail .persona-hover.persona-large .caption, .review-decal, .persona-install, .artist-tools {
display: none;
}
/* @end */