Skip to content
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

Convert championship controller to html #1250

Merged
merged 2 commits into from
Feb 27, 2024
Merged
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
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
Loading