Skip to content

Commit

Permalink
Fix layouts and streams
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed Apr 27, 2024
1 parent 3a6f949 commit b78e01a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/claper/forms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ defmodule Claper.Forms do
|> Repo.insert_or_update()
|> case do
{:ok, r} ->
r = Repo.preload(r, :form) # Preloading form in FormSubmit
case fs do
nil -> broadcast({:ok, r, event_uuid}, :form_submit_created)
_form_submit -> broadcast({:ok, r, event_uuid}, :form_submit_updated)
Expand Down
4 changes: 3 additions & 1 deletion lib/claper_web/live/event_live/manage.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ defmodule ClaperWeb.EventLive.Manage do
posts = list_all_posts(socket, event.uuid)
pinned_posts = list_pinned_posts(socket, event.uuid)
questions = list_all_questions(socket, event.uuid)
form_submits = list_form_submits(socket, event.presentation_file.id)

socket =
socket
Expand All @@ -49,12 +50,13 @@ defmodule ClaperWeb.EventLive.Manage do
|> stream(:posts, posts)
|> stream(:questions, questions)
|> stream(:pinned_posts, pinned_posts)
|> stream(:form_submits, form_submits)
|> assign(:pinned_post_count, length(pinned_posts))
|> assign(:question_count, length(questions))
|> assign(:post_count, length(posts))
|> assign(
:form_submit_count,
length(list_form_submits(socket, event.presentation_file.id))
length(form_submits)
)
|> assign(:polls, list_polls(socket, event.presentation_file.id))
|> assign(:forms, list_forms(socket, event.presentation_file.id))
Expand Down
4 changes: 2 additions & 2 deletions lib/claper_web/live/event_live/presenter.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@
<!-- MESSAGES -->
<div
id="slider-wrapper"
class="w-full min-h-screen flex items-center justify-center relative bg-black"
class={"w-full min-h-screen flex items-center #{if @event.presentation_file.length > 0 || @current_embed, do: 'justify-start', else: 'justify-center'} relative bg-black"}
>
<div
class={"#{if @state.chat_visible, do: (if @event.presentation_file.length > 0, do: 'opacity-100 w-3/12 px-4 showed', else: 'opacity-100 w-2/3 px-4 showed'), else: 'opacity-0 w-0 p-0'} transition-all duration-150 flex flex-col h-screen py-5 justify-end max-h-screen bg-black"}
class={"#{if @state.chat_visible, do: (if @event.presentation_file.length > 0 || @current_embed, do: 'opacity-100 w-3/12 px-4 showed', else: 'opacity-100 w-2/3 px-4 showed'), else: 'opacity-0 w-0 p-0'} transition-all duration-150 flex flex-col h-screen py-5 justify-end max-h-screen bg-black"}
id="post-list-wrapper"
phx-update="replace"
>
Expand Down

0 comments on commit b78e01a

Please sign in to comment.