gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

profile.tmpl (4516B)


      1 {{- /*
      2 // GoToSocial
      3 // Copyright (C) GoToSocial Authors admin@gotosocial.org
      4 // SPDX-License-Identifier: AGPL-3.0-or-later
      5 //
      6 // This program is free software: you can redistribute it and/or modify
      7 // it under the terms of the GNU Affero General Public License as published by
      8 // the Free Software Foundation, either version 3 of the License, or
      9 // (at your option) any later version.
     10 //
     11 // This program is distributed in the hope that it will be useful,
     12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 // GNU Affero General Public License for more details.
     15 //
     16 // You should have received a copy of the GNU Affero General Public License
     17 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
     18 */ -}}
     19 
     20 {{ template "header.tmpl" .}}
     21 
     22 <main class="profile">
     23 	<div class="header">
     24 		<div class="header-image">
     25 			{{ if .account.Header }}
     26 			<img src="{{.account.Header}}" alt="" />
     27 			{{ end }}
     28 		</div>
     29 		<div class="basic-info" aria-hidden="true">
     30 			<a class="avatar" href="{{.account.Avatar}}">
     31 				<img src="{{.account.Avatar}}" alt="">
     32 			</a>
     33 			<span class="displayname text-cutoff">
     34 				{{if .account.DisplayName}}
     35 				{{emojify .account.Emojis (escape .account.DisplayName)}}
     36 				{{else}}
     37 				{{.account.Username}}
     38 				{{end}}
     39 			</span>
     40 			<span class="username text-cutoff">@{{.account.Username}}@{{.instance.AccountDomain}}</span>
     41 			{{- /* Only render account role if 1. it's present and 2. it's not equal to the standard 'user' role */ -}}
     42 			{{ if and (.account.Role) (ne .account.Role.Name "user") }}
     43 			<div class="role {{ .account.Role.Name }}">
     44 				{{ .account.Role.Name }}
     45 			</div>
     46 			{{ end }}
     47 		</div>
     48 		<div class="sr-only">
     49 			Profile for
     50 			{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}.
     51 			Username @{{.account.Username}}, {{.instance.AccountDomain}}.
     52 			{{ if and (.account.Role) (ne .account.Role.Name "user") }}
     53 			Role: {{ .account.Role.Name }}
     54 			{{ end }}
     55 		</div>
     56 	</div>
     57 
     58 	<div class="column-split">
     59 
     60 		<section class="about-user">
     61 			<div class="col-header">
     62 				<h1>About</h1>
     63 			</div>
     64 
     65 			<div class="fields">
     66 				{{ range .account.Fields }}
     67 				<div class="field">
     68 					<b>{{emojify $.account.Emojis (noescape .Name)}}</b>
     69 					<span>{{emojify $.account.Emojis (noescape .Value)}}</span>
     70 				</div>
     71 				{{ end }}
     72 			</div>
     73 
     74 			<div class="bio">
     75 				{{ if .account.Note }}
     76 				{{emojify .account.Emojis (noescape .account.Note)}}
     77 				{{else}}
     78 				This GoToSocial user hasn't written a bio yet!
     79 				{{end}}
     80 			</div>
     81 
     82 			<div class="sr-only" role="group">
     83 				<span>Joined on {{.account.CreatedAt | timestampVague}}.</span>
     84 				<span>{{.account.StatusesCount}} post{{if .account.StatusesCount | eq 1 | not}}s{{end}}.</span>
     85 				<span>Followed by {{.account.FollowersCount}}.</span>
     86 				<span>Following {{.account.FollowingCount}}.</span>
     87 			</div>
     88 
     89 			<div class="accountstats" aria-hidden="true">
     90 				<b>Joined</b><time datetime="{{.account.CreatedAt}}">{{.account.CreatedAt | timestampVague}}</time>
     91 				<b>Posts</b><span>{{.account.StatusesCount}}</span>
     92 				<b>Followed by</b><span>{{.account.FollowersCount}}</span>
     93 				<b>Following</b><span>{{.account.FollowingCount}}</span>
     94 			</div>
     95 		</section>
     96 
     97 		<section class="toots">
     98 			{{ if .pinned_statuses }}
     99 			<div class="col-header">
    100 				<h2>Pinned posts</h2>
    101 				<a href="#recent">jump to recent</a>
    102 			</div>
    103 			<section class="thread">
    104 				{{ range .pinned_statuses }}
    105 				<article class="toot expanded" id="{{.ID}}">
    106 					{{ template "status.tmpl" .}}
    107 				</article>
    108 				{{ end }}
    109 			</section>
    110 			{{ end }}
    111 
    112 			<div class="col-header">
    113 				<h2 id="recent" tabindex="-1">Recent posts</h2>
    114 				{{ if .rssFeed }}
    115 				<a href="{{ .rssFeed }}" class="rss-icon" aria-label="RSS feed">
    116 					<i class="fa fa-rss-square" aria-hidden="true"></i>
    117 				</a>
    118 				{{ end }}
    119 			</div>
    120 
    121 			<section class="thread">
    122 				{{ if not .statuses }}
    123 				<div data-nosnippet class="nothinghere">Nothing here!</div>
    124 				{{ else }}
    125 				{{ range .statuses }}
    126 				<article class="toot expanded" id="{{.ID}}">
    127 					{{ template "status.tmpl" .}}
    128 				</article>
    129 				{{ end }}
    130 				{{ end }}
    131 			</section>
    132 
    133 			<div class="backnextlinks">
    134 				{{ if .show_back_to_top }}
    135 				<a href="/@{{ .account.Username }}">Back to top</a>
    136 				{{ end }}
    137 				{{ if .statuses_next }}
    138 				<a href="{{ .statuses_next }}" class="next">Show older</a>
    139 				{{ end }}
    140 			</div>
    141 		</section>
    142 	</div>
    143 </main>
    144 
    145 {{ template "footer.tmpl" .}}