Just a simple site to publish surveys. Nothing fancy, mostly done because I need it.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package features_survey
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
|
// . "MY/webapp/common"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func GetPageIndex(c *fiber.Ctx) error {
|
|
|
|
|
return c.Render("survey/index", fiber.Map{
|
|
|
|
|
"Survey": QueryData(),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetPageSubmit(c *fiber.Ctx) error {
|
|
|
|
|
return c.Render("survey/submit", fiber.Map{
|
|
|
|
|
"Survey": QueryData(),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetPageFinalize(c *fiber.Ctx) error {
|
|
|
|
|
return c.Render("survey/finalize", fiber.Map{})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetPageResults(c *fiber.Ctx) error {
|
|
|
|
|
return c.Render("survey/results", fiber.Map{
|
|
|
|
|
"Survey": QueryData(),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func SetupViews(app *fiber.App) {
|
|
|
|
|
app.Get("/survey/", GetPageIndex)
|
|
|
|
|
app.Get("/survey/submit", GetPageSubmit)
|
|
|
|
|
app.Get("/survey/finalize", GetPageFinalize)
|
|
|
|
|
app.Get("/survey/results", GetPageResults)
|
|
|
|
|
}
|