Commit e7ece2cf by Pavel Yushchenko

fixes registration form

parent 25bbecee
...@@ -670,13 +670,18 @@ def create_account(request, post_override=None): ...@@ -670,13 +670,18 @@ def create_account(request, post_override=None):
# TODO: Check password is sane # TODO: Check password is sane
required_post_vars = ["email", "password", "lastname", "firstname", "middlename", "year_of_birth", required_post_vars = ["email", "password", "lastname", "firstname", "middlename", "year_of_birth",
"level_of_education", "education_place", "education_year", "education_place", "education_year",
"work_type", "work_number", "work_name", "work_login", "work_location", "work_type", "work_number", "work_name", "work_login", "work_location",
"work_occupation", "work_teaching_experience", "work_qualification_category", "work_qualification_category_year", "work_occupation", "work_teaching_experience", "work_qualification_category", "work_qualification_category_year",
"contact_phone", "terms_of_service", "honor_code"] "contact_phone", "terms_of_service", "honor_code"]
if tos_not_required: if tos_not_required:
required_post_vars = ['username', 'email', 'name', 'password', 'honor_code'] required_post_vars = ['username', 'email', 'name', 'password', 'honor_code']
if len(post_vars["level_of_education"] < 1):
js['value'] = _('Education level is required')
js['field'] = "level_of_education"
return HttpResponse(json.dumps(js))
for a in required_post_vars: for a in required_post_vars:
if len(post_vars[a]) < 2: if len(post_vars[a]) < 2:
error_str = {'username': _('Username must be minimum of two characters long.'), error_str = {'username': _('Username must be minimum of two characters long.'),
......
...@@ -84,6 +84,9 @@ ...@@ -84,6 +84,9 @@
<label for="education-specialty">${_('Diploma specialty')}</label> <label for="education-specialty">${_('Diploma specialty')}</label>
<input id="education-specialty" type="text" name="education_specialty" value="" /> <input id="education-specialty" type="text" name="education_specialty" value="" />
</span> </span>
<div class="input-group">
<span class="field required select" id="field-work-type"> <span class="field required select" id="field-work-type">
<label for="work-type">${_("Type of educational institution")}</label> <label for="work-type">${_("Type of educational institution")}</label>
<select id="work-type" name="work_type"> <select id="work-type" name="work_type">
...@@ -95,15 +98,31 @@ ...@@ -95,15 +98,31 @@
</span> </span>
<span class="field required text" id="field-work-number"> <span class="field required text" id="field-work-number">
<label for="work-number">${_('Number of educational institution')}</label> <label for="work-number">${_('Number of educational institution')}</label>
<input id="work-number" type="text" name="work_number" value="" required aria-required="true" /> <input id="work-number" type="text" name="work_number" value="" placeholder="${_('e.g. 9999')}" required aria-required="true" />
<span style="
display: block;
/* text-align: right; */
font-size: smaller;
color: gray;
top: -10px;
position: relative;
">Если образовательное не имеет номера, введите 0000</span>
</span> </span>
<span class="field required text" id="field-work-name"> <span class="field required text" id="field-work-name">
<label for="work-name">${_('Name of educational institution')}</label> <label for="work-name">${_('Name of educational institution')}</label>
<input id="work-name" type="text" name="work_name" value="" required aria-required="true" /> <input id="work-name" type="text" name="work_name" value="" placeholder="${_('e.g. School of art')}" required aria-required="true" />
</span> </span>
<span class="field required text" id="field-work-login"> <span class="field required text" id="field-work-login">
<label for="work-login">${_('StatGrad login of educational institution')}</label> <label for="work-login">${_('StatGrad login of educational institution')}</label>
<input id="work-login" type="text" name="work_login" value="" required aria-required="true" /> <input id="work-login" type="text" name="work_login" value="" placeholder="${_('e.g. sch9999')}" required aria-required="true" />
<span style="
display: block;
/* text-align: right; */
font-size: smaller;
color: gray;
top: -10px;
position: relative;
">Логин образовательного учреждения можно узнать у администрации ОУ. Если у Вашего образовательного учреждения нет логина в системе СтатГрад, укажите sch9876.</span>
</span> </span>
<span class="field required select" id="field-work-location"> <span class="field required select" id="field-work-location">
<label for="work-location">${_("Okrug of educational institution")}</label> <label for="work-location">${_("Okrug of educational institution")}</label>
...@@ -153,11 +172,13 @@ ...@@ -153,11 +172,13 @@
<label for="work-qualification-category-year">${_('Qualification category year')}</label> <label for="work-qualification-category-year">${_('Qualification category year')}</label>
<input id="work-qualification-category-year" type="text" name="work_qualification_category_year" value="" required aria-required="true" /> <input id="work-qualification-category-year" type="text" name="work_qualification_category_year" value="" required aria-required="true" />
</span> </span>
</div>
<div class="input-group">
<span class="field required text" id="field-contact-phone"> <span class="field required text" id="field-contact-phone">
<label for="contact-phone">${_('Contact phone')}</label> <label for="contact-phone">${_('Contact phone')}</label>
<input id="contact-phone" type="text" name="contact_phone" value="" required aria-required="true" /> <input id="contact-phone" type="text" name="contact_phone" value="" placeholder="${_('e.g. 9091234567')}" required aria-required="true" />
</span> </span>
</div>
</div> </div>
<div class="input-group"> <div class="input-group">
......
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