Exemple #1
0
func Index(w http.ResponseWriter, r *http.Request) {
	server := plate.NewServer()

	photos, err := photos_help.GetAll(r)
	if err != nil {
		photos = nil
	}

	albums, err := albums_help.GetAll(r)
	if err != nil {
		albums = nil
	}

	c := appengine.NewContext(r)
	uploadURL, _ := blobstore.UploadURL(c, "/admin/photos", nil)

	mux := menuMux.New()
	mux.AdminMenu("Photos")

	t, _ := server.Template(w)
	t.Bag["MenuItems"] = mux.GetItems()
	t.Bag["Photos"] = photos
	t.Bag["Albums"] = albums
	t.Bag["UploadURL"] = uploadURL
	t.Layout = "templates/admin/layout.html"
	files := []string{"templates/admin/sidebar.html", "templates/admin/photos/index.html"}
	t.DisplayMultiple(files)

}
Exemple #2
0
func Index(w http.ResponseWriter, r *http.Request) {
	params := r.URL.Query()
	error := params.Get("error")

	server := plate.NewServer()

	albums, err := albums_help.GetAll(r)
	if err != nil {
		albums = nil
	}

	photos, err := photos_help.NoAlbum(r)

	mux := menuMux.New()
	mux.AdminMenu("Albums")

	t, _ := server.Template(w)
	t.Bag["MenuItems"] = mux.GetItems()
	t.Bag["Albums"] = albums
	t.Bag["AlbumError"] = error
	t.Bag["Photos"] = photos
	t.Layout = "templates/admin/layout.html"
	files := []string{"templates/admin/sidebar.html", "templates/admin/albums/index.html"}
	t.DisplayMultiple(files)
}
Exemple #3
0
func Index(w http.ResponseWriter, r *http.Request) {
	server := plate.NewServer()

	mux := menuMux.New()
	mux.AdminMenu("")

	tmpl, _ := server.Template(w)

	tmpl.Bag["MenuItems"] = mux.GetItems()

	tmpl.Layout = "templates/admin/layout.html"
	tmpl_arr := []string{"templates/admin/sidebar.html", "templates/admin/index.html"}
	_ = tmpl.DisplayMultiple(tmpl_arr)
}