This repository has been archived on 2023-12-27. You can view files and clone it, but cannot push or open issues or pull requests.
gts-web/template/profile.tmpl

129 lines
3.7 KiB
Cheetah
Raw Normal View History

2023-12-27 16:09:46 +01:00
{{- /*
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ -}}
{{ template "header.tmpl" .}}
<main class="profile">
<div class="header">
<div class="header-image">
{{ if .account.Header }}
<img src="{{.account.Header}}" alt="" />
{{ end }}
</div>
<div class="basic-info" aria-hidden="true">
<a class="avatar" href="{{.account.Avatar}}">
<img src="{{.account.Avatar}}" alt="">
</a>
<span class="displayname text-cutoff">
{{if .account.DisplayName}}
{{emojify .account.Emojis (escape .account.DisplayName)}}
{{else}}
{{.account.Username}}
{{end}}
</span>
<span class="username text-cutoff">@{{.account.Username}}@{{.instance.AccountDomain}}</span>
{{- /* Only render account role if 1. it's present and 2. it's not equal to the standard 'user' role */ -}}
{{ if and (.account.Role) (ne .account.Role.Name "user") }}
<div class="role {{ .account.Role.Name }}">
{{ if and (.account.Role) (eq .account.Role.Name "admin") }}
webmain
{{ else }}
{{ .account.Role.Name }}
{{ end }}
</div>
{{ end }}
<div class="accountstats">
<b>joined</b><time datetime="{{.account.CreatedAt}}">{{.account.CreatedAt | timestampVague}}</time>
<b>posts</b><span>
{{ if .rssFeed }}
<a href="{{ .rssFeed }}" class="rss-icon" aria-label="RSS feed">
<img src="/rss.svg" width="20" height="20">
</a>
{{ end }}
<span>{{.account.StatusesCount}}</span>
</span>
<b>followers</b><span>{{.account.FollowersCount}}</span>
<b>follows</b><span>{{.account.FollowingCount}}</span>
</div>
</div>
</div>
<div class="column-split">
<section class="about-user">
<div class="bio">
{{ if .account.Note }}
{{emojify .account.Emojis (noescape .account.Note)}}
{{else}}
no bio
{{end}}
</div>
<div class="fields">
{{ range .account.Fields }}
<b>{{emojify $.account.Emojis (noescape .Name)}}</b>
<span>{{emojify $.account.Emojis (noescape .Value)}}</span>
{{ end }}
</div>
</section>
<section class="toots">
{{ if .pinned_statuses }}
<div class="col-header">
<h2>Pinned posts</h2>
<a href="#recent">jump to recent</a>
</div>
<section class="thread">
{{ range .pinned_statuses }}
<article class="toot expanded" id="{{.ID}}">
{{ template "status_profile.tmpl" .}}
</article>
{{ end }}
</section>
{{ end }}
<section class="thread">
{{ if not .statuses }}
<div data-nosnippet class="nothinghere">Nothing here!</div>
{{ else }}
{{ range .statuses }}
<article class="toot expanded" id="{{.ID}}">
{{ template "status_profile.tmpl" .}}
</article>
{{ end }}
{{ end }}
</section>
<div class="backnextlinks">
{{ if .show_back_to_top }}
<a href="/@{{ .account.Username }}">Back to top</a>
{{ end }}
{{ if .statuses_next }}
<a href="{{ .statuses_next }}" class="next">Show older</a>
{{ end }}
</div>
</section>
</div>
</main>
{{ template "footer.tmpl" .}}