Files
PixivFE/assets/views/user.jet.html
T
2024-10-02 18:45:59 +10:00

90 lines
3.7 KiB
HTML

{{- extends "layout/default" }}
{{- import "blocks/pagination" }}
{{- import "blocks/switcher" }}
{{- block body() }}
<div class="row justify-content-center">
<div class="col-12">
{{- if ! .User.BackgroundImage }}
<div class="bg-body-tertiary rounded-5 p-4 mb-4" style="height: 200px;"></div>
{{- else }}
<div class="bg-body-tertiary rounded-5 p-4 mb-4" style="height: 200px; overflow: hidden;">
<img src="{{ .User.BackgroundImage }}" alt="{{ .User.Name }}" class="img-fluid w-100 h-100 object-fit-cover" />
</div>
{{- end }}
</div>
<div class="col-12 col-lg-9">
<div class="card border-0 rounded-5 bg-body-tertiary p-4 mb-4">
<div class="row g-4">
<div class="col-12 col-md-3 text-center">
<img src="{{.User.Avatar}}" alt="Avatar Of User" class="rounded-circle img-fluid" style="width: 150px; height: 150px; object-fit: cover;">
</div>
<div class="col-12 col-md-9">
<h1 class="h3 fw-bold mb-3">{{ .User.Name }}</h1>
<p class="mb-2">
<a href="https://pixiv.net/u/{{ .User.ID }}" class="text-decoration-none">pixiv.net/u/{{ .User.ID }}</a>
</p>
<p class="text-muted mb-3">{{ .User.Following }} Following | {{ .User.MyPixiv }} MyPixiv</p>
<div class="mb-3">
{{- if .User.Webpage }}
<a href="{{ .User.Webpage }}" class="btn btn-secondary rounded-pill me-2 mb-2">
<i class="bi bi-globe"></i>
</a>
{{- end }}
{{- range index, item := .User.Social }}
<a href="{{ item.url }}" class="btn btn-secondary rounded-pill me-2 mb-2">
<i class="bi bi-{{ index }}"></i>
</a>
{{- end }}
</div>
<p class="mb-0">{{ raw: parsePixivRedirect(.User.Comment) }}</p>
</div>
</div>
</div>
<div class="card border-0 rounded-5 bg-body-tertiary p-4 mb-4">
<h2 class="h4 fw-bold mb-3">Frequently Used Tags</h2>
<div class="d-flex flex-wrap">
{{- range .User.FrequentTags }}
<a href="/tags/{{ .Name }}" class="btn btn-secondary rounded-pill me-2 mb-2">#{{ .Name }}</a>
{{- end }}
</div>
</div>
<div class="card border-0 rounded-5 bg-body-tertiary p-4 mb-4">
<h2 class="h4 fw-bold mb-3">Category</h2>
<div class="d-flex flex-wrap">
{{- baseURL := "/users/" + .User.ID + "/" }}
{{- paths := slice("", "illustrations", "manga", "novels", "bookmarks") }}
{{- names := slice("All", "Illustrations", "Mangas", "Novels", "Bookmarks") }}
{{- yield Switcher(baseURL=baseURL, paths=paths, names=names, activeState=.Category) }}
</div>
</div>
<div class="card border-0 rounded-5 bg-body-tertiary p-4 mb-4">
{{- if .Category != "novels" }}
<div class="d-flex justify-content-between align-items-center mb-3">
<h2 class="h4 fw-bold mb-0" id="checkpoint">Illustrations and Manga</h2>
{{- combinedUrl := "/artworks-multi/" + joinArtworkIds(.User.Artworks) }}
<a href="{{combinedUrl}}" class="btn btn-secondary rounded-pill">View all art on this page</a>
</div>
<div class="row row-cols-2 row-cols-md-4 row-cols-lg-6 g-4">
{{- include "fragments/small-tn" .User.Artworks }}
</div>
{{- else }}
<h2 class="h4 fw-bold mb-3" id="checkpoint">Novels</h2>
<div class="row row-cols-1 row-cols-md-2 g-4">
{{- range .User.Novels }}
{{- include "fragments/novel-tn" . }}
{{- end }}
</div>
{{- end }}
</div>
{{- url := "/users/" + .User.ID + "/" + .Category + "?page="}}
{{- paginationData := createPaginator(url, "#checkpoint", .Page, -1, 1, 5) }}
{{- yield pagination(data=paginationData) }}
</div>
</div>
{{- end }}