174 lines
5.1 KiB
Plaintext
Raw Normal View History

2018-11-12 07:52:07 +00:00
component SearchResults(term string, users []*arn.User, animes []*arn.Anime, posts []*arn.Post, threads []*arn.Thread, tracks []*arn.SoundTrack, characters []*arn.Character, amvs []*arn.AMV, companies []*arn.Company, quotes []*arn.Quote, user *arn.User)
2017-07-06 20:26:02 +00:00
h1.page-title= "Search: " + term
2017-11-03 11:02:13 +00:00
.search
2018-12-06 04:27:01 +00:00
.widget(class=utils.SearchClass(animes))
2017-07-09 02:22:14 +00:00
h3.widget-title
Icon("tv")
span Anime
2017-11-09 17:10:10 +00:00
2018-03-17 19:41:18 +00:00
#anime-search-results
2018-04-23 08:30:25 +00:00
AnimeSearchResults(animes, user)
2017-11-05 08:32:46 +00:00
2018-12-06 04:27:01 +00:00
.widget(class=utils.SearchClass(characters))
2017-11-26 17:04:48 +00:00
h3.widget-title
Icon("user")
span Characters
2018-03-17 19:41:18 +00:00
#character-search-results
CharacterSearchResults(characters, user)
2017-11-26 17:04:48 +00:00
2018-12-06 04:27:01 +00:00
.widget(class=utils.SearchClass(posts))
2017-07-09 02:22:14 +00:00
h3.widget-title
Icon("comment")
2018-12-06 04:27:01 +00:00
span Posts
2017-11-09 17:10:10 +00:00
2018-12-06 04:27:01 +00:00
#posts-search-results
PostsSearchResults(posts, user)
.widget(class=utils.SearchClass(threads))
h3.widget-title
Icon("comments")
span Threads
#threads-search-results
ThreadsSearchResults(threads, user)
2017-11-09 17:10:10 +00:00
2018-12-06 04:27:01 +00:00
.widget(class=utils.SearchClass(tracks))
2017-07-09 02:22:14 +00:00
h3.widget-title
Icon("music")
span Soundtracks
2017-11-09 17:10:10 +00:00
2018-03-17 19:41:18 +00:00
#soundtrack-search-results
2018-10-29 02:30:23 +00:00
SoundTrackSearchResults(tracks, user)
2018-03-17 21:09:17 +00:00
2018-12-06 04:27:01 +00:00
.widget(class=utils.SearchClass(amvs))
2018-11-12 07:52:07 +00:00
h3.widget-title
Icon("video-camera")
span AMVs
#amv-search-results
AMVSearchResults(amvs, user)
2018-03-17 21:09:17 +00:00
//- .widget
//- h3.widget-title
//- Icon("quote-left")
//- span Quotes
//- #quote-search-results
//- QuoteSearchResults(quotes)
2018-12-06 04:27:01 +00:00
.widget(class=utils.SearchClass(companies))
2018-03-17 21:09:17 +00:00
h3.widget-title
Icon("building")
span Companies
#company-search-results
CompanySearchResults(companies)
2017-11-05 08:32:46 +00:00
2018-12-06 04:27:01 +00:00
.widget(class=utils.SearchClass(users))
2017-11-05 08:32:46 +00:00
h3.widget-title
Icon("user")
span Users
2017-11-09 17:10:10 +00:00
2018-03-17 19:41:18 +00:00
#user-search-results
UserSearchResults(users)
2018-03-16 18:13:23 +00:00
2018-04-23 08:30:25 +00:00
component AnimeSearchResults(animes []*arn.Anime, user *arn.User)
2018-03-16 18:13:23 +00:00
if len(animes) == 0
p.no-search-results.mountable No anime found.
else
.profile-watching-list.anime-search
each anime in animes
2019-11-19 07:51:55 +00:00
a.profile-watching-list-item.tip.mountable(href=anime.Link(), aria-label=anime.Title.ByUser(user), data-mountable-type="anime", data-added=(user != nil && user.AnimeList().Contains(anime.ID)))
2018-04-23 08:30:25 +00:00
img.anime-cover-image.anime-search-result.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
2018-03-16 18:13:23 +00:00
component CharacterSearchResults(characters []*arn.Character, user *arn.User)
2018-03-16 18:13:23 +00:00
if len(characters) == 0
p.no-search-results.mountable No characters found.
else
.character-search
each character in characters
.mountable(data-mountable-type="character")
CharacterSmall(character, user)
2018-03-16 18:13:23 +00:00
2018-12-06 04:27:01 +00:00
component PostsSearchResults(posts []*arn.Post, user *arn.User)
if len(posts) == 0
2018-03-16 18:13:23 +00:00
p.no-search-results.mountable No posts found.
else
2018-12-06 04:27:01 +00:00
.posts-search-results
2018-03-16 18:13:23 +00:00
each post in posts
2018-12-06 04:27:01 +00:00
.posts-search-result.mountable(data-mountable-type="post")
.posts-search-result-header
a.posts-search-result-title(href=post.Link(), data-mountable-type="post")= post.Parent().TitleByUser(user)
2018-04-08 10:01:18 +00:00
if post.Creator().HasNick()
2018-12-06 04:27:01 +00:00
.posts-search-result-author= post.Creator().Nick
.posts-search-result-sample= post.Text
component ThreadsSearchResults(threads []*arn.Thread, user *arn.User)
if len(threads) == 0
p.no-search-results.mountable No threads found.
else
each thread in threads
.posts-search-result.mountable(data-mountable-type="thread")
.posts-search-result-header
a.posts-search-result-title(href=thread.Link())= thread.Title
if thread.Creator().HasNick()
.posts-search-result-author= thread.Creator().Nick
.posts-search-result-sample= thread.Text
2018-03-16 18:13:23 +00:00
2018-10-29 02:30:23 +00:00
component SoundTrackSearchResults(tracks []*arn.SoundTrack, user *arn.User)
2018-03-16 18:13:23 +00:00
if len(tracks) == 0
p.no-search-results.mountable No soundtracks found.
else
ul.soundtrack-search
each track in tracks
li.mountable(data-mountable-type="track")
2018-10-29 02:30:23 +00:00
a(href=track.Link())= track.Title.ByUser(user)
2018-03-17 21:09:17 +00:00
span.soundtrack-search-anime= " - " + track.MainAnime().Title.Canonical
2018-11-12 07:52:07 +00:00
component AMVSearchResults(amvs []*arn.AMV, user *arn.User)
if len(amvs) == 0
p.no-search-results.mountable No AMVs found.
else
ul.amv-search
each amv in amvs
li.mountable(data-mountable-type="amv")
a(href=amv.Link())= amv.Title.ByUser(user)
if amv.MainAnime() != nil
span.amv-search-anime= " - " + amv.MainAnime().Title.Canonical
else
span.amv-search-anime= fmt.Sprintf(" - %d anime", len(amv.ExtraAnimeIDs))
2018-03-17 21:09:17 +00:00
component CompanySearchResults(companies []*arn.Company)
if len(companies) == 0
p.no-search-results.mountable No companies found.
else
ul.company-search
each company in companies
li.mountable(data-mountable-type="company")
a(href=company.Link())= company.Name.English
2018-03-17 21:09:17 +00:00
component QuoteSearchResults(quotes []*arn.Quote)
if len(quotes) == 0
p.no-search-results.mountable No quotes found.
else
ul.quote-search
each quote in quotes
li.mountable(data-mountable-type="quote")
a(href=quote.Link())= quote.Text.English
2018-03-16 18:13:23 +00:00
component UserSearchResults(users []*arn.User)
if len(users) == 0
p.no-search-results.mountable No users found.
else
.user-avatars.user-search
each user in users
.mountable(data-mountable-type="user")
Avatar(user)
2017-11-26 17:04:48 +00:00