gitlin/views/user.html

96 行
2.7 KiB
HTML

{{ template "header" .}}
<main>
{{ if .user }} {{ range $key, $value := .user}}
<div class="button-parent">
<a rel="noreferrer" href="https://github.com/{{.Login}}" class="button">View on GitHub</a>
</div>
<div class="user-profile">
<img
src="{{ .AvatarUrl }}"
alt="{{.Login}}'s avatar"
class="avatar"
width="150"
height="150"
/>
{{ if .Name }}
<h1 class="user-profile-h1">{{.Name}}</h1>
{{ end }}
<h2>{{.Login}}</h2>
{{ if eq .Type "http://schema.org/Person" }}
<p><b>{{.Followers}}</b> followers - <b>{{.Following}}</b> following</p>
{{ else }}
<p><b>{{.Followers}}</b> followers</p>
{{ end }} {{ if .StatusEmoji}}
<p>{{.StatusEmoji}} {{.Status}}</p>
{{ end }} {{ if .Location }}
<p>🌍 {{.Location}}</p>
{{ end }} {{ if .Timezone }}
<p>🕑️ {{.Timezone}}</p>
{{ end }} {{ if .Link }}
<p>🌐 <a href="https://{{.Link}}" target="_blank">{{.Link}}</a></p>
{{ end }} {{ if .Email }}
<p>✉️ {{.Email}}</p>
{{ end }} {{ if .Social }}
<div class="social-links">
{{range .Social}}
<p>🔗 <a href="{{.}}" target="_blank">{{.}}</a></p>
{{ end }}
</div>
{{ end }} {{ if .Organizations }}
<p>
Organizations: {{range .Organizations}}
<a href="/{{.}}" target="_blank">{{.}}</a>
{{ end }}
</p>
{{ end }} {{ if .OrgMembers }}
<p>
Members: {{range .OrgMembers}}
<a href="/{{.}}" target="_blank">@{{.}}</a>
{{ end }}
</p>
{{ end }} {{ if .Company }}
<p>🏢 {{.Company}}</p>
{{ end }} {{ if eq .Type "http://schema.org/Person" }}
<p>
✏️ {{ if .Name }} {{.Name}} {{ else }} {{.Login}} {{ end }} has made
{{.Contributions}}
</p>
{{ end }}
</div>
{{ if .Bio }}
<div class="user-bio">
<h3>Bio</h3>
<p class="user-bio-text">{{.Bio}}</p>
</div>
{{ end }} {{ if .Readme }}
<div class="user-readme">
<h3>README</h3>
<div class="user-readme-text">{{ unescape .Readme}}</div>
</div>
{{ end }} {{ if .MainRepos }}
<div class="user-readme">
<h3>{{.PinOrPopular}} repositories</h2>
{{range .MainRepos}}
<a class="user-repo-card" href="/{{.Name}}">
<p class="user-repo-header">{{.Name}}</p>
{{if .ForkOf}}
Forked from: <a href="/{{.ForkOf}}">{{.ForkOf}}</a>
{{else}} {{end}} {{if .Desc}}
<p class="">{{.Desc}}</p>
{{else}} {{end}}
<p class="">
{{if .Stars}}⭐ {{.Stars}}{{else}}{{end}} {{if .Forks}} 🍴 {{.Forks}}
{{else}}{{end}} {{if .Lang}} 🗒️ {{.Lang}} {{else}}{{end}}
</p>
</a>
{{ end }}
</div>
{{ end }} {{ end }} {{ else }}
<h2>User not found</h2>
<p>That user doesn't exist.</p>
{{ end }}
</main>
{{ template "footer" .}}