Updated copy in registration process and boost step 1. Removed useless register_done template. Forgot to make a string localizable in the menu.

This commit is contained in:
sork 2011-02-20 22:55:20 +01:00
Родитель 0ea8845139
Коммит cc235777d8
7 изменённых файлов: 32 добавлений и 25 удалений

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

@ -12,10 +12,12 @@
</p>
</div>
<hr>
<h2 id="disclaimer" class="cta"><a href="http://www.mozilla.com/en-US/m/privacy.html">{{ _('Learn how Mozilla protects your geolocation data') }}</a></h2>
<hr>
<div class="buttons-wrapper">
<div class="button left-button"><a href="{{ url('mobile.home') }}">{{ _('Maybe later') }}</a></div>
<div class="button right-button"><a href="#">{{ _('Locate Me') }}</a></div>
<div class="button right-button"><a href="#">{{ _('Locate me') }}</a></div>
</div>
{% endblock %}

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

@ -18,6 +18,10 @@ USERNAME_LONG = _lazy(u'Username is too long (%(show_value)s characters). '
'It must be %(limit_value)s characters or less.')
EMAIL_INVALID = _lazy(u'Please enter a valid email address.')
PASSWD_REQUIRED = _lazy(u'Please enter a valid password.')
PASSWD_SHORT = _lazy(u'Password is too short '
'(At least %(limit_value)s characters).')
PASSWD_LONG = _lazy(u'Password is too long '
'(%(limit_value)s characters or less).')
#PASSWD2_REQUIRED = _lazy(u'Please enter your password twice.')
@ -34,10 +38,12 @@ class RegisterForm(forms.ModelForm):
'required': USERNAME_REQUIRED,
'min_length': USERNAME_SHORT,
'max_length': USERNAME_LONG})
password = forms.CharField(error_messages={'required': PASSWD_REQUIRED})
email = forms.EmailField(error_messages={'invalid': EMAIL_INVALID},
required=False)
# password2 = forms.CharField(error_messages={'required': PASSWD2_REQUIRED})
password = forms.CharField(error_messages={'required': PASSWD_REQUIRED,
'min_length': PASSWD_SHORT,
'max_length': PASSWD_LONG},
min_length=6, max_length=30)
email = forms.EmailField(error_messages={'invalid': EMAIL_INVALID})
#password2 = forms.CharField(error_messages={'required': PASSWD2_REQUIRED})
newsletter = forms.BooleanField(required=False)
class Meta(object):

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

@ -7,6 +7,9 @@
{% set hide_menu = True %}
{% block pagecontent %}
<p class="section legend">
{{ _('All fields are required.') }}
</p>
<hr>
{{ errorlist(form) }}
<form id="signup" action="" method="post" accept-charset="utf-8">
@ -15,24 +18,30 @@
<div class="input-wrapper">
<input tabindex="1" type="text" name="username" value="{{ form.username.data|safe|replace('None','') }}" placeholder="{{ _('Username') }}" required>
</div>
{{ form.username.errors|safe }}
<div class="input-wrapper">
<input tabindex="2" type="password" name="password" value="" placeholder="{{ _('Password') }}" required>
</div>
{{ _('Optional') }}
{{ form.password.errors|safe }}
<div class="input-wrapper">
<input tabindex="3" type="email" name="email" value="{{ form.email.data|safe|replace('None','') }}" placeholder="{{ _('Email address') }}" required>
</div>
{{ _('Email is required to retrieve a lost password') }}
{{ form.email.errors|safe }}
</fieldset>
<hr>
<fieldset id="newsletter">
<p id="custom-cb" class="sans">
<input tabindex="4" id="newsletter-cb" type="checkbox" name="newsletter" value="{{ form.newsletter.data }}">
<label ontouchstart="" for="newsletter-cb">{{ _('Wanna sign up to our newsletter ?') }}</label>
<label ontouchstart="" for="newsletter-cb">{{ _("I'd like to subscribe to monthly updates and keep up-to-date with Mozilla news.") }}</label>
</p>
{{ form.newsletter.errors|safe }}
</fieldset>
<hr>
<hr>
<h2 id="disclaimer" class="cta"><a ontouchstart="" href="http://www.mozilla.com/m/privacy.html">{{ _('Privacy Policy') }}</a></h2>
<hr>
<div class="buttons-wrapper">
<div class="button left-button"><a href="{{ url('mobile.home') }}">{{ _('Cancel') }}</a></div>
<button ontouchstart="" tabindex="5" class="right-button" type="submit">{{ _('Join') }}</button>

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

@ -1,14 +0,0 @@
{% extends "mobile/page.html" %}
{% set title = _('Spark! Get Started') %}
{% set pagetitle = _('Get Started') %}
{% set body_id = 'getstarted' %}
{% set scripts = ('menu',) %}
{% set hide_menu = True %}
{% block pagecontent %}
<article id="register" class="main">
<h1>{{ _('Thank you for registering!') }}</h1>
{# L10n: This string appears on the 'thank you for registering' page. #}
<p>{% trans %}Thank you for being awesome!{% endtrans %}</p>
</article>
{% endblock %}

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

@ -63,7 +63,7 @@ def register(request):
"""Register a new user."""
form = handle_register(request)
if form.is_valid():
return jingo.render(request, 'users/mobile/register_done.html')
return HttpResponseRedirect(reverse('mobile.home'))
return jingo.render(request, 'users/mobile/register.html',
{'form': form})

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

@ -444,6 +444,10 @@ fieldset#newsletter, fieldset#from-website {
width:235px;
}
#getstarted #custom-cb label {
width:500px;
}
#custom-cb input[type=checkbox]:checked + label {
background-position:0 -38px;
}

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

@ -58,7 +58,7 @@
</div>
<div id="logout-confirmation">
<p class="section sans confirmation">
_('Are you sure you want to log out ?')
{{ _('Are you sure you want to log out ?') }}
</p>
<div class="buttons-wrapper">
<div class="button left-button"><a href="#">{{ _('Cancel') }}</a></div>