Added new soundtrack interface
This commit is contained in:
parent
ab253000ef
commit
c32166f38c
2
main.go
2
main.go
@ -19,6 +19,7 @@ import (
|
|||||||
"github.com/animenotifier/notify.moe/pages/forums"
|
"github.com/animenotifier/notify.moe/pages/forums"
|
||||||
"github.com/animenotifier/notify.moe/pages/login"
|
"github.com/animenotifier/notify.moe/pages/login"
|
||||||
"github.com/animenotifier/notify.moe/pages/music"
|
"github.com/animenotifier/notify.moe/pages/music"
|
||||||
|
"github.com/animenotifier/notify.moe/pages/newsoundtrack"
|
||||||
"github.com/animenotifier/notify.moe/pages/newthread"
|
"github.com/animenotifier/notify.moe/pages/newthread"
|
||||||
"github.com/animenotifier/notify.moe/pages/popularanime"
|
"github.com/animenotifier/notify.moe/pages/popularanime"
|
||||||
"github.com/animenotifier/notify.moe/pages/posts"
|
"github.com/animenotifier/notify.moe/pages/posts"
|
||||||
@ -67,6 +68,7 @@ func configure(app *aero.Application) *aero.Application {
|
|||||||
app.Ajax("/user/:nick/animelist", animelist.Get)
|
app.Ajax("/user/:nick/animelist", animelist.Get)
|
||||||
app.Ajax("/user/:nick/animelist/:id", animelistitem.Get)
|
app.Ajax("/user/:nick/animelist/:id", animelistitem.Get)
|
||||||
app.Ajax("/new/thread", newthread.Get)
|
app.Ajax("/new/thread", newthread.Get)
|
||||||
|
app.Ajax("/new/soundtrack", newsoundtrack.Get)
|
||||||
app.Ajax("/settings", settings.Get)
|
app.Ajax("/settings", settings.Get)
|
||||||
app.Ajax("/music", music.Get)
|
app.Ajax("/music", music.Get)
|
||||||
app.Ajax("/admin", admin.Get)
|
app.Ajax("/admin", admin.Get)
|
||||||
|
@ -15,7 +15,7 @@ func Get(ctx *aero.Context) string {
|
|||||||
tracks := []*arn.SoundTrack{}
|
tracks := []*arn.SoundTrack{}
|
||||||
|
|
||||||
tracks = append(tracks, &arn.SoundTrack{
|
tracks = append(tracks, &arn.SoundTrack{
|
||||||
ID: "0",
|
ID: arn.GenerateID("SoundTrack"),
|
||||||
Media: []arn.ExternalMedia{
|
Media: []arn.ExternalMedia{
|
||||||
arn.ExternalMedia{
|
arn.ExternalMedia{
|
||||||
Service: "Soundcloud",
|
Service: "Soundcloud",
|
||||||
@ -30,7 +30,7 @@ func Get(ctx *aero.Context) string {
|
|||||||
})
|
})
|
||||||
|
|
||||||
tracks = append(tracks, &arn.SoundTrack{
|
tracks = append(tracks, &arn.SoundTrack{
|
||||||
ID: "1",
|
ID: arn.GenerateID("SoundTrack"),
|
||||||
Media: []arn.ExternalMedia{
|
Media: []arn.ExternalMedia{
|
||||||
arn.ExternalMedia{
|
arn.ExternalMedia{
|
||||||
Service: "Soundcloud",
|
Service: "Soundcloud",
|
||||||
@ -45,7 +45,7 @@ func Get(ctx *aero.Context) string {
|
|||||||
})
|
})
|
||||||
|
|
||||||
tracks = append(tracks, &arn.SoundTrack{
|
tracks = append(tracks, &arn.SoundTrack{
|
||||||
ID: "2",
|
ID: arn.GenerateID("SoundTrack"),
|
||||||
Media: []arn.ExternalMedia{
|
Media: []arn.ExternalMedia{
|
||||||
arn.ExternalMedia{
|
arn.ExternalMedia{
|
||||||
Service: "Soundcloud",
|
Service: "Soundcloud",
|
||||||
@ -60,7 +60,7 @@ func Get(ctx *aero.Context) string {
|
|||||||
})
|
})
|
||||||
|
|
||||||
tracks = append(tracks, &arn.SoundTrack{
|
tracks = append(tracks, &arn.SoundTrack{
|
||||||
ID: "3",
|
ID: arn.GenerateID("SoundTrack"),
|
||||||
Media: []arn.ExternalMedia{
|
Media: []arn.ExternalMedia{
|
||||||
arn.ExternalMedia{
|
arn.ExternalMedia{
|
||||||
Service: "Soundcloud",
|
Service: "Soundcloud",
|
||||||
@ -75,7 +75,7 @@ func Get(ctx *aero.Context) string {
|
|||||||
})
|
})
|
||||||
|
|
||||||
tracks = append(tracks, &arn.SoundTrack{
|
tracks = append(tracks, &arn.SoundTrack{
|
||||||
ID: "3",
|
ID: arn.GenerateID("SoundTrack"),
|
||||||
Media: []arn.ExternalMedia{
|
Media: []arn.ExternalMedia{
|
||||||
arn.ExternalMedia{
|
arn.ExternalMedia{
|
||||||
Service: "Soundcloud",
|
Service: "Soundcloud",
|
||||||
@ -90,7 +90,7 @@ func Get(ctx *aero.Context) string {
|
|||||||
})
|
})
|
||||||
|
|
||||||
tracks = append(tracks, &arn.SoundTrack{
|
tracks = append(tracks, &arn.SoundTrack{
|
||||||
ID: "3",
|
ID: arn.GenerateID("SoundTrack"),
|
||||||
Media: []arn.ExternalMedia{
|
Media: []arn.ExternalMedia{
|
||||||
arn.ExternalMedia{
|
arn.ExternalMedia{
|
||||||
Service: "Soundcloud",
|
Service: "Soundcloud",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
component Music(tracks []*arn.SoundTrack)
|
component Music(tracks []*arn.SoundTrack)
|
||||||
h2.page-title Music
|
h2 Soundtracks
|
||||||
|
|
||||||
|
.music-buttons
|
||||||
|
a.button.ajax(href="/new/soundtrack")
|
||||||
|
Icon("plus")
|
||||||
|
span Add soundtrack
|
||||||
|
|
||||||
.sound-tracks
|
.sound-tracks
|
||||||
each track in tracks
|
each track in tracks
|
||||||
|
@ -22,3 +22,8 @@
|
|||||||
|
|
||||||
.sound-track-anime-image
|
.sound-track-anime-image
|
||||||
max-width 142px
|
max-width 142px
|
||||||
|
|
||||||
|
.music-buttons
|
||||||
|
position absolute
|
||||||
|
top content-padding
|
||||||
|
right content-padding
|
20
pages/newsoundtrack/newsoundtrack.go
Normal file
20
pages/newsoundtrack/newsoundtrack.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package newsoundtrack
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/aerogo/aero"
|
||||||
|
"github.com/animenotifier/notify.moe/components"
|
||||||
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get forums page.
|
||||||
|
func Get(ctx *aero.Context) string {
|
||||||
|
user := utils.GetUser(ctx)
|
||||||
|
|
||||||
|
if user == nil {
|
||||||
|
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.HTML(components.NewSoundTrack(user))
|
||||||
|
}
|
10
pages/newsoundtrack/newsoundtrack.pixy
Normal file
10
pages/newsoundtrack/newsoundtrack.pixy
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
component NewSoundTrack(user *arn.User)
|
||||||
|
.widgets
|
||||||
|
.widget
|
||||||
|
input#soundcloud-link.widget-element(type="text", placeholder="Soundcloud link or ID")
|
||||||
|
input#anime-link.widget-element(type="text", placeholder="Anime link or ID")
|
||||||
|
input#osu-link.widget-element(type="text", placeholder="Osu beatmap link (optional)")
|
||||||
|
|
||||||
|
button.action(data-action="createSoundTrack", data-trigger="click")
|
||||||
|
Icon("check")
|
||||||
|
span Add soundtrack
|
Loading…
Reference in New Issue
Block a user