feat: add controllers and views for other pages

This commit is contained in:
Ivan R. 2024-07-09 21:21:17 +05:00
parent c6de8dce34
commit 1a394277d2
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
14 changed files with 54 additions and 21 deletions

View file

@ -8,7 +8,6 @@
html {
font-family: Georgia, serif;
background-color: var(--bg);
background-size: 224px;
color: white;
font-size: 16px;
}
@ -41,6 +40,7 @@ main,
footer {
justify-content: center;
}
.limiter {
max-width: 800px;
width: 100%;

View file

@ -6,9 +6,10 @@
</div>
</header>
<.flash_group flash={@flash} />
<main>
<div class="limiter">
<.flash_group flash={@flash} />
<%= @inner_content %>
</div>
</main>

View file

@ -0,0 +1,8 @@
defmodule ComfycampWeb.CinemaController do
use ComfycampWeb, :controller
def index(conn, _params) do
conn
|> render(:index, page_title: "Кинотеатр")
end
end

View file

@ -0,0 +1,8 @@
defmodule ComfycampWeb.CinemaHTML do
@moduledoc """
This module contains pages rendered by CinemaController.
"""
use ComfycampWeb, :html
embed_templates "cinema_html/*"
end

View file

@ -0,0 +1 @@
<p>Кинотеатр</p>

View file

@ -0,0 +1,7 @@
defmodule ComfycampWeb.MainController do
use ComfycampWeb, :controller
def index(conn, _params) do
render(conn, :index, page_title: "Главная")
end
end

View file

@ -0,0 +1,8 @@
defmodule ComfycampWeb.MainHTML do
@moduledoc """
This module contains pages rendered by ServicesController.
"""
use ComfycampWeb, :html
embed_templates "main_html/*"
end

View file

@ -1,4 +1,3 @@
<.flash_group flash={@flash} />
<div>
<h1>Уютный домик</h1>

View file

@ -1,7 +0,0 @@
defmodule ComfycampWeb.PageController do
use ComfycampWeb, :controller
def home(conn, _params) do
render(conn, :home, page_title: "Главная")
end
end

View file

@ -1,10 +0,0 @@
defmodule ComfycampWeb.PageHTML do
@moduledoc """
This module contains pages rendered by PageController.
See the `page_html` directory for all templates available.
"""
use ComfycampWeb, :html
embed_templates "page_html/*"
end

View file

@ -0,0 +1,7 @@
defmodule ComfycampWeb.ServicesController do
use ComfycampWeb, :controller
def index(conn, _params) do
render(conn, :index, page_title: "Сервисы")
end
end

View file

@ -0,0 +1,8 @@
defmodule ComfycampWeb.ServicesHTML do
@moduledoc """
This module contains pages rendered by ServicesController.
"""
use ComfycampWeb, :html
embed_templates "services_html/*"
end

View file

@ -0,0 +1 @@
<p>Сервисы</p>

View file

@ -17,7 +17,9 @@ defmodule ComfycampWeb.Router do
scope "/", ComfycampWeb do
pipe_through :browser
get "/", PageController, :home
get "/", MainController, :index
get "/services", ServicesController, :index
get "/cinema", CinemaController, :index
end
# Other scopes may use custom stacks.