Skip to content

Jc/register page #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
performance={@performance}
title="New performance"
action={:new}
return_to={Routes.admin_karaoke_show_path(@socket, :show, @karaoke_id)}
/>
9 changes: 0 additions & 9 deletions lib/karaokium_web/live/karaoke_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@ defmodule KaraokiumWeb.KaraokeLive.Show do
"""
end

def status(%{karaoke: karaoke} = assigns) when karaoke.status == :ready do
~H"""
<.status
img={Routes.static_path(KaraokiumWeb.Endpoint, "/karaokium/images/illustrations/undraw/happy_music.svg")}
text={"#{@karaoke.name} - Starting soon"}
/>
"""
end

def status(%{karaoke: karaoke} = assigns) when karaoke.status == :finished do
~H"""
<section>
Expand Down
42 changes: 22 additions & 20 deletions lib/karaokium_web/live/karaoke_live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@
<%= unless is_nil(@karaoke.performing_id) do %>
<section style="margin-top: -50px;">
<aside style="padding: 0;">
<img
id="cover-album"
style="border-radius: 4px 4px 0 0;"
alt={@karaoke.performing.song.album.name}
src={hd(@karaoke.performing.song.album.images).url}
height="285"
/>
<img id="cover-album" style="border-radius: 4px 4px 0 0;" height="285" />
<div style="padding: 0 0.5rem;">
<h3 style="margin: 0;"><%= @karaoke.performing.song.name %></h3>
<p>
<strong><%= @karaoke.performing.song.album.name %></strong>
</p>
<p>
<em><%= Enum.map(@karaoke.performing.song.artists, & &1.name) |> Enum.join(", ") %></em>
</p>
<center>
<div class="text-center">
<table style="padding: 0; margin-bottom: 10px;">
<tbody>
<tr>
Expand All @@ -33,7 +23,7 @@
<% end %>
</tbody>
</table>
</center>
</div>
</div>
</aside>
</section>
Expand All @@ -45,7 +35,7 @@
<%= emoji %> <%= reaction_count(@reactions, emoji) %>
</button>
<% else %>
<div class="button" onmousedown={"reactions(this, '#{emoji}')"}>
<div class="button">
<button
phx-throttle="1000"
phx-click="react"
Expand All @@ -64,15 +54,27 @@
<header>
<h2>Vote now!</h2>
</header>
<%= for pontuation <- 1..10 do %>
<button phx-click="vote" phx-value-pontuation={pontuation} style="font-size: 30px; margin: 10px;">
<%= pontuation %>
</button>
<% end %>
<div class="text-center">
<%= for pontuation <- 1..10 do %>
<button phx-click="vote" phx-value-pontuation={pontuation} style="font-size: 30px; margin: 10px;">
<%= pontuation %>
</button>
<% end %>
</div>
<% end %>
</section>
<% end %>
<% else %>
<.status karaoke={@karaoke} />
<%= if @karaoke.status == :ready do %>
<.status
img={Routes.static_path(KaraokiumWeb.Endpoint, "/karaokium/images/illustrations/undraw/happy_music.svg")}
text={"#{@karaoke.name} - Starting soon"}
/>
<span>
<%= live_patch("Create Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id)) %>
</span>
<% else %>
<.status karaoke={@karaoke} />
<% end %>
<% end %>
</div>