devel #198
5 changed files with 32 additions and 16 deletions
|
@ -115,12 +115,14 @@
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
<%= if @profile do %>
|
||||||
<section class="hidden | hcard h-card">
|
<section class="hidden | hcard h-card">
|
||||||
<a href="/" rel="me" class="u-url"><%= @profile.name %></a>
|
<a href="/" rel="me" class="u-url"><%= @profile.name %></a>
|
||||||
<img class="u-photo" src={ChiyaWeb.Uploaders.UserImage.url({@profile.user_image, @profile}, :thumb)} />
|
<img class="u-photo" src={ChiyaWeb.Uploaders.UserImage.url({@profile.user_image, @profile}, :thumb)} />
|
||||||
<span class="p-nickname"><%= @profile.handle %></span>
|
<span class="p-nickname"><%= @profile.handle %></span>
|
||||||
<span class="p-note"><%= @profile.bio %></span>
|
<span class="p-note"><%= @profile.bio %></span>
|
||||||
</section>
|
</section>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<section class="flex h-1 w-full flex-row">
|
<section class="flex h-1 w-full flex-row">
|
||||||
<div class="bg-theme-primary w-full"></div>
|
<div class="bg-theme-primary w-full"></div>
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
<.header>
|
<html>
|
||||||
<:title>four oh four</:title>
|
<head>
|
||||||
<:subtitle>this page went away and never came back.</:subtitle>
|
<title>Not found</title>
|
||||||
</.header>
|
<link rel="preconnect" href="https://rsms.me/" />
|
||||||
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
||||||
|
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<.header>
|
||||||
|
<:title>Not found</:title>
|
||||||
|
<:subtitle>This page went away and never came back.</:subtitle>
|
||||||
|
</.header>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,4 +1,14 @@
|
||||||
<.header>
|
<html>
|
||||||
<:title>infernal server error</:title>
|
<head>
|
||||||
<:subtitle>server got hot and went to hell.</:subtitle>
|
<title>Infernal Server Error</title>
|
||||||
</.header>
|
<link rel="preconnect" href="https://rsms.me/" />
|
||||||
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
||||||
|
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<.header>
|
||||||
|
<:title>Infernal Server Error</:title>
|
||||||
|
<:subtitle>Server got hot and went to hell.</:subtitle>
|
||||||
|
</.header>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,10 +1,9 @@
|
||||||
defmodule ChiyaWeb.Error do
|
defmodule ChiyaWeb.Error do
|
||||||
import Plug.Conn, only: [put_status: 2]
|
import Plug.Conn, only: [put_status: 2]
|
||||||
import Phoenix.Controller, only: [put_view: 2, render: 3, put_root_layout: 2]
|
import Phoenix.Controller, only: [put_view: 2, render: 3]
|
||||||
|
|
||||||
def render_error(conn, :not_found, assigns \\ []) do
|
def render_error(conn, :not_found, assigns \\ []) do
|
||||||
conn
|
conn
|
||||||
|> put_root_layout(html: {ChiyaWeb.Layouts, :root_error})
|
|
||||||
|> put_status(:not_found)
|
|> put_status(:not_found)
|
||||||
|> put_view(ChiyaWeb.ErrorHTML)
|
|> put_view(ChiyaWeb.ErrorHTML)
|
||||||
|> render("404.html", assigns)
|
|> render("404.html", assigns)
|
||||||
|
|
|
@ -6,12 +6,7 @@ defmodule ChiyaWeb.GlobalAssigns do
|
||||||
|
|
||||||
def fetch_profile(conn, _opts) do
|
def fetch_profile(conn, _opts) do
|
||||||
user = Chiya.Accounts.get_user(1)
|
user = Chiya.Accounts.get_user(1)
|
||||||
|
assign(conn, :profile, user)
|
||||||
if user do
|
|
||||||
assign(conn, :profile, user)
|
|
||||||
else
|
|
||||||
conn
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_settings(conn, _opts) do
|
def fetch_settings(conn, _opts) do
|
||||||
|
|
Loading…
Reference in a new issue