Skip to content

Commit

Permalink
Pass .Base to _dashboard_warn_collect.gohtml
Browse files Browse the repository at this point in the history
  • Loading branch information
arp242 committed Aug 19, 2024
1 parent f413299 commit 614d5af
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
zgo.at/isbot v1.0.0
zgo.at/json v0.0.0-20221020004326-fe4f75bb278e
zgo.at/termtext v1.5.0
zgo.at/tz v0.0.0-20211017223207-006eae99adf6
zgo.at/tz v0.0.0-20240819050900-3c7bf6122612
zgo.at/z18n v0.0.0-20240522230155-4d5af439f8c4
zgo.at/zcache v1.2.0
zgo.at/zcache/v2 v2.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tpl/_dashboard_toprefs.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a href="#" class="logged-in configure-widget" aria-label="{{t $.Context "button/cfg-dashboard|Configure"}}">⚙&#xfe0f;</a>
</div>

{{template "_dashboard_warn_collect.gohtml" (map "IsCollected" .IsCollected "Context" .Context)}}
{{template "_dashboard_warn_collect.gohtml" (map "IsCollected" .IsCollected "Context" .Context "Base" .Base)}}
{{if .Err}}
<em>{{t .Context "p/error|Error: %(error-message)" .Err}}</em>
{{else}}
Expand Down
4 changes: 2 additions & 2 deletions widgets/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (w Browsers) RenderHTML(ctx context.Context, shared SharedData) (string, an
TotalUTC int
Stats goatcounter.HitStats
Detail string
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Detail == "", w.loaded, w.err, isCol(ctx, goatcounter.CollectUserAgent),
z18n.T(ctx, "header/browsers|Browsers"),
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Detail == "", w.loaded, w.err,
isCol(ctx, goatcounter.CollectUserAgent), z18n.T(ctx, "header/browsers|Browsers"),
shared.TotalUTC, w.Stats, w.Detail}
}
3 changes: 2 additions & 1 deletion widgets/campaigns.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (w Campaigns) RenderHTML(ctx context.Context, shared SharedData) (string, a
TotalUTC int
Stats goatcounter.HitStats
Campaign int64
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Campaign == 0, w.loaded, w.err, isCol(ctx, goatcounter.CollectReferrer), w.Label(ctx),
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Campaign == 0, w.loaded, w.err,
isCol(ctx, goatcounter.CollectReferrer), w.Label(ctx),
shared.TotalUTC, w.Stats, w.Campaign}
}
3 changes: 2 additions & 1 deletion widgets/languages.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (w Languages) RenderHTML(ctx context.Context, shared SharedData) (string, a
Header string
TotalUTC int
Stats goatcounter.HitStats
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, false, w.loaded, w.err, isCol(ctx, goatcounter.CollectLanguage),
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, false, w.loaded, w.err,
isCol(ctx, goatcounter.CollectLanguage),
header, shared.TotalUTC, w.Stats}
}
4 changes: 2 additions & 2 deletions widgets/locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ func (w Locations) RenderHTML(ctx context.Context, shared SharedData) (string, a
TotalUTC int
Stats goatcounter.HitStats
Detail string
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Detail == "", w.loaded, w.err, isCol(ctx, goatcounter.CollectLocation),
header, shared.TotalUTC, w.Stats, w.Detail}
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Detail == "", w.loaded, w.err,
isCol(ctx, goatcounter.CollectLocation), header, shared.TotalUTC, w.Stats, w.Detail}
}
4 changes: 2 additions & 2 deletions widgets/sizes.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (w Sizes) RenderHTML(ctx context.Context, shared SharedData) (string, any)
TotalUTC int
Stats goatcounter.HitStats
Detail string
}{ctx, goatcounter.Config(ctx).BasePath, w.id, false, shared.RowsOnly, w.Detail == "", w.loaded, w.err, isCol(ctx, goatcounter.CollectScreenSize),
z18n.T(ctx, "header/sizes|Sizes"),
}{ctx, goatcounter.Config(ctx).BasePath, w.id, false, shared.RowsOnly, w.Detail == "", w.loaded, w.err,
isCol(ctx, goatcounter.CollectScreenSize), z18n.T(ctx, "header/sizes|Sizes"),
shared.TotalUTC, w.Stats, w.Detail}
}
4 changes: 2 additions & 2 deletions widgets/systems.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (w Systems) RenderHTML(ctx context.Context, shared SharedData) (string, any
TotalUTC int
Stats goatcounter.HitStats
Detail string
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Detail == "", w.loaded, w.err, isCol(ctx, goatcounter.CollectUserAgent),
z18n.T(ctx, "header/systems|Systems"),
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Detail == "", w.loaded, w.err,
isCol(ctx, goatcounter.CollectUserAgent), z18n.T(ctx, "header/systems|Systems"),
shared.TotalUTC, w.Stats, w.Detail}
}
5 changes: 3 additions & 2 deletions widgets/toprefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (w *TopRefs) GetData(ctx context.Context, a Args) (more bool, err error) {
func (w TopRefs) RenderHTML(ctx context.Context, shared SharedData) (string, any) {
return "_dashboard_toprefs.gohtml", struct {
Context context.Context
Base string
ID int
CanConfigure bool
RowsOnly bool
Expand All @@ -67,6 +68,6 @@ func (w TopRefs) RenderHTML(ctx context.Context, shared SharedData) (string, any
Total int
Stats goatcounter.HitStats
Ref string
}{ctx, w.id, true, shared.RowsOnly, w.Ref == "", w.loaded, w.err, isCol(ctx, goatcounter.CollectReferrer),
shared.Total, w.TopRefs, w.Ref}
}{ctx, goatcounter.Config(ctx).BasePath, w.id, true, shared.RowsOnly, w.Ref == "", w.loaded, w.err,
isCol(ctx, goatcounter.CollectReferrer), shared.Total, w.TopRefs, w.Ref}
}

0 comments on commit 614d5af

Please sign in to comment.