Merge pull request #249 from warpc/230-registration_page

[refs #230] Edit password page
This commit is contained in:
Vladimir Sharshov 2012-03-01 11:43:53 -08:00
commit 9e11a20f71
10 changed files with 75 additions and 52 deletions

View File

@ -221,7 +221,3 @@ div.error {
&.password {
margin-top: -101px;
margin-left: 650px; } }
div.error.forgot {
margin-top: 8px;
margin-left: 308px; }

View File

@ -12,4 +12,12 @@ nav {
margin: 0;
padding: 0;
padding-top: 10px;
text-decoration: none;} }
text-decoration: none;} }
div.error.forgot {
margin-top: 8px;
margin-left: 308px; }
div.error.reset {
margin-top: -141px;
margin-left: 645px; }

View File

@ -1,28 +1,33 @@
.block
%h2= title t('devise.passwords.edit')
.content
.wrap
%nav
%a{:href => new_register_request_path}
%p=t("layout.devise.shared_links.sign_up")
/ Top block
%header
.logo
/ Page
%article
%br
%h1= title t('devise.passwords.edit')
%br
.content
-password_error = nil
- if resource.errors.present?
.flash
.message.error
- messages = resource.errors.full_messages.map { |msg| content_tag(:p, msg) }.join.html_safe
= messages
- resource.errors.each do |attr, array|
-password_error = array if attr == :password
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
= f.hidden_field :reset_password_token
.group.wat-cf
.left
= f.label :password, :class => "label"
.right
= f.text_field :password, :class => "text_field"
.group.wat-cf
.left
= f.label :password_confirmation, :class => "label"
.right
= f.text_field :password_confirmation, :class => "text_field"
.group.navform.wat-cf
%button.button{:tyle => "submit"}
= image_tag("code.png", :alt => t("devise.passwords.edit_button"))
= t("devise.passwords.edit_button")
%span.text_button_padding
= render :partial => "devise/shared/links"
.left.first=t('activerecord.attributes.user.password')
.right.first
= f.text_field :password, :id => 'pass', :class => "registartion-input #{password_error ? "registartion-input-error" : ''}", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};"
.both
.left=t('activerecord.attributes.user.password_confirm')
.right
= f.text_field :password_confirmation, :id => 'pass2', :class => "registartion-input #{password_error ? "registartion-input-error" : ''}", :onClick => "this.className='registartion-input-focus';disError(this);", :onblur => "if(this.value==''){this.value='';this.className='registartion-input';}else{this.className='registartion-input-no-focus';};buttonCheck();", :onfocus => "if(this.value==''){this.value='';this.className='registartion-input-focus';};", :onkeydown => "buttonCheck();"
.both
%br
=f.submit t("devise.passwords.edit_button"), :class => 'button', :id => 'btnLogin'
- if password_error
#hint.error.reset{:style => 'display: block;'}
%p=password_error

View File

@ -6,7 +6,7 @@
- if controller_name == 'sessions' && action_name == 'new'
= stylesheet_link_tag "login"
= javascript_include_tag "login"
- elsif ['registrations', 'passwords'].include?(controller_name) && ['new', 'create'].include?(action_name)
- elsif ['registrations', 'passwords'].include?(controller_name) && ['new', 'create', 'edit', 'update'].include?(action_name)
= stylesheet_link_tag "reg_session"
= csrf_meta_tag

View File

@ -9,6 +9,11 @@ en:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"
activerecord:
errors:
messages:
confirmation: "passwords doesn't match"
devise:
failure:
already_authenticated: 'You are already signed in.'
@ -32,6 +37,7 @@ en:
send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
forgot: 'Forgot password'
send: 'Send'
edit_button: 'Change'
confirmations:
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'

View File

@ -11,6 +11,11 @@ ru:
many: "%{resource}: сохранение не удалось из-за %{count} ошибок"
other: "%{resource}: сохранение не удалось из-за %{count} ошибки"
activerecord:
errors:
messages:
confirmation: "пароли не совпадают"
devise:
failure:
already_authenticated: 'Вы уже вошли в систему.'
@ -34,6 +39,7 @@ ru:
send_paranoid_instructions: "Если Ваш e-mail существует, в течение нескольких минут вы получите e-mail с инструкциями по восстановлению вашего пароля."
forgot: 'Забыли пароль'
send: 'Послать'
edit_button: 'Изменить'
confirmations:
send_instructions: "В течение нескольких минут вы получите e-mail с инструкциями по подтверждению вашей учётной записи."
send_paranoid_instructions: 'Если Ваш e-mail существует, то в течение нескольких минут вы получите e-mail с инструкциями по подтверждению вашей учётной записи.'

View File

@ -617,15 +617,6 @@ en:
platform: Platform
counter: Downloads
errors:
messages:
too_long:
one: "maximum is %{count} character"
other: "maximum is %{count} characters"
too_short:
one: "minimum is %{count} character"
other: "minimum is %{count} characters"
notifications:
subjects:
new_comment_notification: New comment to your task

View File

@ -20,3 +20,13 @@ en:
inline_changes_count:
one: "%{count} change"
other: "%{count} changes"
activerecord:
errors:
messages:
too_long:
one: "maximum is %{count} character"
other: "maximum is %{count} characters"
too_short:
one: "minimum is %{count} character"
other: "minimum is %{count} characters"

View File

@ -26,3 +26,17 @@ ru:
one: "%{count} изменение"
few: "%{count} изменения"
many: "%{count} изменений"
activerecord:
errors:
messages:
too_long:
one: "не может быть больше чем %{count} символ"
few: "не может быть больше чем %{count} символа"
many: "не может быть больше чем %{count} символов"
other: "не может быть больше чем %{count} символа"
too_short:
one: "не может быть меньше %{count} символа"
few: "не может быть меньше %{count} символов"
many: "не может быть меньше %{count} символов"
other: "не может быть меньше %{count} символа"

View File

@ -612,19 +612,6 @@ ru:
platform: Архитектура
counter: Закачки
errors:
messages:
too_long:
one: "не может быть больше чем %{count} символ"
few: "не может быть больше чем %{count} символа"
many: "не может быть больше чем %{count} символов"
other: "не может быть больше чем %{count} символа"
too_short:
one: "не может быть меньше %{count} символа"
few: "не может быть меньше %{count} символов"
many: "не может быть меньше %{count} символов"
other: "не может быть меньше %{count} символа"
notifications:
subjects:
new_comment_notification: Новый комментарий к Вашей задаче