Improved registrations page
This commit is contained in:
parent
802273b7c3
commit
39ef07307c
@ -23,6 +23,7 @@ func UserRegistrations(ctx *aero.Context) string {
|
|||||||
return ctx.Error(http.StatusUnauthorized, "Not authorized", nil)
|
return ctx.Error(http.StatusUnauthorized, "Not authorized", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
total := 0
|
||||||
yearInfo := map[int]utils.YearRegistrations{}
|
yearInfo := map[int]utils.YearRegistrations{}
|
||||||
years := []int{}
|
years := []int{}
|
||||||
|
|
||||||
@ -44,6 +45,8 @@ func UserRegistrations(ctx *aero.Context) string {
|
|||||||
|
|
||||||
yearRegistrations.Months[int(registered.Month())]++
|
yearRegistrations.Months[int(registered.Month())]++
|
||||||
yearInfo[year] = yearRegistrations
|
yearInfo[year] = yearRegistrations
|
||||||
|
|
||||||
|
total++
|
||||||
}
|
}
|
||||||
|
|
||||||
for year := range yearInfo {
|
for year := range yearInfo {
|
||||||
@ -52,5 +55,5 @@ func UserRegistrations(ctx *aero.Context) string {
|
|||||||
|
|
||||||
sort.Ints(years)
|
sort.Ints(years)
|
||||||
|
|
||||||
return ctx.HTML(components.UserRegistrations(years, yearInfo))
|
return ctx.HTML(components.UserRegistrations(total, years, yearInfo))
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
component UserRegistrations(years []int, yearInfo map[int]utils.YearRegistrations)
|
component UserRegistrations(total int, years []int, yearInfo map[int]utils.YearRegistrations)
|
||||||
AdminTabs
|
AdminTabs
|
||||||
h1.page-title User registrations
|
h1.mountable= fmt.Sprintf("User registrations (%d)", total)
|
||||||
|
|
||||||
for _, year := range years
|
for _, year := range years
|
||||||
h3.mountable= year
|
h3.mountable= year
|
||||||
|
Loading…
Reference in New Issue
Block a user