common base template for disco pane (bug 630999)

This commit is contained in:
Chris Van 2011-02-06 13:54:45 -05:00
Родитель f696925c60
Коммит 985f960d9b
7 изменённых файлов: 220 добавлений и 198 удалений

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

@ -1,43 +1,35 @@
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=770">
<title>{% block title %}{{ page_title(addon.name) }}{% endblock %}</title>
{{ css('zamboni/discovery-pane') }}
<base target="_blank" href="{{ settings.SITE_URL }}">
{% block extrahead %}{% endblock %}
</head>
<body class="html-{{ DIR }} {{ request.APP.short }} detail {% block bodyclass %}{% endblock %}"
data-app="{{ request.APP.short }}"
data-appname="{{ request.APP.pretty }}"
data-appid="{{ request.APP.id }}"
data-min-beta-version="{{ settings.MIN_BETA_VERSION }}"
data-anonymous="{{ (not request.user.is_authenticated())|json }}"
data-readonly="{{ settings.READ_ONLY|json }}"
data-media-url="{{ MEDIA_URL }}"
data-pane-url="{{ url('discovery.pane', ':version:', ':platform:') }}">
<section id="main">
<header>
<h1 class="addon">
<img class="icon" src="{{ addon.icon_url }}">
{{ addon.name }}
{% set version = addon.current_version %}
{% if version and not addon.is_selfhosted() %}
<span class="version">{{ version.version }}</span>
{% endif %}
</h1>
<h2 class="author">
{{ _('by') }} {{ users_list(addon.listed_authors) }}
</h2>
<p class="back"><a href="#" target="_self">{{ _('Back to Add-ons') }}</a></p>
</header>
{% block main %}{% endblock %}
</section>
{% block secondary %}{% endblock %}
<script src="{{ url('jsi18n') }}/build:{{ BUILD_ID_JS }}"></script>
{{ js('common') }}
<script async defer src="{{ url('addons.buttons.js') }}/build:{{ BUILD_ID_JS }}"></script>
{{ js('zamboni/discovery-addons') }}
</body>
</html>
{% extends "discovery/base.html" %}
{% block bodyclass %}detail{% endblock %}
{% block bodyattrs %}
data-pane-url="{{ url('discovery.pane', ':version:', ':platform:') }}"
{% endblock %}
{% block title %}{{ page_title(addon.name) }}{% endblock %}
{% block content %}
<section id="main">
<header>
<h1 class="addon">
<img class="icon" src="{{ addon.icon_url }}">
{{ addon.name }}
{% set version = addon.current_version %}
{% if version and not addon.is_selfhosted() %}
<span class="version">{{ version.version }}</span>
{% endif %}
</h1>
<h2 class="author">
{{ _('by') }} {{ users_list(addon.listed_authors) }}
</h2>
<p id="back"><a href="#" target="_self">{{ _('Back to Add-ons') }}</a></p>
</header>
{% block main %}{% endblock %}
</section>
{% block secondary %}{% endblock %}
{% endblock %}
{% block js %}
{{ js('zamboni/discovery-addons') }}
<script async defer src="{{ url('addons.buttons.js') }}/build:{{ BUILD_ID_JS }}"></script>
{% endblock %}

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

@ -5,7 +5,7 @@
{{ page_title(_('End-User License Agreement for {0}')|f(addon.name)) }}
{% endblock %}
{% block bodyclass %}eula{% endblock %}
{% block bodyclass %}{{ super() }} eula{% endblock %}
{% block main %}
<h3>{{ _('End-User License Agreement') }}</h3>

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

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}">
<head>
<meta charset="utf-8">
{% if not settings.ENGAGE_ROBOTS %}
<meta name="robots" content="noindex">
{% endif %}
<meta name="viewport" content="width=700">
<title>{% block title %}{{ _('Discover Add-ons') }}{% endblock %}</title>
{{ css('zamboni/discovery-pane') }}
<base target="_blank" href="{{ settings.SITE_URL }}">
{% block extrahead %}{% endblock %}
</head>
<body class="html-{{ DIR }} {{ request.APP.short }} {% block bodyclass %}{% endblock %}"
data-app="{{ request.APP.short }}"
data-appname="{{ request.APP.pretty }}"
data-appid="{{ request.APP.id }}"
data-min-beta-version="{{ settings.MIN_BETA_VERSION }}"
data-anonymous="{{ (not request.user.is_authenticated())|json }}"
data-readonly="{{ settings.READ_ONLY|json }}"
data-media-url="{{ MEDIA_URL }}"
{% block bodyattrs %}{% endblock %}>
{% block content %}{% endblock %}
<script src="{{ url('jsi18n') }}/build:{{ BUILD_ID_JS }}"></script>
{% block js %}{% endblock %}
</body>
</html>

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

