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,22 +1,14 @@
<!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:') }}">
{% 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">
@ -30,14 +22,14 @@
<h2 class="author">
{{ _('by') }} {{ users_list(addon.listed_authors) }}
</h2>
<p class="back"><a href="#" target="_self">{{ _('Back to Add-ons') }}</a></p>
<p id="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>
{% endblock %}
{% block js %}
{{ js('zamboni/discovery-addons') }}
</body>
</html>
<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,28 +1,18 @@
{% 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 }}"
{% 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 }}">
data-browser-platform="{{ platform }}"
{% endblock %}
{% block content %}
<header>
<section id="intro">
<h1><img src="{{ media('img/zamboni/discovery_pane/logo-addons.png') }}"
@ -132,9 +122,8 @@
</ul>
</section>
</section>
{% endblock %}
<script src="{{ url('jsi18n') }}/build:{{ BUILD_ID_JS }}"></script>
{% block js %}
{{ js('zamboni/discovery-pane') }}
</body>
</html>
{% 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,23 +177,15 @@ 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);
// Set up the carousel.
$("#main-feature").fadeIn("slow").addClass("js").jCarouselLite({
btnNext: "#main-feature .nav-next a",
btnPrev: "#main-feature .nav-prev a",
visible: 1
});
$("#images").fadeIn("slow").addClass("js").jCarouselLite({
btnNext: "#images .nav-next a",
btnPrev: "#images .nav-prev a",
@ -202,7 +194,7 @@ $(document).ready(function(){
$(".addon-info").addClass("js");
// Set up the lightbox.
var lb_baseurl = document.body.getAttribute("data-media-url") + "img/jquery-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",
@ -212,6 +204,14 @@ $(document).ready(function(){
imageBtnNext: "",
containerResizeSpeed: 350
});
}
// Set up the carousel.
$("#main-feature").fadeIn("slow").addClass("js").jCarouselLite({
btnNext: "#main-feature .nav-next a",
btnPrev: "#main-feature .nav-prev a",
visible: 1
});
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',
),