Skip to content

Commit

Permalink
Show pending invites
Browse files Browse the repository at this point in the history
  • Loading branch information
Shpigford committed Oct 31, 2024
1 parent b30d81f commit 886123d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/controllers/settings/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ class Settings::ProfilesController < SettingsController
def show
@user = Current.user
@users = Current.family.users.order(:created_at)
@pending_invitations = Current.family.invitations.pending
end
end
7 changes: 2 additions & 5 deletions app/views/invitations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
{},
{ label: t(".role_label") } %>

<div class="flex justify-end gap-2">
<button type="button" class="text-gray-500" data-action="click->modal#close">
<%= t(".cancel") %>
</button>
<%= form.submit t(".submit"), class: "bg-gray-900 text-white rounded-lg px-4 py-2" %>
<div class="w-full">
<%= form.submit t(".submit"), class: "bg-gray-900 text-white rounded-lg px-4 py-2 w-full" %>
</div>
<% end %>
<% end %>
13 changes: 13 additions & 0 deletions app/views/settings/profiles/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
</div>
</div>
<% end %>
<% if @pending_invitations.any? %>
<% @pending_invitations.each do |invitation| %>
<div class="flex gap-2 items-center bg-white p-4 border border-alpha-black-25 rounded-lg">
<div class="w-9 h-9 shrink-0">
<div class="text-white w-full h-full bg-gray-400 rounded-full flex items-center justify-center text-lg uppercase"><%= invitation.email[0] %></div>
</div>
<p class="text-gray-900 font-medium text-sm"><%= invitation.email %></p>
<div class="rounded-md bg-gray-100 px-1.5 py-0.5">
<p class="uppercase text-gray-500 font-medium text-xs"><%= t(".pending") %></p>
</div>
</div>
<% end %>
<% end %>
<% if Current.user.admin? %>
<%= link_to new_invitation_path,
class: "bg-gray-100 flex items-center justify-center gap-2 text-gray-500 mt-1 hover:bg-gray-200 rounded-lg px-4 py-2 w-full text-center",
Expand Down
2 changes: 1 addition & 1 deletion config/locales/views/invitations/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ en:
failure: "Could not send invitation"
new:
title: Invite Someone
subtitle: Send an invitation to join your family
subtitle: Send an invitation to join your family account on Maybe
email_placeholder: Enter email address
email_label: Email Address
role_member: Member
Expand Down
1 change: 1 addition & 0 deletions config/locales/views/settings/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ en:
profile_subtitle: Customize how you appear on Maybe
profile_title: Profile
save: Save
pending: Pending
user_avatar_field:
accepted_formats: JPG or PNG. 5MB max.
choose: Choose

0 comments on commit 886123d

Please sign in to comment.