From 85a85716c6912f28e784d36f697c90c56c7b98f7 Mon Sep 17 00:00:00 2001 From: maxwell <maxwell@joindiaspora.com> Date: Fri, 3 Dec 2010 13:57:47 -0800 Subject: [PATCH] made user sign up and invitation accept slightly nicer, w/tipsy tooltips and instructions --- app/views/invitations/edit.html.haml | 38 ++++++++++++++++++--------- app/views/registrations/new.html.haml | 17 ++++++++---- config/locales/diaspora/en.yml | 4 +++ 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/app/views/invitations/edit.html.haml b/app/views/invitations/edit.html.haml index 7b315050b6..cea40941ce 100644 --- a/app/views/invitations/edit.html.haml +++ b/app/views/invitations/edit.html.haml @@ -1,16 +1,28 @@ = javascript_include_tag "validation" +:javascript + $(function() { + $('#user_new [title]').tipsy({trigger: 'focus', gravity: 'w'}); + $("#user_username").focus(); + }); -= form_for(resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :put }) do |f| - %p - = f.label :username - = f.text_field :username - %p - = f.label :password - = f.password_field :password - %p - = f.label :password_confirmation - = f.password_field :password_confirmation +.span-12.prepend-6.last + .floating + %h3 + = t('registrations.new.sign_up_for_diaspora') + = form_for(resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :put }) do |f| + %p + = f.label :username , t('username') + = f.text_field :username, :title => t('registrations.new.enter_username') + %p + = f.label :email , t('email') + = f.text_field :email, :title => t('registrations.new.enter_email') + + %p + = f.label :password , t('password') + = f.password_field :password, :title => t('registrations.new.enter_password') + %p + = f.label :password_confirmation , t('password_confirmation') + = f.password_field :password_confirmation, :title => t('registrations.new.enter_password_again') + + = f.submit t('registrations.new.sign_up') - = f.hidden_field :invitation_token - = f.submit t('.sign_up') -= render :partial => "devise/shared/links" diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index 0cf3fc759a..51f75571e9 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -1,5 +1,11 @@ = javascript_include_tag "validation" +:javascript + $(function() { + $('#user_new [title]').tipsy({trigger: 'focus', gravity: 'w'}); + $("#user_username").focus(); + }); + .span-12.prepend-6.last .floating %h3 @@ -7,16 +13,17 @@ = 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.text_field :username, :title => t('.enter_username') + %p = f.label :email , t('email') - = f.text_field :email + = f.text_field :email, :title => t('.enter_email') + %p = f.label :password , t('password') - = f.password_field :password + = f.password_field :password, :title => t('.enter_password') %p = f.label :password_confirmation , t('password_confirmation') - = f.password_field :password_confirmation + = f.password_field :password_confirmation, :title => t('.enter_password_again') = f.submit t('.sign_up') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 4f627247b1..22d7986d13 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -257,6 +257,10 @@ en: new: sign_up: "Sign up" sign_up_for_diaspora: "Sign up for Diaspora" + enter_email: "Enter an e-mail" + enter_username: "Pick a username (only letters, numbers, and underscores)" + enter_password: "Enter a password" + enter_password_again: "Enter the same password as before" create: success: "You've joined Diaspora!" edit: -- GitLab