forked from fixin.me/fixin.me
Add registration form
This commit is contained in:
parent
0ddf6b9d22
commit
bd2557d261
1
.gitignore
vendored
1
.gitignore
vendored
@ -32,6 +32,7 @@
|
||||
/.irb_history
|
||||
/.lesshst
|
||||
/.local
|
||||
/.vim
|
||||
/.viminfo
|
||||
/.webdrivers
|
||||
*.swp
|
||||
|
@ -37,7 +37,7 @@ input {
|
||||
}
|
||||
input:not([type=checkbox]) {
|
||||
font-size: 0.9rem;
|
||||
padding: 0.1rem 0.4rem;
|
||||
padding: 0.2rem 0.4rem;
|
||||
}
|
||||
input[type=checkbox] {
|
||||
accent-color: #009ade;
|
||||
@ -164,9 +164,14 @@ form td.required {
|
||||
form td.error {
|
||||
color: #ff1f5b;
|
||||
}
|
||||
form em {
|
||||
color: #707070;
|
||||
font-size: 0.75rem;
|
||||
font-weight: normal;
|
||||
}
|
||||
form input[type=submit] {
|
||||
float: none;
|
||||
font-size: 0.9rem;
|
||||
margin: 0 auto;
|
||||
padding: 0.6rem;
|
||||
font-size: 1rem;
|
||||
margin: 1.5rem auto;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
@ -5,6 +5,9 @@ module ApplicationHelper
|
||||
def #{selector}(method, options = {})
|
||||
@template.content_tag :tr do
|
||||
label_text = label(method, options.delete(:label))
|
||||
if options[:hint]
|
||||
label_text += @template.tag(:br) + @template.content_tag(:em, options.delete(:hint))
|
||||
end
|
||||
label_class = @template.class_names(required: options[:required],
|
||||
error: @object&.errors[method].present?)
|
||||
|
||||
|
@ -1,29 +1,12 @@
|
||||
<h2>Sign up</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
||||
<%= tabular_form_for resource, url: user_registration_path do |f| %>
|
||||
<%= render "users/shared/error_messages", resource: resource %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
||||
</div>
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true, autocomplete: "email" %>
|
||||
<%= f.password_field :password, required: true, size: 30, minlength: @minimum_password_length,
|
||||
autocomplete: "new-password",
|
||||
hint: ("(#{@minimum_password_length} characters minimum)" if @minimum_password_length) %>
|
||||
<%= f.password_field :password_confirmation, label: t('.password_confirmation'),
|
||||
required: true, size: 30, autocomplete: "new-password" %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password %>
|
||||
<% if @minimum_password_length %>
|
||||
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
||||
<% end %><br />
|
||||
<%= f.password_field :password, autocomplete: "new-password" %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password_confirmation %><br />
|
||||
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Sign up" %>
|
||||
</div>
|
||||
<%= f.submit t(:register) %>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<%= tabular_form_for resource, as: resource_name, url: session_path(resource_name) do |f| %>
|
||||
<%= f.email_field :email, required: true, size: 32, autofocus: true, autocomplete: "email" %>
|
||||
<%= f.password_field :password, required: true, size: 32, autocomplete: "current-password" %>
|
||||
<%= tabular_form_for resource, url: user_session_path do |f| %>
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true, autocomplete: "email" %>
|
||||
<%= f.password_field :password, required: true, size: 30, autocomplete: "current-password" %>
|
||||
|
||||
<% if devise_mapping.rememberable? %>
|
||||
<%= f.check_box :remember_me, label: t('.remember_me') %>
|
||||
@ -8,5 +8,3 @@
|
||||
|
||||
<%= f.submit t(:sign_in) %>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
|
@ -1,7 +1,3 @@
|
||||
<%- if controller_name != 'sessions' %>
|
||||
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
||||
<% end %>
|
||||
|
||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
||||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
||||
<% end %>
|
||||
|
@ -2,13 +2,16 @@ en:
|
||||
activerecord:
|
||||
attributes:
|
||||
user:
|
||||
email: "E-mail"
|
||||
password: "Password"
|
||||
email: E-mail
|
||||
password: Password
|
||||
users:
|
||||
registrations:
|
||||
new:
|
||||
password_confirmation: Retype password
|
||||
sessions:
|
||||
new:
|
||||
remember_me: "Remember me"
|
||||
register: "Register"
|
||||
sign_in: "Sign in"
|
||||
sign_out: "Sign out"
|
||||
recover_password: "Recover password"
|
||||
remember_me: Remember me
|
||||
register: Register
|
||||
sign_in: Sign in
|
||||
sign_out: Sign out
|
||||
recover_password: Recover password
|
||||
|
Loading…
x
Reference in New Issue
Block a user