Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/safira_web/components/avatar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ defmodule SafiraWeb.Components.Avatar do

def avatar(%{link: nil} = assigns) do
~H"""
<%= inner_avatar(assigns) %>
{inner_avatar(assigns)}
"""
end

def avatar(assigns) do
~H"""
<.link navigate={@link}>
<%= inner_avatar(assigns) %>
{inner_avatar(assigns)}
</.link>
"""
end
Expand Down
4 changes: 2 additions & 2 deletions lib/safira_web/components/badge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ defmodule SafiraWeb.Components.Badge do
src="/images/badges/404-fallback.svg"
/>
<span class="text-sm font-semibold text-center">
<%= @badge.name %>
{@badge.name}
</span>
<span :if={@show_tokens} class="text-sm font-semibold">
💰 <%= @badge.tokens %>
💰 {@badge.tokens}
</span>
</div>
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/safira_web/components/banner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule SafiraWeb.Components.Banner do
class="relative w-full bg-gradient-to-b from-accent to-transparent from-85% text-center pt-2 pb-3 text-primary/70 font-bold z-10 transition-transform transform"
data-end={@end_time}
>
<p><%= @text %></p>
<p>{@text}</p>
<div id="timer-countdown">
--:--:--
</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/safira_web/components/button.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ defmodule SafiraWeb.Components.Button do
<%= if @icon != "" do %>
<.icon name={@icon} />
<% end %>
<p class={"uppercase font-terminal text-2xl #{@title_class}"}><%= @title %></p>
<p class="font-terminal"><%= @subtitle %></p>
<p class={"uppercase font-terminal text-2xl #{@title_class}"}>{@title}</p>
<p class="font-terminal">{@subtitle}</p>
</button>
"""
end
Expand Down
56 changes: 28 additions & 28 deletions lib/safira_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ defmodule SafiraWeb.CoreComponents do
</button>
</div>
<div id={"#{@id}-content"}>
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</div>
</.focus_wrap>
</div>
Expand Down Expand Up @@ -127,9 +127,9 @@ defmodule SafiraWeb.CoreComponents do
<p :if={@title} class="flex items-center gap-1.5 text-sm font-semibold leading-6">
<.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-4 w-4" />
<.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-4 w-4" />
<%= @title %>
{@title}
</p>
<p class="mt-2 text-sm leading-5"><%= msg %></p>
<p class="mt-2 text-sm leading-5">{msg}</p>
<button type="button" class="group absolute top-1 right-1 p-2" aria-label={gettext("close")}>
<.icon name="hero-x-mark-solid" class="h-5 w-5 opacity-40 group-hover:opacity-70" />
</button>
Expand Down Expand Up @@ -160,7 +160,7 @@ defmodule SafiraWeb.CoreComponents do
phx-connected={hide("#client-error")}
hidden
>
<%= gettext("Attempting to reconnect") %>
{gettext("Attempting to reconnect")}
<.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
</.flash>

Expand All @@ -172,7 +172,7 @@ defmodule SafiraWeb.CoreComponents do
phx-connected={hide("#server-error")}
hidden
>
<%= gettext("Hang in there while we get back on track") %>
{gettext("Hang in there while we get back on track")}
<.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
</.flash>
</div>
Expand Down Expand Up @@ -207,9 +207,9 @@ defmodule SafiraWeb.CoreComponents do
~H"""
<.form :let={f} for={@for} as={@as} {@rest}>
<div class={"mt-10 space-y-8 #{@class}"}>
<%= render_slot(@inner_block, f) %>
{render_slot(@inner_block, f)}
<div :for={action <- @actions} class="mt-2 flex items-center justify-between gap-6">
<%= render_slot(action, f) %>
{render_slot(action, f)}
</div>
</div>
</.form>
Expand Down Expand Up @@ -241,7 +241,7 @@ defmodule SafiraWeb.CoreComponents do
]}
{@rest}
>
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</button>
"""
end
Expand Down Expand Up @@ -328,36 +328,36 @@ defmodule SafiraWeb.CoreComponents do
class={"rounded border-zinc-300 text-accent focus:ring-0 #{@class}"}
{@rest}
/>
<%= @label %>
{@label}
</label>
<.error :for={msg <- @errors}><%= msg %></.error>
<.error :for={msg <- @errors}>{msg}</.error>
</div>
"""
end

def input(%{type: "select"} = assigns) do
~H"""
<div phx-feedback-for={@name} class={@wrapper_class}>
<.label for={@id}><%= @label %></.label>
<.label for={@id}>{@label}</.label>
<select
id={@id}
name={@name}
class={"mt-2 block w-full rounded-md border border-gray-300 bg-white shadow-sm focus:border-zinc-400 focus:ring-0 sm:text-sm #{@class}"}
multiple={@multiple}
{@rest}
>
<option :if={@prompt} value=""><%= @prompt %></option>
<%= Phoenix.HTML.Form.options_for_select(@options, @value) %>
<option :if={@prompt} value="">{@prompt}</option>
{Phoenix.HTML.Form.options_for_select(@options, @value)}
</select>
<.error :for={msg <- @errors}><%= msg %></.error>
<.error :for={msg <- @errors}>{msg}</.error>
</div>
"""
end

def input(%{type: "textarea"} = assigns) do
~H"""
<div phx-feedback-for={@name} class={@wrapper_class}>
<.label for={@id}><%= @label %></.label>
<.label for={@id}>{@label}</.label>
<textarea
id={@id}
name={@name}
Expand All @@ -370,15 +370,15 @@ defmodule SafiraWeb.CoreComponents do
]}
{@rest}
><%= Phoenix.HTML.Form.normalize_value("textarea", @value) %></textarea>
<.error :for={msg <- @errors}><%= msg %></.error>
<.error :for={msg <- @errors}>{msg}</.error>
</div>
"""
end

