32 lines
1.2 KiB
Text
32 lines
1.2 KiB
Text
<h1 class="mb-5"><%= _("Create account") %></h1>
|
|
|
|
<% if @errors %>
|
|
<% @errors.each do |error| %>
|
|
<% if error.attribute == :password and error.type == :blank %>
|
|
<p class="alert alert-warning mb-4"><%= _("Enter a password.") %></p>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% if @user and @user.errors.any? %>
|
|
<% @user.errors.each do |error| %>
|
|
<% if error.attribute == :email and error.type == :invalid %>
|
|
<div class="alert alert-warning mb-4"><%= _("Email is not a valid email address.") %></div>
|
|
<% end %>
|
|
<% if error.attribute == :email and error.type == :taken %>
|
|
<div class="alert alert-warning mb-4"><%= _("An account already exists for %{email}.") % { email: @user.email } %></div>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<form action="/signup" method="post">
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label"><%= _("Email") %></label>
|
|
<input type="text" name="email" value="<%= params[:email] %>" class="form-control">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="password" class="form-label"><%= _("Password") %></label>
|
|
<input type="password" name="password" value="<%= params[:password] %>" class="form-control">
|
|
</div>
|
|
<button type="submit" class="btn btn-primary"><%= _("Create account") %></button>
|
|
</form>
|