Cleanup
This commit is contained in:
parent
cdec0fc9a7
commit
3fcb1bc36e
@ -7,7 +7,6 @@ import (
|
|||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
const maxPopularAnime = 10
|
const maxPopularAnime = 10
|
||||||
|
|
||||||
// Note this is using the airing-anime as a template with modfications
|
// Note this is using the airing-anime as a template with modfications
|
||||||
|
16
pages/popularanime/old/popular.pixy
Normal file
16
pages/popularanime/old/popular.pixy
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
component OldPopularAnime(popularAnime []*arn.Anime, titleCount int, animeCount int)
|
||||||
|
//- h2 Anime
|
||||||
|
|
||||||
|
//- #search-container
|
||||||
|
//- input#search(type="text", placeholder="Search...", onkeyup="$.searchAnime();", onfocus="this.select();", disabled="disabled", data-count=titleCount, data-anime-count=animeCount)
|
||||||
|
|
||||||
|
//- #search-results-container
|
||||||
|
//- #search-results
|
||||||
|
|
||||||
|
//- if popularAnime != nil
|
||||||
|
//- h3.popular-title Popular
|
||||||
|
|
||||||
|
//- .popular-anime-list
|
||||||
|
//- each anime in popularAnime
|
||||||
|
//- a.popular-anime.ajax(href="/anime/" + toString(anime.ID), title=anime.Title.Romaji + " (" + arn.Plural(anime.Watching(), "user") + " watching)")
|
||||||
|
//- img.anime-image.popular-anime-image(src=anime.Image, alt=anime.Title.Romaji)
|
19
pages/popularanime/old/popular.scarlet
Normal file
19
pages/popularanime/old/popular.scarlet
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// .popular-title
|
||||||
|
// text-align center
|
||||||
|
|
||||||
|
// .popular-anime-list
|
||||||
|
// display flex
|
||||||
|
// flex-flow row wrap
|
||||||
|
// justify-content center
|
||||||
|
|
||||||
|
// .popular-anime
|
||||||
|
// padding 0.5em
|
||||||
|
// display block
|
||||||
|
|
||||||
|
// .popular-anime-image
|
||||||
|
// width 100px !important
|
||||||
|
// height 141px !important
|
||||||
|
// border-radius 3px
|
||||||
|
// object-fit cover
|
||||||
|
// default-transition
|
||||||
|
// shadow-up
|
@ -1,6 +1,8 @@
|
|||||||
package popularanime
|
package popularanime
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/aerogo/aero"
|
"github.com/aerogo/aero"
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/animenotifier/notify.moe/components"
|
"github.com/animenotifier/notify.moe/components"
|
||||||
@ -8,29 +10,10 @@ import (
|
|||||||
|
|
||||||
// Get search page.
|
// Get search page.
|
||||||
func Get(ctx *aero.Context) string {
|
func Get(ctx *aero.Context) string {
|
||||||
// titleCount := 0
|
|
||||||
// animeCount := 0
|
|
||||||
|
|
||||||
// // let info: any = await bluebird.props({
|
|
||||||
// // popular: arn.db.get('Cache', 'popularAnime'),
|
|
||||||
// // stats: arn.db.get('Cache', 'animeStats')
|
|
||||||
// // })
|
|
||||||
|
|
||||||
// // return response.render({
|
|
||||||
// // user,
|
|
||||||
// // popularAnime: info.popular.anime,
|
|
||||||
// // animeCount: info.stats.animeCount,
|
|
||||||
// // titleCount: info.stats.titleCount,
|
|
||||||
// // anime: null
|
|
||||||
// // })
|
|
||||||
|
|
||||||
// popular, _ := arn.GetPopularCache()
|
|
||||||
|
|
||||||
// return ctx.HTML(components.Search(popular.Anime, titleCount, animeCount))
|
|
||||||
animeList, err := arn.GetPopularAnimeCached()
|
animeList, err := arn.GetPopularAnimeCached()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ctx.HTML("There was a problem listing anime!")
|
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.AnimeGrid(animeList))
|
return ctx.HTML(components.AnimeGrid(animeList))
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
component Search(popularAnime []*arn.Anime, titleCount int, animeCount int)
|
|
||||||
h2 Anime
|
|
||||||
|
|
||||||
#search-container
|
|
||||||
input#search(type="text", placeholder="Search...", onkeyup="$.searchAnime();", onfocus="this.select();", disabled="disabled", data-count=titleCount, data-anime-count=animeCount)
|
|
||||||
|
|
||||||
#search-results-container
|
|
||||||
#search-results
|
|
||||||
|
|
||||||
if popularAnime != nil
|
|
||||||
h3.popular-title Popular
|
|
||||||
|
|
||||||
.popular-anime-list
|
|
||||||
each anime in popularAnime
|
|
||||||
a.popular-anime.ajax(href="/anime/" + toString(anime.ID), title=anime.Title.Romaji + " (" + arn.Plural(anime.Watching(), "user") + " watching)")
|
|
||||||
img.anime-image.popular-anime-image(src=anime.Image, alt=anime.Title.Romaji)
|
|
@ -1,19 +0,0 @@
|
|||||||
.popular-title
|
|
||||||
text-align center
|
|
||||||
|
|
||||||
.popular-anime-list
|
|
||||||
display flex
|
|
||||||
flex-flow row wrap
|
|
||||||
justify-content center
|
|
||||||
|
|
||||||
.popular-anime
|
|
||||||
padding 0.5em
|
|
||||||
display block
|
|
||||||
|
|
||||||
.popular-anime-image
|
|
||||||
width 100px !important
|
|
||||||
height 141px !important
|
|
||||||
border-radius 3px
|
|
||||||
object-fit cover
|
|
||||||
default-transition
|
|
||||||
shadow-up
|
|
Loading…
Reference in New Issue
Block a user