@ -1,140 +1,129 @@
{% extends "discovery/base.html" %}
{% from "discovery/macros.html" import addon_list, persona_list %}
{% set app = request.APP.pretty %}
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=700">
<title>{{ _('Discover Add-ons') }}</title>
{{ css('zamboni/discovery-pane') }}
<base target="_blank" href="{{ settings.SITE_URL }}">
</head>
<body class="html-{{ DIR }} pane {{ request.APP.short }}"
data-app="{{ request.APP.short }}"
data-appname="{{ app }}"
data-appid="{{ request.APP.id }}"
data-min-beta-version="{{ settings.MIN_BETA_VERSION }}"
data-anonymous="{{ (not request.user.is_authenticated())|json }}"
data-readonly="{{ settings.READ_ONLY|json }}"
data-media-url="{{ MEDIA_URL }}"
data-services-url="{{ settings.SERVICES_URL }}"
data-recs-url="{{ url('discovery.recs') }}"
data-browser-version="{{ version }}"
data-browser-platform="{{ platform }}">
<header>
<section id="intro">
<h1><img src="{{ media('img/zamboni/discovery_pane/logo-addons.png') }}"
width="87" height="82">{{ _('What are Add-ons?') }}</h1>
<p>
{% trans %}
Add-ons are applications that let you personalize {{ app }} with
extra functionality or style. Try a time-saving sidebar, a weather
notifier, or a themed look to make {{ app }} your own.
{% endtrans %}
<a href="{{ url('home') }}" class="button">{{ _('Learn More') }}</a>
{% block bodyclass %}pane{% endblock %}
{% block bodyattrs %}
data-services-url="{{ settings.SERVICES_URL }}"
data-recs-url="{{ url('discovery.recs') }}"
data-browser-version="{{ version }}"
data-browser-platform="{{ platform }}"
{% endblock %}
{% block content %}
<header>
<section id="intro">
<h1><img src="{{ media('img/zamboni/discovery_pane/logo-addons.png') }}"
width="87" height="82">{{ _('What are Add-ons?') }}</h1>
<p>
{% trans %}
Add-ons are applications that let you personalize {{ app }} with
extra functionality or style. Try a time-saving sidebar, a weather
notifier, or a themed look to make {{ app }} your own.
{% endtrans %}
<a href="{{ url('home') }}" class="button">{{ _('Learn More') }}</a>
</p>
</section>
{% if user.is_authenticated() %}
<section id="my-account">
{# L10n: {0} is the user's login name. #}
<p>{{ _('Hi, {0}')|f(request.amo_user.welcome_name) }}</p>
<ul>
<li><a href="{{ url('users.edit') }}">{{ _('Your Profile') }}</a></li>
<li><a href="{{ url('collections.detail', request.amo_user.username,
'favorites') }}">{{ _('Your Favorites') }}</a></li>
<li><a href="{{ url('collections.user', request.amo_user.username) }}">{{ _('My Collections') }}</a></li>
</ul>
<p id="logout"><a href="{{ remora_url('/users/logout') }}">{{ _('Log out') }}</a></p>
</section>
{% else %}
<section id="mission">
<p>{% trans url="http://www.mozilla.org/" -%}
Thanks for using {{ app }} and supporting
<a href="{{ url }}">Mozilla's mission</a>!
{%- endtrans %}</p>
{% if addon_downloads %}
<p id="download-count">
{{ _('Add-ons downloaded:') }}
<strong>{{ addon_downloads|numberfmt }}</strong>
</p>
</section>
{% endif %}
</section>
{% endif %}
</header>
{% if user.is_authenticated() %}
<section id="my-account">
{# L10n: {0} is the user's login name. #}
<p>{{ _('Hi, {0}')|f(request.amo_user.welcome_name) }}</p>
<ul>
<li><a href="{{ url('users.edit') }}">{{ _('Your Profile') }}</a></li>
<li><a href="{{ url('collections.detail', request.amo_user.username,
'favorites') }}">{{ _('Your Favorites') }}</a></li>
<li><a href="{{ url('collections.user', request.amo_user.username) }}">{{ _('My Collections') }}</a></li>
</ul>
<p id="logout"><a href="{{ remora_url('/users/logout') }}">{{ _('Log out') }}</a></p>
</section>
{% else %}
<section id="mission">
<p>{% trans url="http://www.mozilla.org/" -%}
Thanks for using {{ app }} and supporting
<a href="{{ url }}">Mozilla's mission</a>!
{%- endtrans %}</p>
{% if addon_downloads %}
<p id="download-count">
{{ _('Add-ons downloaded:') }}
<strong>{{ addon_downloads|numberfmt }}</strong>
</p>
{% endif %}
</section>
{% endif %}
</header>
<section id="main">
<section id="main">
<section id="recs">
<div class="header">
<h2>
{{ _('Recommended for You') }}
<a href="{{ url('pages.faq')|
urlparams('personal-recommendations') }}">
{{ _('What is this?') }}</a>
</h2>
</div>
<div class="gallery-wrap">
<ul id="nav-recs">
<li class="nav-prev"><a href="#" class="prev">{{ _('Previous') }}</a></li>
<li class="nav-next"><a href="#" class="next">{{ _('Next') }}</a></li>
</ul>
<div class="gallery">
<ul class="slider rec-addons"></ul>
</div>
</div>
</section>
<section id="main-feature">
<ul id="nav-features">
<section id="recs">
<div class="header">
<h2>
{{ _('Recommended for You') }}
<a href="{{ url('pages.faq')|
urlparams('personal-recommendations') }}">
{{ _('What is this?') }}</a>
</h2>
</div>
<div class="gallery-wrap">
<ul id="nav-recs">
<li class="nav-prev"><a href="#" class="prev">{{ _('Previous') }}</a></li>
<li class="nav-next"><a href="#" class="next">{{ _('Next') }}</a></li>
</ul>
<ul class="slider">
{% for module in modules %}
{{ module.render() }}
{% endfor %}
</ul>
</section>
<section id="featured-addons">
<h2>{{ _('Featured Add-ons') }}</h2>
<div class="addons">
{{ addon_list(featured_addons) }}
<div class="gallery">
<ul class="slider rec-addons"></ul>
</div>
</section>
</div>
</section>
<section id="sub">
<section class="featured" id="top-addons">
<h2><a class="all" href="{{ url('browse.extensions') }}">{{ _('See all') }}</a>
{{ _('Top Add-ons') }}</h2>
{{ addon_list(top_addons, 5, sidebar=True) }}
</section>
<section class="featured personas" id="featured-personas">
<h2><a class="all" href="{{ url('browse.personas') }}">{{ _('See all') }}</a>
{{ _('Featured Personas') }}</h2>
{{ persona_list(featured_personas) }}
</section>
<section id="more-ways">
<h2>{{ _('More ways to customize') }}</h2>
<ul>
<li id="more-addons">
<a href="{{ url('browse.extensions') }}">{{ _('Browse all add-ons') }}</a>
</li>
<li id="more-personas">
<a href="{{ url('browse.themes') }}">
{{ _('See all themes and Personas') }}</a>
</li>
</ul>
</section>
<section id="main-feature">
<ul id="nav-features">
<li class="nav-prev"><a href="#" class="prev">{{ _('Previous') }}</a></li>
<li class="nav-next"><a href="#" class="next">{{ _('Next') }}</a></li>
</ul>
<ul class="slider">
{% for module in modules %}
{{ module.render() }}
{% endfor %}
</ul>
</section>
<script src="{{ url('jsi18n') }}/build:{{ BUILD_ID_JS }}"></script>
{{ js('zamboni/discovery-pane') }}
<section id="featured-addons">
<h2>{{ _('Featured Add-ons') }}</h2>
<div class="addons">
{{ addon_list(featured_addons) }}
</div>
</section>
</body>
</html>
</section>
<section id="sub">
<section class="featured" id="top-addons">
<h2><a class="all" href="{{ url('browse.extensions') }}">{{ _('See all') }}</a>
{{ _('Top Add-ons') }}</h2>
{{ addon_list(top_addons, 5, sidebar=True) }}
</section>
<section class="featured personas" id="featured-personas">
<h2><a class="all" href="{{ url('browse.personas') }}">{{ _('See all') }}</a>
{{ _('Featured Personas') }}</h2>
{{ persona_list(featured_personas) }}
</section>
<section id="more-ways">
<h2>{{ _('More ways to customize') }}</h2>
<ul>
<li id="more-addons">
<a href="{{ url('browse.extensions') }}">{{ _('Browse all add-ons') }}</a>
</li>
<li id="more-personas">
<a href="{{ url('browse.themes') }}">
{{ _('See all themes and Personas') }}</a>
</li>
</ul>
</section>
</section>
{% endblock %}
{% block js %}
{{ js('zamboni/discovery-pane') }}
{% endblock %}

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

