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> </p>
</div> </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> <hr>
<div class="buttons-wrapper"> <div class="buttons-wrapper">
<div class="button left-button"><a href="{{ url('mobile.home') }}">{{ _('Maybe later') }}</a></div> <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> </div>
{% endblock %} {% 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.') 'It must be %(limit_value)s characters or less.')
EMAIL_INVALID = _lazy(u'Please enter a valid email address.') EMAIL_INVALID = _lazy(u'Please enter a valid email address.')
PASSWD_REQUIRED = _lazy(u'Please enter a valid password.') 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.') #PASSWD2_REQUIRED = _lazy(u'Please enter your password twice.')
@ -34,10 +38,12 @@ class RegisterForm(forms.ModelForm):
'required': USERNAME_REQUIRED, 'required': USERNAME_REQUIRED,
'min_length': USERNAME_SHORT, 'min_length': USERNAME_SHORT,
'max_length': USERNAME_LONG}) 'max_length': USERNAME_LONG})
password = forms.CharField(error_messages={'required': PASSWD_REQUIRED}) password = forms.CharField(error_messages={'required': PASSWD_REQUIRED,
email = forms.EmailField(error_messages={'invalid': EMAIL_INVALID}, 'min_length': PASSWD_SHORT,
required=False) 'max_length': PASSWD_LONG},
# password2 = forms.CharField(error_messages={'required': PASSWD2_REQUIRED}) 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) newsletter = forms.BooleanField(required=False)
class Meta(object): class Meta(object):

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

@ -7,6 +7,9 @@
{% set hide_menu = True %} {% set hide_menu = True %}
{% block pagecontent %} {% block pagecontent %}
<p class="section legend">
{{ _('All fields are required.') }}
</p>
<hr> <hr>
{{ errorlist(form) }} {{ errorlist(form) }}
<form id="signup" action="" method="post" accept-charset="utf-8"> <form id="signup" action="" method="post" accept-charset="utf-8">
@ -15,24 +18,30 @@
<div class="input-wrapper"> <div class="input-wrapper">
<input tabindex="1" type="text" name="username" value="{{ form.username.data|safe|replace('None','') }}" placeholder="{{ _('Username') }}" required> <input tabindex="1" type="text" name="username" value="{{ form.username.data|safe|replace('None','') }}" placeholder="{{ _('Username') }}" required>
</div> </div>
{{ form.username.errors|safe }}
<div class="input-wrapper"> <div class="input-wrapper">
<input tabindex="2" type="password" name="password" value="" placeholder="{{ _('Password') }}" required> <input tabindex="2" type="password" name="password" value="" placeholder="{{ _('Password') }}" required>
</div> </div>
{{ _('Optional') }} {{ form.password.errors|safe }}
<div class="input-wrapper"> <div class="input-wrapper">
<input tabindex="3" type="email" name="email" value="{{ form.email.data|safe|replace('None','') }}" placeholder="{{ _('Email address') }}" required> <input tabindex="3" type="email" name="email" value="{{ form.email.data|safe|replace('None','') }}" placeholder="{{ _('Email address') }}" required>
</div> </div>
{{ _('Email is required to retrieve a lost password') }} {{ form.email.errors|safe }}
</fieldset> </fieldset>
<hr> <hr>
<fieldset id="newsletter"> <fieldset id="newsletter">
<p id="custom-cb" class="sans"> <p id="custom-cb" class="sans">
<input tabindex="4" id="newsletter-cb" type="checkbox" name="newsletter" value="{{ form.newsletter.data }}"> <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> </p>
{{ form.newsletter.errors|safe }}
</fieldset> </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="buttons-wrapper">
<div class="button left-button"><a href="{{ url('mobile.home') }}">{{ _('Cancel') }}</a></div> <div class="button left-button"><a href="{{ url('mobile.home') }}">{{ _('Cancel') }}</a></div>
<button ontouchstart="" tabindex="5" class="right-button" type="submit">{{ _('Join') }}</button> <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.""" """Register a new user."""
form = handle_register(request) form = handle_register(request)
if form.is_valid(): 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', return jingo.render(request, 'users/mobile/register.html',
{'form': form}) {'form': form})

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

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

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

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