add attrs to invite card

This commit is contained in:
shibao 2022-11-09 21:17:16 -05:00
parent e2a4dc4b92
commit 9420337228
7 changed files with 20 additions and 15 deletions

View File

@ -4,9 +4,16 @@ defmodule CanneryWeb.Components.InviteCard do
""" """
use CanneryWeb, :component use CanneryWeb, :component
alias Cannery.Invites.Invite
alias CanneryWeb.Endpoint alias CanneryWeb.Endpoint
attr :invite, Invite, required: true
slot(:inner_block)
slot(:code_actions)
def invite_card(assigns) do def invite_card(assigns) do
assigns = assigns |> assign_new(:code_actions, fn -> [] end)
~H""" ~H"""
<div class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center space-y-4 <div class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center space-y-4
border border-gray-400 rounded-lg shadow-lg hover:shadow-md border border-gray-400 rounded-lg shadow-lg hover:shadow-md
@ -34,9 +41,7 @@ defmodule CanneryWeb.Components.InviteCard do
<%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %> <%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %>
</code> </code>
<%= if @code_actions do %>
<%= render_slot(@code_actions) %> <%= render_slot(@code_actions) %>
<% end %>
</div> </div>
<%= if @inner_block do %> <%= if @inner_block do %>

View File

@ -216,7 +216,7 @@ msgstr "Brandmunition"
msgid "Instance Information" msgid "Instance Information"
msgstr "Instanzinformationen" msgstr "Instanzinformationen"
#: lib/cannery_web/components/invite_card.ex:25 #: lib/cannery_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "Einladung deaktiviert" msgstr "Einladung deaktiviert"
@ -466,7 +466,7 @@ msgstr "Art:"
msgid "Users" msgid "Users"
msgstr "Benutzer" msgstr "Benutzer"
#: lib/cannery_web/components/invite_card.ex:20 #: lib/cannery_web/components/invite_card.ex:27
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Uses Left:" msgid "Uses Left:"
msgstr "Verbleibende Nutzung:" msgstr "Verbleibende Nutzung:"

View File

@ -201,7 +201,7 @@ msgstr ""
msgid "Instance Information" msgid "Instance Information"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:25 #: lib/cannery_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "" msgstr ""
@ -449,7 +449,7 @@ msgstr ""
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:20 #: lib/cannery_web/components/invite_card.ex:27
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Uses Left:" msgid "Uses Left:"
msgstr "" msgstr ""

View File

@ -202,7 +202,7 @@ msgstr ""
msgid "Instance Information" msgid "Instance Information"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:25 #: lib/cannery_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "" msgstr ""
@ -450,7 +450,7 @@ msgstr ""
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:20 #: lib/cannery_web/components/invite_card.ex:27
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Uses Left:" msgid "Uses Left:"
msgstr "" msgstr ""

View File

@ -216,7 +216,7 @@ msgstr ""
msgid "Instance Information" msgid "Instance Information"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:25 #: lib/cannery_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "" msgstr ""
@ -464,7 +464,7 @@ msgstr ""
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:20 #: lib/cannery_web/components/invite_card.ex:27
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Uses Left:" msgid "Uses Left:"
msgstr "" msgstr ""

View File

@ -216,7 +216,7 @@ msgstr "Incendiaire"
msgid "Instance Information" msgid "Instance Information"
msgstr "Information de linstance" msgstr "Information de linstance"
#: lib/cannery_web/components/invite_card.ex:25 #: lib/cannery_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "Invitation désactivée" msgstr "Invitation désactivée"
@ -468,7 +468,7 @@ msgstr "Type:"
msgid "Users" msgid "Users"
msgstr "Utilisateurs" msgstr "Utilisateurs"
#: lib/cannery_web/components/invite_card.ex:20 #: lib/cannery_web/components/invite_card.ex:27
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Uses Left:" msgid "Uses Left:"
msgstr "Utilisations restantes:" msgstr "Utilisations restantes:"

View File

@ -212,7 +212,7 @@ msgstr ""
msgid "Instance Information" msgid "Instance Information"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:25 #: lib/cannery_web/components/invite_card.ex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "" msgstr ""
@ -460,7 +460,7 @@ msgstr ""
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: lib/cannery_web/components/invite_card.ex:20 #: lib/cannery_web/components/invite_card.ex:27
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Uses Left:" msgid "Uses Left:"
msgstr "" msgstr ""