diff --git a/controllers/reportsController.go b/controllers/reportsController.go index 8308ce4..8a6729b 100644 --- a/controllers/reportsController.go +++ b/controllers/reportsController.go @@ -17,12 +17,15 @@ func ReportsIndex(c *gin.Context) { return } + isAdmin := getCookie("is-admin", c) + c.HTML(http.StatusOK, "reports-index.html", gin.H{ "months": months, "days": days, "years": years, "partner_codes": partnerCodes, "isLoggedIn": loggedIn, + "isAdmin": isAdmin, }) } @@ -34,6 +37,8 @@ func ReportRange(c *gin.Context) { return } + isAdmin := getCookie("is-admin", c) + var dateRange = database.DateRange{} if err := c.Bind(&dateRange); err != nil { c.JSON(http.StatusBadRequest, err.Error()) @@ -56,6 +61,7 @@ func ReportRange(c *gin.Context) { "repository": partnerCodes[dateRange.RepositoryID], "partner_codes": partnerCodes, "isLoggedIn": loggedIn, + "isAdmin": isAdmin, }) }