@ -902,33 +902,33 @@ h1.addon .icon {
}
h2.author,
p.back {
p#back {
font-size: 1em;
font-weight: bold;
}
/* @group Add-on details header */
.detail #main header p.back {
.detail p#back {
margin: 0 0 1em 1em;
position: absolute;
top: 0;
right: 0;
}
.html-rtl .detail #main header p.back {
.html-rtl p#back {
left: 0;
margin: 0 1em 1em 0;
}
p.back:before {
p#back:before {
content: "\25B4";
margin-right: 0.5em;
position: relative;
bottom: 1px;
}
p.back:before,
p.back a:link,
p.back a:visited {
p#back:before,
p#back a:link,
p#back a:visited {
color: #144fae;
}

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

@ -177,15 +177,33 @@ function css(el, prop) {
$(document).ready(function(){
$(".install-action a").attr("target", "_self");
// Construct URL for the link back to the discovery promo pane.
if ($(".detail").length) {
$(".install-action a").attr("target", "_self");
var version = localStorage.getItem("discopane-browser-version", version),
platform = localStorage.getItem("discopane-browser-platform", platform),
url = document.body.getAttribute("data-pane-url");
url = url.replace(":version:", version).replace(":platform:", platform);
$(".detail header p.back a").attr("href", url);
$("p#back a").attr("href", url);
$("#images").fadeIn("slow").addClass("js").jCarouselLite({
btnNext: "#images .nav-next a",
btnPrev: "#images .nav-prev a",
circular: false
});
$(".addon-info").addClass("js");
// Set up the lightbox.
var lb_baseurl = z.media_url + "img/jquery-lightbox/";
$("#images li.panel a[rel=jquery-lightbox]").lightBox({
overlayOpacity: 0.6,
imageBlank: lb_baseurl + "lightbox-blank.gif",
imageLoading: lb_baseurl + "lightbox-ico-loading.gif",
imageBtnClose: "",
imageBtnPrev: "",
imageBtnNext: "",
containerResizeSpeed: 350
});
}
// Set up the carousel.
@ -194,24 +212,6 @@ $(document).ready(function(){
btnPrev: "#main-feature .nav-prev a",
visible: 1
});
$("#images").fadeIn("slow").addClass("js").jCarouselLite({
btnNext: "#images .nav-next a",
btnPrev: "#images .nav-prev a",
circular: false
});
$(".addon-info").addClass("js");
// Set up the lightbox.
var lb_baseurl = document.body.getAttribute("data-media-url") + "img/jquery-lightbox/";
$("#images li.panel a[rel=jquery-lightbox]").lightBox({
overlayOpacity: 0.6,
imageBlank: lb_baseurl + "lightbox-blank.gif",
imageLoading: lb_baseurl + "lightbox-ico-loading.gif",
imageBtnClose: "",
imageBtnPrev: "",
imageBtnNext: "",
containerResizeSpeed: 350
});
setPanelWidth("detail");
});

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

@ -428,18 +428,32 @@ MINIFY_BUNDLES = {
),
'zamboni/discovery-pane': (
'js/zamboni/jquery-1.4.2.min.js',
'js/jquery-ui/ui.lightbox.js',
'js/zamboni/format.js',
'js/zamboni/truncation.js',
# Personas
'js/zamboni/jquery.hoverIntent.min.js',
'js/zamboni/personas.js',
'js/zamboni/truncation.js',
'js/zamboni/discovery_pane.js',
'js/zamboni/discovery.js',
),
'zamboni/discovery-addons': (
'js/zamboni/jquery-1.4.2.min.js',
'js/zamboni/jquery-ui/custom-1.8.5.min.js',
'js/zamboni/underscore-min.js',
'js/amo2009/addons.js',
'js/zamboni/init.js',
'js/zamboni/format.js',
'js/zamboni/buttons.js',
# Add-ons details page
'js/jquery-ui/ui.lightbox.js',
# Personas
'js/zamboni/jquery.hoverIntent.min.js',
'js/zamboni/personas.js',
'js/zamboni/truncation.js',
'js/zamboni/discovery_pane.js',
),