diaspora/app/views/registrations/new.html.haml
2010-12-02 00:57:56 +03:00

36 lines
946 B
Text

:javascript
$(function() {
var Validation = {
username: {
characters: /^(|[A-Za-z0-9_]{0,32})$/,
length: [6, 32]
}
};
$("#user_username").keypress(function(evt) {
if(!Validation.username.characters.test(this.value + String.fromCharCode(evt.charCode)) {
evt.preventDefault();
}
});
});
.span-12.prepend-6.last
.floating
%h3
= t('.sign_up_for_diaspora')
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
%p
= f.label :username , t('username')
= f.text_field :username
%p
= f.label :email , t('email')
= f.text_field :email
%p
= f.label :password , t('password')
= f.password_field :password
%p
= f.label :password_confirmation , t('password_confirmation')
= f.password_field :password_confirmation
= f.submit t('.sign_up')