23 lines
539 B
Go
23 lines
539 B
Go
package regio43
|
|
|
|
import (
|
|
"math/rand"
|
|
"net/http"
|
|
"prettysunflower-website/baseTemplates"
|
|
)
|
|
|
|
type TrainsTemplateData struct {
|
|
PlaylistItems []PlaylistItem
|
|
}
|
|
|
|
func trains(w http.ResponseWriter, r *http.Request) {
|
|
trainsPlaylist := getPlaylistOfVideos("PLZoWUOSrw9RfbTAwQ1pTg3rZD-jZJHd9S")
|
|
rand.Shuffle(len(trainsPlaylist), func(i, j int) {
|
|
trainsPlaylist[i], trainsPlaylist[j] = trainsPlaylist[j], trainsPlaylist[i]
|
|
})
|
|
|
|
baseTemplates.WithBase(w, TrainsTemplateData{
|
|
PlaylistItems: trainsPlaylist,
|
|
}, "templates/regio43.tmpl")
|
|
}
|