mirror of
https://github.com/ClaperCo/Claper.git
synced 2025-12-16 11:57:58 +01:00
Format files
This commit is contained in:
@@ -99,7 +99,18 @@ defmodule ClaperWeb.EventLive.FormComponent do
|
|||||||
|
|
||||||
<%= unless is_nil(assigns.current_form_submit) do %>
|
<%= unless is_nil(assigns.current_form_submit) do %>
|
||||||
<div class="flex gap-1 text-green-500 text-sm">
|
<div class="flex gap-1 text-green-500 text-sm">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M9 12l2 2l4 -4" /></svg>
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
class="h-6 w-6"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke="currentColor"
|
||||||
|
fill="none"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" /><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M9 12l2 2l4 -4" />
|
||||||
|
</svg>
|
||||||
<span><%= gettext("Saved") %></span>
|
<span><%= gettext("Saved") %></span>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -87,8 +87,7 @@ defmodule ClaperWeb.EventLive.Manage do
|
|||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> update(:all_posts, fn posts -> [updated_post | posts] end)
|
|> update(:all_posts, fn posts -> [updated_post | posts] end)
|
||||||
|> update(:pinned_posts, fn posts -> [updated_post | posts] end)
|
|> update(:pinned_posts, fn posts -> [updated_post | posts] end)}
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
@@ -97,8 +96,9 @@ defmodule ClaperWeb.EventLive.Manage do
|
|||||||
socket
|
socket
|
||||||
|> update(:all_posts, fn posts -> [deleted_post | posts] end)
|
|> update(:all_posts, fn posts -> [deleted_post | posts] end)
|
||||||
|> update(:pinned_posts, fn posts -> [deleted_post | posts] end)
|
|> update(:pinned_posts, fn posts -> [deleted_post | posts] end)
|
||||||
|> update(:pinned_post_count, fn pinned_post_count -> pinned_post_count - if deleted_post.pinned, do: 1, else: 0 end)
|
|> update(:pinned_post_count, fn pinned_post_count ->
|
||||||
}
|
pinned_post_count - if deleted_post.pinned, do: 1, else: 0
|
||||||
|
end)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
@@ -119,6 +119,7 @@ defmodule ClaperWeb.EventLive.Manage do
|
|||||||
|> update(:all_posts, fn all_posts -> [post | all_posts] end)
|
|> update(:all_posts, fn all_posts -> [post | all_posts] end)
|
||||||
|> update(:pinned_posts, fn pinned_posts -> [post | pinned_posts] end)
|
|> update(:pinned_posts, fn pinned_posts -> [post | pinned_posts] end)
|
||||||
|> assign(:pinned_post_count, socket.assigns.pinned_post_count - 1)
|
|> assign(:pinned_post_count, socket.assigns.pinned_post_count - 1)
|
||||||
|
|
||||||
{:noreply, updated_socket}
|
{:noreply, updated_socket}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -704,7 +704,11 @@
|
|||||||
|
|
||||||
<div class="grid grid-cols-1 grid-rows-2 md:grid-rows-3" style="height: 100%;">
|
<div class="grid grid-cols-1 grid-rows-2 md:grid-rows-3" style="height: 100%;">
|
||||||
<div class="bg-gray-200 md:row-span-2 border-2">
|
<div class="bg-gray-200 md:row-span-2 border-2">
|
||||||
<ul id="menu" phx-update="replace" class="fixed z-20 flex items-center bg-gray-200 space-x-3 px-2 w-full py-2">
|
<ul
|
||||||
|
id="menu"
|
||||||
|
phx-update="replace"
|
||||||
|
class="fixed z-20 flex items-center bg-gray-200 space-x-3 px-2 w-full py-2"
|
||||||
|
>
|
||||||
<li class={"rounded-md #{if @list_tab==:posts, do: 'bg-secondary-600 text-white' ,
|
<li class={"rounded-md #{if @list_tab==:posts, do: 'bg-secondary-600 text-white' ,
|
||||||
else: 'bg-white text-gray-600' } px-2 py-0.5 text-sm shadow-sm"}>
|
else: 'bg-white text-gray-600' } px-2 py-0.5 text-sm shadow-sm"}>
|
||||||
<%= link(gettext("Messages"), to: "#", phx_click: "list-tab", phx_value_tab: :posts) %>
|
<%= link(gettext("Messages"), to: "#", phx_click: "list-tab", phx_value_tab: :posts) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user