def input(%{type: "handle"} = assigns) do
~H"""
<div phx-feedback-for={@name} class={@wrapper_class}>
<.label for={@id}><%= @label %></.label>
<.label for={@id}>{@label}</.label>
<div class={[
"mt-2 flex bg-white w-full rounded-lg text-zinc-900 focus:ring-0 sm:text-sm sm:leading-6",
"phx-no-feedback:border-zinc-300 phx-no-feedback:focus:border-zinc-400 select-none",
Expand All @@ -399,7 +399,7 @@ defmodule SafiraWeb.CoreComponents do
{@rest}
/>
</div>
<.error :for={msg <- @errors}><%= msg %></.error>
<.error :for={msg <- @errors}>{msg}</.error>
</div>
"""
end
Expand All @@ -408,7 +408,7 @@ defmodule SafiraWeb.CoreComponents do
def input(assigns) do
~H"""
<div phx-feedback-for={@name} class={@wrapper_class}>
<.label for={@id}><%= @label %></.label>
<.label for={@id}>{@label}</.label>
<input
type={@type}
name={@name}
Expand All @@ -423,7 +423,7 @@ defmodule SafiraWeb.CoreComponents do
]}
{@rest}
/>
<.error :for={msg <- @errors}><%= msg %></.error>
<.error :for={msg <- @errors}>{msg}</.error>
</div>
"""
end
Expand All @@ -438,7 +438,7 @@ defmodule SafiraWeb.CoreComponents do
def label(assigns) do
~H"""
<label for={@for} class={"block text-sm font-semibold leading-6 dark:text-white #{@class}"}>
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</label>
"""
end
Expand All @@ -452,7 +452,7 @@ defmodule SafiraWeb.CoreComponents do
~H"""
<p class="mt-3 flex gap-3 text-sm leading-6 text-rose-600 phx-no-feedback:hidden">
<.icon name="hero-exclamation-circle-mini" class="mt-0.5 h-5 w-5 flex-none" />
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</p>
"""
end
Expand All @@ -476,13 +476,13 @@ defmodule SafiraWeb.CoreComponents do
]}>
<div class="flex flex-col justify-center">
<h1 class={"font-semibold leading-8 #{@title_class}"}>
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</h1>
<p :if={@subtitle != []} class="mt-2 text-sm leading-6">
<%= render_slot(@subtitle) %>
{render_slot(@subtitle)}
</p>
</div>
<div class="flex-none"><%= render_slot(@actions) %></div>
<div class="flex-none">{render_slot(@actions)}</div>
</header>
"""
end
Expand All @@ -506,8 +506,8 @@ defmodule SafiraWeb.CoreComponents do
<div class="mt-14">
<dl class="-my-4 divide-y divide-zinc-100">
<div :for={item <- @item} class="flex gap-4 py-4 text-sm leading-6 sm:gap-8">
<dt class="w-1/4 flex-none text-zinc-500"><%= item.title %></dt>
<dd class="text-zinc-700"><%= render_slot(item) %></dd>
<dt class="w-1/4 flex-none text-zinc-500">{item.title}</dt>
<dd class="text-zinc-700">{render_slot(item)}</dd>
</div>
</dl>
</div>
Expand All @@ -532,7 +532,7 @@ defmodule SafiraWeb.CoreComponents do
class="text-sm font-semibold leading-6 text-dark hover:text-darkShade/80 dark:text-light dark:hover:text-lightShade/80"
>
<.icon name="hero-arrow-left-solid" class="h-3 w-3" />
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</.link>
</div>
"""
Expand Down
4 changes: 2 additions & 2 deletions lib/safira_web/components/cv_upload.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ defmodule SafiraWeb.Components.CVUpload do
</.image_uploader>
<div :if={@current_user.cv} class="pt-2">
<p class="text-sm text-lightSahde dark:text-darkMuted">
<%= gettext("Current CV: ") %><span class="text-lightMuted"><%= @current_user.cv.file_name %></span>
{gettext("Current CV: ")}<span class="text-lightMuted"><%= @current_user.cv.file_name %></span>
</p>
<p class="text-sm text-lightMuted dark:text-darkMuted">
<%= gettext("You can replace your current CV by uploading again.") %>
{gettext("You can replace your current CV by uploading again.")}
</p>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions lib/safira_web/components/dropdown.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ defmodule SafiraWeb.Components.Dropdown do
<span class="sr-only">Open options</span>

<%= if @label do %>
<%= @label %>
{@label}
<.icon name="hero-chevron-down-solid" class="w-5 h-5 safira-dropdown__chevron" />
<% end %>

<%= if @trigger_element do %>
<%= render_slot(@trigger_element) %>
{render_slot(@trigger_element)}
<% end %>

<%= if !@label && @trigger_element == [] do %>
Expand All @@ -98,7 +98,7 @@ defmodule SafiraWeb.Components.Dropdown do
aria-labelledby="options-menu"
>
<div class="py-1" role="none">
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</div>
</div>
</div>
Expand Down Expand Up @@ -127,7 +127,7 @@ defmodule SafiraWeb.Components.Dropdown do
role="menuitem"
{@rest}
>
<%= render_slot(@inner_block) || @label %>
{render_slot(@inner_block) || @label}
</Link.a>
"""
end
Expand Down
2 changes: 1 addition & 1 deletion lib/safira_web/components/ensure_permissions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule SafiraWeb.Components.EnsurePermissions do
def ensure_permissions(assigns) do
~H"""
<%= if verify_permissions(@user, @permissions) do %>
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
<% end %>
"""
end
Expand Down
Loading
Loading