попытка реализовать галерею. так сыро потому что мне скоро уезжать

This commit is contained in:
lost+skunk 2024-06-30 14:40:27 +03:00
parent a8633b828f
commit ed031b3530
7 changed files with 372 additions and 298 deletions

View File

@ -52,7 +52,7 @@ func Router() {
// пути // пути
switch e { switch e {
default: default:
skunky.httperr(404) skunky.ReturnHTTPError(404)
case "/", "": case "/", "":
open_n_send("html/index.htm") open_n_send("html/index.htm")
case "post": case "post":
@ -62,7 +62,7 @@ func Router() {
skunky.Search() skunky.Search()
case "dd": case "dd":
skunky.DD() skunky.DD()
case "group": case "group_user":
skunky.GRUser() skunky.GRUser()
case "media": case "media":

View File

@ -2,11 +2,38 @@ package app
import ( import (
"encoding/json" "encoding/json"
"net/http"
"strconv"
"strings" "strings"
"text/template"
"git.macaw.me/skunky/devianter" "git.macaw.me/skunky/devianter"
) )
// парсинг темплейтов
func (s skunkyart) ExecuteTemplate(file string, data any) {
var buf strings.Builder
tmp, e := template.ParseFiles(file)
err(e)
err(tmp.Execute(&buf, &data))
wr(s.Writer, buf.String())
}
func (s skunkyart) ReturnHTTPError(status int) {
s.Writer.WriteHeader(status)
// пострйока с помощью strings.Builder, потому что такой метод быстрее обычного сложения
var msg strings.Builder
msg.WriteString(`<html><link rel="stylesheet" href="/gui/css/skunky.css" />`)
msg.WriteString("<h1>")
msg.WriteString(strconv.Itoa(status))
msg.WriteString(" - ")
msg.WriteString(http.StatusText(status))
msg.WriteString("</h1></html>")
wr(s.Writer, msg.String())
}
type text struct { type text struct {
TXT string TXT string
from int from int
@ -87,3 +114,174 @@ func ParseDescription(dscr devianter.Text) string {
return parseddescription.String() return parseddescription.String()
} }
// навигация по страницам
type dlist struct {
Pages int
More bool
}
// FIXME: на некоротрых артах первая страница может вызывать полное отсутствие панели навигации.
func (s skunkyart) NavBase(c dlist) string {
// TODO: сделать понятнее
// навигация по страницам
var list strings.Builder
list.WriteString("<br>")
p := s.Page
// функция для генерации ссылок
prevrev := func(msg string, page int, onpage bool) {
if !onpage {
list.WriteString(`<a href="?p=`)
list.WriteString(strconv.Itoa(page))
if s.Type != 0 {
list.WriteString("&type=")
list.WriteRune(s.Type)
}
if s.Query != "" {
list.WriteString("&q=")
list.WriteString(s.Query)
}
list.WriteString(`">`)
list.WriteString(msg)
list.WriteString("</a> ")
} else {
list.WriteString(strconv.Itoa(page))
list.WriteString(" ")
}
}
// вперёд-назад
if p > 1 {
prevrev("<= Prev |", p-1, false)
} else {
p = 1
}
if c.Pages > 0 {
// назад
for x := p - 6; x < p && x > 0; x++ {
prevrev(strconv.Itoa(x), x, false)
}
// вперёд
for x := p; x <= p+6; x++ {
if x == p {
prevrev("", x, true)
x++
}
if x > p {
prevrev(strconv.Itoa(x), x, false)
}
}
}
// вперёд-назад
if c.More {
prevrev("| Next =>", p+1, false)
}
return list.String()
}
func (s skunkyart) DeviationList(devs []devianter.Deviation, content ...dlist) string {
var list strings.Builder
list.WriteString(`<div class="content">`)
for _, data := range devs {
url := devianter.UrlFromMedia(data.Media)
list.WriteString(`<a title="open/download" href="`)
list.WriteString(url)
list.WriteString(`"><div class="block"><img src="`)
list.WriteString(url)
list.WriteString(`" width="15%"></a><br><a href="`)
list.WriteString("/post/")
list.WriteString(data.Author.Username)
list.WriteString("/")
list.WriteString(data.Url[27:][strings.Index(data.Url[27:], "/art/")+5:])
list.WriteString(`">`)
list.WriteString(data.Author.Username)
list.WriteString(" - ")
list.WriteString(data.Title)
// шильдики нсфв, аи и ежедневного поста
if data.NSFW {
list.WriteString(` [<span class="nsfw">NSFW</span>]`)
}
if data.AI {
list.WriteString(" [🤖]")
}
if data.DD {
list.WriteString(` [<span class="dd">DD</span>]`)
}
list.WriteString("</a></div>")
}
list.WriteString("</div>")
list.WriteString(s.NavBase(content[0]))
return list.String()
}
// FIXME: первый комментарий не отображается.
func (s skunkyart) ParseComments(c devianter.Comments) string {
var cmmts strings.Builder
replied := make(map[int]string)
cmmts.WriteString("<details><summary>Comments: <b>")
cmmts.WriteString(strconv.Itoa(c.Total))
cmmts.WriteString("</b></summary>")
for _, x := range c.Thread {
replied[x.ID] = x.User.Username
cmmts.WriteString(`<div class="msg`)
if x.Parent > 0 {
cmmts.WriteString(` reply`)
}
cmmts.WriteString(`"><p id="`)
cmmts.WriteString(strconv.Itoa(x.ID))
cmmts.WriteString(`"><img src="/media/`)
cmmts.WriteString(x.User.Username)
cmmts.WriteString(`?type=a" width="30px" height="30px"><a href="/group_user?type=about&q=`)
cmmts.WriteString(x.User.Username)
cmmts.WriteString(`"><b`)
cmmts.WriteString(` class="`)
if x.User.Banned {
cmmts.WriteString(`banned`)
}
if x.Author {
cmmts.WriteString(`author`)
}
cmmts.WriteString(`">`)
cmmts.WriteString(x.User.Username)
cmmts.WriteString("</b></a> ")
if x.Parent > 0 {
cmmts.WriteString(` In reply to <a href="#`)
cmmts.WriteString(strconv.Itoa(x.Parent))
cmmts.WriteString(`">`)
if replied[x.Parent] == "" {
cmmts.WriteString("???")
} else {
cmmts.WriteString(replied[x.Parent])
}
cmmts.WriteString("</a>")
}
cmmts.WriteString(" [")
cmmts.WriteString(x.Posted.UTC().String())
cmmts.WriteString("]<p>")
cmmts.WriteString(x.Comment)
cmmts.WriteString("<p>👍: ")
cmmts.WriteString(strconv.Itoa(x.Likes))
cmmts.WriteString(" ⏩: ")
cmmts.WriteString(strconv.Itoa(x.Replies))
cmmts.WriteString("</p></div>\n")
}
cmmts.WriteString(s.NavBase(dlist{
Pages: 0,
More: c.HasMore,
}))
cmmts.WriteString("</details>")
return cmmts.String()
}

View File

@ -1,14 +1,13 @@
package app package app
import ( import (
"bytes" "fmt"
"io" "io"
"net/http" "net/http"
"net/url" "net/url"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
"text/template"
"time" "time"
"git.macaw.me/skunky/devianter" "git.macaw.me/skunky/devianter"
@ -22,104 +21,8 @@ type skunkyart struct {
Type rune Type rune
Query string Query string
Page int Page int
} Templates struct {
GroupUser struct {
// парсинг темплейтов
func (s skunkyart) exe(file string, data any) {
var buf bytes.Buffer
tmp, e := template.ParseFiles(file)
err(e)
tmp.Execute(&buf, &data)
wr(s.Writer, buf.String())
}
func (s skunkyart) httperr(status int) {
s.Writer.WriteHeader(status)
// пострйока с помощью strings.Builder, потому что такой метод быстрее обычного сложения
var msg strings.Builder
msg.WriteString(`<html><link rel="stylesheet" href="/gui/css/skunky.css" />`)
msg.WriteString("<h1>")
msg.WriteString(strconv.Itoa(status))
msg.WriteString(" - ")
msg.WriteString(http.StatusText(status))
msg.WriteString("</h1></html>")
wr(s.Writer, msg.String())
}
// навигация по страницам
type dlist struct {
Pages int
More bool
}
// FIXME: на некоротрых артах первая страница может вызывать полное отсутствие панели навигации.
func (s skunkyart) NavBase(c dlist) string {
// TODO: сделать понятнее
// навигация по страницам
var list strings.Builder
list.WriteString("<br>")
p := s.Page
// функция для генерации ссылок
prevrev := func(msg string, page int, onpage bool) {
if !onpage {
list.WriteString(`<a href="?p=`)
list.WriteString(strconv.Itoa(page))
if s.Type != 0 {
list.WriteString("&type=")
list.WriteRune(s.Type)
}
if s.Query != "" {
list.WriteString("&q=")
list.WriteString(s.Query)
}
list.WriteString(`">`)
list.WriteString(msg)
list.WriteString("</a> ")
} else {
list.WriteString(strconv.Itoa(page))
list.WriteString(" ")
}
}
// вперёд-назад
if p > 1 {
prevrev("<= Prev |", p-1, false)
} else {
p = 1
}
if c.Pages > 0 {
// назад
for x := p - 6; x < p && x > 0; x++ {
prevrev(strconv.Itoa(x), x, false)
}
// вперёд
for x := p; x <= p+6; x++ {
if x == p {
prevrev("", x, true)
x++
}
if x > p {
prevrev(strconv.Itoa(x), x, false)
}
}
}
// вперёд-назад
if c.More {
prevrev("| Next =>", p+1, false)
}
return list.String()
}
func (s skunkyart) GRUser() {
var group struct {
GR devianter.GRuser GR devianter.GRuser
CreationDate string CreationDate string
@ -127,37 +30,50 @@ func (s skunkyart) GRUser() {
A devianter.About A devianter.About
DescriptionFormatted string DescriptionFormatted string
Interests string Interests, Social string
Social string Comments string
BG devianter.Deviation BG string
BGMeta devianter.Deviation
}
Gallery struct {
Pages int
List string
}
}
Search struct {
Content devianter.Search
List string
}
} }
} }
func (s skunkyart) GRUser() {
if len(s.Query) < 1 { if len(s.Query) < 1 {
s.httperr(400) s.ReturnHTTPError(400)
return return
} }
var g devianter.Group var g devianter.Group
g.Name = s.Query g.Name = s.Query
group.GR = g.GroupFunc() s.Templates.GroupUser.GR = g.GroupFunc()
group := &s.Templates.GroupUser
switch s.Type {
case 'a':
if g := group.GR; !g.Owner.Group { if g := group.GR; !g.Owner.Group {
for _, x := range g.Gruser.Page.Modules { for _, x := range g.Gruser.Page.Modules {
switch x.Name {
case "about":
group.About.A = x.ModuleData.About
var about = group.About.A var about = group.About.A
if x.ModuleData.About.RegDate != 0 {
about = x.ModuleData.About
}
group.About.DescriptionFormatted = ParseDescription(about.Description) group.About.DescriptionFormatted = ParseDescription(about.Description)
group.About.Comments = s.ParseComments(devianter.CommentsFunc(
for _, val := range x.ModuleData.About.Interests { strconv.Itoa(group.GR.Gruser.ID),
var interest strings.Builder "",
interest.WriteString(val.Label) s.Page,
interest.WriteString(": <b>") 4,
interest.WriteString(val.Value) ))
interest.WriteString("</b><br>")
group.About.Interests += interest.String()
}
for _, val := range x.ModuleData.About.SocialLinks { for _, val := range x.ModuleData.About.SocialLinks {
var social strings.Builder var social strings.Builder
@ -169,54 +85,39 @@ func (s skunkyart) GRUser() {
group.About.Social += social.String() group.About.Social += social.String()
} }
for _, val := range x.ModuleData.About.Interests {
var interest strings.Builder
interest.WriteString(val.Label)
interest.WriteString(": <b>")
interest.WriteString(val.Value)
interest.WriteString("</b><br>")
group.About.Interests += interest.String()
}
if rd := x.ModuleData.About.RegDate; rd != 0 { if rd := x.ModuleData.About.RegDate; rd != 0 {
group.CreationDate = time.Unix(time.Now().Unix()-rd, 0).UTC().String() group.CreationDate = time.Unix(time.Now().Unix()-rd, 0).UTC().String()
} }
case "cover_deviation":
group.About.BGMeta = x.ModuleData.CoverDeviation.Deviation
group.About.BG = devianter.UrlFromMedia(group.About.BGMeta.Media)
}
} }
} else { } else {
} }
case 'g':
s.exe("html/gruser.htm", &group) gallery := g.Gallery(s.Page)
fmt.Println(gallery)
for _, x := range gallery.Content.Gruser.Page.Modules {
group.Gallery.List = s.DeviationList(x.ModuleData.Folder.Deviations, dlist{
Pages: x.ModuleData.Folder.Pages,
})
}
default:
s.ReturnHTTPError(400)
} }
func (s skunkyart) DeviationList(devs []devianter.Deviation, content ...dlist) string { s.ExecuteTemplate("html/gruser.htm", &s)
var list strings.Builder
list.WriteString(`<div class="content">`)
for _, data := range devs {
url := devianter.UrlFromMedia(data.Media)
list.WriteString(`<a title="open/download" href="`)
list.WriteString(url)
list.WriteString(`"><div class="block"><img src="`)
list.WriteString(url)
list.WriteString(`" width="15%"></a><br><a href="`)
list.WriteString("/post/")
list.WriteString(data.Author.Username)
list.WriteString("/")
list.WriteString(data.Url[27:][strings.Index(data.Url[27:], "/art/")+5:])
list.WriteString(`">`)
list.WriteString(data.Author.Username)
list.WriteString(" - ")
list.WriteString(data.Title)
// шильдики нсфв, аи и ежедневного поста
if data.NSFW {
list.WriteString(` [<span class="nsfw">NSFW</span>]`)
}
if data.AI {
list.WriteString(" [🤖]")
}
if data.DD {
list.WriteString(` [<span class="dd">DD</span>]`)
}
list.WriteString("</a></div>")
}
list.WriteString("</div>")
list.WriteString(s.NavBase(content[0]))
return list.String()
} }
// посты // посты
@ -250,115 +151,52 @@ func (s skunkyart) Deviation(author, postname string) {
post.Tags += tag.String() post.Tags += tag.String()
} }
// FIXME: первый комментарий не отображается. post.Comments = s.ParseComments(devianter.CommentsFunc(id, post.Post.Comments.Cursor, s.Page, 1))
// генерация комментов
var cmmts strings.Builder
replied := make(map[int]string)
c := devianter.CommentsFunc(id, post.Post.Comments.Cursor, s.Page, 1)
cmmts.WriteString("<details><summary>Comments: <b>") s.ExecuteTemplate("html/deviantion.htm", &post)
cmmts.WriteString(strconv.Itoa(c.Total))
cmmts.WriteString("</b></summary>")
for _, x := range c.Thread {
replied[x.ID] = x.User.Username
cmmts.WriteString(`<div class="msg`)
if x.Parent > 0 {
cmmts.WriteString(` reply`)
}
cmmts.WriteString(`"><p id="`)
cmmts.WriteString(strconv.Itoa(x.ID))
cmmts.WriteString(`"><img src="/media/`)
cmmts.WriteString(x.User.Username)
cmmts.WriteString(`?type=a" width="30px" height="30px"><a href="/user/`)
cmmts.WriteString(x.User.Username)
cmmts.WriteString(`"><b`)
cmmts.WriteString(` class="`)
if x.User.Banned {
cmmts.WriteString(`banned`)
}
if x.Author {
cmmts.WriteString(`author`)
}
cmmts.WriteString(`">`)
cmmts.WriteString(x.User.Username)
cmmts.WriteString("</b></a> ")
if x.Parent > 0 {
cmmts.WriteString(` In reply to <a href="#`)
cmmts.WriteString(strconv.Itoa(x.Parent))
cmmts.WriteString(`">`)
if replied[x.Parent] == "" {
cmmts.WriteString("???")
} else { } else {
cmmts.WriteString(replied[x.Parent]) s.ReturnHTTPError(400)
}
cmmts.WriteString("</a>")
}
cmmts.WriteString(" [")
cmmts.WriteString(x.Posted.UTC().String())
cmmts.WriteString("]<p>")
cmmts.WriteString(x.Comment)
cmmts.WriteString("<p>👍: ")
cmmts.WriteString(strconv.Itoa(x.Likes))
cmmts.WriteString(" ⏩: ")
cmmts.WriteString(strconv.Itoa(x.Replies))
cmmts.WriteString("</p></div>\n")
}
cmmts.WriteString(s.NavBase(dlist{
Pages: 0,
More: c.HasMore,
}))
cmmts.WriteString("</details>")
post.Comments = cmmts.String()
s.exe("html/deviantion.htm", &post)
} else {
s.httperr(400)
} }
} }
func (s skunkyart) DD() { func (s skunkyart) DD() {
dd := devianter.DailyDeviationsFunc(s.Page) dd := devianter.DailyDeviationsFunc(s.Page)
s.exe("html/list.htm", s.DeviationList(dd.Deviations, dlist{ s.ExecuteTemplate("html/list.htm", s.DeviationList(dd.Deviations, dlist{
Pages: 0, Pages: 0,
More: dd.HasMore, More: dd.HasMore,
})) }))
} }
func (s skunkyart) Search() { func (s skunkyart) Search() {
// тут всё и так понятно
switch s.Type {
case 'a', 't', 'g':
var srch struct {
Search devianter.Search
List string
}
var e error var e error
srch.Search, e = devianter.SearchFunc(s.Query, s.Page, s.Type) ss := &s.Templates.Search
switch s.Type {
case 'a', 't':
ss.Content, e = devianter.SearchFunc(s.Query, s.Page, s.Type)
case 'g':
ss.Content, e = devianter.SearchFunc(s.Query, s.Page, s.Type, s.Args.Get("usr"))
default:
s.ReturnHTTPError(400)
}
err(e) err(e)
srch.List = s.DeviationList(srch.Search.Results, dlist{
Pages: srch.Search.Pages, ss.List = s.DeviationList(ss.Content.Results, dlist{
More: srch.Search.HasMore, Pages: ss.Content.Pages,
More: ss.Content.HasMore,
}) })
s.exe("html/search.htm", &srch) s.ExecuteTemplate("html/search.htm", &s)
default:
s.httperr(400)
}
} }
func (s skunkyart) Emojitar(name string) { func (s skunkyart) Emojitar(name string) {
if name != "" && (s.Type == 'a' || s.Type == 'e') { if name != "" && (s.Type == 'a' || s.Type == 'e') {
ae, e := devianter.AEmedia(name, s.Type) ae, e := devianter.AEmedia(name, s.Type)
if e != nil { if e != nil {
s.httperr(404) s.ReturnHTTPError(404)
println(e.Error()) println(e.Error())
} }
wr(s.Writer, ae) wr(s.Writer, ae)
} else { } else {
s.httperr(400) s.ReturnHTTPError(400)
} }
} }

View File

@ -83,4 +83,11 @@ form input, button, select {
.block p { .block p {
word-break: break-all; word-break: break-all;
} }
.ubg {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.ubg img {
width: 20%;
}

View File

@ -18,7 +18,7 @@
</header> </header>
<figure> <figure>
<img src="/media/{{.Post.Deviation.Author.Username}}?type=a" width="30px"> <img src="/media/{{.Post.Deviation.Author.Username}}?type=a" width="30px">
<span><strong><a href="/user/{{.Post.Deviation.Author.Username}}">{{.Post.Deviation.Author.Username}}</a></strong> — {{if (.Post.Deviation.DD)}} <span><strong><a href="/group_user?type=about&q={{.Post.Deviation.Author.Username}}">{{.Post.Deviation.Author.Username}}</a></strong> — {{if (.Post.Deviation.DD)}}
<span class="dd" title="Daily Deviation!"><b>{{.Post.Deviation.Title}}</b></span> <span class="dd" title="Daily Deviation!"><b>{{.Post.Deviation.Title}}</b></span>
{{else}}{{.Post.Deviation.Title}}{{end}} {{else}}{{.Post.Deviation.Title}}{{end}}
{{if (ne .Post.Deviation.License "none")}}<mark title="License">{{.Post.Deviation.License}}</mark>{{end}} {{if (.Post.Deviation.AI)}}[🤖]{{end}} {{if (ne .Post.Deviation.License "none")}}<mark title="License">{{.Post.Deviation.License}}</mark>{{end}} {{if (.Post.Deviation.AI)}}[🤖]{{end}}

View File

@ -1,43 +1,74 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>SkunkyArt | {{.GR.Owner.Username}}</title> <title>SkunkyArt |
{{if eq .Type 'a'}}
{{.Templates.GroupUser.GR.Owner.Username}}
{{else}}
gallery of {{.Templates.GroupUser.GR.Owner.Username}}
{{end}}
</title>
<link rel="stylesheet" href="/gui/css/skunky.css"> <link rel="stylesheet" href="/gui/css/skunky.css">
</head> </head>
<main> <main>
<header> <header>
<h1><a href="/">HOME</a> | <a href="/dd">DD</a></h1> <h1><a href="/">HOME</a> | <a href="/dd">DD</a>
| <a href="?q={{.Templates.GroupUser.GR.Owner.Username}}&type={{if eq .Type 'a'}}gallery">Gallery</a></h1>{{else}}about">About</a></h1>
{{end}}
<form method="get" action="/search"> <form method="get" action="/search">
<input type="text" name="q" placeholder="Search for ..." autocomplete="off" autocapitalize="none" spellcheck="false"> <input type="gallery" name="q" placeholder="Search for ..." autocomplete="off" autocapitalize="none" spellcheck="false">
<input type="hidden" name="usr" value="{{.Templates.GroupUser.GR.Owner.Username}}">
<select name="type"> <select name="type">
<option value="all">All</option> <option value="all">All</option>
<option value="tag">Tag</option> <option value="tag">Tag</option>
<option value="gallery">Gallery</option>
</select> </select>
<button type="submit">Search!</button> <button type="submit">Search!</button>
</form> </form>
</header> </header>
<img src="/media/{{.GR.Owner.Username}}?type=a" width="30px" height="30px"> <b>{{.GR.Owner.Username}}</b> {{if eq .Type 'a'}}
{{if (eq .About.A.Gender "male")}} {{if ne .Templates.GroupUser.About.BG ""}}
<a href="{{.Templates.GroupUser.About.BGMeta.Url}}" class="ubg"><img title="{{if ne .Templates.GroupUser.GR.Owner.Username .Templates.GroupUser.About.BGMeta.Author.Username}}
{{.Templates.GroupUser.About.BGMeta.Author.Username}} - {{end}}{{.Templates.GroupUser.About.BGMeta.Title}}" src="{{.Templates.GroupUser.About.BG}}"></a>
{{end}}
<img src="/media/{{.Templates.GroupUser.GR.Owner.Username}}?type=a" width="30px" height="30px"> <b>{{.Templates.GroupUser.GR.Owner.Username}}</b>
{{if (eq .Templates.GroupUser.About.A.Gender "male")}}
♂️ ♂️
{{end}} {{end}}
{{if (eq .About.A.Gender "female")}} {{if (eq .Templates.GroupUser.About.A.Gender "female")}}
♀️ ♀️
{{end}} {{end}}
[<span title="UID">{{.GR.Gruser.ID}}</span>] [<span title="UID">{{.Templates.GroupUser.GR.Gruser.ID}}</span>]
[<span title="Registration date">{{.CreationDate}}</span>] [<span title="Registration date">{{.Templates.GroupUser.CreationDate}}</span>]
<i title="User's Tag">"{{.GR.Extra.Tag}}"</i> {{if ne .Templates.GroupUser.GR.Extra.Tag ""}}
<i title="User's Tag">"{{.Templates.GroupUser.GR.Extra.Tag}}"</i>{{end}} (<b>{{.Templates.GroupUser.About.A.Country}}</b>)
<h3 id="stats"><a href="#stats">#</a> Statistics</h3> <h3 id="stats"><a href="#stats">#</a> Statistics</h3>
<p>Favourites: <b>{{.GR.Extra.Stats.Favourites}}</b>; Deviations: <b>{{.GR.Extra.Stats.Deviations}}</b>; Watchers: <b>{{.GR.Extra.Stats.Watchers}}</b> <p>Favourites: <b>{{.Templates.GroupUser.GR.Extra.Stats.Favourites}}</b>; Deviations: <b>{{.Templates.GroupUser.GR.Extra.Stats.Deviations}}</b>; Watchers: <b>{{.Templates.GroupUser.GR.Extra.Stats.Watchers}}</b>
<p>Watching: <b>{{.GR.Extra.Stats.Watching}}</b>; Pageviews: <b>{{.GR.Extra.Stats.Pageviews}}</b>; Comments Made: <b>{{.GR.Extra.Stats.CommentsMade}}</b>; Friends: <b>{{.GR.Extra.Stats.Friends}}</b></p> <p>Watching: <b>{{.Templates.GroupUser.GR.Extra.Stats.Watching}}</b>; Pageviews: <b>{{.Templates.GroupUser.GR.Extra.Stats.Pageviews}}</b>; Comments Made: <b>{{.Templates.GroupUser.GR.Extra.Stats.CommentsMade}}</b>; Friends: <b>{{.Templates.GroupUser.GR.Extra.Stats.Friends}}</b></p>
{{if ne .Templates.GroupUser.About.Interests ""}}
<h3 id="interests"><a href="#interests">#</a> Interests</h3> <h3 id="interests"><a href="#interests">#</a> Interests</h3>
{{.About.Interests}} {{.Templates.GroupUser.About.Interests}}
{{end}}
{{if ne .Templates.GroupUser.About.Social ""}}
<h3 id="social"><a href="#social">#</a> Social Links</h3> <h3 id="social"><a href="#social">#</a> Social Links</h3>
{{.About.Social}} {{.Templates.GroupUser.About.Social}}
{{end}}
{{if ne .Templates.GroupUser.About.DescriptionFormatted ""}}
<h3 id="about"><a href="#about">#</a> About me</h3> <h3 id="about"><a href="#about">#</a> About me</h3>
{{.About.DescriptionFormatted}} {{.Templates.GroupUser.About.DescriptionFormatted}}
{{end}}
{{if ne .Templates.GroupUser.About.Comments ""}}
<br>
<h3 id="comments"><a href="#comments">#</a> Comments</h3>
{{.Templates.GroupUser.About.Comments}}
{{end}}
{{else}}
{{.Templates.GroupUser.Gallery.List}}
{{end}}
</main> </main>
</html> </html>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>SkunkyArt | Search</title> <title>SkunkyArt | Search "{{.Query}}"</title>
<link rel="stylesheet" href="/gui/css/skunky.css"> <link rel="stylesheet" href="/gui/css/skunky.css">
</head> </head>
<main> <main>
@ -16,11 +16,11 @@
<button type="submit">Search!</button> <button type="submit">Search!</button>
</form> </form>
</header> </header>
{{if (ne .List "")}} {{if ne .Templates.Search.List ""}}
{{if (ne .Search.Total 0)}} {{if ne .Templates.Search.Content.Total 0}}
<h1>Total resuls: {{.Search.Total}}</h1> <h1>Total resuls: {{.Templates.Search.Content.Total}}</h1>
{{end}} {{end}}
{{.List}} {{.Templates.Search.List}}
{{else}} {{else}}
<p>No results :(</p> <p>No results :(</p>
{{end}} {{end}}