Commit fe8126ee authored by Michal Čihař's avatar Michal Čihař

Support django-registration 0.8 (issue #45)

parent 9f0887e4
......@@ -26,6 +26,7 @@ Relased on ? 2012.
* Support for locking translation by translator.
* Optionally maintain Language-Team header in po file.
* Include some statistics in about page.
* Supports (and requires) django-registration 0.8.
weblate 1.1
-----------
......
......@@ -14,7 +14,7 @@ Translate-toolkit
http://translate.sourceforge.net/wiki/toolkit/index
GitPython (>= 0.3)
https://github.com/gitpython-developers/GitPython
Django-registration (<= 0.7, 0.8 won't work)
Django-registration (>= 0.8)
https://bitbucket.org/ubernostrum/django-registration/
Whoosh
http://bitbucket.org/mchaput/whoosh/
......
......@@ -13,7 +13,7 @@ Url: http://weblate.org/
Requires: apache2-mod_wsgi
Requires: cron
Requires: python-django >= 1.3
Requires: python-django-registration
Requires: python-django-registration >= 0.8
Requires: translate-toolkit
Requires: python-GitPython >= 0.3
Requires: python-whoosh
......
......@@ -4,33 +4,11 @@
{% block content %}
{% if account %}
<p>
{% blocktrans with account.username as username %}Thank you. Your
account is now activated. Your username is
<b>{{ username }}</b>.{% endblocktrans %}
</p>
<p>
{% url 'weblate.accounts.views.profile' as profile_url %}
{% blocktrans %}You might want to <a href="{{ profile_url }}">adjust your profile</a> now.{% endblocktrans %}
</p>
{% else %}
<h2>{% trans "Your account could not be activated" %}</h2>
<p>
{% blocktrans count expiration_days as days %}This may be because it is already active or because you waited over {{ days }} day to activate it.{% plural %} This may be because it is already active or because you waited over {{ days }} days to activate it.{% endblocktrans %}
{% url 'registration.views.register' as reg_url %}
{% blocktrans count expiration_days as days %}
Your account could not be activated.
This may be because it is already active or because you waited over
{{ days }} day to activate it.
If this is not the case, please contact the website administrator.
Otherwise, you may <a href="{{ reg_url }}">register again</a>.
{% plural %}
Your account could not be activated.
This may be because it is already active or because you waited over
{{ days }} days to activate it.
If this is not the case, please contact the website administrator.
Otherwise, you may <a href="{{ reg_url }}">register again</a>.
{% endblocktrans %}
{% blocktrans %}If this is not the case, please <a href="/contact/">contact</a> the website administrator. Otherwise, you may <a href="{{ reg_url }}">register again</a>.{% endblocktrans %}
</p>
{% endif %}
{% endblock %}
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<p>
{% blocktrans %}Thank you. Your account is now activated.{% endblocktrans %}
</p>
<p>
{% url 'weblate.accounts.views.profile' as profile_url %}
{% blocktrans %}You might want to <a href="{{ profile_url }}">adjust your profile</a> now.{% endblocktrans %}
</p>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}
{% block content %}
<p>{% blocktrans %}Sorry, but registrations on this site are disabled. You can <a href="/contact/">contact us</a> for more details.{% endblocktrans %}</p>
{% endblock %}
......@@ -98,8 +98,10 @@ urlpatterns = patterns('',
# Auth
url(r'^accounts/register/$', register, {
'form_class': RegistrationForm,
'extra_context': {'title': _('User registration')}},
'backend': 'registration.backends.default.DefaultBackend',
'form_class': RegistrationForm,
'extra_context': {'title': _('User registration')}
},
name='weblate_register'),
url(r'^accounts/register/complete/$',
direct_to_template,
......@@ -108,9 +110,29 @@ urlpatterns = patterns('',
'extra_context': {'title': _('User registration')},
},
name='registration_complete'),
url(r'^accounts/register/closed/$',
direct_to_template,
{
'template': 'registration/registration_closed.html',
'extra_context': {'title': _('User registration')},
},
name='registration_disallowed'),
url(r'^accounts/activate/complete/$',
direct_to_template,
{
'template': 'registration/activation_complete.html',
'extra_context': {'title': _('User registration')},
},
name='registration_activation_complete'),
url(r'^accounts/activate/(?P<activation_key>\w+)/$',
activate,
{'extra_context': {'title': _('Account activation')}},
{
'backend': 'registration.backends.default.DefaultBackend',
'extra_context': {
'title': _('Account activation'),
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
}
},
name='registration_activate'),
url(r'^accounts/login/$',
auth_views.login,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment