This commit is contained in:
Chris Van 2011-07-19 10:47:01 -07:00
Родитель ea50fd72aa
Коммит 87ea3db218
18 изменённых файлов: 350 добавлений и 59 удалений

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

@ -0,0 +1,11 @@
{% if author_addons %}
<ol>
{% for other in author_addons %}
{% if other.id == addon.id %}{% continue %}{% endif %}
<li>
<a href="{{ other.get_url_path(impala=True) }}" title="{{ other.name }}">
{{ other.name|string|truncate(50) }}</a>
</li>
{% endfor %}
</ol>
{% endif %}

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

@ -1,3 +1,4 @@
{% set meet_url = url('addons.i_meet', addon.slug) %}
{% if addon.charity %}
{% set charity_url = addon.charity.outgoing_url %}
{% set charity_name = addon.charity.name %}
@ -5,22 +6,16 @@
<div class="notice c author" id="contribution">
{% with single_dev = addon.listed_authors|random %}
<img class="avatar" alt="{{ single_dev.name }}" height="64"
width="64" src="{{ single_dev.picture_url }}"/>
<img class="avatar" alt="{{ single_dev.name }}"
src="{{ single_dev.picture_url }}">
{% endwith %}
<div class="aux{% if show_install %}-bottom{% endif %}">
<div class="aux">
<div class="button-wrapper">
<a class="button contribute prominent" id="contribute-button"
href="{{ url('addons.contribute', addon.slug)|urlparams(src=contribution_src) }}">
<b></b>{{ _('Contribute') }}
</a>
{% if show_install %}
{# L10n: Click Contribute button OR Install button #}
<span class="continue">{{ _('or') }}</span>
{% set ver = version or None %}
{{ install_button(addon, version=ver, show_contrib=False, src=src) }}
{% endif %}
</div>{# /button-wrapper #}
<p class="suggestion">
@ -30,6 +25,14 @@
{% endtrans %}
{% endif %}
</p>{# /suggestion #}
{% if show_install %}
{# L10n: Click Contribute button OR Install button #}
<span class="continue">{{ _('or') }}</span>
{% set ver = version or None %}
{{ install_button(addon, impala=True, version=ver, show_contrib=False,
src=src) }}
{% endif %}
</div>{# /aux #}
<h3>{{ _('Enjoy this add-on?') }}</h3>
@ -37,17 +40,17 @@
{% if text %}
{{ text }}
{% elif not addon.charity %}
{% trans meet_url=url('addons.meet', addon.slug) %}
The <a href="{{ meet_url }}">developer of this add-on</a> asks that you help support its
{% trans %}
The <a href="{{ meet_url }}">developer of this add-on</a> asks that you help support its
continued development by making a small contribution.
{% endtrans %}
{% elif addon.charity_id == amo.FOUNDATION_ORG %}
{% trans meet_url=url('addons.meet', addon.slug) %}
{% trans %}
The <a href="{{ meet_url }}">developer of this add-on</a> asks that you show your support
by making a donation to the <a href="{{ charity_url }}">{{ charity_name }}</a>.
{% endtrans %}
{% else %}
{% trans meet_url=url('addons.meet', addon.slug) %}
{% trans %}
The <a href="{{ meet_url }}">developer of this add-on</a> asks that you show your support
by making a small contribution to <a href="{{ charity_url }}">{{ charity_name }}</a>.
{% endtrans %}

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

@ -233,7 +233,7 @@
<div class="modal" id="privacy-policy">
<a href="#" class="close">{{ _('close') }}</a>
<h2>{{ _('Privacy Policy') }}</h2>
<div class="copy">
<div class="prose">
{{ addon.privacy_policy|nl2br }}
</div>
</div>

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

@ -0,0 +1,106 @@
{% extends "impala/base.html" %}
{# L10n: {0} is an add-on name. #}
{% if page == 'installed' %}
{% set title = _('Thank you for installing {0}')|f(addon.name) %}
{% else %}
{% set title = _('Meet the {0} Developer')|f(addon.name) %}
{% endif %}
{% block title %}{{ page_title(title) }}{% endblock %}
{% set authors = addon.listed_authors %}
{% block bodyclass %}
meet gutter {% if page == 'installed' %}about{% endif %}
{% endblock %}
{% if page == 'roadblock' %}
{% set contribution_src = page %}
{% endif %}
{# contribute/installed is a 'headerless' page, so remove those elements. #}
{% block site_header %}
{% if page != 'installed' %}{{ super() }}{% endif %}
{% endblock %}
{% block navbar %}
{% if page != 'installed' %}{{ super() }}{% endif %}
{% endblock %}
{% block footer %}
{% if page != 'installed' %}{{ super() }}{% endif %}
{% endblock %}
{% if page == 'roadblock' and not addon.charity %}
{% set msg = _('Before downloading this add-on, please consider supporting the '
'development of this add-on by making a small contribution.') %}
{% else %}
{% set msg = None %}
{% endif %}
{% block content %}
<section class="primary full">
<hgroup class="hero">
{% if page == 'installed' %}
<h2 class="addon"{{ addon.name|locale_html }}>{{ title }}</h2>
{% else %}
{{ impala_breadcrumbs([(addon.type_url(), amo.ADDON_TYPES[addon.type]),
(addon.get_url_path(), addon.name),
(None, title)]) }}
<h2>{{ title }}</h2>
{% endif %}
</hgroup>
</section>
<aside class="secondary">
{{ addon|sidebar_listing }}
</aside>
<section class="primary c">
{% if addon.takes_contributions %}
{{ impala_contribution(addon=addon, src=src, text=msg,
show_install=(page != 'installed'),
contribution_src=contribution_src) }}
{% endif %}
</section>
<section class="primary full c">
<div class="island prose">
{% if addon.the_reason %}
<h3>{{ _('Why was {0} created?')|f(addon.name) }}</h3>
<p>{{ addon.the_reason|nl2br }}</p>
{% endif %}
{% if addon.the_future %}
<h3>{{ _("What's next for {0}")|f(addon.name) }}</h3>
<p>{{ addon.the_future|nl2br }}</p>
{% endif %}
</div>
</section>
<section class="primary full">
<header class="hero">
<h2>{{ ngettext('About the Developer', 'About the Developers',
authors|length) }}</h2>
 </header>
</section>
{% for author in authors %}
<section class="island c">
<aside class="secondary">
<img class="avatar" src="{{ author.picture_url }}"
{% if not author.picture_type %}alt="{{ _('No Photo') }}"{% endif %}>
</aside>
<section class="primary">
<div class="vcard">
{% with profile=author, table_class='person-info' %}
{% include "users/impala/vcard.html" %}
{% endwith %}
</div>
<div class="prose">
{% if author.bio %}
<h3>{{ _('Who is {0}?')|f(author.name) }}</h3>
<p class="intro">{{ author.bio|nl2br }}</p>
{% endif %}
</div>
</section>
</section>
{% endfor %}
{% endblock %}

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

@ -41,7 +41,7 @@
{{ impala_performance_note(amount=addon.ts_slowness, listing=True) }}
{% endif %}
</div>
{{ install_button(addon, impala=True) }}
{{ install_button(addon, impala=True, collection=collection) }}
</div>
{% endfor %}
{% endcache %}

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

@ -42,6 +42,12 @@ detail_patterns = patterns('',
impala_detail_patterns = patterns('',
url('^$', views.impala_addon_detail, name='addons.i_detail'),
('^reviews/', include('reviews.impala_urls')),
url('^developers$', views.impala_developers, {'page': 'developers'},
name='addons.i_meet'),
url('^contribute/roadblock/', views.impala_developers,
{'page': 'roadblock'}, name='addons.i_roadblock'),
url('^contribute/installed/', views.impala_developers,
{'page': 'installed'}, name='addons.i_installed'),
)

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

@ -532,8 +532,7 @@ def privacy(request, addon):
return jingo.render(request, 'addons/privacy.html', {'addon': addon})
@addon_view
def developers(request, addon, page):
def _developers(request, addon, page, template=None):
if 'version' in request.GET:
qs = addon.versions.filter(files__status__in=amo.VALID_STATUSES)
version = get_list_or_404(qs, version=request.GET['version'])[0]
@ -554,13 +553,23 @@ def developers(request, addon, page):
if addon.is_persona():
raise http.Http404()
author_addons = order_by_translation(addon.authors_other_addons, 'name')
return jingo.render(request, 'addons/developers.html',
return jingo.render(request, template,
{'addon': addon, 'author_addons': author_addons,
'page': page, 'src': src,
'contribution_src': contribution_src,
'version': version})
@addon_view
def developers(request, addon, page):
return _developers(request, addon, page, 'addons/developers.html')
@addon_view
def impala_developers(request, addon, page):
return _developers(request, addon, page, 'addons/impala/developers.html')
@addon_view
def contribute(request, addon):
contrib_type = request.GET.get('type', 'suggested')

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

@ -71,7 +71,7 @@ def review_list(request, addon, review_id=None, user_id=None, template=None):
@addon_view
def impala_review_list(request, addon, review_id=None, user_id=None, template=None):
def impala_review_list(request, addon, review_id=None, user_id=None):
q = (Review.objects.valid().filter(addon=addon)
.order_by('-created'))

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

@ -0,0 +1,48 @@
<table class="{{ table_class }}">
<caption>{{ _('Developer Information') }}</caption>
<tbody>
<tr>
<th>{{ _('Name') }}</th>
<td class="fn n">{{ profile.name }}</td>
</tr>
{% if profile.location %}
<tr>
<th>{{ _('Location') }}</th>
<td class="adr">{{ profile.location }}</td>
</tr>
{% endif %}
{% if profile.occupation %}
<tr>
<th>{{ _('Occupation') }}</th>
<td class="role">{{ profile.occupation }}</td>
</tr>
{% endif %}
{% if profile.homepage %}
<tr>
<th>{{ _('Homepage') }}</th>
<td><a class="url" href="{{ profile.homepage|external_url }}">
{{ profile.homepage }}</a></td>
</tr>
{% endif %}
{% if not profile.emailhidden %}
<tr>
<th>{{ _('Email address') }}</th>
<td>{{ emaillink(profile.email) }}</td>
</tr>
{% endif %}
<tr>
<th>{{ _('User since') }}</th>
<td>{{ profile.created|datetime }}</td>
</tr>
{% if author_addons %}
<tr>
<th>{{ _('Other Add-ons developed') }}</th>
<td>{% include "addons/impala/author_other_addons.html" %}</td>
</tr>
{% endif %}
<tr>
<th>{{ _('Average rating for their Add-ons') }}</th>
<td>{{ profile.averagerating|float|stars }}</td>
</tr>
</tbody>
</table>

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

@ -12,7 +12,6 @@
margin: 0 12px 1em 0;
}
h2 {
font-size: 24px;
padding-right: 54px;
}
.install {
@ -64,7 +63,7 @@
.border-radius(5px);
.box-shadow(0 -1px 0 #D7E1ED inset, 0 1px 0 rgba(0, 0, 0, 0.05));
border: 1px solid #CCD6E3;
padding: 1em 1em 1em 104px;
padding: 14px 14px 14px 104px;
background: #E3EDFA;
margin-bottom: 1em;
h3 {
@ -80,17 +79,23 @@
}
.notice.author {
min-height: 64px;
position: relative;
height: 64px;
.aux {
float: right;
margin-left: 7px;
text-align: center;
margin: 0 1em;
p {
font-size: 11px;
}
}
.continue {
display: block;
margin-top: .25em;
}
.avatar {
height: 64px;
width: 64px;
position: absolute;
left: 20px;
top: 1em;
@ -401,8 +406,8 @@
}
h4 {
font-size: 12px;
line-height: 14px;
}
}
}
@ -421,3 +426,93 @@ span.featured {
span.featured {
background-color: #093;
}
span.emaillink {
direction: rtl;
unicode-bidi: bidi-override;
.i {
display: none;
}
}
caption {
display: none;
}
th {
text-align: left;
}
.html-rtl th {
text-align: right;
}
table.person-info {
width: 100%;
th, td {
border-top: 1px solid @border-black;
padding: 8px 0;
}
th {
color: #333;
line-height: 15px;
width: 40%;
}
tr:first-child {
th, td {
border-top: none;
}
}
td {
padding-top: 0;
}
ol {
list-style: decimal;
margin: 0 0 0 1.5em;
}
}
img.avatar {
border: 3px solid #fff;
}
img.icon {
padding: 4px;
}
.meet {
.hero h2 {
margin-top: 1em;
}
hgroup.hero h2 {
margin-bottom: 1em;
}
&.about {
hgroup.hero h2 {
margin: 2em 0;
}
}
.author-bio {
border-top: 1px dotted @border-blue;
margin-top: 1em;
padding-top: 1em;
}
.notice.author {
padding-left: 14px;
.avatar {
display: none;
}
}
.island {
> h3:first-child {
margin: 0;
}
> section {
float: none;
padding: 0 14px 0 0;
width: auto;
}
.secondary {
width: 208px;
}
}
}

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

@ -1,16 +0,0 @@
.copy {
b {
font-weight: bold;
}
ul {
list-style: disc outside none;
margin: 0 0 0 20px;
}
ol {
list-style: decimal outside none;
margin: 0 0 0 20px;
}
blockquote {
margin-bottom: 0;
}
}

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

@ -7,6 +7,7 @@
@error-red: #C00000;
@orange: #D16B00;
@border-blue: #C9DDF2;
@border-black: fadeOut(#000, 80%);
@green: #093;

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

@ -1,10 +1,13 @@
.prose {
line-height: 1.2em;
ul, ol {
 margin: 0 0 0 20px;
}
ul {
list-style-type: disc;
list-style: disc;
}
ol {
list-style-type: decimal;
list-style: decimal;
}
li {
margin-left: 1em;
@ -16,6 +19,6 @@
font-style: italic;
}
blockquote {
margin: 1em;
margin: 1em 1em 0;
}
}
}

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

@ -53,12 +53,13 @@ a {
}
}
.primary {
position: relative;
}
.primary {
margin-left: 210px;
position: relative;
&.full {
margin: 0;
width: 100%;
}
.primary {
margin-right: 210px;
margin-left: 0;
@ -71,6 +72,9 @@ a {
.html-rtl.gutter .primary {
margin-left: 210px;
margin-right: 0;
&.full {
margin: 0;
}
}
.secondary {
@ -113,7 +117,7 @@ a {
margin-bottom: 28px;
}
li {
border: 1px solid fadeOut(#000, 80%);
border: 1px solid @border-black;
border-width: 0 0 1px 0;
position: relative;
&:first-child {
@ -164,7 +168,7 @@ a {
padding: 0 6px;
}
section > h3 {
border-bottom: 1px solid fadeOut(#000, 80%);
border-bottom: 1px solid @border-black;
color: #484848;
font-size: 12px;
font-weight: bold;

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

@ -25,6 +25,10 @@ h1 {
text-transform: uppercase;
}
h2 {
font-size: 24px;
}
h4 {
font-size: 14px;
}
@ -99,10 +103,6 @@ pre, code, kbd, tt, samp, tt {
}
}
&.hero {
h2 {
color: @red;
font-size: 24px;
}
hgroup {
h3 {
color: #666;
@ -119,6 +119,20 @@ pre, code, kbd, tt, samp, tt {
}
}
.primary {
.hero {
h2 {
color: @red;
}
}
.prose {
h3 {
font: italic 16px/18px @serif-stack;
margin-top: 1em;
}
}
}
.secondary {
h2 {
font-family: @sans-stack;
@ -138,4 +152,4 @@ pre, code, kbd, tt, samp, tt {
.error {
color: @red;
}
}

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

@ -108,6 +108,14 @@ $(function() {
$img.attr('src', $img.attr('data-defer-src'));
});
// Email obfuscation.
$('span.emaillink').each(function() {
var $this = $(this);
$this.find('.i').remove();
var em = $this.text().split('').reverse().join('');
$this.prev('a').attr('href', 'mailto:' + em);
});
//allow dismissal of site-balloons.
$('.site-balloon .close').click(function(e) {
e.preventDefault();

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

@ -428,10 +428,9 @@ MINIFY_BUNDLES = {
'css/impala/l10n.less',
'css/impala/contributions.less',
'css/impala/lightbox.less',
'css/impala/copy.less',
'css/impala/prose.less',
'css/impala/sharing.less',
'css/impala/abuse.less',
'css/impala/prose.less',
'css/impala/paginator.less',
'css/impala/listing.less',
'css/impala/users.less',
@ -698,7 +697,6 @@ PREVIEWS_PATH = UPLOADS_PATH + '/previews'
USERPICS_PATH = UPLOADS_PATH + '/userpics'
PACKAGER_PATH = os.path.join(TMP_PATH, 'packager')
ADDON_ICONS_DEFAULT_PATH = os.path.join(MEDIA_ROOT, 'img/addon-icons')
PREVIEW_THUMBNAIL_PATH = (PREVIEWS_PATH + '/thumbs/%s/%d.png')
PREVIEW_FULL_PATH = (PREVIEWS_PATH + '/full/%s/%d.png')
@ -709,6 +707,7 @@ ADDON_ICONS_DEFAULT_URL = MEDIA_URL + '/img/addon-icons'
ADDON_ICON_BASE_URL = MEDIA_URL + 'img/icons/'
ADDON_ICON_URL = ('%s/images/addon_icon/%%d-%%d.png?modified=%%s' %
STATIC_URL)
PREVIEW_THUMBNAIL_URL = (STATIC_URL +
'/img/uploads/previews/thumbs/%s/%d.png?modified=%d')
PREVIEW_FULL_URL = (STATIC_URL +

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

@ -45,7 +45,7 @@ urlpatterns = patterns('',
('', include('users.urls')),
# Developer Hub.
('developers/', include('devhub.urls')),
('^developers/', include('devhub.urls')),
# Developer Hub.
('editors/', include('editors.urls')),