-
Notifications
You must be signed in to change notification settings - Fork 20
/
statistics_page.go
47 lines (43 loc) 路 1.27 KB
/
statistics_page.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package html
import (
"github.com/elliotchance/gedcom"
"github.com/elliotchance/gedcom/html/core"
"io"
)
type StatisticsPage struct {
document *gedcom.Document
googleAnalyticsID string
options PublishShowOptions
visibility LivingVisibility
}
func NewStatisticsPage(document *gedcom.Document, googleAnalyticsID string, options PublishShowOptions, visibility LivingVisibility) *StatisticsPage {
return &StatisticsPage{
document: document,
googleAnalyticsID: googleAnalyticsID,
options: options,
visibility: visibility,
}
}
func (c *StatisticsPage) WriteHTMLTo(w io.Writer) (int64, error) {
return core.NewPage(
"Statistics",
core.NewComponents(
NewPublishHeader(c.document, "", selectedStatisticsTab, c.options),
core.NewBigTitle(1, core.NewText("Statistics")),
core.NewSpace(),
core.NewRow(
core.NewColumn(core.HalfRow, core.NewComponents(
NewIndividualStatistics(c.document, c.visibility),
core.NewSpace(),
NewFamilyStatistics(c.document),
core.NewSpace(),
NewSourceStatistics(c.document),
core.NewSpace(),
newPlaceStatistics(c.document),
)),
core.NewColumn(core.HalfRow, NewEventStatistics(c.document)),
),
),
c.googleAnalyticsID,
).WriteHTMLTo(w)
}