Skip to content

Commit

Permalink
Convert championship controller to html
Browse files Browse the repository at this point in the history
* Update championship index action
* Update championships controller show action
* Update championship live for components
* Remove unused championship code and add back tests
  • Loading branch information
axelclark committed Feb 27, 2024
1 parent 8d3da16 commit 6837dca
Show file tree
Hide file tree
Showing 14 changed files with 600 additions and 534 deletions.
11 changes: 11 additions & 0 deletions lib/ex338_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,17 @@ defmodule Ex338Web.CoreComponents do
attr :class, :string, default: nil
slot :inner_block, required: true

def section_header(assigns) do
~H"""
<h3 class={["py-2 pl-4 mt-4 text-base text-gray-700 sm:pl-6", @class]}>
<%= render_slot(@inner_block) %>
</h3>
"""
end

attr :class, :string, default: nil
slot :inner_block, required: true

def legacy_table(assigns) do
~H"""
<div class={["md:max-w-md", @class]}>
Expand Down
6 changes: 3 additions & 3 deletions lib/ex338_web/controllers/championship_controller.ex
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
defmodule Ex338Web.ChampionshipController do
use Ex338Web, :controller
use Ex338Web, :controller_html

alias Ex338.Championships
alias Ex338.FantasyLeagues

def index(conn, %{"fantasy_league_id" => league_id}) do
render(
conn,
"index.html",
:index,
championships: Championships.all_for_league(league_id),
fantasy_league: FantasyLeagues.get(league_id)
)
Expand All @@ -16,7 +16,7 @@ defmodule Ex338Web.ChampionshipController do
def show(conn, %{"fantasy_league_id" => league_id, "id" => id}) do
render(
conn,
"show.html",
:show,
championship: Championships.get_championship_by_league(id, league_id),
fantasy_league: FantasyLeagues.get(league_id)
)
Expand Down
Loading

0 comments on commit 6837dca

Please sign in to comment.