feat: add controllers and views for other pages
This commit is contained in:
parent
c6de8dce34
commit
1a394277d2
14 changed files with 54 additions and 21 deletions
|
@ -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%;
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
</div>
|
||||
</header>
|
||||
|
||||
<.flash_group flash={@flash} />
|
||||
|
||||
<main>
|
||||
<div class="limiter">
|
||||
<.flash_group flash={@flash} />
|
||||
<%= @inner_content %>
|
||||
</div>
|
||||
</main>
|
||||
|
|
8
lib/comfycamp_web/controllers/cinema_controller.ex
Normal file
8
lib/comfycamp_web/controllers/cinema_controller.ex
Normal file
|
@ -0,0 +1,8 @@
|
|||
defmodule ComfycampWeb.CinemaController do
|
||||
use ComfycampWeb, :controller
|
||||
|
||||
def index(conn, _params) do
|
||||
conn
|
||||
|> render(:index, page_title: "Кинотеатр")
|
||||
end
|
||||
end
|
8
lib/comfycamp_web/controllers/cinema_html.ex
Normal file
8
lib/comfycamp_web/controllers/cinema_html.ex
Normal 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
|
|
@ -0,0 +1 @@
|
|||
<p>Кинотеатр</p>
|
7
lib/comfycamp_web/controllers/main_controller.ex
Normal file
7
lib/comfycamp_web/controllers/main_controller.ex
Normal file
|
@ -0,0 +1,7 @@
|
|||
defmodule ComfycampWeb.MainController do
|
||||
use ComfycampWeb, :controller
|
||||
|
||||
def index(conn, _params) do
|
||||
render(conn, :index, page_title: "Главная")
|
||||
end
|
||||
end
|
8
lib/comfycamp_web/controllers/main_html.ex
Normal file
8
lib/comfycamp_web/controllers/main_html.ex
Normal 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
|
|
@ -1,4 +1,3 @@
|
|||
<.flash_group flash={@flash} />
|
||||
<div>
|
||||
<h1>Уютный домик</h1>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
defmodule ComfycampWeb.PageController do
|
||||
use ComfycampWeb, :controller
|
||||
|
||||
def home(conn, _params) do
|
||||
render(conn, :home, page_title: "Главная")
|
||||
end
|
||||
end
|
|
@ -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
|
7
lib/comfycamp_web/controllers/services_controller.ex
Normal file
7
lib/comfycamp_web/controllers/services_controller.ex
Normal file
|
@ -0,0 +1,7 @@
|
|||
defmodule ComfycampWeb.ServicesController do
|
||||
use ComfycampWeb, :controller
|
||||
|
||||
def index(conn, _params) do
|
||||
render(conn, :index, page_title: "Сервисы")
|
||||
end
|
||||
end
|
8
lib/comfycamp_web/controllers/services_html.ex
Normal file
8
lib/comfycamp_web/controllers/services_html.ex
Normal 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
|
|
@ -0,0 +1 @@
|
|||
<p>Сервисы</p>
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue