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
alias Cannery.Invites.Invite
alias CanneryWeb.Endpoint
attr :invite, Invite, required: true
slot(:inner_block)
slot(:code_actions)
def invite_card(assigns) do
assigns = assigns |> assign_new(:code_actions, fn -> [] end)
~H"""
<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
@ -34,9 +41,7 @@ defmodule CanneryWeb.Components.InviteCard do
<%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %>
</code>
<%= if @code_actions do %>
<%= render_slot(@code_actions) %>
<% end %>
<%= render_slot(@code_actions) %>
</div>
<%= if @inner_block do %>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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