From d70fd8ab1a07d842603b820d8ce7d0e5be9f976d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 21 Oct 2011 11:53:53 +0100 Subject: [PATCH] Use HTML5 email and url field types where appropriate --- app/assets/stylesheets/common.css.scss | 2 +- app/views/user/account.html.erb | 4 ++-- app/views/user/login.html.erb | 2 +- app/views/user/new.html.erb | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 1c8f72c24..d8992b637 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -979,7 +979,7 @@ p#contributorGuidance { font-size: 0.8em; } -input[type="text"], input[type="password"], textarea { +input[type="text"], input[type="email"], input[type="url"], input[type="password"], textarea { border: 1px solid black; } diff --git a/app/views/user/account.html.erb b/app/views/user/account.html.erb index 606e8c358..0da8b2530 100644 --- a/app/views/user/account.html.erb +++ b/app/views/user/account.html.erb @@ -14,7 +14,7 @@ <%= t 'user.account.new email address' %> - <%= f.text_field :new_email, {:size => 50, :maxlength => 255} %> <%= t 'user.account.email never displayed publicly' %> + <%= f.email_field :new_email, {:size => 50, :maxlength => 255} %> <%= t 'user.account.email never displayed publicly' %> @@ -29,7 +29,7 @@ <%= t 'user.account.openid.openid' %> - <%= f.text_field :openid_url, {:id => "openid_url", :class => "openid_url"} %> (<%= t 'user.account.openid.link text' %>) + <%= f.url_field :openid_url, {:id => "openid_url", :class => "openid_url"} %> (<%= t 'user.account.openid.link text' %>) diff --git a/app/views/user/login.html.erb b/app/views/user/login.html.erb index 66392095b..9a4f50abc 100644 --- a/app/views/user/login.html.erb +++ b/app/views/user/login.html.erb @@ -45,7 +45,7 @@ <%= raw t 'user.login.openid', :logo => openid_logo %> - <%= text_field_tag("openid_url", "", { :size => 28, :maxlength => 255, :tabindex => 3, :class => "openid_url" }) %> + <%= url_field_tag("openid_url", "", { :size => 28, :maxlength => 255, :tabindex => 3, :class => "openid_url" }) %> (<%= t 'user.account.openid.link text' %>) diff --git a/app/views/user/new.html.erb b/app/views/user/new.html.erb index 97622ae13..104a88959 100644 --- a/app/views/user/new.html.erb +++ b/app/views/user/new.html.erb @@ -18,11 +18,11 @@ - + - + @@ -43,7 +43,7 @@ - + -- 2.43.2
<%= t 'user.new.email address' %><%= text_field(:user, :email, { :size => 50, :maxlength => 255, :tabindex => 1 }) %><%= email_field(:user, :email, { :size => 50, :maxlength => 255, :tabindex => 1 }) %>
<%= t 'user.new.confirm email address' %><%= text_field(:user, :email_confirmation, { :size => 50, :maxlength => 255, :tabindex => 2 }) %><%= email_field(:user, :email_confirmation, { :size => 50, :maxlength => 255, :tabindex => 2 }) %>
<%= raw t 'user.new.openid', :logo => openid_logo %><%= text_field(:user, :openid_url, { :id => "openid_url", :size => 50, :maxlength => 255, :tabindex => 4, :class => "openid_url" }) %><%= url_field(:user, :openid_url, { :id => "openid_url", :size => 50, :maxlength => 255, :tabindex => 4, :class => "openid_url" }) %>