Skip to content

Commit c3afa5e

Browse files
committed
Fix controllers
1 parent dc1f340 commit c3afa5e

File tree

9 files changed

+22
-7
lines changed

9 files changed

+22
-7
lines changed

.github/workflows/master.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ jobs:
7272
working-directory: ./services/app
7373

7474
# --- pnpm setup & caching ---
75+
- name: Setup pnpm
76+
uses: pnpm/action-setup@v4
77+
with:
78+
version: 9
79+
run_install: false
80+
7581
- name: Setup Node
7682
uses: actions/setup-node@v4
7783
with:
7884
node-version: "24"
7985
cache: "pnpm"
8086
cache-dependency-path: ./services/app/apps/codebattle/pnpm-lock.yaml
8187

82-
- name: Setup pnpm
83-
uses: pnpm/action-setup@v4
84-
with:
85-
version: 9
86-
run_install: false
87-
8888
- name: Install pnpm dependencies
8989
run: pnpm install --frozen-lockfile
9090
working-directory: ./services/app/apps/codebattle

services/app/apps/codebattle/lib/codebattle_web/controllers/clan_controller.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ defmodule CodebattleWeb.ClanController do
55

66
plug(CodebattleWeb.Plugs.RequireAuth)
77

8+
plug(:put_view, CodebattleWeb.ClanView)
9+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
10+
811
def index(conn, _params) do
912
clans = Clan.get_all(:creator)
1013

services/app/apps/codebattle/lib/codebattle_web/controllers/hall_of_fame_controller.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ defmodule CodebattleWeb.HallOfFameController do
33

44
import PhoenixGon.Controller
55

6+
plug(:put_view, CodebattleWeb.HallOfFameView)
7+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
8+
69
def index(conn, _params) do
710
top10 = Codebattle.User.get_nearby_users(%{id: nil, rank: 1}, 9)
811

services/app/apps/codebattle/lib/codebattle_web/controllers/session_controller.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ defmodule CodebattleWeb.SessionController do
44
alias Codebattle.User
55

66
plug(:put_view, CodebattleWeb.SessionView)
7+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
78

89
def external_signup(conn, _params) do
910
conn = put_meta_tags(conn, Application.get_all_env(:phoenix_meta_tags))

services/app/apps/codebattle/lib/codebattle_web/controllers/stream_controller.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ defmodule CodebattleWeb.StreamController do
99

1010
plug(CodebattleWeb.Plugs.RequireAuth when action in [:index, :stream_preset])
1111

12+
plug(:put_view, CodebattleWeb.StreamView)
13+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
14+
1215
def index(conn, %{"modern" => _}) do
1316
stream_configs =
1417
conn.assigns.current_user.id

services/app/apps/codebattle/lib/codebattle_web/controllers/task_controller.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ defmodule CodebattleWeb.TaskController do
99

1010
plug(CodebattleWeb.Plugs.RequireAuth)
1111
plug(:put_view, CodebattleWeb.TaskView)
12+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
1213

1314
def index(conn, _params) do
1415
tasks =

services/app/apps/codebattle/lib/codebattle_web/controllers/task_pack_controller.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ defmodule CodebattleWeb.TaskPackController do
55
alias Codebattle.User
66

77
plug(:put_view, CodebattleWeb.TaskPackView)
8+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
89

910
plug(CodebattleWeb.Plugs.RequireAuth)
1011

services/app/apps/codebattle/lib/codebattle_web/controllers/tournaments_schedule_controller.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ defmodule CodebattleWeb.TournamentsScheduleController do
44
require Logger
55

66
plug(CodebattleWeb.Plugs.RequireAuth when action in [:index])
7+
plug(:put_view, CodebattleWeb.TournamentsScheduleView)
8+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
79

810
def index(conn, _) do
911
render(conn, "index.html")

services/app/apps/codebattle/lib/codebattle_web/controllers/user_controller.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
defmodule CodebattleWeb.UserController do
22
use CodebattleWeb, :controller
33

4-
plug(:put_view, CodebattleWeb.UserView)
54
plug(CodebattleWeb.Plugs.RequireAuth when action in [:index, :edit, :show])
5+
plug(:put_view, CodebattleWeb.UserView)
6+
plug(:put_layout, {CodebattleWeb.LayoutView, "app.html"})
67

78
def index(conn, _params) do
89
conn

0 commit comments

Comments
 (0)