Move user-mini display to subtemplate
This commit is contained in:
parent
e617406872
commit
04fdd2ae8e
3 changed files with 15 additions and 13 deletions
|
@ -231,6 +231,7 @@ pub const Response = struct {
|
|||
writer,
|
||||
.{
|
||||
._page = templ,
|
||||
.@"mini-user" = @embedFile("./controllers/web/_components/mini-user.tmpl.html"),
|
||||
},
|
||||
@embedFile("./controllers/web/_format.tmpl.html"),
|
||||
data,
|
||||
|
|
13
src/main/controllers/web/_components/mini-user.tmpl.html
Normal file
13
src/main/controllers/web/_components/mini-user.tmpl.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<div class="user-mini">
|
||||
<img class="avatar" src="{.avatar_url}" />
|
||||
<div class="details">
|
||||
<div class="display_name">
|
||||
{=#if .display_name |$name|=}
|
||||
{$name}
|
||||
{= #else =}
|
||||
{.username}
|
||||
{= /if =}
|
||||
</div>
|
||||
<div class="handle">@{.username}@{.host}</div>
|
||||
</div>
|
||||
</div>
|
|
@ -9,19 +9,7 @@
|
|||
{#if .invite |$invite| =}
|
||||
<div>
|
||||
<div>You are about to accept an invite from:</div>
|
||||
<div class="user-mini">
|
||||
<img class="avatar" src="{$invite.creator.avatar_url}" />
|
||||
<div class="details">
|
||||
<div class="display_name">
|
||||
{=#if $invite.creator.display_name |$name|=}
|
||||
{$name}
|
||||
{= #else =}
|
||||
{$invite.creator.username}
|
||||
{= /if =}
|
||||
</div>
|
||||
<div class="handle">@{$invite.creator.username}@{$invite.creator.host}</div>
|
||||
</div>
|
||||
</div>
|
||||
{#template mini-user $invite.creator}
|
||||
{#if @isTag($invite.kind, community_owner) =}
|
||||
<div>This act will make your new account the owner of { %community.name }.</div>
|
||||
{/if =}
|
||||
|
|
Loading…
Reference in a new issue