Skip to content

Commit

Permalink
Improve UI of Accept Invitation Form
Browse files Browse the repository at this point in the history
  • Loading branch information
marlena-b committed Oct 24, 2023
1 parent b0b4942 commit 0a3918e
Showing 1 changed file with 38 additions and 19 deletions.
57 changes: 38 additions & 19 deletions app/views/organizations/invitations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
<h2><%= t "devise.invitations.edit.header" %></h2>

<%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :put }) do |f| %>
<%= f.hidden_field :invitation_token, readonly: true %>

<% if f.object.class.require_password_on_accepting %>
<div class="field">
<%= f.label :password %><br />
<%= f.password_field :password %>
<section class="container d-flex flex-column">
<div class="row align-items-center justify-content-center g-0 min-vh-100">
<div class="col-lg-5 col-md-8 py-8 py-xl-0">
<!-- Card -->
<div class="card shadow">
<!-- Card body -->
<div class="card-body p-6">
<div class="mb-4">
<div class='d-flex justify-content-center'>
<div class='d-flex flex-column align-items-center mb-3'>
<%= image_tag "brand/pet-rescue.png", class: 'mb-0', alt: 'logo-icon', height: 200, width: 200 %>
<h1 class='text-muted'><%= resource.organization.name %></h1>
</div>
</div>
<h1 class="mb-1 fw-bold"><%= t "devise.invitations.edit.header" %></h1>
</div>
<div>
<% if flash[:alert] %>
<div class="alert alert-danger" role="alert">
<%= alert %>
</div>
<% end%>
</div>
<%= bootstrap_form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :put }) do |f| %>
<%= f.hidden_field :invitation_token, readonly: true %>
<% if f.object.class.require_password_on_accepting %>
<%= f.password_field :password, autofocus: true, class: 'form-control' %>
<%= f.password_field :password_confirmation, class: 'form-control' %>
<% end %>
<div class='mb-5'>
<div class="d-grid">
<%= f.submit t("devise.invitations.edit.submit_button"), class: 'btn btn-primary' %>
</div>
</div>
<% end %>
</div>
</div>
</div>

<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %>
</div>
<% end %>

<div class="actions">
<%= f.submit t("devise.invitations.edit.submit_button") %>
</div>
<% end %>
</section>

0 comments on commit 0a3918e

Please sign in to comment.