-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
8 changed files
with
70 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule MediaServerWeb.SeasonsLive.Show do | ||
use MediaServerWeb, :live_view | ||
|
||
alias MediaServerWeb.Repositories.Series | ||
alias MediaServerWeb.Repositories.Episodes | ||
|
||
@impl true | ||
def handle_params(%{"serie" => id, "season" => number}, _url, socket) do | ||
serie = Series.get_serie(id) | ||
|
||
{ | ||
:noreply, | ||
socket | ||
|> assign(:page_title, "#{serie["title"]}: Season #{number}") | ||
|> assign(:episodes, Episodes.get_all(id, number)) | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="max-w-4xl mx-auto py-6 px-4"> | ||
<ul role="list" class="-my-5 divide-y divide-gray-200"> | ||
|
||
<%= for item <- @episodes do %> | ||
|
||
<li class="py-4"> | ||
<div class="sm:flex"> | ||
<div class="mb-4 flex-shrink-0 sm:mb-0 sm:mr-4"> | ||
|
||
<%= if List.first(item["images"]) do %> | ||
<img class="h-48 w-full sm:w-72 object-cover" src={MediaServerWeb.Repositories.Episodes.get_screenshot(item)}> | ||
<% else %> | ||
<svg class="h-48 w-full sm:w-72 border border-gray-300 bg-white text-gray-300" preserveAspectRatio="none" stroke="currentColor" fill="none" viewBox="0 0 200 200" aria-hidden="true"> | ||
<path vector-effect="non-scaling-stroke" stroke-width="1" d="M0 0l200 200M0 200L200 0" /> | ||
</svg> | ||
<% end %> | ||
</div> | ||
<div> | ||
<h4 class="text-md font-bold"><%= "Season #{item["seasonNumber"]} - Episode #{item["episodeNumber"]}" %></h4> | ||
<p class="mt-1"> | ||
<%= item["title"] %> | ||
</p> | ||
<p class="mt-2"> | ||
<%= item["overview"] %> | ||
</p> | ||
|
||
<%= live_redirect "Play", id: "play-#{ item["id"] }", to: Routes.watch_episode_show_path(@socket, :show, item["id"]), class: "mt-4 inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-slate-600 hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500" %> | ||
</div> | ||
</div> | ||
</li> | ||
|
||
<% end %> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters