add proper hcard to homepage
This commit is contained in:
parent
79fc09b839
commit
0f4f4940d0
4 changed files with 19 additions and 2 deletions
|
@ -68,6 +68,8 @@ defmodule Chiya.Accounts do
|
||||||
"""
|
"""
|
||||||
def get_user!(id), do: Repo.get!(User, id)
|
def get_user!(id), do: Repo.get!(User, id)
|
||||||
|
|
||||||
|
def get_user(id), do: Repo.get(User, id)
|
||||||
|
|
||||||
## User registration
|
## User registration
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -110,10 +110,14 @@
|
||||||
<p class="mt-4 max-w-2xl mx-auto text-center">
|
<p class="mt-4 max-w-2xl mx-auto text-center">
|
||||||
Struggling to make a decent website since 2011
|
Struggling to make a decent website since 2011
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a href="/about" class="hidden | h-card" rel="me">Inhji</a>
|
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
<section class="hidden | hcard h-card">
|
||||||
|
<a href="/" rel="me"><%= @profile.name %></a>
|
||||||
|
<img class="u-photo" src={ChiyaWeb.Uploaders.UserImage.url({@profile.user_image, @profile}, :thumb)} />
|
||||||
|
<a href="acct:inhji@inhji.de" class="u-url" />
|
||||||
|
</section>
|
||||||
|
|
||||||
<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>
|
||||||
<div class="bg-theme-secondary w-full"></div>
|
<div class="bg-theme-secondary w-full"></div>
|
||||||
|
|
|
@ -4,6 +4,16 @@ defmodule ChiyaWeb.GlobalAssigns do
|
||||||
@token_endpoint Application.compile_env!(:chiya, [:indie, :token_endpoint])
|
@token_endpoint Application.compile_env!(:chiya, [:indie, :token_endpoint])
|
||||||
@auth_endpoint Application.compile_env!(:chiya, [:indie, :auth_endpoint])
|
@auth_endpoint Application.compile_env!(:chiya, [:indie, :auth_endpoint])
|
||||||
|
|
||||||
|
def fetch_profile(conn, _opts) do
|
||||||
|
user = Chiya.Accounts.get_user(1)
|
||||||
|
|
||||||
|
if user do
|
||||||
|
assign(conn, :profile, user)
|
||||||
|
else
|
||||||
|
conn
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def fetch_settings(conn, _opts) do
|
def fetch_settings(conn, _opts) do
|
||||||
settings = Chiya.Site.get_settings()
|
settings = Chiya.Site.get_settings()
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ defmodule ChiyaWeb.Router do
|
||||||
plug :put_root_layout, {ChiyaWeb.Layouts, :root_public}
|
plug :put_root_layout, {ChiyaWeb.Layouts, :root_public}
|
||||||
plug :fetch_identities
|
plug :fetch_identities
|
||||||
plug :fetch_public_channels
|
plug :fetch_public_channels
|
||||||
|
plug :fetch_profile
|
||||||
end
|
end
|
||||||
|
|
||||||
pipeline :api do
|
pipeline :api do
|
||||||
|
|
Loading…
Reference in a new issue