Skip to content

Commit

Permalink
Revert indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Nov 10, 2024
1 parent a493402 commit 30ec7e0
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions app/views/users/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<% content_for :heading, "Create your account" %>
<% if @person.errors.any? %>
<div id="error_explanation" class="px-3 py-2 mt-3 font-medium text-red-500 rounded-lg bg-red-50">
<ul>
<% @person.errors.full_messages.reverse.each do |error| # We want the User error first %>
<li><%= error.gsub(/Personable |credentials /, '').capitalize %><%# Cleanup "Personable password is ..." %></li>
<% end %>
</ul>
</div>
<div id="error_explanation" class="px-3 py-2 mt-3 font-medium text-red-500 rounded-lg bg-red-50">
<ul>
<% @person.errors.full_messages.reverse.each do |error| # We want the User error first %>
<li><%= error.gsub(/Personable |credentials /, '').capitalize %><%# Cleanup "Personable password is ..." %></li>
<% end %>
</ul>
</div>
<% end %>
<% if Feature.google_authentication? %>
<%= button_to "Sign Up with Google", "/auth/google",
<%= button_to "Sign Up with Google", "/auth/google",
method: "post",
class: %|
text-white font-medium
Expand All @@ -25,9 +25,9 @@
turbo: false,
}
%>
<span class="text-sm text-center <%= Feature.disabled?(:password_authentication) && 'hidden' %>">
- Or -
</span>
<span class="text-sm text-center <%= Feature.disabled?(:password_authentication) && 'hidden' %>">
- Or -
</span>
<% end %>
<% if Feature.microsoft_graph_authentication? %>
Expand All @@ -52,7 +52,7 @@
<% end %>
<% if Feature.password_authentication? %>
<%= form_with method: :post,
<%= form_with method: :post,
model: @person,
url: users_path,
class: "flex flex-col space-y-4 w-80",
Expand All @@ -61,48 +61,50 @@
transition_toggle_class: "max-h-0 max-h-40"
} do |f|
%>
<%= f.hidden_field :personable_type, id: "personable_type", value: "User" %>
<%= f.hidden_field :personable_type, id: "personable_type", value: "User" %>
<%= f.label :email, class: "input input-bordered flex items-center justify-between" do %>
<span>Email <span class="">*</span></span>
<%= f.email_field :email,
<%= f.label :email, class: "input input-bordered flex items-center justify-between" do %>
<span>Email <span class="">*</span></span>
<%= f.email_field :email,
autofocus: true,
placeholder: "Email",
class: "w-44 border-0 dark:text-black"
%>
<% end %>
<% end %>
<%= f.fields_for :personable_attributes, @person.personable do |user_fields| %>
<%= user_fields.fields_for :credentials_attributes, @person.personable.credentials.build, index: "0" do |credential_fields| %>
<%= credential_fields.hidden_field :type, value: "PasswordCredential" %>
<%= credential_fields.label :password, class: "input input-bordered flex items-center justify-between" do %>
<span>Password <span class="">*</span></span>
<%= credential_fields.password_field :password,
<%= f.fields_for :personable_attributes, @person.personable do |user_fields| %>
<%= user_fields.fields_for :credentials_attributes, @person.personable.credentials.build, index: "0" do |credential_fields| %>
<%= credential_fields.hidden_field :type, value: "PasswordCredential" %>
<%= credential_fields.label :password, class: "input input-bordered flex items-center justify-between" do %>
<span>Password <span class="">*</span></span>
<%= credential_fields.password_field :password,
placeholder: "Password",
class: "w-44 border-0 dark:text-black",
data: { action: "focus->transition#toggleClassOn" }
%>
<% end %>
<% end %>
<% end %>
<% end %>

<div class="
<div class="
overflow-hidden
<%= @person.errors.any? ? "max-h-40" : "max-h-0" %>
flex flex-col
transition-all duration-100 ease-in
space-y-4
" data-transition-target="transitionable">
"
data-transition-target="transitionable"
>

<%= user_fields.label :name, class: "input input-bordered flex items-center justify-between" do %>
<span>Full Name <span class="">*</span></span>
<%= user_fields.text_field :name,
<%= user_fields.label :name, class: "input input-bordered flex items-center justify-between" do %>
<span>Full Name <span class="">*</span></span>
<%= user_fields.text_field :name,
placeholder: "First & Last name",
class: "w-44 border-0 dark:text-black"
%>
<% end %>
</div>
<% end %>
<%= f.submit "Sign Up",
<% end %>
</div>
<% end %>
<%= f.submit "Sign Up",
class: %|
text-white font-medium
bg-brand-blue dark:bg-gray-900
Expand All @@ -113,7 +115,7 @@
|,
data: { turbo_submits_with: "Creating..." }
%>
<% end # password_authentication? %>
<% end # password_authentication? %>
<% end %>
<span class="text-sm text-center">
Expand Down

0 comments on commit 30ec7e0

Please sign in to comment.