Skip to content

Commit

Permalink
Mix format
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed Nov 23, 2023
1 parent 2220c1c commit 8ae3ed8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 20 deletions.
4 changes: 3 additions & 1 deletion lib/claper/embeds/embed.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ defmodule Claper.Embeds.Embed do
:position,
:attendee_visibility
])
|> validate_format(:content, ~r/<iframe.*<\/iframe>/, message: gettext("Invalid embed format (should start with <iframe> and end with </iframe>)"))
|> validate_format(:content, ~r/<iframe.*<\/iframe>/,
message: gettext("Invalid embed format (should start with <iframe> and end with </iframe>)")
)
end
end
5 changes: 4 additions & 1 deletion lib/claper_web/live/embed_live/form_component.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@

<div class="flex gap-x-2 mb-5 mt-3">
<%= checkbox(f, :attendee_visibility, class: "h-4 w-5") %>
<%= label(f, :attendee_visibility, gettext("Attendee can view the web content on their device"),
<%= label(
f,
:attendee_visibility,
gettext("Attendee can view the web content on their device"),
class: "text-sm font-medium"
) %>
</div>
Expand Down
1 change: 0 additions & 1 deletion lib/claper_web/live/event_live/manage.ex
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ defmodule ClaperWeb.EventLive.Manage do
"pinned_posts" ->
socket
|> assign(:pinned_posts, list_pinned_posts(socket, socket.assigns.event.uuid))

end

{:noreply, socket}
Expand Down
43 changes: 28 additions & 15 deletions lib/claper_web/live/event_live/manage.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,11 @@
</li>
<li class={"rounded-md #{if @list_tab==:pinned_posts, do: 'bg-secondary-600 text-white' ,
else: 'bg-white text-gray-600' } px-2 py-0.5 text-sm shadow-sm"}>
<%= link(gettext("Pinned messages") <> " (#{ length(@pinned_posts)})", to: "#", phx_click: "list-tab", phx_value_tab: :pinned_posts) %>
<%= link(gettext("Pinned messages") <> " (#{length(@pinned_posts)})",
to: "#",
phx_click: "list-tab",
phx_value_tab: :pinned_posts
) %>
</li>
<li class={"rounded-md #{if @list_tab==:forms, do: 'bg-secondary-600 text-white' ,
else: 'bg-white text-gray-600' } px-2 py-0.5 text-sm shadow-sm"}>
Expand Down Expand Up @@ -900,27 +904,37 @@
<% end %>
<%= if @list_tab == :pinned_posts do %>
<%= if Enum.count(@pinned_posts) == 0 do %>
<div
class="text-center flex flex-col space-y-5 items-center justify-center text-gray-400"
style="height: 100%;"
<div
class="text-center flex flex-col space-y-5 items-center justify-center text-gray-400"
style="height: 100%;"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-36 w-36"
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="M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4" /><path d="M9 15l-4.5 4.5" /><path d="M14.5 4l5.5 5.5" />
</svg>

<svg xmlns="http://www.w3.org/2000/svg" class="h-36 w-36" 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="M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4" /><path d="M9 15l-4.5 4.5" /><path d="M14.5 4l5.5 5.5" /></svg>

<p class="text-lg">
<%= gettext("Pinned messages will appear here.") %>
</p>
</div>
<% end %>
<p class="text-lg">
<%= gettext("Pinned messages will appear here.") %>
</p>
</div>
<% end %>

<div
<div
id="x-pinned"
class={"overflow-y-auto #{if Enum.any?(@pinned_posts), do: 'h-full', else: 'h-1/2'}"}
>
<%= if Enum.any?(@pinned_posts) do %>
<div
id="pinned-post-list"
class={"overflow-y-auto pb-5 pt-8 px-5"}
class="overflow-y-auto pb-5 pt-8 px-5"
phx-update="replace"
data-posts-nb={Enum.count(@pinned_posts)}
phx-hook="ScrollIntoDiv"
Expand All @@ -930,7 +944,7 @@
<div
class={if post.__meta__.state == :deleted, do: "hidden"}
id={"#{post.id}-post"}
>
>
<div class="px-4 pb-2 pt-3 rounded-b-lg rounded-tr-lg bg-white relative shadow-md text-black break-all mt-4">
<div class="float-right mr-1">
<%= if post.attendee_identifier do %>
Expand Down Expand Up @@ -1064,7 +1078,6 @@
</div>
<% end %>


<%= if @list_tab==:forms do %>
<%= if Enum.count(@form_submits)==0 do %>
<div class="text-center h-full flex flex-col space-y-5 items-center justify-center text-gray-400">
Expand Down
6 changes: 4 additions & 2 deletions lib/claper_web/live/event_live/poll_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ defmodule ClaperWeb.EventLive.PollComponent do
<%= if @poll.multiple do %>
<span class="h-5 w-5 mt-0.5 point-select border-2 border-white"></span>
<% else %>
<span class="h-5 w-5 mt-0.5 rounded-full point-select border-2 border-white"></span>
<span class="h-5 w-5 mt-0.5 rounded-full point-select border-2 border-white">
</span>
<% end %>
<% end %>
<span class="flex-1"><%= opt.content %></span>
Expand Down Expand Up @@ -104,7 +105,8 @@ defmodule ClaperWeb.EventLive.PollComponent do
<%= if @poll.multiple do %>
<span class="h-5 w-5 mt-0.5 point-select border-2 border-white"></span>
<% else %>
<span class="h-5 w-5 mt-0.5 rounded-full point-select border-2 border-white"></span>
<span class="h-5 w-5 mt-0.5 rounded-full point-select border-2 border-white">
</span>
<% end %>
<% end %>
<span class="flex-1"><%= opt.content %></span>
Expand Down

0 comments on commit 8ae3ed8

Please sign in to comment.