chore: use verified routes in nav bar
This commit is contained in:
parent
8040c38edf
commit
2d81bf20ce
1 changed files with 8 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
||||||
defmodule ComfycampWeb.NavBar do
|
defmodule ComfycampWeb.NavBar do
|
||||||
use Phoenix.Component
|
use Phoenix.Component
|
||||||
|
use ComfycampWeb, :verified_routes
|
||||||
|
|
||||||
alias Comfycamp.Accounts.User
|
alias Comfycamp.Accounts.User
|
||||||
|
|
||||||
|
@ -15,26 +16,26 @@ defmodule ComfycampWeb.NavBar do
|
||||||
def navbar(assigns) do
|
def navbar(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<nav class="limiter navbar">
|
<nav class="limiter navbar">
|
||||||
<.link href="/">Главная</.link>
|
<.link href={~p"/"}>Главная</.link>
|
||||||
<.link href="/blog/">Блог</.link>
|
<.link href={~p"/blog/"}>Блог</.link>
|
||||||
<.link href="/cinema/">Кинотеатр</.link>
|
<.link href={~p"/cinema/"}>Кинотеатр</.link>
|
||||||
|
|
||||||
<div class="space" />
|
<div class="space" />
|
||||||
|
|
||||||
<%= if @current_user do %>
|
<%= if @current_user do %>
|
||||||
<.link href="/users/settings">
|
<.link href={~p"/users/settings"}>
|
||||||
Настройки
|
Настройки
|
||||||
</.link>
|
</.link>
|
||||||
|
|
||||||
<.link href="/users/log_out" method="delete">
|
<.link href={~p"/users/log_out"} method="delete">
|
||||||
Выйти
|
Выйти
|
||||||
</.link>
|
</.link>
|
||||||
<% else %>
|
<% else %>
|
||||||
<.link href="/users/register">
|
<.link href={~p"/users/register"}>
|
||||||
Зарегистрироваться
|
Зарегистрироваться
|
||||||
</.link>
|
</.link>
|
||||||
|
|
||||||
<.link href="/users/log_in">
|
<.link href={~p"/users/log_in"}>
|
||||||
Войти
|
Войти
|
||||||
</.link>
|
</.link>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue