[refs #230] shorter error messages
This commit is contained in:
parent
4931dc773b
commit
b0b53edf48
|
@ -11,20 +11,23 @@
|
||||||
%h1= title t('devise.passwords.edit')
|
%h1= title t('devise.passwords.edit')
|
||||||
%br
|
%br
|
||||||
.content
|
.content
|
||||||
- is_error = resource.errors.present?
|
-password_error = nil
|
||||||
|
- if resource.errors.present?
|
||||||
|
- 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|
|
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "form" }) do |f|
|
||||||
= f.hidden_field :reset_password_token
|
= f.hidden_field :reset_password_token
|
||||||
.left.first=t('activerecord.attributes.user.password')
|
.left.first=t('activerecord.attributes.user.password')
|
||||||
.right.first
|
.right.first
|
||||||
= f.text_field :password, :id => 'pass', :class => "registartion-input #{is_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';};"
|
= 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
|
.both
|
||||||
.left=t('activerecord.attributes.user.password_confirm')
|
.left=t('activerecord.attributes.user.password_confirm')
|
||||||
.right
|
.right
|
||||||
= f.text_field :password_confirmation, :id => 'pass2', :class => "registartion-input #{is_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();"
|
= 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
|
.both
|
||||||
%br
|
%br
|
||||||
=f.submit t("devise.passwords.edit_button"), :class => 'button', :id => 'btnLogin'
|
=f.submit t("devise.passwords.edit_button"), :class => 'button', :id => 'btnLogin'
|
||||||
|
- if password_error
|
||||||
#hint.error.reset{:style => is_error ? 'display: block;' : ''}
|
#hint.error.reset{:style => 'display: block;'}
|
||||||
%p=resource.errors.full_messages.first
|
%p=password_error
|
||||||
|
|
|
@ -9,6 +9,11 @@ en:
|
||||||
one: "1 error prohibited this %{resource} from being saved:"
|
one: "1 error prohibited this %{resource} from being saved:"
|
||||||
other: "%{count} errors prohibited this %{resource} from being saved:"
|
other: "%{count} errors prohibited this %{resource} from being saved:"
|
||||||
|
|
||||||
|
activerecord:
|
||||||
|
errors:
|
||||||
|
messages:
|
||||||
|
confirmation: "passwords doesn't match"
|
||||||
|
|
||||||
devise:
|
devise:
|
||||||
failure:
|
failure:
|
||||||
already_authenticated: 'You are already signed in.'
|
already_authenticated: 'You are already signed in.'
|
||||||
|
|
|
@ -11,6 +11,11 @@ ru:
|
||||||
many: "%{resource}: сохранение не удалось из-за %{count} ошибок"
|
many: "%{resource}: сохранение не удалось из-за %{count} ошибок"
|
||||||
other: "%{resource}: сохранение не удалось из-за %{count} ошибки"
|
other: "%{resource}: сохранение не удалось из-за %{count} ошибки"
|
||||||
|
|
||||||
|
activerecord:
|
||||||
|
errors:
|
||||||
|
messages:
|
||||||
|
confirmation: "пароли не совпадают"
|
||||||
|
|
||||||
devise:
|
devise:
|
||||||
failure:
|
failure:
|
||||||
already_authenticated: 'Вы уже вошли в систему.'
|
already_authenticated: 'Вы уже вошли в систему.'
|
||||||
|
|
Loading…
Reference in New Issue