Merge pull request #80 from soulcramer/Search_Characters_#70
✨ Added the ability to search for a character
This commit is contained in:
commit
246e431103
@ -13,12 +13,13 @@ const maxAnime = 25
|
|||||||
const maxPosts = 3
|
const maxPosts = 3
|
||||||
const maxThreads = 3
|
const maxThreads = 3
|
||||||
const maxTracks = 4
|
const maxTracks = 4
|
||||||
|
const maxCharacters = 5
|
||||||
|
|
||||||
// Get search page.
|
// Get search page.
|
||||||
func Get(ctx *aero.Context) string {
|
func Get(ctx *aero.Context) string {
|
||||||
term := ctx.Get("term")
|
term := ctx.Get("term")
|
||||||
term = strings.TrimPrefix(term, "/")
|
term = strings.TrimPrefix(term, "/")
|
||||||
|
|
||||||
users, animes, posts, threads, tracks := arn.Search(term, maxUsers, maxAnime, maxPosts, maxThreads, maxTracks)
|
users, animes, posts, threads, tracks, characters := arn.Search(term, maxUsers, maxAnime, maxPosts, maxThreads, maxTracks, maxCharacters)
|
||||||
return ctx.HTML(components.SearchResults(term, users, animes, posts, threads, tracks))
|
return ctx.HTML(components.SearchResults(term, users, animes, posts, threads, tracks, characters))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
component SearchResults(term string, users []*arn.User, animes []*arn.Anime, posts []*arn.Post, threads []*arn.Thread, tracks []*arn.SoundTrack)
|
component SearchResults(term string, users []*arn.User, animes []*arn.Anime, posts []*arn.Post, threads []*arn.Thread, tracks []*arn.SoundTrack, characters []*arn.Character)
|
||||||
h1.page-title= "Search: " + term
|
h1.page-title= "Search: " + term
|
||||||
|
|
||||||
.search
|
.search
|
||||||
@ -64,4 +64,17 @@ component SearchResults(term string, users []*arn.User, animes []*arn.Anime, pos
|
|||||||
each user in users
|
each user in users
|
||||||
.mountable(data-mountable-type="user")
|
.mountable(data-mountable-type="user")
|
||||||
Avatar(user)
|
Avatar(user)
|
||||||
//- a.ajax(href=user.Link())= user.Nick
|
//- a.ajax(href=user.Link())= user.Nick
|
||||||
|
.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")
|
||||||
|
Character(character)
|
||||||
|
//- a.ajax(href=user.Link())= user.Nick
|
@ -3,6 +3,9 @@
|
|||||||
.soundtrack-search
|
.soundtrack-search
|
||||||
justify-content flex-start
|
justify-content flex-start
|
||||||
|
|
||||||
|
.character-search
|
||||||
|
horizontal-wrap
|
||||||
|
|
||||||
.anime-search-result
|
.anime-search-result
|
||||||
width 55px !important
|
width 55px !important
|
||||||
height 78px !important
|
height 78px !important
|
||||||
|
Loading…
Reference in New Issue
Block a user