meet the developer and eula stubs
This commit is contained in:
Родитель
780161b9a8
Коммит
2974554d0c
|
@ -204,10 +204,9 @@ class Addon(amo.models.ModelBase):
|
|||
def get_url_path(self):
|
||||
return reverse('addons.detail', args=(self.id,))
|
||||
|
||||
@property
|
||||
def meet_developers_url(self):
|
||||
# TODO(davedash): reverse when developers pages are build
|
||||
return self.get_url_path() + 'developers'
|
||||
def meet_the_dev_url(self, extra=None):
|
||||
args = [self.id, extra] if extra else [self.id]
|
||||
return reverse('addons.meet', args=args)
|
||||
|
||||
@property
|
||||
def reviews_url(self):
|
||||
|
|
|
@ -332,7 +332,7 @@
|
|||
<p>{{ _("Learn why {0} was created and find out what's next for this "
|
||||
'add-on.')|f(addon.name) }}</p>
|
||||
<p>
|
||||
<a class="more-info" href="{{ addon.meet_developers_url }}">
|
||||
<a class="more-info" href="{{ addon.meet_the_dev_url() }}">
|
||||
{% if addon.listed_authors|length > 1 %}
|
||||
{{ _('Meet the Developers') }}
|
||||
{% else %}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{% extends "base_side_categories.html" %}
|
||||
|
||||
{% block title %}{{ page_title(_('Eula for {0}')|f(addon.name)) }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{{ _('Eula for {0}')|f(addon.name) }}</h2>
|
||||
{{ install_button(addon, show_eula=False) }}
|
||||
{% endblock content %}
|
|
@ -8,6 +8,7 @@
|
|||
<div class="install {{ b.install_class }}"
|
||||
data-addon="{{ addon.id }}"
|
||||
data-icon="{{ addon.icon_url }}"
|
||||
data-developers="{{ addon.meet_the_dev_url() }}"
|
||||
data-name="{{ addon.name }}"
|
||||
{% if compat %}
|
||||
data-min="{{ compat.min.version }}"
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{{ page_title(_('Meet the {0} Developer')|f(addon.name)) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{{ _('Meet the {0} Developer')|f(addon.name) }}</h2>
|
||||
{{ install_button(addon, show_contrib=False) }}
|
||||
{% endblock content %}
|
|
@ -6,6 +6,9 @@ from . import views
|
|||
# These will all start with /addon/<addon_id>/
|
||||
detail_patterns = patterns('',
|
||||
url('^$', views.addon_detail, name='addons.detail'),
|
||||
url('^eula/(?P<file_id>\d+)$', views.eula, name='addons.eula'),
|
||||
url('^developers(?:/(?P<extra>.+))?$', views.meet_the_developer,
|
||||
name='addons.meet'),
|
||||
|
||||
('^reviews/', include('reviews.urls')),
|
||||
('^statistics/', include('stats.urls')),
|
||||
|
|
|
@ -196,3 +196,14 @@ class CollectionPromoBox(object):
|
|||
|
||||
def __nonzero__(self):
|
||||
return self.request.APP == amo.FIREFOX
|
||||
|
||||
|
||||
def eula(request, addon_id, file_id):
|
||||
addon = get_object_or_404(Addon.objects.valid(), id=addon_id)
|
||||
return jingo.render(request, 'addons/eula.html', {'addon': addon})
|
||||
|
||||
|
||||
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})
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<contribution_data>
|
||||
<link>{{ addon.contribution_url|absolutify|urlparams(src='api') }}</link>
|
||||
<suggested_amount currency="USD">{{ addon.suggested_amount }}</suggested_amount>
|
||||
<meet_developers>{{ addon.meet_developers_url|absolutify|urlparams(src='api') }}</meet_developers>
|
||||
<meet_developers>{{ addon.meet_the_dev_url()|absolutify|urlparams(src='api') }}</meet_developers>
|
||||
</contribution_data>
|
||||
{%- endif -%}
|
||||
<developer_comments>{{ addon.developer_comments }}</developer_comments>
|
||||
|
|
|
@ -4,6 +4,7 @@ from django.conf import settings
|
|||
from django.db import models
|
||||
|
||||
import amo.models
|
||||
from amo.urlresolvers import reverse
|
||||
from versions.models import Version
|
||||
|
||||
|
||||
|
@ -36,8 +37,8 @@ class File(amo.models.ModelBase):
|
|||
return os.path.join(*url)
|
||||
|
||||
def eula_url(self):
|
||||
# TODO(jbalogh): reverse
|
||||
return '/addons/policy/0/%s/%s' % (self.version.addon_id, self.id)
|
||||
addon = self.version.addon_id
|
||||
return reverse('addons.eula', args=[addon, self.id])
|
||||
|
||||
@property
|
||||
def extension(self):
|
||||
|
|
|
@ -161,7 +161,7 @@ class Contribution(caching.base.CachingMixin, models.Model):
|
|||
|
||||
# Make sure the url uses the right language.
|
||||
# Setting a prefixer would be nicer, but that requires a request.
|
||||
url_parts = self.addon.meet_developers_url.split('/')
|
||||
url_parts = self.addon.meet_the_dev_url().split('/')
|
||||
url_parts[1] = lang
|
||||
|
||||
# Buildup the email components.
|
||||
|
|
Загрузка…
Ссылка в новой задаче