This commit is contained in:
Jeff Balogh 2010-04-20 20:08:27 -07:00
Родитель b33d887a3e
Коммит 10d21d8c0d
8 изменённых файлов: 114 добавлений и 8 удалений

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

@ -22,8 +22,6 @@ urlpatterns = patterns('',
# URLs for a single add-on.
('^addon/(?P<addon_id>\d+)/', include(detail_patterns)),
url('^discovery/?', views.discovery, name='addon.discovery'),
# For happy install button debugging.
url('^addons/smorgasbord$', 'addons.buttons.smorgasbord'),
url('^addons/buttons.js$', 'addons.buttons.js'),

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

@ -276,7 +276,3 @@ def meet_the_developer(request, addon_id, extra=None):
addon = get_object_or_404(Addon.objects.valid(), id=addon_id)
return jingo.render(request, 'addons/meet_the_developer.html',
{'addon': addon})
def discovery(request):
return jingo.render(request, 'addons/discovery.html')

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

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

@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}">
<head>
<title>{{ _('Add-on Discovery Pane') }}</title>
{{ css('zamboni/discovery-pane') }}
</head>
<body class="html-{{ DIR }}">
<section id="what-are-addons">
<h1>{{ _('What are Add-ons?') }}</h1>
<p>{{ lipsum(1, False) }}</p>
</section>
{% if user.is_authenticated() %}
<section id="my-account">
<h1>{{ _('Welcome, {0}')|f(user.welcome_name) }}</h1>
{% trans url=url('home') -%}
You're logged in to your <a href="{{ url }}">Mozilla Add-ons</a> account.
{%- endtrans %}
<ul>
<li>
<a href="{{ remora_url('/users/edit') }}">{{ _('My Profile') }}</a>
</li>
<li>
<a href="{{ remora_url('/collections/mine') }}">{{ _('My Collections') }}</a>
</li>
</ul>
</section>
{% else %}
<section id="mission">
{% trans url="TODO" -%}
Thanks for using Firefox and supporting
<a href="{{ url }}">Mozilla's mission</a>!
{%- endtrans %}
<table>
{% if app_downloads %}
<tr>
{# L10n: {0} is an application name, like Firefox. #}
<th>{{ _('{0} downloads')|f(APP.pretty) }}</th>
<td>{{ app_downloads|numberfmt }}</td>
</tr>
{% endif %}
{% if addon_downloads %}
<tr>
<th>{{ _('Add-ons downloaded') }}</th>
<td>{{ addon_downloads|numberfmt }}</td>
</tr>
{% endif %}
</table>
</section>
{% endif %}
<section id="main">
{% if ryf %}
<section id="rock-your-firefox">
<h1>This week's Add-on</h1>
<p>{{ lipsum(1, False) }}</p>
</section>
{% endif %}
{# {% cache featured_collections %} #}
{% for collection in featured_collections %}
<section class="featured-collection">
<h1>{{ collection.title }}</h1>
<ul>
{% for addon in collection.addons %}
<li><img src="{{ addon.thumbnail_url }}">{{ addon.name }}</li>
{% endfor %}
</ul>
{# L10n: {{ name }} is the name of a collection like "Shopping Collection" #}
<p>{% trans url=collection.get_url_path(), name=collection.name %}
Find more add-ons in the <a href="{{ url }}">{{ name }}</a>
{% endtrans %}</p>
</section>
{% endfor %}
{# {% endcache %} #}
</section>
<section id="top-addons">
<h1>{{ _('Top Add-ons') }}</h1>
{# xhr call to api #}
</section>
<section id="featured-addons">
<h1>{{ _('Featured add-ons') }}</h1>
{# xhr call to api #}
</section>
<section id="recs">
<h1>{{ _('Get Personal') }}</h1>
<p>{{ lipsum(1, False) }}</p>
</section>
<section id="links">
<p>More ways to customize</p>
<a href="#">Browse all add-ons</a>
</section>
</body>
</html>

9
apps/discovery/urls.py Normal file
Просмотреть файл

@ -0,0 +1,9 @@
from django.conf.urls.defaults import patterns, url
from . import views
urlpatterns = patterns('',
url('^(?P<version>[^/]+)/(?P<os>[^/]+)$', views.pane,
name='discovery.pane'),
)

5
apps/discovery/views.py Normal file
Просмотреть файл

@ -0,0 +1,5 @@
import jingo
def pane(request, version, os):
return jingo.render(request, 'discovery/pane.html')

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

@ -186,10 +186,9 @@ AUTH_PROFILE_MODULE = 'users.UserProfile'
ROOT_URLCONF = '%s.urls' % ROOT_PACKAGE
INSTALLED_APPS = (
'amo',
'amo', # amo comes first so it always takes precedence.
'access',
'addons',
'zadmin',
'api',
'applications',
'bandwagon',
@ -197,6 +196,7 @@ INSTALLED_APPS = (
'browse',
'cronjobs',
'devhub',
'discovery',
'editors',
'files',
'minify',
@ -211,6 +211,7 @@ INSTALLED_APPS = (
'translations',
'users',
'versions',
'zadmin',
# We need this so the jsi18n view will pick up our locale directory.
ROOT_PACKAGE,
@ -279,6 +280,9 @@ MINIFY_BUNDLES = {
'css/zamboni/tags.css',
'css/zamboni/tabs.css',
),
'zamboni/discovery-pane': (
'css/zamboni/discovery-pane.css',
)
},
'js': {
# JS files common to the entire site.

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

@ -9,6 +9,9 @@ handler404 = 'amo.views.handler404'
handler500 = 'amo.views.handler500'
urlpatterns = patterns('',
# Discovery pane is first for undetectable efficiency wins.
('^discovery/', include('discovery.urls')),
# Add-ons.
('', include('addons.urls')),