func render(c *gin.Context, data gin.H, templateName string) {
	// loggedInInterface, e := c.Get("isLoggedIn")
	// if e {
	// 	data["isLoggedIn"] = loggedInInterface.(bool)
	// }
	// } else {
	// 	fmt.Println("Redirecting to /log-in from render 1")
	// 	c.Redirect(http.StatusFound, "/log-in")
	// 	return
	// }
	// roleInterface, e := c.Get("role")
	// if e {
	// 	data["role"] = roleInterface.(string)
	// }
	// } else {
	// 	fmt.Println("Redirecting to /log-in from render 2")
	// 	c.Redirect(http.StatusFound, "/log-in")
	// 	return
	// }

	data["GLOBAL"] = getGobalTemplateVariables(c)

	switch c.Request.Header.Get("Accept") {
	case "application/json":
		// Respond with JSON
		c.JSON(http.StatusOK, data["payload"])
	default:
		// Respond with HTML

		c.HTML(http.StatusOK, templateName, data)
	}
}
// This method renders all templates and export the HTML to the browser the HTML
This method renders all templates and export the HTML to the browser the HTML
// This method renders all templates and export the HTML to the browser the HTML
func render(c *gin.Context, data gin.H, templateName string) {
	 else {
	 else {
	data["GLOBAL"] = getGobalTemplateVariables(c)
	switch c.Request.Header.Get("Accept") {
	case "application/json":
		c.JSON(http.StatusOK, data["payload"])
	default:
		c.HTML(http.StatusOK, templateName, data)
	}
}
func render ( c * gin . Context , data gin . H , templateName string ) { data [ " " ] = getGobalTemplateVariables ( c ) switch c . Request . Header . Get ( " " ) { case " " : c . JSON ( http . StatusOK , data [ " " ] ) default : c . HTML ( http . StatusOK , templateName , data ) } }
This method renders all templates and export the HTML to the browser the HTML
This method renders all templates and export the HTML to the browser the HTML
// loggedInInterface, e := c.Get("isLoggedIn") // if e { // 	data["isLoggedIn"] = loggedInInterface.(bool) // } // } else { // 	fmt.Println("Redirecting to /log-in from render 1") // 	c.Redirect(http.StatusFound, "/log-in") // 	return // } // roleInterface, e := c.Get("role") // if e { // 	data["role"] = roleInterface.(string) // } // } else { // 	fmt.Println("Redirecting to /log-in from render 2") // 	c.Redirect(http.StatusFound, "/log-in") // 	return // } // Respond with JSON // Respond with HTML