Removed outdated dashboard code
This commit is contained in:
parent
86ef991d1d
commit
84f650a636
@ -1,97 +0,0 @@
|
||||
package dashboard
|
||||
|
||||
// import (
|
||||
// "net/http"
|
||||
// "sort"
|
||||
|
||||
// "github.com/aerogo/aero"
|
||||
// "github.com/aerogo/flow"
|
||||
// "github.com/animenotifier/arn"
|
||||
// "github.com/animenotifier/notify.moe/components"
|
||||
// "github.com/animenotifier/notify.moe/utils"
|
||||
// )
|
||||
|
||||
// const maxForumActivity = 5
|
||||
// const maxFollowing = 5
|
||||
// const maxSoundTracks = 5
|
||||
// const maxScheduleItems = 5
|
||||
|
||||
// // Get the dashboard.
|
||||
// func Get(ctx *aero.Context) string {
|
||||
// var forumActivity []arn.Postable
|
||||
// var followingList []*arn.User
|
||||
// var soundTracks []*arn.SoundTrack
|
||||
// var upcomingEpisodes []*arn.UpcomingEpisode
|
||||
|
||||
// user := utils.GetUser(ctx)
|
||||
|
||||
// if user == nil {
|
||||
// return ctx.Error(http.StatusUnauthorized, "Not logged in")
|
||||
// }
|
||||
|
||||
// flow.Parallel(func() {
|
||||
// posts := arn.AllPosts()
|
||||
// threads := arn.AllThreads()
|
||||
|
||||
// arn.SortPostsLatestFirst(posts)
|
||||
// arn.SortThreadsLatestFirst(threads)
|
||||
|
||||
// posts = arn.FilterPostsWithUniqueThreads(posts, maxForumActivity)
|
||||
|
||||
// postPostables := arn.ToPostables(posts)
|
||||
// threadPostables := arn.ToPostables(threads)
|
||||
|
||||
// allPostables := append(postPostables, threadPostables...)
|
||||
|
||||
// arn.SortPostablesLatestFirst(allPostables)
|
||||
// forumActivity = arn.FilterPostablesWithUniqueThreads(allPostables, maxForumActivity)
|
||||
// }, func() {
|
||||
// animeList, err := arn.GetAnimeList(user.ID)
|
||||
|
||||
// if err != nil {
|
||||
// return
|
||||
// }
|
||||
|
||||
// animeList = animeList.Watching()
|
||||
// animeList.Lock()
|
||||
|
||||
// for _, item := range animeList.Items {
|
||||
// futureEpisodes := item.Anime().UpcomingEpisodes()
|
||||
|
||||
// if len(futureEpisodes) == 0 {
|
||||
// continue
|
||||
// }
|
||||
|
||||
// upcomingEpisodes = append(upcomingEpisodes, futureEpisodes...)
|
||||
// }
|
||||
|
||||
// animeList.Unlock()
|
||||
|
||||
// sort.Slice(upcomingEpisodes, func(i, j int) bool {
|
||||
// return upcomingEpisodes[i].Episode.AiringDate.Start < upcomingEpisodes[j].Episode.AiringDate.Start
|
||||
// })
|
||||
|
||||
// if len(upcomingEpisodes) >= maxScheduleItems {
|
||||
// upcomingEpisodes = upcomingEpisodes[:maxScheduleItems]
|
||||
// }
|
||||
// }, func() {
|
||||
// soundTracks = arn.FilterSoundTracks(func(track *arn.SoundTrack) bool {
|
||||
// return !track.IsDraft && len(track.Media) > 0
|
||||
// })
|
||||
|
||||
// arn.SortSoundTracksLatestFirst(soundTracks)
|
||||
|
||||
// if len(soundTracks) > maxSoundTracks {
|
||||
// soundTracks = soundTracks[:maxSoundTracks]
|
||||
// }
|
||||
// }, func() {
|
||||
// followingList = user.Follows().Users()
|
||||
// arn.SortUsersLastSeen(followingList)
|
||||
|
||||
// if len(followingList) > maxFollowing {
|
||||
// followingList = followingList[:maxFollowing]
|
||||
// }
|
||||
// })
|
||||
|
||||
// return ctx.HTML(components.Dashboard(upcomingEpisodes, forumActivity, soundTracks, followingList, user))
|
||||
// }
|
@ -1,101 +0,0 @@
|
||||
component Dashboard(schedule []*arn.UpcomingEpisode, posts []arn.Postable, soundTracks []*arn.SoundTrack, following []*arn.User, user *arn.User)
|
||||
//- h1.page-title Dashboard
|
||||
|
||||
//- .dashboard
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title Schedule
|
||||
|
||||
//- for i := 0; i <= 4; i++
|
||||
//- if i < len(schedule)
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- a.schedule-item-link(href=schedule[i].Anime.Link())
|
||||
//- Icon("calendar-o")
|
||||
//- .schedule-item-title= schedule[i].Anime.Title.ByUser(user)
|
||||
//- .spacer
|
||||
//- .schedule-item-date.utc-airing-date(data-start-date=schedule[i].Episode.AiringDate.Start, data-end-date=schedule[i].Episode.AiringDate.End, data-episode-number=schedule[i].Episode.Number)
|
||||
//- else
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("calendar-o")
|
||||
//- span ...
|
||||
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title Forums
|
||||
|
||||
//- each post in posts
|
||||
//- a.widget-ui-element(href=post.Thread().Link())
|
||||
//- .widget-ui-element-text
|
||||
//- Icon(arn.GetForumIcon(post.Thread().Tags[0]))
|
||||
//- span= post.Thread().Title
|
||||
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title Artworks
|
||||
|
||||
//- for i := 1; i <= 5; i++
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("paint-brush")
|
||||
//- span ...
|
||||
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title Soundtracks
|
||||
|
||||
//- for i := 0; i <= 4; i++
|
||||
//- if i < len(soundTracks)
|
||||
//- a.widget-ui-element(href=soundTracks[i].Link())
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("music")
|
||||
//- if soundTracks[i].Title == ""
|
||||
//- span untitled
|
||||
//- else
|
||||
//- span= soundTracks[i].Title
|
||||
//- else
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("music")
|
||||
//- span ...
|
||||
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title AMVs
|
||||
|
||||
//- for i := 1; i <= 5; i++
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("video-camera")
|
||||
//- span ...
|
||||
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title Reviews
|
||||
|
||||
//- for i := 1; i <= 5; i++
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("book")
|
||||
//- span ...
|
||||
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title Groups
|
||||
|
||||
//- for i := 1; i <= 5; i++
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("group")
|
||||
//- span ...
|
||||
|
||||
//- .widget.mountable
|
||||
//- h3.widget-title Contacts
|
||||
|
||||
//- for i := 0; i <= 4; i++
|
||||
//- if i < len(following)
|
||||
//- a.widget-ui-element(href="/+" + following[i].Nick)
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("address-card")
|
||||
//- span= following[i].Nick
|
||||
//- else
|
||||
//- .widget-ui-element
|
||||
//- .widget-ui-element-text
|
||||
//- Icon("address-card")
|
||||
//- span ...
|
||||
|
||||
//- Footer
|
@ -1,20 +0,0 @@
|
||||
// .schedule-item-link,
|
||||
// .schedule-item-title
|
||||
// clip-long-text
|
||||
|
||||
// .schedule-item-link
|
||||
// horizontal
|
||||
// align-items center
|
||||
|
||||
// .schedule-item-date
|
||||
// text-align right
|
||||
|
||||
.footer-element
|
||||
:after
|
||||
content " | "
|
||||
color text-color
|
||||
opacity 0.5
|
||||
|
||||
:last-child
|
||||
:after
|
||||
display none
|
@ -8,4 +8,14 @@
|
||||
opacity 0 !important
|
||||
|
||||
&.mounted
|
||||
opacity 0.7 !important
|
||||
opacity 0.7 !important
|
||||
|
||||
.footer-element
|
||||
:after
|
||||
content " | "
|
||||
color text-color
|
||||
opacity 0.5
|
||||
|
||||
:last-child
|
||||
:after
|
||||
display none
|
Loading…
Reference in New Issue
Block a user