notify.moe/pages/search/search.pixy

82 lines
2.5 KiB
Plaintext
Raw Normal View History

component SearchResults(term string, users []*arn.User, animes []*arn.Anime, posts []*arn.Post, threads []*arn.Thread, tracks []*arn.SoundTrack, characters []*arn.Character)
2017-07-06 22:26:02 +02:00
h1.page-title= "Search: " + term
2017-11-03 12:02:13 +01:00
.search
2017-06-20 22:54:45 +02:00
.widget
2017-07-09 04:22:14 +02:00
h3.widget-title
Icon("tv")
span Anime
2017-11-09 18:10:10 +01:00
2017-06-20 22:54:45 +02:00
.profile-watching-list.anime-search
2017-11-07 14:53:02 +01:00
if len(animes) == 0
2017-07-09 17:43:13 +02:00
p.no-search-results.mountable No anime found.
2017-06-20 22:54:45 +02:00
else
2017-11-07 14:53:02 +01:00
each anime in animes
2017-07-02 17:51:17 +02:00
a.profile-watching-list-item.mountable.ajax(href=anime.Link(), title=anime.Title.Canonical, data-mountable-type="anime")
2017-12-03 16:37:52 +01:00
img.anime-cover-image.anime-search-result.lazy(data-src=anime.Image("small"), data-webp="true", alt=anime.Title.Canonical)
2017-11-05 09:32:46 +01:00
2017-11-26 18:04:48 +01:00
.widget
h3.widget-title
Icon("user")
span Characters
.character-search
if len(characters) == 0
p.no-search-results.mountable No characters found.
else
each character in characters
.mountable(data-mountable-type="character")
2017-12-03 17:02:11 +01:00
CharacterSmall(character)
2017-11-26 18:04:48 +01:00
2017-07-09 04:22:14 +02:00
.widget
h3.widget-title
Icon("comment")
2017-07-20 14:26:43 +02:00
span Forum
2017-11-09 18:10:10 +01:00
2017-11-07 14:53:02 +01:00
if len(posts) == 0 && len(threads) == 0
2017-07-20 14:26:43 +02:00
p.no-search-results.mountable No posts found.
else
2017-12-03 17:02:11 +01:00
.forum-search-results
each thread in threads
.forum-search-result.mountable(data-mountable-type="forum")
.forum-search-result-header
a.forum-search-result-title.ajax(href=thread.Link())= thread.Title
if thread.Author().HasNick()
.forum-search-result-author= thread.Author().Nick
.forum-search-result-sample= thread.Text
2017-11-09 18:10:10 +01:00
2017-12-03 17:02:11 +01:00
each post in posts
.forum-search-result.mountable(data-mountable-type="forum")
.forum-search-result-header
a.forum-search-result-title.ajax(href=post.Link(), data-mountable-type="forum")= post.Thread().Title
if post.Author().HasNick()
.forum-search-result-author= post.Author().Nick
.forum-search-result-sample= post.Text
2017-11-09 18:10:10 +01:00
2017-07-09 04:22:14 +02:00
.widget
h3.widget-title
Icon("music")
span Soundtracks
2017-11-09 18:10:10 +01:00
2017-11-07 14:53:02 +01:00
if len(tracks) == 0
p.no-search-results.mountable No soundtracks found.
else
ul.soundtrack-search
each track in tracks
2017-11-07 14:54:40 +01:00
li.mountable(data-mountable-type="track")
2017-11-07 14:53:02 +01:00
a.ajax(href=track.Link())= track.Title
2017-11-05 09:32:46 +01:00
.widget
h3.widget-title
Icon("user")
span Users
2017-11-09 18:10:10 +01:00
2017-11-05 09:32:46 +01:00
.user-avatars.user-search
if len(users) == 0
p.no-search-results.mountable No users found.
else
each user in users
.mountable(data-mountable-type="user")
Avatar(user)
//- a.ajax(href=user.Link())= user.Nick
2017-11-26 18:04:48 +01:00