fix(systemviews): simplify history header layout
- commit
- 4e23726143761692a1941f4a8ca047adb6b12bda
- author
- brice · · 2026-04-26 07:07 UTC
- parent
- d685499
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
7 files · +287 -478
M assets/systemviews/systemviews.css +41 -43
| @@ -240,29 +240,6 @@ body { | |||
| 240 | 240 | } | |
| 241 | 241 | } | |
| 242 | 242 | ||
| 243 | - | .sv-history-overview { | |
| 244 | - | display: grid; | |
| 245 | - | gap: 1rem; | |
| 246 | - | align-items: start; | |
| 247 | - | } | |
| 248 | - | ||
| 249 | - | .sv-history-overview > .sv-section { | |
| 250 | - | min-width: 0; | |
| 251 | - | height: 100%; | |
| 252 | - | } | |
| 253 | - | ||
| 254 | - | @media (min-width: 720px) { | |
| 255 | - | .sv-history-overview { | |
| 256 | - | grid-template-columns: minmax(12rem, 3.8fr) minmax(0, 6.2fr); | |
| 257 | - | } | |
| 258 | - | } | |
| 259 | - | ||
| 260 | - | @media (min-width: 900px) { | |
| 261 | - | .sv-history-overview { | |
| 262 | - | grid-template-columns: minmax(13rem, 3fr) minmax(0, 7fr); | |
| 263 | - | } | |
| 264 | - | } | |
| 265 | - | ||
| 266 | 243 | .sv-stat-grid { | |
| 267 | 244 | display: grid; | |
| 268 | 245 | grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); | |
| @@ -270,12 +247,6 @@ body { | |||
| 270 | 247 | margin-top: 0.75rem; | |
| 271 | 248 | } | |
| 272 | 249 | ||
| 273 | - | .sv-history-overview .sv-stat-grid { | |
| 274 | - | grid-template-columns: 1fr; | |
| 275 | - | gap: 0.55rem; | |
| 276 | - | margin-top: 0.5rem; | |
| 277 | - | } | |
| 278 | - | ||
| 279 | 250 | .sv-stat-card { | |
| 280 | 251 | display: grid; | |
| 281 | 252 | gap: 0.15rem; | |
| @@ -285,10 +256,6 @@ body { | |||
| 285 | 256 | background: var(--sv-surface-variant, #1d2129); | |
| 286 | 257 | } | |
| 287 | 258 | ||
| 288 | - | .sv-history-overview .sv-stat-card { | |
| 289 | - | padding: 0.65rem 0.75rem; | |
| 290 | - | } | |
| 291 | - | ||
| 292 | 259 | .sv-stat-value { | |
| 293 | 260 | color: var(--sv-accent, #8ab4ff); | |
| 294 | 261 | font-size: 1.35rem; | |
| @@ -307,28 +274,36 @@ body { | |||
| 307 | 274 | .sv-domain-list { | |
| 308 | 275 | display: flex; | |
| 309 | 276 | flex-wrap: wrap; | |
| 310 | - | gap: 0.5rem; | |
| 311 | - | margin-top: 0.75rem; | |
| 277 | + | gap: 0.35rem; | |
| 278 | + | max-height: 4rem; | |
| 279 | + | margin-top: 0.5rem; | |
| 280 | + | overflow: hidden; | |
| 312 | 281 | } | |
| 313 | 282 | ||
| 314 | 283 | .sv-domain-chip { | |
| 315 | - | display: grid; | |
| 316 | - | grid-template-columns: minmax(0, 1fr) auto; | |
| 317 | - | gap: 0.5rem; | |
| 318 | - | align-items: start; | |
| 319 | - | min-width: 10.5rem; | |
| 320 | - | padding: 0.55rem 0.65rem; | |
| 284 | + | display: inline-flex; | |
| 285 | + | gap: 0.35rem; | |
| 286 | + | align-items: center; | |
| 287 | + | max-width: 13rem; | |
| 288 | + | min-width: 0; | |
| 289 | + | padding: 0.25rem 0.35rem 0.25rem 0.5rem; | |
| 321 | 290 | border: 1px solid var(--sv-border, #2a313d); | |
| 322 | 291 | border-radius: var(--sv-radius-chip, 0.45rem); | |
| 323 | 292 | background: var(--sv-surface-variant, #1d2129); | |
| 324 | 293 | } | |
| 325 | 294 | ||
| 326 | 295 | .sv-domain-chip-main { | |
| 327 | - | display: grid; | |
| 328 | - | gap: 0.15rem; | |
| 296 | + | display: inline-flex; | |
| 297 | + | gap: 0.3rem; | |
| 298 | + | align-items: baseline; | |
| 329 | 299 | min-width: 0; | |
| 330 | 300 | } | |
| 331 | 301 | ||
| 302 | + | .sv-domain-meta { | |
| 303 | + | flex: 0 0 auto; | |
| 304 | + | white-space: nowrap; | |
| 305 | + | } | |
| 306 | + | ||
| 332 | 307 | .sv-domain-meta, | |
| 333 | 308 | .sv-history-meta, | |
| 334 | 309 | .sv-history-url { | |
| @@ -619,6 +594,7 @@ body { | |||
| 619 | 594 | ||
| 620 | 595 | .sv-filter-chip button, | |
| 621 | 596 | .sv-domain-filter, | |
| 597 | + | .sv-domain-delete, | |
| 622 | 598 | .sv-icon-button { | |
| 623 | 599 | border: 0; | |
| 624 | 600 | background: transparent; | |
| @@ -628,10 +604,32 @@ body { | |||
| 628 | 604 | } | |
| 629 | 605 | ||
| 630 | 606 | .sv-domain-filter { | |
| 607 | + | min-width: 0; | |
| 608 | + | overflow: hidden; | |
| 631 | 609 | color: var(--sv-text, #e8ebf0); | |
| 632 | 610 | font-weight: 700; | |
| 633 | 611 | padding: 0; | |
| 634 | 612 | text-align: left; | |
| 613 | + | text-overflow: ellipsis; | |
| 614 | + | white-space: nowrap; | |
| 615 | + | } | |
| 616 | + | ||
| 617 | + | .sv-domain-delete { | |
| 618 | + | display: inline-grid; | |
| 619 | + | place-items: center; | |
| 620 | + | flex: 0 0 auto; | |
| 621 | + | width: 1rem; | |
| 622 | + | height: 1rem; | |
| 623 | + | padding: 0; | |
| 624 | + | border-radius: 999px; | |
| 625 | + | color: var(--sv-danger-text, #fecaca); | |
| 626 | + | font-size: 0.85rem; | |
| 627 | + | font-weight: 700; | |
| 628 | + | line-height: 1; | |
| 629 | + | } | |
| 630 | + | ||
| 631 | + | .sv-domain-delete:hover { | |
| 632 | + | background: color-mix(in srgb, var(--sv-danger, #ef4444) 18%, transparent); | |
| 635 | 633 | } | |
| 636 | 634 | ||
| 637 | 635 | .sv-icon-button { | |
| @@ -240,29 +240,6 @@ body { | |||||
| 240 | } | 240 | } | ||
| 241 | } | 241 | } | ||
| 242 | 242 | ||||
| 243 | - | .sv-history-overview { | |||
| 244 | - | display: grid; | |||
| 245 | - | gap: 1rem; | |||
| 246 | - | align-items: start; | |||
| 247 | - | } | |||
| 248 | - | ||||
| 249 | - | .sv-history-overview > .sv-section { | |||
| 250 | - | min-width: 0; | |||
| 251 | - | height: 100%; | |||
| 252 | - | } | |||
| 253 | - | ||||
| 254 | - | @media (min-width: 720px) { | |||
| 255 | - | .sv-history-overview { | |||
| 256 | - | grid-template-columns: minmax(12rem, 3.8fr) minmax(0, 6.2fr); | |||
| 257 | - | } | |||
| 258 | - | } | |||
| 259 | - | ||||
| 260 | - | @media (min-width: 900px) { | |||
| 261 | - | .sv-history-overview { | |||
| 262 | - | grid-template-columns: minmax(13rem, 3fr) minmax(0, 7fr); | |||
| 263 | - | } | |||
| 264 | - | } | |||
| 265 | - | ||||
| 266 | .sv-stat-grid { | 243 | .sv-stat-grid { | ||
| 267 | display: grid; | 244 | display: grid; | ||
| 268 | grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); | 245 | grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); | ||
| @@ -270,12 +247,6 @@ body { | |||||
| 270 | margin-top: 0.75rem; | 247 | margin-top: 0.75rem; | ||
| 271 | } | 248 | } | ||
| 272 | 249 | ||||
| 273 | - | .sv-history-overview .sv-stat-grid { | |||
| 274 | - | grid-template-columns: 1fr; | |||
| 275 | - | gap: 0.55rem; | |||
| 276 | - | margin-top: 0.5rem; | |||
| 277 | - | } | |||
| 278 | - | ||||
| 279 | .sv-stat-card { | 250 | .sv-stat-card { | ||
| 280 | display: grid; | 251 | display: grid; | ||
| 281 | gap: 0.15rem; | 252 | gap: 0.15rem; | ||
| @@ -285,10 +256,6 @@ body { | |||||
| 285 | background: var(--sv-surface-variant, #1d2129); | 256 | background: var(--sv-surface-variant, #1d2129); | ||
| 286 | } | 257 | } | ||
| 287 | 258 | ||||
| 288 | - | .sv-history-overview .sv-stat-card { | |||
| 289 | - | padding: 0.65rem 0.75rem; | |||
| 290 | - | } | |||
| 291 | - | ||||
| 292 | .sv-stat-value { | 259 | .sv-stat-value { | ||
| 293 | color: var(--sv-accent, #8ab4ff); | 260 | color: var(--sv-accent, #8ab4ff); | ||
| 294 | font-size: 1.35rem; | 261 | font-size: 1.35rem; | ||
| @@ -307,28 +274,36 @@ body { | |||||
| 307 | .sv-domain-list { | 274 | .sv-domain-list { | ||
| 308 | display: flex; | 275 | display: flex; | ||
| 309 | flex-wrap: wrap; | 276 | flex-wrap: wrap; | ||
| 310 | - | gap: 0.5rem; | 277 | + | gap: 0.35rem; |
| 311 | - | margin-top: 0.75rem; | 278 | + | max-height: 4rem; |
| 279 | + | margin-top: 0.5rem; | |||
| 280 | + | overflow: hidden; | |||
| 312 | } | 281 | } | ||
| 313 | 282 | ||||
| 314 | .sv-domain-chip { | 283 | .sv-domain-chip { | ||
| 315 | - | display: grid; | 284 | + | display: inline-flex; |
| 316 | - | grid-template-columns: minmax(0, 1fr) auto; | 285 | + | gap: 0.35rem; |
| 317 | - | gap: 0.5rem; | 286 | + | align-items: center; |
| 318 | - | align-items: start; | 287 | + | max-width: 13rem; |
| 319 | - | min-width: 10.5rem; | 288 | + | min-width: 0; |
| 320 | - | padding: 0.55rem 0.65rem; | 289 | + | padding: 0.25rem 0.35rem 0.25rem 0.5rem; |
| 321 | border: 1px solid var(--sv-border, #2a313d); | 290 | border: 1px solid var(--sv-border, #2a313d); | ||
| 322 | border-radius: var(--sv-radius-chip, 0.45rem); | 291 | border-radius: var(--sv-radius-chip, 0.45rem); | ||
| 323 | background: var(--sv-surface-variant, #1d2129); | 292 | background: var(--sv-surface-variant, #1d2129); | ||
| 324 | } | 293 | } | ||
| 325 | 294 | ||||
| 326 | .sv-domain-chip-main { | 295 | .sv-domain-chip-main { | ||
| 327 | - | display: grid; | 296 | + | display: inline-flex; |
| 328 | - | gap: 0.15rem; | 297 | + | gap: 0.3rem; |
| 298 | + | align-items: baseline; | |||
| 329 | min-width: 0; | 299 | min-width: 0; | ||
| 330 | } | 300 | } | ||
| 331 | 301 | ||||
| 302 | + | .sv-domain-meta { | |||
| 303 | + | flex: 0 0 auto; | |||
| 304 | + | white-space: nowrap; | |||
| 305 | + | } | |||
| 306 | + | ||||
| 332 | .sv-domain-meta, | 307 | .sv-domain-meta, | ||
| 333 | .sv-history-meta, | 308 | .sv-history-meta, | ||
| 334 | .sv-history-url { | 309 | .sv-history-url { | ||
| @@ -619,6 +594,7 @@ body { | |||||
| 619 | 594 | ||||
| 620 | .sv-filter-chip button, | 595 | .sv-filter-chip button, | ||
| 621 | .sv-domain-filter, | 596 | .sv-domain-filter, | ||
| 597 | + | .sv-domain-delete, | |||
| 622 | .sv-icon-button { | 598 | .sv-icon-button { | ||
| 623 | border: 0; | 599 | border: 0; | ||
| 624 | background: transparent; | 600 | background: transparent; | ||
| @@ -628,10 +604,32 @@ body { | |||||
| 628 | } | 604 | } | ||
| 629 | 605 | ||||
| 630 | .sv-domain-filter { | 606 | .sv-domain-filter { | ||
| 607 | + | min-width: 0; | |||
| 608 | + | overflow: hidden; | |||
| 631 | color: var(--sv-text, #e8ebf0); | 609 | color: var(--sv-text, #e8ebf0); | ||
| 632 | font-weight: 700; | 610 | font-weight: 700; | ||
| 633 | padding: 0; | 611 | padding: 0; | ||
| 634 | text-align: left; | 612 | text-align: left; | ||
| 613 | + | text-overflow: ellipsis; | |||
| 614 | + | white-space: nowrap; | |||
| 615 | + | } | |||
| 616 | + | ||||
| 617 | + | .sv-domain-delete { | |||
| 618 | + | display: inline-grid; | |||
| 619 | + | place-items: center; | |||
| 620 | + | flex: 0 0 auto; | |||
| 621 | + | width: 1rem; | |||
| 622 | + | height: 1rem; | |||
| 623 | + | padding: 0; | |||
| 624 | + | border-radius: 999px; | |||
| 625 | + | color: var(--sv-danger-text, #fecaca); | |||
| 626 | + | font-size: 0.85rem; | |||
| 627 | + | font-weight: 700; | |||
| 628 | + | line-height: 1; | |||
| 629 | + | } | |||
| 630 | + | ||||
| 631 | + | .sv-domain-delete:hover { | |||
| 632 | + | background: color-mix(in srgb, var(--sv-danger, #ef4444) 18%, transparent); | |||
| 635 | } | 633 | } | ||
| 636 | 634 | ||||
| 637 | .sv-icon-button { | 635 | .sv-icon-button { | ||
M internal/ui/systemviews/app.go +8 -6
| @@ -513,10 +513,11 @@ func (a *App) loadHistoryLoadingRoute() { | |||
| 513 | 513 | Error: a.historyError, | |
| 514 | 514 | Loading: true, | |
| 515 | 515 | } | |
| 516 | + | title := historyDocumentTitle(data) | |
| 516 | 517 | a.renderedHTML = renderAppFrame(renderedPage{ | |
| 517 | 518 | route: RouteHistory, | |
| 518 | - | title: "History — Loading", | |
| 519 | - | subtitle: "Recent visits", | |
| 519 | + | title: title, | |
| 520 | + | subtitle: title, | |
| 520 | 521 | body: historyHTML(data), | |
| 521 | 522 | }, a.shellTheme) | |
| 522 | 523 | } | |
| @@ -527,7 +528,7 @@ func (a *App) loadHistoryRoute(ctx context.Context) error { | |||
| 527 | 528 | a.renderedHTML = renderAppFrame(renderedPage{ | |
| 528 | 529 | route: a.currentRoute, | |
| 529 | 530 | title: routeDocumentTitle(RouteHistory), | |
| 530 | - | subtitle: "Recent visits", | |
| 531 | + | subtitle: routeDocumentTitle(RouteHistory), | |
| 531 | 532 | body: placeholderHTML(a.currentRoute), | |
| 532 | 533 | }, a.shellTheme) | |
| 533 | 534 | return nil | |
| @@ -585,7 +586,7 @@ func (a *App) renderHistoryRouteSnapshot(ctx context.Context, snapshot historyRo | |||
| 585 | 586 | html: renderAppFrame(renderedPage{ | |
| 586 | 587 | route: snapshot.route, | |
| 587 | 588 | title: routeDocumentTitle(RouteHistory), | |
| 588 | - | subtitle: "Recent visits", | |
| 589 | + | subtitle: routeDocumentTitle(RouteHistory), | |
| 589 | 590 | body: placeholderHTML(snapshot.route), | |
| 590 | 591 | }, snapshot.shellTheme), | |
| 591 | 592 | }, nil | |
| @@ -630,10 +631,11 @@ func (a *App) renderHistoryRouteSnapshot(ctx context.Context, snapshot historyRo | |||
| 630 | 631 | Notice: snapshot.notice, | |
| 631 | 632 | Error: snapshot.error, | |
| 632 | 633 | } | |
| 634 | + | title := historyDocumentTitle(data) | |
| 633 | 635 | result.html = renderAppFrame(renderedPage{ | |
| 634 | 636 | route: RouteHistory, | |
| 635 | - | title: historyDocumentTitle(data), | |
| 636 | - | subtitle: "Recent visits", | |
| 637 | + | title: title, | |
| 638 | + | subtitle: title, | |
| 637 | 639 | body: historyHTML(data), | |
| 638 | 640 | }, snapshot.shellTheme) | |
| 639 | 641 | return result, nil | |
| @@ -513,10 +513,11 @@ func (a *App) loadHistoryLoadingRoute() { | |||||
| 513 | Error: a.historyError, | 513 | Error: a.historyError, | ||
| 514 | Loading: true, | 514 | Loading: true, | ||
| 515 | } | 515 | } | ||
| 516 | + | title := historyDocumentTitle(data) | |||
| 516 | a.renderedHTML = renderAppFrame(renderedPage{ | 517 | a.renderedHTML = renderAppFrame(renderedPage{ | ||
| 517 | route: RouteHistory, | 518 | route: RouteHistory, | ||
| 518 | - | title: "History — Loading", | 519 | + | title: title, |
| 519 | - | subtitle: "Recent visits", | 520 | + | subtitle: title, |
| 520 | body: historyHTML(data), | 521 | body: historyHTML(data), | ||
| 521 | }, a.shellTheme) | 522 | }, a.shellTheme) | ||
| 522 | } | 523 | } | ||
| @@ -527,7 +528,7 @@ func (a *App) loadHistoryRoute(ctx context.Context) error { | |||||
| 527 | a.renderedHTML = renderAppFrame(renderedPage{ | 528 | a.renderedHTML = renderAppFrame(renderedPage{ | ||
| 528 | route: a.currentRoute, | 529 | route: a.currentRoute, | ||
| 529 | title: routeDocumentTitle(RouteHistory), | 530 | title: routeDocumentTitle(RouteHistory), | ||
| 530 | - | subtitle: "Recent visits", | 531 | + | subtitle: routeDocumentTitle(RouteHistory), |
| 531 | body: placeholderHTML(a.currentRoute), | 532 | body: placeholderHTML(a.currentRoute), | ||
| 532 | }, a.shellTheme) | 533 | }, a.shellTheme) | ||
| 533 | return nil | 534 | return nil | ||
| @@ -585,7 +586,7 @@ func (a *App) renderHistoryRouteSnapshot(ctx context.Context, snapshot historyRo | |||||
| 585 | html: renderAppFrame(renderedPage{ | 586 | html: renderAppFrame(renderedPage{ | ||
| 586 | route: snapshot.route, | 587 | route: snapshot.route, | ||
| 587 | title: routeDocumentTitle(RouteHistory), | 588 | title: routeDocumentTitle(RouteHistory), | ||
| 588 | - | subtitle: "Recent visits", | 589 | + | subtitle: routeDocumentTitle(RouteHistory), |
| 589 | body: placeholderHTML(snapshot.route), | 590 | body: placeholderHTML(snapshot.route), | ||
| 590 | }, snapshot.shellTheme), | 591 | }, snapshot.shellTheme), | ||
| 591 | }, nil | 592 | }, nil | ||
| @@ -630,10 +631,11 @@ func (a *App) renderHistoryRouteSnapshot(ctx context.Context, snapshot historyRo | |||||
| 630 | Notice: snapshot.notice, | 631 | Notice: snapshot.notice, | ||
| 631 | Error: snapshot.error, | 632 | Error: snapshot.error, | ||
| 632 | } | 633 | } | ||
| 634 | + | title := historyDocumentTitle(data) | |||
| 633 | result.html = renderAppFrame(renderedPage{ | 635 | result.html = renderAppFrame(renderedPage{ | ||
| 634 | route: RouteHistory, | 636 | route: RouteHistory, | ||
| 635 | - | title: historyDocumentTitle(data), | 637 | + | title: title, |
| 636 | - | subtitle: "Recent visits", | 638 | + | subtitle: title, |
| 637 | body: historyHTML(data), | 639 | body: historyHTML(data), | ||
| 638 | }, snapshot.shellTheme) | 640 | }, snapshot.shellTheme) | ||
| 639 | return result, nil | 641 | return result, nil | ||
M internal/ui/systemviews/app_test.go +5 -5
| @@ -90,7 +90,7 @@ func TestAppLoadInitialHistoryRouteUsesStyledSections(t *testing.T) { | |||
| 90 | 90 | assert.NotContains(t, app.renderedHTML, "<body") | |
| 91 | 91 | assert.Contains(t, app.renderedHTML, `class="sv-shell"`) | |
| 92 | 92 | assert.Contains(t, app.renderedHTML, `data-route="history"`) | |
| 93 | - | assert.Contains(t, app.renderedHTML, `data-page-title="History — 1 entry"`) | |
| 93 | + | assert.Contains(t, app.renderedHTML, `data-page-title="History - 1 entry, 1 visit, 0 days"`) | |
| 94 | 94 | assert.Contains(t, app.renderedHTML, `sv-section`) | |
| 95 | 95 | assert.Contains(t, app.renderedHTML, `class="sv-list"`) | |
| 96 | 96 | } | |
| @@ -110,10 +110,10 @@ func TestAppLoadInitialHistoryRouteShowsTotalStatsWithWindowedTimeline(t *testin | |||
| 110 | 110 | require.NoError(t, app.LoadInitial(context.Background())) | |
| 111 | 111 | assert.True(t, history.statsCalled) | |
| 112 | 112 | assert.Contains(t, app.renderedHTML, "Loaded 2 items") | |
| 113 | - | assert.Contains(t, app.renderedHTML, `data-page-title="History — 8904 entries"`) | |
| 114 | - | assert.Contains(t, app.renderedHTML, `<span class="sv-stat-value">8904</span><span class="sv-stat-label">Entries</span>`) | |
| 115 | - | assert.Contains(t, app.renderedHTML, `<span class="sv-stat-value">40947</span><span class="sv-stat-label">Visits</span>`) | |
| 116 | - | assert.Contains(t, app.renderedHTML, `<span class="sv-stat-value">121</span><span class="sv-stat-label">Days</span>`) | |
| 113 | + | assert.Contains(t, app.renderedHTML, `data-page-title="History - 8904 entries, 40947 visits, 121 days"`) | |
| 114 | + | assert.Contains(t, app.renderedHTML, `<h1 class="sv-title">History - 8904 entries, 40947 visits, 121 days</h1>`) | |
| 115 | + | assert.NotContains(t, app.renderedHTML, `sv-history-summary`) | |
| 116 | + | assert.NotContains(t, app.renderedHTML, `sv-stat-value`) | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | 119 | func TestAppRunMountsHistoryLoadingBeforeAsyncHydration(t *testing.T) { | |
| @@ -90,7 +90,7 @@ func TestAppLoadInitialHistoryRouteUsesStyledSections(t *testing.T) { | |||||
| 90 | assert.NotContains(t, app.renderedHTML, "<body") | 90 | assert.NotContains(t, app.renderedHTML, "<body") | ||
| 91 | assert.Contains(t, app.renderedHTML, `class="sv-shell"`) | 91 | assert.Contains(t, app.renderedHTML, `class="sv-shell"`) | ||
| 92 | assert.Contains(t, app.renderedHTML, `data-route="history"`) | 92 | assert.Contains(t, app.renderedHTML, `data-route="history"`) | ||
| 93 | - | assert.Contains(t, app.renderedHTML, `data-page-title="History — 1 entry"`) | 93 | + | assert.Contains(t, app.renderedHTML, `data-page-title="History - 1 entry, 1 visit, 0 days"`) |
| 94 | assert.Contains(t, app.renderedHTML, `sv-section`) | 94 | assert.Contains(t, app.renderedHTML, `sv-section`) | ||
| 95 | assert.Contains(t, app.renderedHTML, `class="sv-list"`) | 95 | assert.Contains(t, app.renderedHTML, `class="sv-list"`) | ||
| 96 | } | 96 | } | ||
| @@ -110,10 +110,10 @@ func TestAppLoadInitialHistoryRouteShowsTotalStatsWithWindowedTimeline(t *testin | |||||
| 110 | require.NoError(t, app.LoadInitial(context.Background())) | 110 | require.NoError(t, app.LoadInitial(context.Background())) | ||
| 111 | assert.True(t, history.statsCalled) | 111 | assert.True(t, history.statsCalled) | ||
| 112 | assert.Contains(t, app.renderedHTML, "Loaded 2 items") | 112 | assert.Contains(t, app.renderedHTML, "Loaded 2 items") | ||
| 113 | - | assert.Contains(t, app.renderedHTML, `data-page-title="History — 8904 entries"`) | 113 | + | assert.Contains(t, app.renderedHTML, `data-page-title="History - 8904 entries, 40947 visits, 121 days"`) |
| 114 | - | assert.Contains(t, app.renderedHTML, `<span class="sv-stat-value">8904</span><span class="sv-stat-label">Entries</span>`) | 114 | + | assert.Contains(t, app.renderedHTML, `<h1 class="sv-title">History - 8904 entries, 40947 visits, 121 days</h1>`) |
| 115 | - | assert.Contains(t, app.renderedHTML, `<span class="sv-stat-value">40947</span><span class="sv-stat-label">Visits</span>`) | 115 | + | assert.NotContains(t, app.renderedHTML, `sv-history-summary`) |
| 116 | - | assert.Contains(t, app.renderedHTML, `<span class="sv-stat-value">121</span><span class="sv-stat-label">Days</span>`) | 116 | + | assert.NotContains(t, app.renderedHTML, `sv-stat-value`) |
| 117 | } | 117 | } | ||
| 118 | 118 | ||||
| 119 | func TestAppRunMountsHistoryLoadingBeforeAsyncHydration(t *testing.T) { | 119 | func TestAppRunMountsHistoryLoadingBeforeAsyncHydration(t *testing.T) { | ||
M internal/ui/systemviews/history.templ +5 -32
| @@ -12,14 +12,9 @@ templ HistoryView(data historyRenderData) { | |||
| 12 | 12 | @Section("sv-history-controls", "Manage history") { | |
| 13 | 13 | @HistoryControls(data) | |
| 14 | 14 | } | |
| 15 | - | <div class="sv-history-overview"> | |
| 16 | - | @Section("sv-history-summary", "History stats") { | |
| 17 | - | @HistorySummary(data) | |
| 18 | - | } | |
| 19 | - | @Section("sv-history-domains", "Top domains") { | |
| 20 | - | @HistoryDomains(data) | |
| 21 | - | } | |
| 22 | - | </div> | |
| 15 | + | @Section("sv-history-domains", "Top domains") { | |
| 16 | + | @HistoryDomains(data) | |
| 17 | + | } | |
| 23 | 18 | @Section("sv-history-timeline", "Recent visits") { | |
| 24 | 19 | @HistoryTimeline(data) | |
| 25 | 20 | } | |
| @@ -57,28 +52,6 @@ templ HistoryControls(data historyRenderData) { | |||
| 57 | 52 | </div> | |
| 58 | 53 | } | |
| 59 | 54 | ||
| 60 | - | templ HistorySummary(data historyRenderData) { | |
| 61 | - | if historySummaryLoading(data) { | |
| 62 | - | <div class="sv-stat-grid"> | |
| 63 | - | @LoadingCard("Entries") | |
| 64 | - | @LoadingCard("Visits") | |
| 65 | - | @LoadingCard("Days") | |
| 66 | - | </div> | |
| 67 | - | } else { | |
| 68 | - | {{ entries, visits, days := historySummaryValues(data) }} | |
| 69 | - | <div class="sv-stat-grid"> | |
| 70 | - | @HistoryStatCard("Entries", entries) | |
| 71 | - | @HistoryStatCard("Visits", visits) | |
| 72 | - | @HistoryStatCard("Days", days) | |
| 73 | - | </div> | |
| 74 | - | } | |
| 75 | - | } | |
| 76 | - | ||
| 77 | - | ||
| 78 | - | templ HistoryStatCard(label string, value int64) { | |
| 79 | - | <div class="sv-stat-card"><span class="sv-stat-value">{ fmt.Sprintf("%d", value) }</span><span class="sv-stat-label">{ label }</span></div> | |
| 80 | - | } | |
| 81 | - | ||
| 82 | 55 | templ HistoryDomains(data historyRenderData) { | |
| 83 | 56 | if data.Loading { | |
| 84 | 57 | @LoadingPanel("Loading top domains…") | |
| @@ -93,9 +66,9 @@ templ HistoryDomains(data historyRenderData) { | |||
| 93 | 66 | <span class="sv-domain-chip"> | |
| 94 | 67 | <span class="sv-domain-chip-main"> | |
| 95 | 68 | <button type="button" class="sv-domain-filter" data-sv-action="history.filterDomain" data-domain={ domainKey }>{ displayDomain }</button> | |
| 96 | - | <span class="sv-domain-meta">{ fmt.Sprintf("%d pages · %d visits", domain.PageCount, domain.TotalVisits) }</span> | |
| 69 | + | <span class="sv-domain-meta">{ fmt.Sprintf("%dp · %dv", domain.PageCount, domain.TotalVisits) }</span> | |
| 97 | 70 | </span> | |
| 98 | - | <button type="button" class="sv-icon-button sv-danger" data-sv-action="history.deleteDomain" data-domain={ domainKey } data-sv-confirm={ "Delete all history for " + displayDomain + "?" } aria-label={ "Delete history for " + displayDomain }>@IconOnly(iconTrash, "Delete history for " + displayDomain)</button> | |
| 71 | + | <button type="button" class="sv-domain-delete" data-sv-action="history.deleteDomain" data-domain={ domainKey } data-sv-confirm={ "Delete all history for " + displayDomain + "?" } aria-label={ "Delete history for " + displayDomain }><span aria-hidden="true">×</span><span class="sv-sr-only">Delete history for { displayDomain }</span></button> | |
| 99 | 72 | </span> | |
| 100 | 73 | } | |
| 101 | 74 | } | |
| @@ -12,14 +12,9 @@ templ HistoryView(data historyRenderData) { | |||||
| 12 | @Section("sv-history-controls", "Manage history") { | 12 | @Section("sv-history-controls", "Manage history") { | ||
| 13 | @HistoryControls(data) | 13 | @HistoryControls(data) | ||
| 14 | } | 14 | } | ||
| 15 | - | <div class="sv-history-overview"> | 15 | + | @Section("sv-history-domains", "Top domains") { |
| 16 | - | @Section("sv-history-summary", "History stats") { | 16 | + | @HistoryDomains(data) |
| 17 | - | @HistorySummary(data) | 17 | + | } |
| 18 | - | } | |||
| 19 | - | @Section("sv-history-domains", "Top domains") { | |||
| 20 | - | @HistoryDomains(data) | |||
| 21 | - | } | |||
| 22 | - | </div> | |||
| 23 | @Section("sv-history-timeline", "Recent visits") { | 18 | @Section("sv-history-timeline", "Recent visits") { | ||
| 24 | @HistoryTimeline(data) | 19 | @HistoryTimeline(data) | ||
| 25 | } | 20 | } | ||
| @@ -57,28 +52,6 @@ templ HistoryControls(data historyRenderData) { | |||||
| 57 | </div> | 52 | </div> | ||
| 58 | } | 53 | } | ||
| 59 | 54 | ||||
| 60 | - | templ HistorySummary(data historyRenderData) { | |||
| 61 | - | if historySummaryLoading(data) { | |||
| 62 | - | <div class="sv-stat-grid"> | |||
| 63 | - | @LoadingCard("Entries") | |||
| 64 | - | @LoadingCard("Visits") | |||
| 65 | - | @LoadingCard("Days") | |||
| 66 | - | </div> | |||
| 67 | - | } else { | |||
| 68 | - | {{ entries, visits, days := historySummaryValues(data) }} | |||
| 69 | - | <div class="sv-stat-grid"> | |||
| 70 | - | @HistoryStatCard("Entries", entries) | |||
| 71 | - | @HistoryStatCard("Visits", visits) | |||
| 72 | - | @HistoryStatCard("Days", days) | |||
| 73 | - | </div> | |||
| 74 | - | } | |||
| 75 | - | } | |||
| 76 | - | ||||
| 77 | - | ||||
| 78 | - | templ HistoryStatCard(label string, value int64) { | |||
| 79 | - | <div class="sv-stat-card"><span class="sv-stat-value">{ fmt.Sprintf("%d", value) }</span><span class="sv-stat-label">{ label }</span></div> | |||
| 80 | - | } | |||
| 81 | - | ||||
| 82 | templ HistoryDomains(data historyRenderData) { | 55 | templ HistoryDomains(data historyRenderData) { | ||
| 83 | if data.Loading { | 56 | if data.Loading { | ||
| 84 | @LoadingPanel("Loading top domains…") | 57 | @LoadingPanel("Loading top domains…") | ||
| @@ -93,9 +66,9 @@ templ HistoryDomains(data historyRenderData) { | |||||
| 93 | <span class="sv-domain-chip"> | 66 | <span class="sv-domain-chip"> | ||
| 94 | <span class="sv-domain-chip-main"> | 67 | <span class="sv-domain-chip-main"> | ||
| 95 | <button type="button" class="sv-domain-filter" data-sv-action="history.filterDomain" data-domain={ domainKey }>{ displayDomain }</button> | 68 | <button type="button" class="sv-domain-filter" data-sv-action="history.filterDomain" data-domain={ domainKey }>{ displayDomain }</button> | ||
| 96 | - | <span class="sv-domain-meta">{ fmt.Sprintf("%d pages · %d visits", domain.PageCount, domain.TotalVisits) }</span> | 69 | + | <span class="sv-domain-meta">{ fmt.Sprintf("%dp · %dv", domain.PageCount, domain.TotalVisits) }</span> |
| 97 | </span> | 70 | </span> | ||
| 98 | - | <button type="button" class="sv-icon-button sv-danger" data-sv-action="history.deleteDomain" data-domain={ domainKey } data-sv-confirm={ "Delete all history for " + displayDomain + "?" } aria-label={ "Delete history for " + displayDomain }>@IconOnly(iconTrash, "Delete history for " + displayDomain)</button> | 71 | + | <button type="button" class="sv-domain-delete" data-sv-action="history.deleteDomain" data-domain={ domainKey } data-sv-confirm={ "Delete all history for " + displayDomain + "?" } aria-label={ "Delete history for " + displayDomain }><span aria-hidden="true">×</span><span class="sv-sr-only">Delete history for { displayDomain }</span></button> |
| 99 | </span> | 72 | </span> | ||
| 100 | } | 73 | } | ||
| 101 | } | 74 | } | ||
M internal/ui/systemviews/history_actions.go +3 -2
| @@ -235,10 +235,11 @@ func (a *App) handleHistoryLoadMore(ctx context.Context, event DOMAction) error | |||
| 235 | 235 | if _, ok := dom.(DOMHistoryTimelineAppender); !ok { | |
| 236 | 236 | fullData := data | |
| 237 | 237 | fullData.Entries = a.historyEntries | |
| 238 | + | title := historyDocumentTitle(fullData) | |
| 238 | 239 | a.renderedHTML = renderAppFrame(renderedPage{ | |
| 239 | 240 | route: RouteHistory, | |
| 240 | - | title: historyDocumentTitle(fullData), | |
| 241 | - | subtitle: "Recent visits", | |
| 241 | + | title: title, | |
| 242 | + | subtitle: title, | |
| 242 | 243 | body: historyHTML(fullData), | |
| 243 | 244 | }, a.shellTheme) | |
| 244 | 245 | fallbackHTML = a.renderedHTML | |
| @@ -235,10 +235,11 @@ func (a *App) handleHistoryLoadMore(ctx context.Context, event DOMAction) error | |||||
| 235 | if _, ok := dom.(DOMHistoryTimelineAppender); !ok { | 235 | if _, ok := dom.(DOMHistoryTimelineAppender); !ok { | ||
| 236 | fullData := data | 236 | fullData := data | ||
| 237 | fullData.Entries = a.historyEntries | 237 | fullData.Entries = a.historyEntries | ||
| 238 | + | title := historyDocumentTitle(fullData) | |||
| 238 | a.renderedHTML = renderAppFrame(renderedPage{ | 239 | a.renderedHTML = renderAppFrame(renderedPage{ | ||
| 239 | route: RouteHistory, | 240 | route: RouteHistory, | ||
| 240 | - | title: historyDocumentTitle(fullData), | 241 | + | title: title, |
| 241 | - | subtitle: "Recent visits", | 242 | + | subtitle: title, |
| 242 | body: historyHTML(fullData), | 243 | body: historyHTML(fullData), | ||
| 243 | }, a.shellTheme) | 244 | }, a.shellTheme) | ||
| 244 | fallbackHTML = a.renderedHTML | 245 | fallbackHTML = a.renderedHTML | ||
M internal/ui/systemviews/history_templ.go +212 -361
| @@ -64,33 +64,7 @@ func HistoryView(data historyRenderData) templ.Component { | |||
| 64 | 64 | if templ_7745c5c3_Err != nil { | |
| 65 | 65 | return templ_7745c5c3_Err | |
| 66 | 66 | } | |
| 67 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"sv-history-overview\">") | |
| 68 | - | if templ_7745c5c3_Err != nil { | |
| 69 | - | return templ_7745c5c3_Err | |
| 70 | - | } | |
| 71 | 67 | templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |
| 72 | - | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |
| 73 | - | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |
| 74 | - | if !templ_7745c5c3_IsBuffer { | |
| 75 | - | defer func() { | |
| 76 | - | templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) | |
| 77 | - | if templ_7745c5c3_Err == nil { | |
| 78 | - | templ_7745c5c3_Err = templ_7745c5c3_BufErr | |
| 79 | - | } | |
| 80 | - | }() | |
| 81 | - | } | |
| 82 | - | ctx = templ.InitializeContext(ctx) | |
| 83 | - | templ_7745c5c3_Err = HistorySummary(data).Render(ctx, templ_7745c5c3_Buffer) | |
| 84 | - | if templ_7745c5c3_Err != nil { | |
| 85 | - | return templ_7745c5c3_Err | |
| 86 | - | } | |
| 87 | - | return nil | |
| 88 | - | }) | |
| 89 | - | templ_7745c5c3_Err = Section("sv-history-summary", "History stats").Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) | |
| 90 | - | if templ_7745c5c3_Err != nil { | |
| 91 | - | return templ_7745c5c3_Err | |
| 92 | - | } | |
| 93 | - | templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |
| 94 | 68 | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |
| 95 | 69 | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |
| 96 | 70 | if !templ_7745c5c3_IsBuffer { | |
| @@ -108,15 +82,11 @@ func HistoryView(data historyRenderData) templ.Component { | |||
| 108 | 82 | } | |
| 109 | 83 | return nil | |
| 110 | 84 | }) | |
| 111 | - | templ_7745c5c3_Err = Section("sv-history-domains", "Top domains").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) | |
| 112 | - | if templ_7745c5c3_Err != nil { | |
| 113 | - | return templ_7745c5c3_Err | |
| 114 | - | } | |
| 115 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div>") | |
| 85 | + | templ_7745c5c3_Err = Section("sv-history-domains", "Top domains").Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) | |
| 116 | 86 | if templ_7745c5c3_Err != nil { | |
| 117 | 87 | return templ_7745c5c3_Err | |
| 118 | 88 | } | |
| 119 | - | templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |
| 89 | + | templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |
| 120 | 90 | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |
| 121 | 91 | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |
| 122 | 92 | if !templ_7745c5c3_IsBuffer { | |
| @@ -134,7 +104,7 @@ func HistoryView(data historyRenderData) templ.Component { | |||
| 134 | 104 | } | |
| 135 | 105 | return nil | |
| 136 | 106 | }) | |
| 137 | - | templ_7745c5c3_Err = Section("sv-history-timeline", "Recent visits").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) | |
| 107 | + | templ_7745c5c3_Err = Section("sv-history-timeline", "Recent visits").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) | |
| 138 | 108 | if templ_7745c5c3_Err != nil { | |
| 139 | 109 | return templ_7745c5c3_Err | |
| 140 | 110 | } | |
| @@ -158,25 +128,25 @@ func HistoryControls(data historyRenderData) templ.Component { | |||
| 158 | 128 | }() | |
| 159 | 129 | } | |
| 160 | 130 | ctx = templ.InitializeContext(ctx) | |
| 161 | - | templ_7745c5c3_Var6 := templ.GetChildren(ctx) | |
| 162 | - | if templ_7745c5c3_Var6 == nil { | |
| 163 | - | templ_7745c5c3_Var6 = templ.NopComponent | |
| 131 | + | templ_7745c5c3_Var5 := templ.GetChildren(ctx) | |
| 132 | + | if templ_7745c5c3_Var5 == nil { | |
| 133 | + | templ_7745c5c3_Var5 = templ.NopComponent | |
| 164 | 134 | } | |
| 165 | 135 | ctx = templ.ClearChildren(ctx) | |
| 166 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<form class=\"sv-toolbar sv-history-search\" data-sv-action=\"history.search\"><label class=\"sv-search-label\"><span>Search</span> <input data-sv-history-search data-sv-autofocus name=\"query\" type=\"search\" value=\"") | |
| 136 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<form class=\"sv-toolbar sv-history-search\" data-sv-action=\"history.search\"><label class=\"sv-search-label\"><span>Search</span> <input data-sv-history-search data-sv-autofocus name=\"query\" type=\"search\" value=\"") | |
| 167 | 137 | if templ_7745c5c3_Err != nil { | |
| 168 | 138 | return templ_7745c5c3_Err | |
| 169 | 139 | } | |
| 170 | - | var templ_7745c5c3_Var7 string | |
| 171 | - | templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) | |
| 140 | + | var templ_7745c5c3_Var6 string | |
| 141 | + | templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) | |
| 172 | 142 | if templ_7745c5c3_Err != nil { | |
| 173 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 32, Col: 96} | |
| 143 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 27, Col: 96} | |
| 174 | 144 | } | |
| 175 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) | |
| 145 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) | |
| 176 | 146 | if templ_7745c5c3_Err != nil { | |
| 177 | 147 | return templ_7745c5c3_Err | |
| 178 | 148 | } | |
| 179 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" placeholder=\"Search title or URL\" autocomplete=\"off\" autofocus></label> <button class=\"sv-button\" type=\"submit\">") | |
| 149 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" placeholder=\"Search title or URL\" autocomplete=\"off\" autofocus></label> <button class=\"sv-button\" type=\"submit\">") | |
| 180 | 150 | if templ_7745c5c3_Err != nil { | |
| 181 | 151 | return templ_7745c5c3_Err | |
| 182 | 152 | } | |
| @@ -184,7 +154,7 @@ func HistoryControls(data historyRenderData) templ.Component { | |||
| 184 | 154 | if templ_7745c5c3_Err != nil { | |
| 185 | 155 | return templ_7745c5c3_Err | |
| 186 | 156 | } | |
| 187 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</button> <button class=\"sv-button sv-button-secondary\" type=\"button\" data-sv-action=\"history.clear\">") | |
| 157 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</button> <button class=\"sv-button sv-button-secondary\" type=\"button\" data-sv-action=\"history.clear\">") | |
| 188 | 158 | if templ_7745c5c3_Err != nil { | |
| 189 | 159 | return templ_7745c5c3_Err | |
| 190 | 160 | } | |
| @@ -192,49 +162,49 @@ func HistoryControls(data historyRenderData) templ.Component { | |||
| 192 | 162 | if templ_7745c5c3_Err != nil { | |
| 193 | 163 | return templ_7745c5c3_Err | |
| 194 | 164 | } | |
| 195 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</button></form>") | |
| 165 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</button></form>") | |
| 196 | 166 | if templ_7745c5c3_Err != nil { | |
| 197 | 167 | return templ_7745c5c3_Err | |
| 198 | 168 | } | |
| 199 | 169 | if showHistoryFilters(data) { | |
| 200 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<div class=\"sv-active-filters\">") | |
| 170 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div class=\"sv-active-filters\">") | |
| 201 | 171 | if templ_7745c5c3_Err != nil { | |
| 202 | 172 | return templ_7745c5c3_Err | |
| 203 | 173 | } | |
| 204 | 174 | if data.Query != "" { | |
| 205 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<span class=\"sv-filter-chip\">Query: ") | |
| 175 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<span class=\"sv-filter-chip\">Query: ") | |
| 206 | 176 | if templ_7745c5c3_Err != nil { | |
| 207 | 177 | return templ_7745c5c3_Err | |
| 208 | 178 | } | |
| 209 | - | var templ_7745c5c3_Var8 string | |
| 210 | - | templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) | |
| 179 | + | var templ_7745c5c3_Var7 string | |
| 180 | + | templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) | |
| 211 | 181 | if templ_7745c5c3_Err != nil { | |
| 212 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 40, Col: 52} | |
| 182 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 35, Col: 52} | |
| 213 | 183 | } | |
| 214 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) | |
| 184 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) | |
| 215 | 185 | if templ_7745c5c3_Err != nil { | |
| 216 | 186 | return templ_7745c5c3_Err | |
| 217 | 187 | } | |
| 218 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</span> ") | |
| 188 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</span> ") | |
| 219 | 189 | if templ_7745c5c3_Err != nil { | |
| 220 | 190 | return templ_7745c5c3_Err | |
| 221 | 191 | } | |
| 222 | 192 | } | |
| 223 | 193 | if data.DomainFilter != "" { | |
| 224 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<span class=\"sv-filter-chip\">Domain: ") | |
| 194 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<span class=\"sv-filter-chip\">Domain: ") | |
| 225 | 195 | if templ_7745c5c3_Err != nil { | |
| 226 | 196 | return templ_7745c5c3_Err | |
| 227 | 197 | } | |
| 228 | - | var templ_7745c5c3_Var9 string | |
| 229 | - | templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.DomainFilter) | |
| 198 | + | var templ_7745c5c3_Var8 string | |
| 199 | + | templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.DomainFilter) | |
| 230 | 200 | if templ_7745c5c3_Err != nil { | |
| 231 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 43, Col: 60} | |
| 201 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 38, Col: 60} | |
| 232 | 202 | } | |
| 233 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) | |
| 203 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) | |
| 234 | 204 | if templ_7745c5c3_Err != nil { | |
| 235 | 205 | return templ_7745c5c3_Err | |
| 236 | 206 | } | |
| 237 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " <button type=\"button\" data-sv-action=\"history.clearDomain\" aria-label=\"Clear domain filter\">") | |
| 207 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, " <button type=\"button\" data-sv-action=\"history.clearDomain\" aria-label=\"Clear domain filter\">") | |
| 238 | 208 | if templ_7745c5c3_Err != nil { | |
| 239 | 209 | return templ_7745c5c3_Err | |
| 240 | 210 | } | |
| @@ -242,203 +212,79 @@ func HistoryControls(data historyRenderData) templ.Component { | |||
| 242 | 212 | if templ_7745c5c3_Err != nil { | |
| 243 | 213 | return templ_7745c5c3_Err | |
| 244 | 214 | } | |
| 245 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</button></span>") | |
| 215 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</button></span>") | |
| 246 | 216 | if templ_7745c5c3_Err != nil { | |
| 247 | 217 | return templ_7745c5c3_Err | |
| 248 | 218 | } | |
| 249 | 219 | } | |
| 250 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</div>") | |
| 220 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div>") | |
| 251 | 221 | if templ_7745c5c3_Err != nil { | |
| 252 | 222 | return templ_7745c5c3_Err | |
| 253 | 223 | } | |
| 254 | 224 | } | |
| 255 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<div class=\"sv-history-actions-panel\"><div class=\"sv-button-row\" aria-label=\"History pagination\"><span class=\"sv-meta\">") | |
| 225 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<div class=\"sv-history-actions-panel\"><div class=\"sv-button-row\" aria-label=\"History pagination\"><span class=\"sv-meta\">") | |
| 256 | 226 | if templ_7745c5c3_Err != nil { | |
| 257 | 227 | return templ_7745c5c3_Err | |
| 258 | 228 | } | |
| 259 | - | var templ_7745c5c3_Var10 string | |
| 260 | - | templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(historyShowingLabel(data)) | |
| 229 | + | var templ_7745c5c3_Var9 string | |
| 230 | + | templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(historyShowingLabel(data)) | |
| 261 | 231 | if templ_7745c5c3_Err != nil { | |
| 262 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 52} | |
| 232 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 44, Col: 52} | |
| 263 | 233 | } | |
| 264 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) | |
| 234 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) | |
| 265 | 235 | if templ_7745c5c3_Err != nil { | |
| 266 | 236 | return templ_7745c5c3_Err | |
| 267 | 237 | } | |
| 268 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</span></div><div class=\"sv-button-row\" aria-label=\"History cleanup\"><span class=\"sv-meta\">Clean up</span> ") | |
| 238 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</span></div><div class=\"sv-button-row\" aria-label=\"History cleanup\"><span class=\"sv-meta\">Clean up</span> ") | |
| 269 | 239 | if templ_7745c5c3_Err != nil { | |
| 270 | 240 | return templ_7745c5c3_Err | |
| 271 | 241 | } | |
| 272 | 242 | for _, item := range historyCleanupItems() { | |
| 273 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<button type=\"button\" class=\"sv-danger-link\" data-sv-action=\"history.deleteRange\" data-range=\"") | |
| 274 | - | if templ_7745c5c3_Err != nil { | |
| 275 | - | return templ_7745c5c3_Err | |
| 276 | - | } | |
| 277 | - | var templ_7745c5c3_Var11 string | |
| 278 | - | templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(item.RangeID) | |
| 279 | - | if templ_7745c5c3_Err != nil { | |
| 280 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 54, Col: 111} | |
| 281 | - | } | |
| 282 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) | |
| 283 | - | if templ_7745c5c3_Err != nil { | |
| 284 | - | return templ_7745c5c3_Err | |
| 285 | - | } | |
| 286 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\" data-sv-confirm=\"") | |
| 287 | - | if templ_7745c5c3_Err != nil { | |
| 288 | - | return templ_7745c5c3_Err | |
| 289 | - | } | |
| 290 | - | var templ_7745c5c3_Var12 string | |
| 291 | - | templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(item.Confirm) | |
| 292 | - | if templ_7745c5c3_Err != nil { | |
| 293 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 54, Col: 144} | |
| 294 | - | } | |
| 295 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) | |
| 296 | - | if templ_7745c5c3_Err != nil { | |
| 297 | - | return templ_7745c5c3_Err | |
| 298 | - | } | |
| 299 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\">") | |
| 300 | - | if templ_7745c5c3_Err != nil { | |
| 301 | - | return templ_7745c5c3_Err | |
| 302 | - | } | |
| 303 | - | var templ_7745c5c3_Var13 string | |
| 304 | - | templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(item.Label) | |
| 305 | - | if templ_7745c5c3_Err != nil { | |
| 306 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 54, Col: 159} | |
| 307 | - | } | |
| 308 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) | |
| 309 | - | if templ_7745c5c3_Err != nil { | |
| 310 | - | return templ_7745c5c3_Err | |
| 311 | - | } | |
| 312 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</button>") | |
| 313 | - | if templ_7745c5c3_Err != nil { | |
| 314 | - | return templ_7745c5c3_Err | |
| 315 | - | } | |
| 316 | - | } | |
| 317 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</div></div>") | |
| 318 | - | if templ_7745c5c3_Err != nil { | |
| 319 | - | return templ_7745c5c3_Err | |
| 320 | - | } | |
| 321 | - | return nil | |
| 322 | - | }) | |
| 323 | - | } | |
| 324 | - | ||
| 325 | - | func HistorySummary(data historyRenderData) templ.Component { | |
| 326 | - | return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |
| 327 | - | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |
| 328 | - | if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { | |
| 329 | - | return templ_7745c5c3_CtxErr | |
| 330 | - | } | |
| 331 | - | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |
| 332 | - | if !templ_7745c5c3_IsBuffer { | |
| 333 | - | defer func() { | |
| 334 | - | templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) | |
| 335 | - | if templ_7745c5c3_Err == nil { | |
| 336 | - | templ_7745c5c3_Err = templ_7745c5c3_BufErr | |
| 337 | - | } | |
| 338 | - | }() | |
| 339 | - | } | |
| 340 | - | ctx = templ.InitializeContext(ctx) | |
| 341 | - | templ_7745c5c3_Var14 := templ.GetChildren(ctx) | |
| 342 | - | if templ_7745c5c3_Var14 == nil { | |
| 343 | - | templ_7745c5c3_Var14 = templ.NopComponent | |
| 344 | - | } | |
| 345 | - | ctx = templ.ClearChildren(ctx) | |
| 346 | - | if historySummaryLoading(data) { | |
| 347 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<div class=\"sv-stat-grid\">") | |
| 243 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<button type=\"button\" class=\"sv-danger-link\" data-sv-action=\"history.deleteRange\" data-range=\"") | |
| 348 | 244 | if templ_7745c5c3_Err != nil { | |
| 349 | 245 | return templ_7745c5c3_Err | |
| 350 | 246 | } | |
| 351 | - | templ_7745c5c3_Err = LoadingCard("Entries").Render(ctx, templ_7745c5c3_Buffer) | |
| 247 | + | var templ_7745c5c3_Var10 string | |
| 248 | + | templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(item.RangeID) | |
| 352 | 249 | if templ_7745c5c3_Err != nil { | |
| 353 | - | return templ_7745c5c3_Err | |
| 250 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 111} | |
| 354 | 251 | } | |
| 355 | - | templ_7745c5c3_Err = LoadingCard("Visits").Render(ctx, templ_7745c5c3_Buffer) | |
| 252 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) | |
| 356 | 253 | if templ_7745c5c3_Err != nil { | |
| 357 | 254 | return templ_7745c5c3_Err | |
| 358 | 255 | } | |
| 359 | - | templ_7745c5c3_Err = LoadingCard("Days").Render(ctx, templ_7745c5c3_Buffer) | |
| 256 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\" data-sv-confirm=\"") | |
| 360 | 257 | if templ_7745c5c3_Err != nil { | |
| 361 | 258 | return templ_7745c5c3_Err | |
| 362 | 259 | } | |
| 363 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</div>") | |
| 260 | + | var templ_7745c5c3_Var11 string | |
| 261 | + | templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(item.Confirm) | |
| 364 | 262 | if templ_7745c5c3_Err != nil { | |
| 365 | - | return templ_7745c5c3_Err | |
| 263 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 144} | |
| 366 | 264 | } | |
| 367 | - | } else { | |
| 368 | - | entries, visits, days := historySummaryValues(data) | |
| 369 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<div class=\"sv-stat-grid\">") | |
| 265 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) | |
| 370 | 266 | if templ_7745c5c3_Err != nil { | |
| 371 | 267 | return templ_7745c5c3_Err | |
| 372 | 268 | } | |
| 373 | - | templ_7745c5c3_Err = HistoryStatCard("Entries", entries).Render(ctx, templ_7745c5c3_Buffer) | |
| 269 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "\">") | |
| 374 | 270 | if templ_7745c5c3_Err != nil { | |
| 375 | 271 | return templ_7745c5c3_Err | |
| 376 | 272 | } | |
| 377 | - | templ_7745c5c3_Err = HistoryStatCard("Visits", visits).Render(ctx, templ_7745c5c3_Buffer) | |
| 273 | + | var templ_7745c5c3_Var12 string | |
| 274 | + | templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(item.Label) | |
| 378 | 275 | if templ_7745c5c3_Err != nil { | |
| 379 | - | return templ_7745c5c3_Err | |
| 276 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 159} | |
| 380 | 277 | } | |
| 381 | - | templ_7745c5c3_Err = HistoryStatCard("Days", days).Render(ctx, templ_7745c5c3_Buffer) | |
| 278 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) | |
| 382 | 279 | if templ_7745c5c3_Err != nil { | |
| 383 | 280 | return templ_7745c5c3_Err | |
| 384 | 281 | } | |
| 385 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</div>") | |
| 282 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</button>") | |
| 386 | 283 | if templ_7745c5c3_Err != nil { | |
| 387 | 284 | return templ_7745c5c3_Err | |
| 388 | 285 | } | |
| 389 | 286 | } | |
| 390 | - | return nil | |
| 391 | - | }) | |
| 392 | - | } | |
| 393 | - | ||
| 394 | - | func HistoryStatCard(label string, value int64) templ.Component { | |
| 395 | - | return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |
| 396 | - | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |
| 397 | - | if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { | |
| 398 | - | return templ_7745c5c3_CtxErr | |
| 399 | - | } | |
| 400 | - | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |
| 401 | - | if !templ_7745c5c3_IsBuffer { | |
| 402 | - | defer func() { | |
| 403 | - | templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) | |
| 404 | - | if templ_7745c5c3_Err == nil { | |
| 405 | - | templ_7745c5c3_Err = templ_7745c5c3_BufErr | |
| 406 | - | } | |
| 407 | - | }() | |
| 408 | - | } | |
| 409 | - | ctx = templ.InitializeContext(ctx) | |
| 410 | - | templ_7745c5c3_Var15 := templ.GetChildren(ctx) | |
| 411 | - | if templ_7745c5c3_Var15 == nil { | |
| 412 | - | templ_7745c5c3_Var15 = templ.NopComponent | |
| 413 | - | } | |
| 414 | - | ctx = templ.ClearChildren(ctx) | |
| 415 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<div class=\"sv-stat-card\"><span class=\"sv-stat-value\">") | |
| 416 | - | if templ_7745c5c3_Err != nil { | |
| 417 | - | return templ_7745c5c3_Err | |
| 418 | - | } | |
| 419 | - | var templ_7745c5c3_Var16 string | |
| 420 | - | templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", value)) | |
| 421 | - | if templ_7745c5c3_Err != nil { | |
| 422 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 79, Col: 81} | |
| 423 | - | } | |
| 424 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) | |
| 425 | - | if templ_7745c5c3_Err != nil { | |
| 426 | - | return templ_7745c5c3_Err | |
| 427 | - | } | |
| 428 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</span><span class=\"sv-stat-label\">") | |
| 429 | - | if templ_7745c5c3_Err != nil { | |
| 430 | - | return templ_7745c5c3_Err | |
| 431 | - | } | |
| 432 | - | var templ_7745c5c3_Var17 string | |
| 433 | - | templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(label) | |
| 434 | - | if templ_7745c5c3_Err != nil { | |
| 435 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 79, Col: 125} | |
| 436 | - | } | |
| 437 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) | |
| 438 | - | if templ_7745c5c3_Err != nil { | |
| 439 | - | return templ_7745c5c3_Err | |
| 440 | - | } | |
| 441 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</span></div>") | |
| 287 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</div></div>") | |
| 442 | 288 | if templ_7745c5c3_Err != nil { | |
| 443 | 289 | return templ_7745c5c3_Err | |
| 444 | 290 | } | |
| @@ -462,9 +308,9 @@ func HistoryDomains(data historyRenderData) templ.Component { | |||
| 462 | 308 | }() | |
| 463 | 309 | } | |
| 464 | 310 | ctx = templ.InitializeContext(ctx) | |
| 465 | - | templ_7745c5c3_Var18 := templ.GetChildren(ctx) | |
| 466 | - | if templ_7745c5c3_Var18 == nil { | |
| 467 | - | templ_7745c5c3_Var18 = templ.NopComponent | |
| 311 | + | templ_7745c5c3_Var13 := templ.GetChildren(ctx) | |
| 312 | + | if templ_7745c5c3_Var13 == nil { | |
| 313 | + | templ_7745c5c3_Var13 = templ.NopComponent | |
| 468 | 314 | } | |
| 469 | 315 | ctx = templ.ClearChildren(ctx) | |
| 470 | 316 | if data.Loading { | |
| @@ -478,7 +324,7 @@ func HistoryDomains(data historyRenderData) templ.Component { | |||
| 478 | 324 | return templ_7745c5c3_Err | |
| 479 | 325 | } | |
| 480 | 326 | } else { | |
| 481 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<div class=\"sv-domain-list\">") | |
| 327 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<div class=\"sv-domain-list\">") | |
| 482 | 328 | if templ_7745c5c3_Err != nil { | |
| 483 | 329 | return templ_7745c5c3_Err | |
| 484 | 330 | } | |
| @@ -486,99 +332,104 @@ func HistoryDomains(data historyRenderData) templ.Component { | |||
| 486 | 332 | if domain != nil && domain.Domain != "" { | |
| 487 | 333 | domainKey := historyDomainActionKey(domain) | |
| 488 | 334 | displayDomain := historyDomainDisplayLabel(domain) | |
| 489 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<span class=\"sv-domain-chip\"><span class=\"sv-domain-chip-main\"><button type=\"button\" class=\"sv-domain-filter\" data-sv-action=\"history.filterDomain\" data-domain=\"") | |
| 335 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<span class=\"sv-domain-chip\"><span class=\"sv-domain-chip-main\"><button type=\"button\" class=\"sv-domain-filter\" data-sv-action=\"history.filterDomain\" data-domain=\"") | |
| 490 | 336 | if templ_7745c5c3_Err != nil { | |
| 491 | 337 | return templ_7745c5c3_Err | |
| 492 | 338 | } | |
| 493 | - | var templ_7745c5c3_Var19 string | |
| 494 | - | templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) | |
| 339 | + | var templ_7745c5c3_Var14 string | |
| 340 | + | templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) | |
| 495 | 341 | if templ_7745c5c3_Err != nil { | |
| 496 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 95, Col: 115} | |
| 342 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 68, Col: 115} | |
| 497 | 343 | } | |
| 498 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) | |
| 344 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) | |
| 499 | 345 | if templ_7745c5c3_Err != nil { | |
| 500 | 346 | return templ_7745c5c3_Err | |
| 501 | 347 | } | |
| 502 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "\">") | |
| 348 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\">") | |
| 503 | 349 | if templ_7745c5c3_Err != nil { | |
| 504 | 350 | return templ_7745c5c3_Err | |
| 505 | 351 | } | |
| 506 | - | var templ_7745c5c3_Var20 string | |
| 507 | - | templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(displayDomain) | |
| 352 | + | var templ_7745c5c3_Var15 string | |
| 353 | + | templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(displayDomain) | |
| 508 | 354 | if templ_7745c5c3_Err != nil { | |
| 509 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 95, Col: 133} | |
| 355 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 68, Col: 133} | |
| 510 | 356 | } | |
| 511 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) | |
| 357 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) | |
| 512 | 358 | if templ_7745c5c3_Err != nil { | |
| 513 | 359 | return templ_7745c5c3_Err | |
| 514 | 360 | } | |
| 515 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</button> <span class=\"sv-domain-meta\">") | |
| 361 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</button> <span class=\"sv-domain-meta\">") | |
| 516 | 362 | if templ_7745c5c3_Err != nil { | |
| 517 | 363 | return templ_7745c5c3_Err | |
| 518 | 364 | } | |
| 519 | - | var templ_7745c5c3_Var21 string | |
| 520 | - | templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d pages · %d visits", domain.PageCount, domain.TotalVisits)) | |
| 365 | + | var templ_7745c5c3_Var16 string | |
| 366 | + | templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%dp · %dv", domain.PageCount, domain.TotalVisits)) | |
| 521 | 367 | if templ_7745c5c3_Err != nil { | |
| 522 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 96, Col: 112} | |
| 368 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 69, Col: 101} | |
| 523 | 369 | } | |
| 524 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) | |
| 370 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) | |
| 525 | 371 | if templ_7745c5c3_Err != nil { | |
| 526 | 372 | return templ_7745c5c3_Err | |
| 527 | 373 | } | |
| 528 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</span></span> <button type=\"button\" class=\"sv-icon-button sv-danger\" data-sv-action=\"history.deleteDomain\" data-domain=\"") | |
| 374 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</span></span> <button type=\"button\" class=\"sv-domain-delete\" data-sv-action=\"history.deleteDomain\" data-domain=\"") | |
| 529 | 375 | if templ_7745c5c3_Err != nil { | |
| 530 | 376 | return templ_7745c5c3_Err | |
| 531 | 377 | } | |
| 532 | - | var templ_7745c5c3_Var22 string | |
| 533 | - | templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) | |
| 378 | + | var templ_7745c5c3_Var17 string | |
| 379 | + | templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) | |
| 534 | 380 | if templ_7745c5c3_Err != nil { | |
| 535 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 98, Col: 122} | |
| 381 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 114} | |
| 536 | 382 | } | |
| 537 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) | |
| 383 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) | |
| 538 | 384 | if templ_7745c5c3_Err != nil { | |
| 539 | 385 | return templ_7745c5c3_Err | |
| 540 | 386 | } | |
| 541 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\" data-sv-confirm=\"") | |
| 387 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\" data-sv-confirm=\"") | |
| 542 | 388 | if templ_7745c5c3_Err != nil { | |
| 543 | 389 | return templ_7745c5c3_Err | |
| 544 | 390 | } | |
| 545 | - | var templ_7745c5c3_Var23 string | |
| 546 | - | templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs("Delete all history for " + displayDomain + "?") | |
| 391 | + | var templ_7745c5c3_Var18 string | |
| 392 | + | templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs("Delete all history for " + displayDomain + "?") | |
| 547 | 393 | if templ_7745c5c3_Err != nil { | |
| 548 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 98, Col: 190} | |
| 394 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 182} | |
| 549 | 395 | } | |
| 550 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) | |
| 396 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) | |
| 551 | 397 | if templ_7745c5c3_Err != nil { | |
| 552 | 398 | return templ_7745c5c3_Err | |
| 553 | 399 | } | |
| 554 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\" aria-label=\"") | |
| 400 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\" aria-label=\"") | |
| 555 | 401 | if templ_7745c5c3_Err != nil { | |
| 556 | 402 | return templ_7745c5c3_Err | |
| 557 | 403 | } | |
| 558 | - | var templ_7745c5c3_Var24 string | |
| 559 | - | templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs("Delete history for " + displayDomain) | |
| 404 | + | var templ_7745c5c3_Var19 string | |
| 405 | + | templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs("Delete history for " + displayDomain) | |
| 560 | 406 | if templ_7745c5c3_Err != nil { | |
| 561 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 98, Col: 243} | |
| 407 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 235} | |
| 562 | 408 | } | |
| 563 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) | |
| 409 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) | |
| 564 | 410 | if templ_7745c5c3_Err != nil { | |
| 565 | 411 | return templ_7745c5c3_Err | |
| 566 | 412 | } | |
| 567 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\">") | |
| 413 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "\"><span aria-hidden=\"true\">×</span><span class=\"sv-sr-only\">Delete history for ") | |
| 568 | 414 | if templ_7745c5c3_Err != nil { | |
| 569 | 415 | return templ_7745c5c3_Err | |
| 570 | 416 | } | |
| 571 | - | templ_7745c5c3_Err = IconOnly(iconTrash, "Delete history for "+displayDomain).Render(ctx, templ_7745c5c3_Buffer) | |
| 417 | + | var templ_7745c5c3_Var20 string | |
| 418 | + | templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(displayDomain) | |
| 419 | + | if templ_7745c5c3_Err != nil { | |
| 420 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 331} | |
| 421 | + | } | |
| 422 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) | |
| 572 | 423 | if templ_7745c5c3_Err != nil { | |
| 573 | 424 | return templ_7745c5c3_Err | |
| 574 | 425 | } | |
| 575 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</button></span>") | |
| 426 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</span></button></span>") | |
| 576 | 427 | if templ_7745c5c3_Err != nil { | |
| 577 | 428 | return templ_7745c5c3_Err | |
| 578 | 429 | } | |
| 579 | 430 | } | |
| 580 | 431 | } | |
| 581 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</div>") | |
| 432 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</div>") | |
| 582 | 433 | if templ_7745c5c3_Err != nil { | |
| 583 | 434 | return templ_7745c5c3_Err | |
| 584 | 435 | } | |
| @@ -603,9 +454,9 @@ func HistoryTimeline(data historyRenderData) templ.Component { | |||
| 603 | 454 | }() | |
| 604 | 455 | } | |
| 605 | 456 | ctx = templ.InitializeContext(ctx) | |
| 606 | - | templ_7745c5c3_Var25 := templ.GetChildren(ctx) | |
| 607 | - | if templ_7745c5c3_Var25 == nil { | |
| 608 | - | templ_7745c5c3_Var25 = templ.NopComponent | |
| 457 | + | templ_7745c5c3_Var21 := templ.GetChildren(ctx) | |
| 458 | + | if templ_7745c5c3_Var21 == nil { | |
| 459 | + | templ_7745c5c3_Var21 = templ.NopComponent | |
| 609 | 460 | } | |
| 610 | 461 | ctx = templ.ClearChildren(ctx) | |
| 611 | 462 | if data.Loading { | |
| @@ -614,7 +465,7 @@ func HistoryTimeline(data historyRenderData) templ.Component { | |||
| 614 | 465 | return templ_7745c5c3_Err | |
| 615 | 466 | } | |
| 616 | 467 | } else { | |
| 617 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<div class=\"sv-history-timeline-list\" data-sv-history-timeline>") | |
| 468 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<div class=\"sv-history-timeline-list\" data-sv-history-timeline>") | |
| 618 | 469 | if templ_7745c5c3_Err != nil { | |
| 619 | 470 | return templ_7745c5c3_Err | |
| 620 | 471 | } | |
| @@ -634,7 +485,7 @@ func HistoryTimeline(data historyRenderData) templ.Component { | |||
| 634 | 485 | if templ_7745c5c3_Err != nil { | |
| 635 | 486 | return templ_7745c5c3_Err | |
| 636 | 487 | } | |
| 637 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</div>") | |
| 488 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</div>") | |
| 638 | 489 | if templ_7745c5c3_Err != nil { | |
| 639 | 490 | return templ_7745c5c3_Err | |
| 640 | 491 | } | |
| @@ -659,9 +510,9 @@ func HistoryTimelineAppend(data historyRenderData) templ.Component { | |||
| 659 | 510 | }() | |
| 660 | 511 | } | |
| 661 | 512 | ctx = templ.InitializeContext(ctx) | |
| 662 | - | templ_7745c5c3_Var26 := templ.GetChildren(ctx) | |
| 663 | - | if templ_7745c5c3_Var26 == nil { | |
| 664 | - | templ_7745c5c3_Var26 = templ.NopComponent | |
| 513 | + | templ_7745c5c3_Var22 := templ.GetChildren(ctx) | |
| 514 | + | if templ_7745c5c3_Var22 == nil { | |
| 515 | + | templ_7745c5c3_Var22 = templ.NopComponent | |
| 665 | 516 | } | |
| 666 | 517 | ctx = templ.ClearChildren(ctx) | |
| 667 | 518 | templ_7745c5c3_Err = HistoryTimelineAppendGroups(data.Entries, data.AppendSkipFirstDate).Render(ctx, templ_7745c5c3_Buffer) | |
| @@ -692,9 +543,9 @@ func HistoryTimelineGroups(entries []*entity.HistoryEntry, skipFirstDate string) | |||
| 692 | 543 | }() | |
| 693 | 544 | } | |
| 694 | 545 | ctx = templ.InitializeContext(ctx) | |
| 695 | - | templ_7745c5c3_Var27 := templ.GetChildren(ctx) | |
| 696 | - | if templ_7745c5c3_Var27 == nil { | |
| 697 | - | templ_7745c5c3_Var27 = templ.NopComponent | |
| 546 | + | templ_7745c5c3_Var23 := templ.GetChildren(ctx) | |
| 547 | + | if templ_7745c5c3_Var23 == nil { | |
| 548 | + | templ_7745c5c3_Var23 = templ.NopComponent | |
| 698 | 549 | } | |
| 699 | 550 | ctx = templ.ClearChildren(ctx) | |
| 700 | 551 | groups := groupHistoryEntries(entries) | |
| @@ -724,28 +575,28 @@ func HistoryTimelineAppendGroups(entries []*entity.HistoryEntry, mergeFirstDate | |||
| 724 | 575 | }() | |
| 725 | 576 | } | |
| 726 | 577 | ctx = templ.InitializeContext(ctx) | |
| 727 | - | templ_7745c5c3_Var28 := templ.GetChildren(ctx) | |
| 728 | - | if templ_7745c5c3_Var28 == nil { | |
| 729 | - | templ_7745c5c3_Var28 = templ.NopComponent | |
| 578 | + | templ_7745c5c3_Var24 := templ.GetChildren(ctx) | |
| 579 | + | if templ_7745c5c3_Var24 == nil { | |
| 580 | + | templ_7745c5c3_Var24 = templ.NopComponent | |
| 730 | 581 | } | |
| 731 | 582 | ctx = templ.ClearChildren(ctx) | |
| 732 | 583 | groups := groupHistoryEntries(entries) | |
| 733 | 584 | for index, group := range groups { | |
| 734 | 585 | if index == 0 && group.Date == mergeFirstDate { | |
| 735 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<div data-sv-history-merge-date=\"") | |
| 586 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<div data-sv-history-merge-date=\"") | |
| 736 | 587 | if templ_7745c5c3_Err != nil { | |
| 737 | 588 | return templ_7745c5c3_Err | |
| 738 | 589 | } | |
| 739 | - | var templ_7745c5c3_Var29 string | |
| 740 | - | templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) | |
| 590 | + | var templ_7745c5c3_Var25 string | |
| 591 | + | templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) | |
| 741 | 592 | if templ_7745c5c3_Err != nil { | |
| 742 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 138, Col: 47} | |
| 593 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 111, Col: 47} | |
| 743 | 594 | } | |
| 744 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) | |
| 595 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) | |
| 745 | 596 | if templ_7745c5c3_Err != nil { | |
| 746 | 597 | return templ_7745c5c3_Err | |
| 747 | 598 | } | |
| 748 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "\">") | |
| 599 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\">") | |
| 749 | 600 | if templ_7745c5c3_Err != nil { | |
| 750 | 601 | return templ_7745c5c3_Err | |
| 751 | 602 | } | |
| @@ -757,7 +608,7 @@ func HistoryTimelineAppendGroups(entries []*entity.HistoryEntry, mergeFirstDate | |||
| 757 | 608 | } | |
| 758 | 609 | } | |
| 759 | 610 | } | |
| 760 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "</div>") | |
| 611 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</div>") | |
| 761 | 612 | if templ_7745c5c3_Err != nil { | |
| 762 | 613 | return templ_7745c5c3_Err | |
| 763 | 614 | } | |
| @@ -788,48 +639,48 @@ func HistoryTimelineGroup(group historyTimelineGroup, showHeading bool) templ.Co | |||
| 788 | 639 | }() | |
| 789 | 640 | } | |
| 790 | 641 | ctx = templ.InitializeContext(ctx) | |
| 791 | - | templ_7745c5c3_Var30 := templ.GetChildren(ctx) | |
| 792 | - | if templ_7745c5c3_Var30 == nil { | |
| 793 | - | templ_7745c5c3_Var30 = templ.NopComponent | |
| 642 | + | templ_7745c5c3_Var26 := templ.GetChildren(ctx) | |
| 643 | + | if templ_7745c5c3_Var26 == nil { | |
| 644 | + | templ_7745c5c3_Var26 = templ.NopComponent | |
| 794 | 645 | } | |
| 795 | 646 | ctx = templ.ClearChildren(ctx) | |
| 796 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<section class=\"sv-timeline-group\" data-sv-history-date=\"") | |
| 647 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<section class=\"sv-timeline-group\" data-sv-history-date=\"") | |
| 797 | 648 | if templ_7745c5c3_Err != nil { | |
| 798 | 649 | return templ_7745c5c3_Err | |
| 799 | 650 | } | |
| 800 | - | var templ_7745c5c3_Var31 string | |
| 801 | - | templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) | |
| 651 | + | var templ_7745c5c3_Var27 string | |
| 652 | + | templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) | |
| 802 | 653 | if templ_7745c5c3_Err != nil { | |
| 803 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 152, Col: 69} | |
| 654 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 125, Col: 69} | |
| 804 | 655 | } | |
| 805 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) | |
| 656 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) | |
| 806 | 657 | if templ_7745c5c3_Err != nil { | |
| 807 | 658 | return templ_7745c5c3_Err | |
| 808 | 659 | } | |
| 809 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "\">") | |
| 660 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\">") | |
| 810 | 661 | if templ_7745c5c3_Err != nil { | |
| 811 | 662 | return templ_7745c5c3_Err | |
| 812 | 663 | } | |
| 813 | 664 | if showHeading { | |
| 814 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<h3>") | |
| 665 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<h3>") | |
| 815 | 666 | if templ_7745c5c3_Err != nil { | |
| 816 | 667 | return templ_7745c5c3_Err | |
| 817 | 668 | } | |
| 818 | - | var templ_7745c5c3_Var32 string | |
| 819 | - | templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(group.Label) | |
| 669 | + | var templ_7745c5c3_Var28 string | |
| 670 | + | templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(group.Label) | |
| 820 | 671 | if templ_7745c5c3_Err != nil { | |
| 821 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 154, Col: 20} | |
| 672 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 127, Col: 20} | |
| 822 | 673 | } | |
| 823 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) | |
| 674 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) | |
| 824 | 675 | if templ_7745c5c3_Err != nil { | |
| 825 | 676 | return templ_7745c5c3_Err | |
| 826 | 677 | } | |
| 827 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</h3>") | |
| 678 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</h3>") | |
| 828 | 679 | if templ_7745c5c3_Err != nil { | |
| 829 | 680 | return templ_7745c5c3_Err | |
| 830 | 681 | } | |
| 831 | 682 | } | |
| 832 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<ul class=\"sv-list\">") | |
| 683 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<ul class=\"sv-list\">") | |
| 833 | 684 | if templ_7745c5c3_Err != nil { | |
| 834 | 685 | return templ_7745c5c3_Err | |
| 835 | 686 | } | |
| @@ -841,7 +692,7 @@ func HistoryTimelineGroup(group historyTimelineGroup, showHeading bool) templ.Co | |||
| 841 | 692 | } | |
| 842 | 693 | } | |
| 843 | 694 | } | |
| 844 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</ul></section>") | |
| 695 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</ul></section>") | |
| 845 | 696 | if templ_7745c5c3_Err != nil { | |
| 846 | 697 | return templ_7745c5c3_Err | |
| 847 | 698 | } | |
| @@ -865,40 +716,40 @@ func HistoryLoadMore(data historyRenderData) templ.Component { | |||
| 865 | 716 | }() | |
| 866 | 717 | } | |
| 867 | 718 | ctx = templ.InitializeContext(ctx) | |
| 868 | - | templ_7745c5c3_Var33 := templ.GetChildren(ctx) | |
| 869 | - | if templ_7745c5c3_Var33 == nil { | |
| 870 | - | templ_7745c5c3_Var33 = templ.NopComponent | |
| 719 | + | templ_7745c5c3_Var29 := templ.GetChildren(ctx) | |
| 720 | + | if templ_7745c5c3_Var29 == nil { | |
| 721 | + | templ_7745c5c3_Var29 = templ.NopComponent | |
| 871 | 722 | } | |
| 872 | 723 | ctx = templ.ClearChildren(ctx) | |
| 873 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<div class=\"sv-history-load-more\" data-sv-history-load-more-container>") | |
| 724 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<div class=\"sv-history-load-more\" data-sv-history-load-more-container>") | |
| 874 | 725 | if templ_7745c5c3_Err != nil { | |
| 875 | 726 | return templ_7745c5c3_Err | |
| 876 | 727 | } | |
| 877 | 728 | if showHistoryLoadMore(data) { | |
| 878 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<button type=\"button\" class=\"sv-button sv-button-secondary\" data-sv-action=\"history.loadMore\" data-before=\"") | |
| 729 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<button type=\"button\" class=\"sv-button sv-button-secondary\" data-sv-action=\"history.loadMore\" data-before=\"") | |
| 879 | 730 | if templ_7745c5c3_Err != nil { | |
| 880 | 731 | return templ_7745c5c3_Err | |
| 881 | 732 | } | |
| 882 | - | var templ_7745c5c3_Var34 string | |
| 883 | - | templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(historyLoadMoreCursor(data)) | |
| 733 | + | var templ_7745c5c3_Var30 string | |
| 734 | + | templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(historyLoadMoreCursor(data)) | |
| 884 | 735 | if templ_7745c5c3_Err != nil { | |
| 885 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 169, Col: 138} | |
| 736 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 142, Col: 138} | |
| 886 | 737 | } | |
| 887 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) | |
| 738 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) | |
| 888 | 739 | if templ_7745c5c3_Err != nil { | |
| 889 | 740 | return templ_7745c5c3_Err | |
| 890 | 741 | } | |
| 891 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\" data-sv-history-load-more>Load older visits</button>") | |
| 742 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\" data-sv-history-load-more>Load older visits</button>") | |
| 892 | 743 | if templ_7745c5c3_Err != nil { | |
| 893 | 744 | return templ_7745c5c3_Err | |
| 894 | 745 | } | |
| 895 | 746 | } else if strings.TrimSpace(data.Query) == "" && countHistoryEntries(data.Entries) > 0 { | |
| 896 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<p class=\"sv-meta\">End of history</p>") | |
| 747 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<p class=\"sv-meta\">End of history</p>") | |
| 897 | 748 | if templ_7745c5c3_Err != nil { | |
| 898 | 749 | return templ_7745c5c3_Err | |
| 899 | 750 | } | |
| 900 | 751 | } | |
| 901 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</div>") | |
| 752 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</div>") | |
| 902 | 753 | if templ_7745c5c3_Err != nil { | |
| 903 | 754 | return templ_7745c5c3_Err | |
| 904 | 755 | } | |
| @@ -922,162 +773,162 @@ func HistoryItem(entry *entity.HistoryEntry) templ.Component { | |||
| 922 | 773 | }() | |
| 923 | 774 | } | |
| 924 | 775 | ctx = templ.InitializeContext(ctx) | |
| 925 | - | templ_7745c5c3_Var35 := templ.GetChildren(ctx) | |
| 926 | - | if templ_7745c5c3_Var35 == nil { | |
| 927 | - | templ_7745c5c3_Var35 = templ.NopComponent | |
| 776 | + | templ_7745c5c3_Var31 := templ.GetChildren(ctx) | |
| 777 | + | if templ_7745c5c3_Var31 == nil { | |
| 778 | + | templ_7745c5c3_Var31 = templ.NopComponent | |
| 928 | 779 | } | |
| 929 | 780 | ctx = templ.ClearChildren(ctx) | |
| 930 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<li class=\"sv-list-row\"><article class=\"sv-history-item\" data-sv-history-row data-history-id=\"") | |
| 781 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<li class=\"sv-list-row\"><article class=\"sv-history-item\" data-sv-history-row data-history-id=\"") | |
| 931 | 782 | if templ_7745c5c3_Err != nil { | |
| 932 | 783 | return templ_7745c5c3_Err | |
| 933 | 784 | } | |
| 934 | - | var templ_7745c5c3_Var36 string | |
| 935 | - | templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) | |
| 785 | + | var templ_7745c5c3_Var32 string | |
| 786 | + | templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) | |
| 936 | 787 | if templ_7745c5c3_Err != nil { | |
| 937 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 178, Col: 100} | |
| 788 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 151, Col: 100} | |
| 938 | 789 | } | |
| 939 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36)) | |
| 790 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) | |
| 940 | 791 | if templ_7745c5c3_Err != nil { | |
| 941 | 792 | return templ_7745c5c3_Err | |
| 942 | 793 | } | |
| 943 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\"><div class=\"sv-history-content\">") | |
| 794 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "\"><div class=\"sv-history-content\">") | |
| 944 | 795 | if templ_7745c5c3_Err != nil { | |
| 945 | 796 | return templ_7745c5c3_Err | |
| 946 | 797 | } | |
| 947 | 798 | faviconURL := historyItemFaviconURL(entry) | |
| 948 | - | var templ_7745c5c3_Var37 = []any{historyFaviconClass(faviconURL)} | |
| 949 | - | templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var37...) | |
| 799 | + | var templ_7745c5c3_Var33 = []any{historyFaviconClass(faviconURL)} | |
| 800 | + | templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var33...) | |
| 950 | 801 | if templ_7745c5c3_Err != nil { | |
| 951 | 802 | return templ_7745c5c3_Err | |
| 952 | 803 | } | |
| 953 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<span class=\"") | |
| 804 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<span class=\"") | |
| 954 | 805 | if templ_7745c5c3_Err != nil { | |
| 955 | 806 | return templ_7745c5c3_Err | |
| 956 | 807 | } | |
| 957 | - | var templ_7745c5c3_Var38 string | |
| 958 | - | templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var37).String()) | |
| 808 | + | var templ_7745c5c3_Var34 string | |
| 809 | + | templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var33).String()) | |
| 959 | 810 | if templ_7745c5c3_Err != nil { | |
| 960 | 811 | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 1, Col: 0} | |
| 961 | 812 | } | |
| 962 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38)) | |
| 813 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) | |
| 963 | 814 | if templ_7745c5c3_Err != nil { | |
| 964 | 815 | return templ_7745c5c3_Err | |
| 965 | 816 | } | |
| 966 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "\" aria-hidden=\"true\"><span class=\"sv-history-favicon-fallback\">") | |
| 817 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\" aria-hidden=\"true\"><span class=\"sv-history-favicon-fallback\">") | |
| 967 | 818 | if templ_7745c5c3_Err != nil { | |
| 968 | 819 | return templ_7745c5c3_Err | |
| 969 | 820 | } | |
| 970 | - | var templ_7745c5c3_Var39 string | |
| 971 | - | templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(historyFaviconFallback(entry)) | |
| 821 | + | var templ_7745c5c3_Var35 string | |
| 822 | + | templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(historyFaviconFallback(entry)) | |
| 972 | 823 | if templ_7745c5c3_Err != nil { | |
| 973 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 182, Col: 78} | |
| 824 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 155, Col: 78} | |
| 974 | 825 | } | |
| 975 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39)) | |
| 826 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35)) | |
| 976 | 827 | if templ_7745c5c3_Err != nil { | |
| 977 | 828 | return templ_7745c5c3_Err | |
| 978 | 829 | } | |
| 979 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</span> ") | |
| 830 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</span> ") | |
| 980 | 831 | if templ_7745c5c3_Err != nil { | |
| 981 | 832 | return templ_7745c5c3_Err | |
| 982 | 833 | } | |
| 983 | 834 | if faviconURL != "" { | |
| 984 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "<img src=\"") | |
| 835 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<img src=\"") | |
| 985 | 836 | if templ_7745c5c3_Err != nil { | |
| 986 | 837 | return templ_7745c5c3_Err | |
| 987 | 838 | } | |
| 988 | - | var templ_7745c5c3_Var40 string | |
| 989 | - | templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(templ.SafeURL(faviconURL)) | |
| 839 | + | var templ_7745c5c3_Var36 string | |
| 840 | + | templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(templ.SafeURL(faviconURL)) | |
| 990 | 841 | if templ_7745c5c3_Err != nil { | |
| 991 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 184, Col: 42} | |
| 842 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 157, Col: 42} | |
| 992 | 843 | } | |
| 993 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) | |
| 844 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36)) | |
| 994 | 845 | if templ_7745c5c3_Err != nil { | |
| 995 | 846 | return templ_7745c5c3_Err | |
| 996 | 847 | } | |
| 997 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "\" alt=\"\" width=\"24\" height=\"24\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"same-origin\" onerror=\"this.parentElement.classList.remove('sv-history-favicon-has-image'); this.remove()\">") | |
| 848 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\" alt=\"\" width=\"24\" height=\"24\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"same-origin\" onerror=\"this.parentElement.classList.remove('sv-history-favicon-has-image'); this.remove()\">") | |
| 998 | 849 | if templ_7745c5c3_Err != nil { | |
| 999 | 850 | return templ_7745c5c3_Err | |
| 1000 | 851 | } | |
| 1001 | 852 | } | |
| 1002 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</span><div class=\"sv-history-main\"><a class=\"sv-link sv-history-open\" href=\"") | |
| 853 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</span><div class=\"sv-history-main\"><a class=\"sv-link sv-history-open\" href=\"") | |
| 1003 | 854 | if templ_7745c5c3_Err != nil { | |
| 1004 | 855 | return templ_7745c5c3_Err | |
| 1005 | 856 | } | |
| 1006 | - | var templ_7745c5c3_Var41 templ.SafeURL | |
| 1007 | - | templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) | |
| 857 | + | var templ_7745c5c3_Var37 templ.SafeURL | |
| 858 | + | templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) | |
| 1008 | 859 | if templ_7745c5c3_Err != nil { | |
| 1009 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 188, Col: 85} | |
| 860 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 161, Col: 85} | |
| 1010 | 861 | } | |
| 1011 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) | |
| 862 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37)) | |
| 1012 | 863 | if templ_7745c5c3_Err != nil { | |
| 1013 | 864 | return templ_7745c5c3_Err | |
| 1014 | 865 | } | |
| 1015 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\">") | |
| 866 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "\">") | |
| 1016 | 867 | if templ_7745c5c3_Err != nil { | |
| 1017 | 868 | return templ_7745c5c3_Err | |
| 1018 | 869 | } | |
| 1019 | - | var templ_7745c5c3_Var42 string | |
| 1020 | - | templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemLabel(entry)) | |
| 870 | + | var templ_7745c5c3_Var38 string | |
| 871 | + | templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemLabel(entry)) | |
| 1021 | 872 | if templ_7745c5c3_Err != nil { | |
| 1022 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 188, Col: 113} | |
| 873 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 161, Col: 113} | |
| 1023 | 874 | } | |
| 1024 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42)) | |
| 875 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38)) | |
| 1025 | 876 | if templ_7745c5c3_Err != nil { | |
| 1026 | 877 | return templ_7745c5c3_Err | |
| 1027 | 878 | } | |
| 1028 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</a><p class=\"sv-history-url\" title=\"") | |
| 879 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</a><p class=\"sv-history-url\" title=\"") | |
| 1029 | 880 | if templ_7745c5c3_Err != nil { | |
| 1030 | 881 | return templ_7745c5c3_Err | |
| 1031 | 882 | } | |
| 1032 | - | var templ_7745c5c3_Var43 string | |
| 1033 | - | templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(entry.URL) | |
| 883 | + | var templ_7745c5c3_Var39 string | |
| 884 | + | templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(entry.URL) | |
| 1034 | 885 | if templ_7745c5c3_Err != nil { | |
| 1035 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 189, Col: 48} | |
| 886 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 162, Col: 48} | |
| 1036 | 887 | } | |
| 1037 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) | |
| 888 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39)) | |
| 1038 | 889 | if templ_7745c5c3_Err != nil { | |
| 1039 | 890 | return templ_7745c5c3_Err | |
| 1040 | 891 | } | |
| 1041 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "\">") | |
| 892 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\">") | |
| 1042 | 893 | if templ_7745c5c3_Err != nil { | |
| 1043 | 894 | return templ_7745c5c3_Err | |
| 1044 | 895 | } | |
| 1045 | - | var templ_7745c5c3_Var44 string | |
| 1046 | - | templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemURL(entry)) | |
| 896 | + | var templ_7745c5c3_Var40 string | |
| 897 | + | templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemURL(entry)) | |
| 1047 | 898 | if templ_7745c5c3_Err != nil { | |
| 1048 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 189, Col: 74} | |
| 899 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 162, Col: 74} | |
| 1049 | 900 | } | |
| 1050 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44)) | |
| 901 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) | |
| 1051 | 902 | if templ_7745c5c3_Err != nil { | |
| 1052 | 903 | return templ_7745c5c3_Err | |
| 1053 | 904 | } | |
| 1054 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</p><p class=\"sv-history-meta\">") | |
| 905 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</p><p class=\"sv-history-meta\">") | |
| 1055 | 906 | if templ_7745c5c3_Err != nil { | |
| 1056 | 907 | return templ_7745c5c3_Err | |
| 1057 | 908 | } | |
| 1058 | - | var templ_7745c5c3_Var45 string | |
| 1059 | - | templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemMeta(entry)) | |
| 909 | + | var templ_7745c5c3_Var41 string | |
| 910 | + | templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemMeta(entry)) | |
| 1060 | 911 | if templ_7745c5c3_Err != nil { | |
| 1061 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 190, Col: 56} | |
| 912 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 163, Col: 56} | |
| 1062 | 913 | } | |
| 1063 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45)) | |
| 914 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) | |
| 1064 | 915 | if templ_7745c5c3_Err != nil { | |
| 1065 | 916 | return templ_7745c5c3_Err | |
| 1066 | 917 | } | |
| 1067 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "</p></div></div><div class=\"sv-history-row-actions\"><a class=\"sv-button sv-button-secondary\" href=\"") | |
| 918 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</p></div></div><div class=\"sv-history-row-actions\"><a class=\"sv-button sv-button-secondary\" href=\"") | |
| 1068 | 919 | if templ_7745c5c3_Err != nil { | |
| 1069 | 920 | return templ_7745c5c3_Err | |
| 1070 | 921 | } | |
| 1071 | - | var templ_7745c5c3_Var46 templ.SafeURL | |
| 1072 | - | templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) | |
| 922 | + | var templ_7745c5c3_Var42 templ.SafeURL | |
| 923 | + | templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) | |
| 1073 | 924 | if templ_7745c5c3_Err != nil { | |
| 1074 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 194, Col: 90} | |
| 925 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 167, Col: 90} | |
| 1075 | 926 | } | |
| 1076 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46)) | |
| 927 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42)) | |
| 1077 | 928 | if templ_7745c5c3_Err != nil { | |
| 1078 | 929 | return templ_7745c5c3_Err | |
| 1079 | 930 | } | |
| 1080 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "\">") | |
| 931 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "\">") | |
| 1081 | 932 | if templ_7745c5c3_Err != nil { | |
| 1082 | 933 | return templ_7745c5c3_Err | |
| 1083 | 934 | } | |
| @@ -1085,30 +936,30 @@ func HistoryItem(entry *entity.HistoryEntry) templ.Component { | |||
| 1085 | 936 | if templ_7745c5c3_Err != nil { | |
| 1086 | 937 | return templ_7745c5c3_Err | |
| 1087 | 938 | } | |
| 1088 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "</a> <button type=\"button\" class=\"sv-button sv-button-secondary sv-button-danger sv-button-icon-only\" data-sv-action=\"history.deleteEntry\" data-id=\"") | |
| 939 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</a> <button type=\"button\" class=\"sv-button sv-button-secondary sv-button-danger sv-button-icon-only\" data-sv-action=\"history.deleteEntry\" data-id=\"") | |
| 1089 | 940 | if templ_7745c5c3_Err != nil { | |
| 1090 | 941 | return templ_7745c5c3_Err | |
| 1091 | 942 | } | |
| 1092 | - | var templ_7745c5c3_Var47 string | |
| 1093 | - | templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) | |
| 943 | + | var templ_7745c5c3_Var43 string | |
| 944 | + | templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) | |
| 1094 | 945 | if templ_7745c5c3_Err != nil { | |
| 1095 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 195, Col: 175} | |
| 946 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 168, Col: 175} | |
| 1096 | 947 | } | |
| 1097 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47)) | |
| 948 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) | |
| 1098 | 949 | if templ_7745c5c3_Err != nil { | |
| 1099 | 950 | return templ_7745c5c3_Err | |
| 1100 | 951 | } | |
| 1101 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\" data-sv-confirm=\"Delete this history entry?\" aria-label=\"Delete this history entry\"") | |
| 952 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "\" data-sv-confirm=\"Delete this history entry?\" aria-label=\"Delete this history entry\"") | |
| 1102 | 953 | if templ_7745c5c3_Err != nil { | |
| 1103 | 954 | return templ_7745c5c3_Err | |
| 1104 | 955 | } | |
| 1105 | 956 | if entry.ID <= 0 { | |
| 1106 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, " disabled") | |
| 957 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, " disabled") | |
| 1107 | 958 | if templ_7745c5c3_Err != nil { | |
| 1108 | 959 | return templ_7745c5c3_Err | |
| 1109 | 960 | } | |
| 1110 | 961 | } | |
| 1111 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, ">") | |
| 962 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, ">") | |
| 1112 | 963 | if templ_7745c5c3_Err != nil { | |
| 1113 | 964 | return templ_7745c5c3_Err | |
| 1114 | 965 | } | |
| @@ -1116,7 +967,7 @@ func HistoryItem(entry *entity.HistoryEntry) templ.Component { | |||
| 1116 | 967 | if templ_7745c5c3_Err != nil { | |
| 1117 | 968 | return templ_7745c5c3_Err | |
| 1118 | 969 | } | |
| 1119 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "</button></div></article></li>") | |
| 970 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</button></div></article></li>") | |
| 1120 | 971 | if templ_7745c5c3_Err != nil { | |
| 1121 | 972 | return templ_7745c5c3_Err | |
| 1122 | 973 | } | |
| @@ -64,33 +64,7 @@ func HistoryView(data historyRenderData) templ.Component { | |||||
| 64 | if templ_7745c5c3_Err != nil { | 64 | if templ_7745c5c3_Err != nil { | ||
| 65 | return templ_7745c5c3_Err | 65 | return templ_7745c5c3_Err | ||
| 66 | } | 66 | } | ||
| 67 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"sv-history-overview\">") | |||
| 68 | - | if templ_7745c5c3_Err != nil { | |||
| 69 | - | return templ_7745c5c3_Err | |||
| 70 | - | } | |||
| 71 | templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | 67 | templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | ||
| 72 | - | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |||
| 73 | - | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |||
| 74 | - | if !templ_7745c5c3_IsBuffer { | |||
| 75 | - | defer func() { | |||
| 76 | - | templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) | |||
| 77 | - | if templ_7745c5c3_Err == nil { | |||
| 78 | - | templ_7745c5c3_Err = templ_7745c5c3_BufErr | |||
| 79 | - | } | |||
| 80 | - | }() | |||
| 81 | - | } | |||
| 82 | - | ctx = templ.InitializeContext(ctx) | |||
| 83 | - | templ_7745c5c3_Err = HistorySummary(data).Render(ctx, templ_7745c5c3_Buffer) | |||
| 84 | - | if templ_7745c5c3_Err != nil { | |||
| 85 | - | return templ_7745c5c3_Err | |||
| 86 | - | } | |||
| 87 | - | return nil | |||
| 88 | - | }) | |||
| 89 | - | templ_7745c5c3_Err = Section("sv-history-summary", "History stats").Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) | |||
| 90 | - | if templ_7745c5c3_Err != nil { | |||
| 91 | - | return templ_7745c5c3_Err | |||
| 92 | - | } | |||
| 93 | - | templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |||
| 94 | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | 68 | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | ||
| 95 | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | 69 | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | ||
| 96 | if !templ_7745c5c3_IsBuffer { | 70 | if !templ_7745c5c3_IsBuffer { | ||
| @@ -108,15 +82,11 @@ func HistoryView(data historyRenderData) templ.Component { | |||||
| 108 | } | 82 | } | ||
| 109 | return nil | 83 | return nil | ||
| 110 | }) | 84 | }) | ||
| 111 | - | templ_7745c5c3_Err = Section("sv-history-domains", "Top domains").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) | 85 | + | templ_7745c5c3_Err = Section("sv-history-domains", "Top domains").Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) |
| 112 | - | if templ_7745c5c3_Err != nil { | |||
| 113 | - | return templ_7745c5c3_Err | |||
| 114 | - | } | |||
| 115 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div>") | |||
| 116 | if templ_7745c5c3_Err != nil { | 86 | if templ_7745c5c3_Err != nil { | ||
| 117 | return templ_7745c5c3_Err | 87 | return templ_7745c5c3_Err | ||
| 118 | } | 88 | } | ||
| 119 | - | templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | 89 | + | templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { |
| 120 | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | 90 | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | ||
| 121 | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | 91 | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | ||
| 122 | if !templ_7745c5c3_IsBuffer { | 92 | if !templ_7745c5c3_IsBuffer { | ||
| @@ -134,7 +104,7 @@ func HistoryView(data historyRenderData) templ.Component { | |||||
| 134 | } | 104 | } | ||
| 135 | return nil | 105 | return nil | ||
| 136 | }) | 106 | }) | ||
| 137 | - | templ_7745c5c3_Err = Section("sv-history-timeline", "Recent visits").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) | 107 | + | templ_7745c5c3_Err = Section("sv-history-timeline", "Recent visits").Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) |
| 138 | if templ_7745c5c3_Err != nil { | 108 | if templ_7745c5c3_Err != nil { | ||
| 139 | return templ_7745c5c3_Err | 109 | return templ_7745c5c3_Err | ||
| 140 | } | 110 | } | ||
| @@ -158,25 +128,25 @@ func HistoryControls(data historyRenderData) templ.Component { | |||||
| 158 | }() | 128 | }() | ||
| 159 | } | 129 | } | ||
| 160 | ctx = templ.InitializeContext(ctx) | 130 | ctx = templ.InitializeContext(ctx) | ||
| 161 | - | templ_7745c5c3_Var6 := templ.GetChildren(ctx) | 131 | + | templ_7745c5c3_Var5 := templ.GetChildren(ctx) |
| 162 | - | if templ_7745c5c3_Var6 == nil { | 132 | + | if templ_7745c5c3_Var5 == nil { |
| 163 | - | templ_7745c5c3_Var6 = templ.NopComponent | 133 | + | templ_7745c5c3_Var5 = templ.NopComponent |
| 164 | } | 134 | } | ||
| 165 | ctx = templ.ClearChildren(ctx) | 135 | ctx = templ.ClearChildren(ctx) | ||
| 166 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<form class=\"sv-toolbar sv-history-search\" data-sv-action=\"history.search\"><label class=\"sv-search-label\"><span>Search</span> <input data-sv-history-search data-sv-autofocus name=\"query\" type=\"search\" value=\"") | 136 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<form class=\"sv-toolbar sv-history-search\" data-sv-action=\"history.search\"><label class=\"sv-search-label\"><span>Search</span> <input data-sv-history-search data-sv-autofocus name=\"query\" type=\"search\" value=\"") |
| 167 | if templ_7745c5c3_Err != nil { | 137 | if templ_7745c5c3_Err != nil { | ||
| 168 | return templ_7745c5c3_Err | 138 | return templ_7745c5c3_Err | ||
| 169 | } | 139 | } | ||
| 170 | - | var templ_7745c5c3_Var7 string | 140 | + | var templ_7745c5c3_Var6 string |
| 171 | - | templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) | 141 | + | templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) |
| 172 | if templ_7745c5c3_Err != nil { | 142 | if templ_7745c5c3_Err != nil { | ||
| 173 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 32, Col: 96} | 143 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 27, Col: 96} |
| 174 | } | 144 | } | ||
| 175 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) | 145 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) |
| 176 | if templ_7745c5c3_Err != nil { | 146 | if templ_7745c5c3_Err != nil { | ||
| 177 | return templ_7745c5c3_Err | 147 | return templ_7745c5c3_Err | ||
| 178 | } | 148 | } | ||
| 179 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" placeholder=\"Search title or URL\" autocomplete=\"off\" autofocus></label> <button class=\"sv-button\" type=\"submit\">") | 149 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" placeholder=\"Search title or URL\" autocomplete=\"off\" autofocus></label> <button class=\"sv-button\" type=\"submit\">") |
| 180 | if templ_7745c5c3_Err != nil { | 150 | if templ_7745c5c3_Err != nil { | ||
| 181 | return templ_7745c5c3_Err | 151 | return templ_7745c5c3_Err | ||
| 182 | } | 152 | } | ||
| @@ -184,7 +154,7 @@ func HistoryControls(data historyRenderData) templ.Component { | |||||
| 184 | if templ_7745c5c3_Err != nil { | 154 | if templ_7745c5c3_Err != nil { | ||
| 185 | return templ_7745c5c3_Err | 155 | return templ_7745c5c3_Err | ||
| 186 | } | 156 | } | ||
| 187 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</button> <button class=\"sv-button sv-button-secondary\" type=\"button\" data-sv-action=\"history.clear\">") | 157 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</button> <button class=\"sv-button sv-button-secondary\" type=\"button\" data-sv-action=\"history.clear\">") |
| 188 | if templ_7745c5c3_Err != nil { | 158 | if templ_7745c5c3_Err != nil { | ||
| 189 | return templ_7745c5c3_Err | 159 | return templ_7745c5c3_Err | ||
| 190 | } | 160 | } | ||
| @@ -192,49 +162,49 @@ func HistoryControls(data historyRenderData) templ.Component { | |||||
| 192 | if templ_7745c5c3_Err != nil { | 162 | if templ_7745c5c3_Err != nil { | ||
| 193 | return templ_7745c5c3_Err | 163 | return templ_7745c5c3_Err | ||
| 194 | } | 164 | } | ||
| 195 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</button></form>") | 165 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</button></form>") |
| 196 | if templ_7745c5c3_Err != nil { | 166 | if templ_7745c5c3_Err != nil { | ||
| 197 | return templ_7745c5c3_Err | 167 | return templ_7745c5c3_Err | ||
| 198 | } | 168 | } | ||
| 199 | if showHistoryFilters(data) { | 169 | if showHistoryFilters(data) { | ||
| 200 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<div class=\"sv-active-filters\">") | 170 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div class=\"sv-active-filters\">") |
| 201 | if templ_7745c5c3_Err != nil { | 171 | if templ_7745c5c3_Err != nil { | ||
| 202 | return templ_7745c5c3_Err | 172 | return templ_7745c5c3_Err | ||
| 203 | } | 173 | } | ||
| 204 | if data.Query != "" { | 174 | if data.Query != "" { | ||
| 205 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<span class=\"sv-filter-chip\">Query: ") | 175 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<span class=\"sv-filter-chip\">Query: ") |
| 206 | if templ_7745c5c3_Err != nil { | 176 | if templ_7745c5c3_Err != nil { | ||
| 207 | return templ_7745c5c3_Err | 177 | return templ_7745c5c3_Err | ||
| 208 | } | 178 | } | ||
| 209 | - | var templ_7745c5c3_Var8 string | 179 | + | var templ_7745c5c3_Var7 string |
| 210 | - | templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) | 180 | + | templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.Query) |
| 211 | if templ_7745c5c3_Err != nil { | 181 | if templ_7745c5c3_Err != nil { | ||
| 212 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 40, Col: 52} | 182 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 35, Col: 52} |
| 213 | } | 183 | } | ||
| 214 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) | 184 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) |
| 215 | if templ_7745c5c3_Err != nil { | 185 | if templ_7745c5c3_Err != nil { | ||
| 216 | return templ_7745c5c3_Err | 186 | return templ_7745c5c3_Err | ||
| 217 | } | 187 | } | ||
| 218 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</span> ") | 188 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</span> ") |
| 219 | if templ_7745c5c3_Err != nil { | 189 | if templ_7745c5c3_Err != nil { | ||
| 220 | return templ_7745c5c3_Err | 190 | return templ_7745c5c3_Err | ||
| 221 | } | 191 | } | ||
| 222 | } | 192 | } | ||
| 223 | if data.DomainFilter != "" { | 193 | if data.DomainFilter != "" { | ||
| 224 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<span class=\"sv-filter-chip\">Domain: ") | 194 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<span class=\"sv-filter-chip\">Domain: ") |
| 225 | if templ_7745c5c3_Err != nil { | 195 | if templ_7745c5c3_Err != nil { | ||
| 226 | return templ_7745c5c3_Err | 196 | return templ_7745c5c3_Err | ||
| 227 | } | 197 | } | ||
| 228 | - | var templ_7745c5c3_Var9 string | 198 | + | var templ_7745c5c3_Var8 string |
| 229 | - | templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.DomainFilter) | 199 | + | templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.DomainFilter) |
| 230 | if templ_7745c5c3_Err != nil { | 200 | if templ_7745c5c3_Err != nil { | ||
| 231 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 43, Col: 60} | 201 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 38, Col: 60} |
| 232 | } | 202 | } | ||
| 233 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) | 203 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) |
| 234 | if templ_7745c5c3_Err != nil { | 204 | if templ_7745c5c3_Err != nil { | ||
| 235 | return templ_7745c5c3_Err | 205 | return templ_7745c5c3_Err | ||
| 236 | } | 206 | } | ||
| 237 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " <button type=\"button\" data-sv-action=\"history.clearDomain\" aria-label=\"Clear domain filter\">") | 207 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, " <button type=\"button\" data-sv-action=\"history.clearDomain\" aria-label=\"Clear domain filter\">") |
| 238 | if templ_7745c5c3_Err != nil { | 208 | if templ_7745c5c3_Err != nil { | ||
| 239 | return templ_7745c5c3_Err | 209 | return templ_7745c5c3_Err | ||
| 240 | } | 210 | } | ||
| @@ -242,203 +212,79 @@ func HistoryControls(data historyRenderData) templ.Component { | |||||
| 242 | if templ_7745c5c3_Err != nil { | 212 | if templ_7745c5c3_Err != nil { | ||
| 243 | return templ_7745c5c3_Err | 213 | return templ_7745c5c3_Err | ||
| 244 | } | 214 | } | ||
| 245 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</button></span>") | 215 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</button></span>") |
| 246 | if templ_7745c5c3_Err != nil { | 216 | if templ_7745c5c3_Err != nil { | ||
| 247 | return templ_7745c5c3_Err | 217 | return templ_7745c5c3_Err | ||
| 248 | } | 218 | } | ||
| 249 | } | 219 | } | ||
| 250 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</div>") | 220 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div>") |
| 251 | if templ_7745c5c3_Err != nil { | 221 | if templ_7745c5c3_Err != nil { | ||
| 252 | return templ_7745c5c3_Err | 222 | return templ_7745c5c3_Err | ||
| 253 | } | 223 | } | ||
| 254 | } | 224 | } | ||
| 255 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<div class=\"sv-history-actions-panel\"><div class=\"sv-button-row\" aria-label=\"History pagination\"><span class=\"sv-meta\">") | 225 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<div class=\"sv-history-actions-panel\"><div class=\"sv-button-row\" aria-label=\"History pagination\"><span class=\"sv-meta\">") |
| 256 | if templ_7745c5c3_Err != nil { | 226 | if templ_7745c5c3_Err != nil { | ||
| 257 | return templ_7745c5c3_Err | 227 | return templ_7745c5c3_Err | ||
| 258 | } | 228 | } | ||
| 259 | - | var templ_7745c5c3_Var10 string | 229 | + | var templ_7745c5c3_Var9 string |
| 260 | - | templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(historyShowingLabel(data)) | 230 | + | templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(historyShowingLabel(data)) |
| 261 | if templ_7745c5c3_Err != nil { | 231 | if templ_7745c5c3_Err != nil { | ||
| 262 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 52} | 232 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 44, Col: 52} |
| 263 | } | 233 | } | ||
| 264 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) | 234 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) |
| 265 | if templ_7745c5c3_Err != nil { | 235 | if templ_7745c5c3_Err != nil { | ||
| 266 | return templ_7745c5c3_Err | 236 | return templ_7745c5c3_Err | ||
| 267 | } | 237 | } | ||
| 268 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</span></div><div class=\"sv-button-row\" aria-label=\"History cleanup\"><span class=\"sv-meta\">Clean up</span> ") | 238 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</span></div><div class=\"sv-button-row\" aria-label=\"History cleanup\"><span class=\"sv-meta\">Clean up</span> ") |
| 269 | if templ_7745c5c3_Err != nil { | 239 | if templ_7745c5c3_Err != nil { | ||
| 270 | return templ_7745c5c3_Err | 240 | return templ_7745c5c3_Err | ||
| 271 | } | 241 | } | ||
| 272 | for _, item := range historyCleanupItems() { | 242 | for _, item := range historyCleanupItems() { | ||
| 273 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<button type=\"button\" class=\"sv-danger-link\" data-sv-action=\"history.deleteRange\" data-range=\"") | 243 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<button type=\"button\" class=\"sv-danger-link\" data-sv-action=\"history.deleteRange\" data-range=\"") |
| 274 | - | if templ_7745c5c3_Err != nil { | |||
| 275 | - | return templ_7745c5c3_Err | |||
| 276 | - | } | |||
| 277 | - | var templ_7745c5c3_Var11 string | |||
| 278 | - | templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(item.RangeID) | |||
| 279 | - | if templ_7745c5c3_Err != nil { | |||
| 280 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 54, Col: 111} | |||
| 281 | - | } | |||
| 282 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) | |||
| 283 | - | if templ_7745c5c3_Err != nil { | |||
| 284 | - | return templ_7745c5c3_Err | |||
| 285 | - | } | |||
| 286 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\" data-sv-confirm=\"") | |||
| 287 | - | if templ_7745c5c3_Err != nil { | |||
| 288 | - | return templ_7745c5c3_Err | |||
| 289 | - | } | |||
| 290 | - | var templ_7745c5c3_Var12 string | |||
| 291 | - | templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(item.Confirm) | |||
| 292 | - | if templ_7745c5c3_Err != nil { | |||
| 293 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 54, Col: 144} | |||
| 294 | - | } | |||
| 295 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) | |||
| 296 | - | if templ_7745c5c3_Err != nil { | |||
| 297 | - | return templ_7745c5c3_Err | |||
| 298 | - | } | |||
| 299 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\">") | |||
| 300 | - | if templ_7745c5c3_Err != nil { | |||
| 301 | - | return templ_7745c5c3_Err | |||
| 302 | - | } | |||
| 303 | - | var templ_7745c5c3_Var13 string | |||
| 304 | - | templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(item.Label) | |||
| 305 | - | if templ_7745c5c3_Err != nil { | |||
| 306 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 54, Col: 159} | |||
| 307 | - | } | |||
| 308 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) | |||
| 309 | - | if templ_7745c5c3_Err != nil { | |||
| 310 | - | return templ_7745c5c3_Err | |||
| 311 | - | } | |||
| 312 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</button>") | |||
| 313 | - | if templ_7745c5c3_Err != nil { | |||
| 314 | - | return templ_7745c5c3_Err | |||
| 315 | - | } | |||
| 316 | - | } | |||
| 317 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</div></div>") | |||
| 318 | - | if templ_7745c5c3_Err != nil { | |||
| 319 | - | return templ_7745c5c3_Err | |||
| 320 | - | } | |||
| 321 | - | return nil | |||
| 322 | - | }) | |||
| 323 | - | } | |||
| 324 | - | ||||
| 325 | - | func HistorySummary(data historyRenderData) templ.Component { | |||
| 326 | - | return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |||
| 327 | - | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |||
| 328 | - | if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { | |||
| 329 | - | return templ_7745c5c3_CtxErr | |||
| 330 | - | } | |||
| 331 | - | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |||
| 332 | - | if !templ_7745c5c3_IsBuffer { | |||
| 333 | - | defer func() { | |||
| 334 | - | templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) | |||
| 335 | - | if templ_7745c5c3_Err == nil { | |||
| 336 | - | templ_7745c5c3_Err = templ_7745c5c3_BufErr | |||
| 337 | - | } | |||
| 338 | - | }() | |||
| 339 | - | } | |||
| 340 | - | ctx = templ.InitializeContext(ctx) | |||
| 341 | - | templ_7745c5c3_Var14 := templ.GetChildren(ctx) | |||
| 342 | - | if templ_7745c5c3_Var14 == nil { | |||
| 343 | - | templ_7745c5c3_Var14 = templ.NopComponent | |||
| 344 | - | } | |||
| 345 | - | ctx = templ.ClearChildren(ctx) | |||
| 346 | - | if historySummaryLoading(data) { | |||
| 347 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<div class=\"sv-stat-grid\">") | |||
| 348 | if templ_7745c5c3_Err != nil { | 244 | if templ_7745c5c3_Err != nil { | ||
| 349 | return templ_7745c5c3_Err | 245 | return templ_7745c5c3_Err | ||
| 350 | } | 246 | } | ||
| 351 | - | templ_7745c5c3_Err = LoadingCard("Entries").Render(ctx, templ_7745c5c3_Buffer) | 247 | + | var templ_7745c5c3_Var10 string |
| 248 | + | templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(item.RangeID) | |||
| 352 | if templ_7745c5c3_Err != nil { | 249 | if templ_7745c5c3_Err != nil { | ||
| 353 | - | return templ_7745c5c3_Err | 250 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 111} |
| 354 | } | 251 | } | ||
| 355 | - | templ_7745c5c3_Err = LoadingCard("Visits").Render(ctx, templ_7745c5c3_Buffer) | 252 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) |
| 356 | if templ_7745c5c3_Err != nil { | 253 | if templ_7745c5c3_Err != nil { | ||
| 357 | return templ_7745c5c3_Err | 254 | return templ_7745c5c3_Err | ||
| 358 | } | 255 | } | ||
| 359 | - | templ_7745c5c3_Err = LoadingCard("Days").Render(ctx, templ_7745c5c3_Buffer) | 256 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\" data-sv-confirm=\"") |
| 360 | if templ_7745c5c3_Err != nil { | 257 | if templ_7745c5c3_Err != nil { | ||
| 361 | return templ_7745c5c3_Err | 258 | return templ_7745c5c3_Err | ||
| 362 | } | 259 | } | ||
| 363 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</div>") | 260 | + | var templ_7745c5c3_Var11 string |
| 261 | + | templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(item.Confirm) | |||
| 364 | if templ_7745c5c3_Err != nil { | 262 | if templ_7745c5c3_Err != nil { | ||
| 365 | - | return templ_7745c5c3_Err | 263 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 144} |
| 366 | } | 264 | } | ||
| 367 | - | } else { | 265 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) |
| 368 | - | entries, visits, days := historySummaryValues(data) | |||
| 369 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<div class=\"sv-stat-grid\">") | |||
| 370 | if templ_7745c5c3_Err != nil { | 266 | if templ_7745c5c3_Err != nil { | ||
| 371 | return templ_7745c5c3_Err | 267 | return templ_7745c5c3_Err | ||
| 372 | } | 268 | } | ||
| 373 | - | templ_7745c5c3_Err = HistoryStatCard("Entries", entries).Render(ctx, templ_7745c5c3_Buffer) | 269 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "\">") |
| 374 | if templ_7745c5c3_Err != nil { | 270 | if templ_7745c5c3_Err != nil { | ||
| 375 | return templ_7745c5c3_Err | 271 | return templ_7745c5c3_Err | ||
| 376 | } | 272 | } | ||
| 377 | - | templ_7745c5c3_Err = HistoryStatCard("Visits", visits).Render(ctx, templ_7745c5c3_Buffer) | 273 | + | var templ_7745c5c3_Var12 string |
| 274 | + | templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(item.Label) | |||
| 378 | if templ_7745c5c3_Err != nil { | 275 | if templ_7745c5c3_Err != nil { | ||
| 379 | - | return templ_7745c5c3_Err | 276 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 49, Col: 159} |
| 380 | } | 277 | } | ||
| 381 | - | templ_7745c5c3_Err = HistoryStatCard("Days", days).Render(ctx, templ_7745c5c3_Buffer) | 278 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) |
| 382 | if templ_7745c5c3_Err != nil { | 279 | if templ_7745c5c3_Err != nil { | ||
| 383 | return templ_7745c5c3_Err | 280 | return templ_7745c5c3_Err | ||
| 384 | } | 281 | } | ||
| 385 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</div>") | 282 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</button>") |
| 386 | if templ_7745c5c3_Err != nil { | 283 | if templ_7745c5c3_Err != nil { | ||
| 387 | return templ_7745c5c3_Err | 284 | return templ_7745c5c3_Err | ||
| 388 | } | 285 | } | ||
| 389 | } | 286 | } | ||
| 390 | - | return nil | 287 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</div></div>") |
| 391 | - | }) | |||
| 392 | - | } | |||
| 393 | - | ||||
| 394 | - | func HistoryStatCard(label string, value int64) templ.Component { | |||
| 395 | - | return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | |||
| 396 | - | templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | |||
| 397 | - | if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { | |||
| 398 | - | return templ_7745c5c3_CtxErr | |||
| 399 | - | } | |||
| 400 | - | templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | |||
| 401 | - | if !templ_7745c5c3_IsBuffer { | |||
| 402 | - | defer func() { | |||
| 403 | - | templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) | |||
| 404 | - | if templ_7745c5c3_Err == nil { | |||
| 405 | - | templ_7745c5c3_Err = templ_7745c5c3_BufErr | |||
| 406 | - | } | |||
| 407 | - | }() | |||
| 408 | - | } | |||
| 409 | - | ctx = templ.InitializeContext(ctx) | |||
| 410 | - | templ_7745c5c3_Var15 := templ.GetChildren(ctx) | |||
| 411 | - | if templ_7745c5c3_Var15 == nil { | |||
| 412 | - | templ_7745c5c3_Var15 = templ.NopComponent | |||
| 413 | - | } | |||
| 414 | - | ctx = templ.ClearChildren(ctx) | |||
| 415 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<div class=\"sv-stat-card\"><span class=\"sv-stat-value\">") | |||
| 416 | - | if templ_7745c5c3_Err != nil { | |||
| 417 | - | return templ_7745c5c3_Err | |||
| 418 | - | } | |||
| 419 | - | var templ_7745c5c3_Var16 string | |||
| 420 | - | templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", value)) | |||
| 421 | - | if templ_7745c5c3_Err != nil { | |||
| 422 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 79, Col: 81} | |||
| 423 | - | } | |||
| 424 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) | |||
| 425 | - | if templ_7745c5c3_Err != nil { | |||
| 426 | - | return templ_7745c5c3_Err | |||
| 427 | - | } | |||
| 428 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</span><span class=\"sv-stat-label\">") | |||
| 429 | - | if templ_7745c5c3_Err != nil { | |||
| 430 | - | return templ_7745c5c3_Err | |||
| 431 | - | } | |||
| 432 | - | var templ_7745c5c3_Var17 string | |||
| 433 | - | templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(label) | |||
| 434 | - | if templ_7745c5c3_Err != nil { | |||
| 435 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 79, Col: 125} | |||
| 436 | - | } | |||
| 437 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) | |||
| 438 | - | if templ_7745c5c3_Err != nil { | |||
| 439 | - | return templ_7745c5c3_Err | |||
| 440 | - | } | |||
| 441 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</span></div>") | |||
| 442 | if templ_7745c5c3_Err != nil { | 288 | if templ_7745c5c3_Err != nil { | ||
| 443 | return templ_7745c5c3_Err | 289 | return templ_7745c5c3_Err | ||
| 444 | } | 290 | } | ||
| @@ -462,9 +308,9 @@ func HistoryDomains(data historyRenderData) templ.Component { | |||||
| 462 | }() | 308 | }() | ||
| 463 | } | 309 | } | ||
| 464 | ctx = templ.InitializeContext(ctx) | 310 | ctx = templ.InitializeContext(ctx) | ||
| 465 | - | templ_7745c5c3_Var18 := templ.GetChildren(ctx) | 311 | + | templ_7745c5c3_Var13 := templ.GetChildren(ctx) |
| 466 | - | if templ_7745c5c3_Var18 == nil { | 312 | + | if templ_7745c5c3_Var13 == nil { |
| 467 | - | templ_7745c5c3_Var18 = templ.NopComponent | 313 | + | templ_7745c5c3_Var13 = templ.NopComponent |
| 468 | } | 314 | } | ||
| 469 | ctx = templ.ClearChildren(ctx) | 315 | ctx = templ.ClearChildren(ctx) | ||
| 470 | if data.Loading { | 316 | if data.Loading { | ||
| @@ -478,7 +324,7 @@ func HistoryDomains(data historyRenderData) templ.Component { | |||||
| 478 | return templ_7745c5c3_Err | 324 | return templ_7745c5c3_Err | ||
| 479 | } | 325 | } | ||
| 480 | } else { | 326 | } else { | ||
| 481 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<div class=\"sv-domain-list\">") | 327 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<div class=\"sv-domain-list\">") |
| 482 | if templ_7745c5c3_Err != nil { | 328 | if templ_7745c5c3_Err != nil { | ||
| 483 | return templ_7745c5c3_Err | 329 | return templ_7745c5c3_Err | ||
| 484 | } | 330 | } | ||
| @@ -486,99 +332,104 @@ func HistoryDomains(data historyRenderData) templ.Component { | |||||
| 486 | if domain != nil && domain.Domain != "" { | 332 | if domain != nil && domain.Domain != "" { | ||
| 487 | domainKey := historyDomainActionKey(domain) | 333 | domainKey := historyDomainActionKey(domain) | ||
| 488 | displayDomain := historyDomainDisplayLabel(domain) | 334 | displayDomain := historyDomainDisplayLabel(domain) | ||
| 489 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<span class=\"sv-domain-chip\"><span class=\"sv-domain-chip-main\"><button type=\"button\" class=\"sv-domain-filter\" data-sv-action=\"history.filterDomain\" data-domain=\"") | 335 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<span class=\"sv-domain-chip\"><span class=\"sv-domain-chip-main\"><button type=\"button\" class=\"sv-domain-filter\" data-sv-action=\"history.filterDomain\" data-domain=\"") |
| 490 | if templ_7745c5c3_Err != nil { | 336 | if templ_7745c5c3_Err != nil { | ||
| 491 | return templ_7745c5c3_Err | 337 | return templ_7745c5c3_Err | ||
| 492 | } | 338 | } | ||
| 493 | - | var templ_7745c5c3_Var19 string | 339 | + | var templ_7745c5c3_Var14 string |
| 494 | - | templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) | 340 | + | templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) |
| 495 | if templ_7745c5c3_Err != nil { | 341 | if templ_7745c5c3_Err != nil { | ||
| 496 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 95, Col: 115} | 342 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 68, Col: 115} |
| 497 | } | 343 | } | ||
| 498 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) | 344 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) |
| 499 | if templ_7745c5c3_Err != nil { | 345 | if templ_7745c5c3_Err != nil { | ||
| 500 | return templ_7745c5c3_Err | 346 | return templ_7745c5c3_Err | ||
| 501 | } | 347 | } | ||
| 502 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "\">") | 348 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\">") |
| 503 | if templ_7745c5c3_Err != nil { | 349 | if templ_7745c5c3_Err != nil { | ||
| 504 | return templ_7745c5c3_Err | 350 | return templ_7745c5c3_Err | ||
| 505 | } | 351 | } | ||
| 506 | - | var templ_7745c5c3_Var20 string | 352 | + | var templ_7745c5c3_Var15 string |
| 507 | - | templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(displayDomain) | 353 | + | templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(displayDomain) |
| 508 | if templ_7745c5c3_Err != nil { | 354 | if templ_7745c5c3_Err != nil { | ||
| 509 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 95, Col: 133} | 355 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 68, Col: 133} |
| 510 | } | 356 | } | ||
| 511 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) | 357 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) |
| 512 | if templ_7745c5c3_Err != nil { | 358 | if templ_7745c5c3_Err != nil { | ||
| 513 | return templ_7745c5c3_Err | 359 | return templ_7745c5c3_Err | ||
| 514 | } | 360 | } | ||
| 515 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</button> <span class=\"sv-domain-meta\">") | 361 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</button> <span class=\"sv-domain-meta\">") |
| 516 | if templ_7745c5c3_Err != nil { | 362 | if templ_7745c5c3_Err != nil { | ||
| 517 | return templ_7745c5c3_Err | 363 | return templ_7745c5c3_Err | ||
| 518 | } | 364 | } | ||
| 519 | - | var templ_7745c5c3_Var21 string | 365 | + | var templ_7745c5c3_Var16 string |
| 520 | - | templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d pages · %d visits", domain.PageCount, domain.TotalVisits)) | 366 | + | templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%dp · %dv", domain.PageCount, domain.TotalVisits)) |
| 521 | if templ_7745c5c3_Err != nil { | 367 | if templ_7745c5c3_Err != nil { | ||
| 522 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 96, Col: 112} | 368 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 69, Col: 101} |
| 523 | } | 369 | } | ||
| 524 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) | 370 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) |
| 525 | if templ_7745c5c3_Err != nil { | 371 | if templ_7745c5c3_Err != nil { | ||
| 526 | return templ_7745c5c3_Err | 372 | return templ_7745c5c3_Err | ||
| 527 | } | 373 | } | ||
| 528 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</span></span> <button type=\"button\" class=\"sv-icon-button sv-danger\" data-sv-action=\"history.deleteDomain\" data-domain=\"") | 374 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</span></span> <button type=\"button\" class=\"sv-domain-delete\" data-sv-action=\"history.deleteDomain\" data-domain=\"") |
| 529 | if templ_7745c5c3_Err != nil { | 375 | if templ_7745c5c3_Err != nil { | ||
| 530 | return templ_7745c5c3_Err | 376 | return templ_7745c5c3_Err | ||
| 531 | } | 377 | } | ||
| 532 | - | var templ_7745c5c3_Var22 string | 378 | + | var templ_7745c5c3_Var17 string |
| 533 | - | templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) | 379 | + | templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(domainKey) |
| 534 | if templ_7745c5c3_Err != nil { | 380 | if templ_7745c5c3_Err != nil { | ||
| 535 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 98, Col: 122} | 381 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 114} |
| 536 | } | 382 | } | ||
| 537 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) | 383 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) |
| 538 | if templ_7745c5c3_Err != nil { | 384 | if templ_7745c5c3_Err != nil { | ||
| 539 | return templ_7745c5c3_Err | 385 | return templ_7745c5c3_Err | ||
| 540 | } | 386 | } | ||
| 541 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\" data-sv-confirm=\"") | 387 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\" data-sv-confirm=\"") |
| 542 | if templ_7745c5c3_Err != nil { | 388 | if templ_7745c5c3_Err != nil { | ||
| 543 | return templ_7745c5c3_Err | 389 | return templ_7745c5c3_Err | ||
| 544 | } | 390 | } | ||
| 545 | - | var templ_7745c5c3_Var23 string | 391 | + | var templ_7745c5c3_Var18 string |
| 546 | - | templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs("Delete all history for " + displayDomain + "?") | 392 | + | templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs("Delete all history for " + displayDomain + "?") |
| 547 | if templ_7745c5c3_Err != nil { | 393 | if templ_7745c5c3_Err != nil { | ||
| 548 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 98, Col: 190} | 394 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 182} |
| 549 | } | 395 | } | ||
| 550 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) | 396 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) |
| 551 | if templ_7745c5c3_Err != nil { | 397 | if templ_7745c5c3_Err != nil { | ||
| 552 | return templ_7745c5c3_Err | 398 | return templ_7745c5c3_Err | ||
| 553 | } | 399 | } | ||
| 554 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\" aria-label=\"") | 400 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\" aria-label=\"") |
| 555 | if templ_7745c5c3_Err != nil { | 401 | if templ_7745c5c3_Err != nil { | ||
| 556 | return templ_7745c5c3_Err | 402 | return templ_7745c5c3_Err | ||
| 557 | } | 403 | } | ||
| 558 | - | var templ_7745c5c3_Var24 string | 404 | + | var templ_7745c5c3_Var19 string |
| 559 | - | templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs("Delete history for " + displayDomain) | 405 | + | templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs("Delete history for " + displayDomain) |
| 560 | if templ_7745c5c3_Err != nil { | 406 | if templ_7745c5c3_Err != nil { | ||
| 561 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 98, Col: 243} | 407 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 235} |
| 562 | } | 408 | } | ||
| 563 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) | 409 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) |
| 564 | if templ_7745c5c3_Err != nil { | 410 | if templ_7745c5c3_Err != nil { | ||
| 565 | return templ_7745c5c3_Err | 411 | return templ_7745c5c3_Err | ||
| 566 | } | 412 | } | ||
| 567 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\">") | 413 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "\"><span aria-hidden=\"true\">×</span><span class=\"sv-sr-only\">Delete history for ") |
| 568 | if templ_7745c5c3_Err != nil { | 414 | if templ_7745c5c3_Err != nil { | ||
| 569 | return templ_7745c5c3_Err | 415 | return templ_7745c5c3_Err | ||
| 570 | } | 416 | } | ||
| 571 | - | templ_7745c5c3_Err = IconOnly(iconTrash, "Delete history for "+displayDomain).Render(ctx, templ_7745c5c3_Buffer) | 417 | + | var templ_7745c5c3_Var20 string |
| 418 | + | templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(displayDomain) | |||
| 419 | + | if templ_7745c5c3_Err != nil { | |||
| 420 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 71, Col: 331} | |||
| 421 | + | } | |||
| 422 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) | |||
| 572 | if templ_7745c5c3_Err != nil { | 423 | if templ_7745c5c3_Err != nil { | ||
| 573 | return templ_7745c5c3_Err | 424 | return templ_7745c5c3_Err | ||
| 574 | } | 425 | } | ||
| 575 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</button></span>") | 426 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</span></button></span>") |
| 576 | if templ_7745c5c3_Err != nil { | 427 | if templ_7745c5c3_Err != nil { | ||
| 577 | return templ_7745c5c3_Err | 428 | return templ_7745c5c3_Err | ||
| 578 | } | 429 | } | ||
| 579 | } | 430 | } | ||
| 580 | } | 431 | } | ||
| 581 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</div>") | 432 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</div>") |
| 582 | if templ_7745c5c3_Err != nil { | 433 | if templ_7745c5c3_Err != nil { | ||
| 583 | return templ_7745c5c3_Err | 434 | return templ_7745c5c3_Err | ||
| 584 | } | 435 | } | ||
| @@ -603,9 +454,9 @@ func HistoryTimeline(data historyRenderData) templ.Component { | |||||
| 603 | }() | 454 | }() | ||
| 604 | } | 455 | } | ||
| 605 | ctx = templ.InitializeContext(ctx) | 456 | ctx = templ.InitializeContext(ctx) | ||
| 606 | - | templ_7745c5c3_Var25 := templ.GetChildren(ctx) | 457 | + | templ_7745c5c3_Var21 := templ.GetChildren(ctx) |
| 607 | - | if templ_7745c5c3_Var25 == nil { | 458 | + | if templ_7745c5c3_Var21 == nil { |
| 608 | - | templ_7745c5c3_Var25 = templ.NopComponent | 459 | + | templ_7745c5c3_Var21 = templ.NopComponent |
| 609 | } | 460 | } | ||
| 610 | ctx = templ.ClearChildren(ctx) | 461 | ctx = templ.ClearChildren(ctx) | ||
| 611 | if data.Loading { | 462 | if data.Loading { | ||
| @@ -614,7 +465,7 @@ func HistoryTimeline(data historyRenderData) templ.Component { | |||||
| 614 | return templ_7745c5c3_Err | 465 | return templ_7745c5c3_Err | ||
| 615 | } | 466 | } | ||
| 616 | } else { | 467 | } else { | ||
| 617 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<div class=\"sv-history-timeline-list\" data-sv-history-timeline>") | 468 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<div class=\"sv-history-timeline-list\" data-sv-history-timeline>") |
| 618 | if templ_7745c5c3_Err != nil { | 469 | if templ_7745c5c3_Err != nil { | ||
| 619 | return templ_7745c5c3_Err | 470 | return templ_7745c5c3_Err | ||
| 620 | } | 471 | } | ||
| @@ -634,7 +485,7 @@ func HistoryTimeline(data historyRenderData) templ.Component { | |||||
| 634 | if templ_7745c5c3_Err != nil { | 485 | if templ_7745c5c3_Err != nil { | ||
| 635 | return templ_7745c5c3_Err | 486 | return templ_7745c5c3_Err | ||
| 636 | } | 487 | } | ||
| 637 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</div>") | 488 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</div>") |
| 638 | if templ_7745c5c3_Err != nil { | 489 | if templ_7745c5c3_Err != nil { | ||
| 639 | return templ_7745c5c3_Err | 490 | return templ_7745c5c3_Err | ||
| 640 | } | 491 | } | ||
| @@ -659,9 +510,9 @@ func HistoryTimelineAppend(data historyRenderData) templ.Component { | |||||
| 659 | }() | 510 | }() | ||
| 660 | } | 511 | } | ||
| 661 | ctx = templ.InitializeContext(ctx) | 512 | ctx = templ.InitializeContext(ctx) | ||
| 662 | - | templ_7745c5c3_Var26 := templ.GetChildren(ctx) | 513 | + | templ_7745c5c3_Var22 := templ.GetChildren(ctx) |
| 663 | - | if templ_7745c5c3_Var26 == nil { | 514 | + | if templ_7745c5c3_Var22 == nil { |
| 664 | - | templ_7745c5c3_Var26 = templ.NopComponent | 515 | + | templ_7745c5c3_Var22 = templ.NopComponent |
| 665 | } | 516 | } | ||
| 666 | ctx = templ.ClearChildren(ctx) | 517 | ctx = templ.ClearChildren(ctx) | ||
| 667 | templ_7745c5c3_Err = HistoryTimelineAppendGroups(data.Entries, data.AppendSkipFirstDate).Render(ctx, templ_7745c5c3_Buffer) | 518 | templ_7745c5c3_Err = HistoryTimelineAppendGroups(data.Entries, data.AppendSkipFirstDate).Render(ctx, templ_7745c5c3_Buffer) | ||
| @@ -692,9 +543,9 @@ func HistoryTimelineGroups(entries []*entity.HistoryEntry, skipFirstDate string) | |||||
| 692 | }() | 543 | }() | ||
| 693 | } | 544 | } | ||
| 694 | ctx = templ.InitializeContext(ctx) | 545 | ctx = templ.InitializeContext(ctx) | ||
| 695 | - | templ_7745c5c3_Var27 := templ.GetChildren(ctx) | 546 | + | templ_7745c5c3_Var23 := templ.GetChildren(ctx) |
| 696 | - | if templ_7745c5c3_Var27 == nil { | 547 | + | if templ_7745c5c3_Var23 == nil { |
| 697 | - | templ_7745c5c3_Var27 = templ.NopComponent | 548 | + | templ_7745c5c3_Var23 = templ.NopComponent |
| 698 | } | 549 | } | ||
| 699 | ctx = templ.ClearChildren(ctx) | 550 | ctx = templ.ClearChildren(ctx) | ||
| 700 | groups := groupHistoryEntries(entries) | 551 | groups := groupHistoryEntries(entries) | ||
| @@ -724,28 +575,28 @@ func HistoryTimelineAppendGroups(entries []*entity.HistoryEntry, mergeFirstDate | |||||
| 724 | }() | 575 | }() | ||
| 725 | } | 576 | } | ||
| 726 | ctx = templ.InitializeContext(ctx) | 577 | ctx = templ.InitializeContext(ctx) | ||
| 727 | - | templ_7745c5c3_Var28 := templ.GetChildren(ctx) | 578 | + | templ_7745c5c3_Var24 := templ.GetChildren(ctx) |
| 728 | - | if templ_7745c5c3_Var28 == nil { | 579 | + | if templ_7745c5c3_Var24 == nil { |
| 729 | - | templ_7745c5c3_Var28 = templ.NopComponent | 580 | + | templ_7745c5c3_Var24 = templ.NopComponent |
| 730 | } | 581 | } | ||
| 731 | ctx = templ.ClearChildren(ctx) | 582 | ctx = templ.ClearChildren(ctx) | ||
| 732 | groups := groupHistoryEntries(entries) | 583 | groups := groupHistoryEntries(entries) | ||
| 733 | for index, group := range groups { | 584 | for index, group := range groups { | ||
| 734 | if index == 0 && group.Date == mergeFirstDate { | 585 | if index == 0 && group.Date == mergeFirstDate { | ||
| 735 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<div data-sv-history-merge-date=\"") | 586 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<div data-sv-history-merge-date=\"") |
| 736 | if templ_7745c5c3_Err != nil { | 587 | if templ_7745c5c3_Err != nil { | ||
| 737 | return templ_7745c5c3_Err | 588 | return templ_7745c5c3_Err | ||
| 738 | } | 589 | } | ||
| 739 | - | var templ_7745c5c3_Var29 string | 590 | + | var templ_7745c5c3_Var25 string |
| 740 | - | templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) | 591 | + | templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) |
| 741 | if templ_7745c5c3_Err != nil { | 592 | if templ_7745c5c3_Err != nil { | ||
| 742 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 138, Col: 47} | 593 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 111, Col: 47} |
| 743 | } | 594 | } | ||
| 744 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) | 595 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) |
| 745 | if templ_7745c5c3_Err != nil { | 596 | if templ_7745c5c3_Err != nil { | ||
| 746 | return templ_7745c5c3_Err | 597 | return templ_7745c5c3_Err | ||
| 747 | } | 598 | } | ||
| 748 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "\">") | 599 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\">") |
| 749 | if templ_7745c5c3_Err != nil { | 600 | if templ_7745c5c3_Err != nil { | ||
| 750 | return templ_7745c5c3_Err | 601 | return templ_7745c5c3_Err | ||
| 751 | } | 602 | } | ||
| @@ -757,7 +608,7 @@ func HistoryTimelineAppendGroups(entries []*entity.HistoryEntry, mergeFirstDate | |||||
| 757 | } | 608 | } | ||
| 758 | } | 609 | } | ||
| 759 | } | 610 | } | ||
| 760 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "</div>") | 611 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</div>") |
| 761 | if templ_7745c5c3_Err != nil { | 612 | if templ_7745c5c3_Err != nil { | ||
| 762 | return templ_7745c5c3_Err | 613 | return templ_7745c5c3_Err | ||
| 763 | } | 614 | } | ||
| @@ -788,48 +639,48 @@ func HistoryTimelineGroup(group historyTimelineGroup, showHeading bool) templ.Co | |||||
| 788 | }() | 639 | }() | ||
| 789 | } | 640 | } | ||
| 790 | ctx = templ.InitializeContext(ctx) | 641 | ctx = templ.InitializeContext(ctx) | ||
| 791 | - | templ_7745c5c3_Var30 := templ.GetChildren(ctx) | 642 | + | templ_7745c5c3_Var26 := templ.GetChildren(ctx) |
| 792 | - | if templ_7745c5c3_Var30 == nil { | 643 | + | if templ_7745c5c3_Var26 == nil { |
| 793 | - | templ_7745c5c3_Var30 = templ.NopComponent | 644 | + | templ_7745c5c3_Var26 = templ.NopComponent |
| 794 | } | 645 | } | ||
| 795 | ctx = templ.ClearChildren(ctx) | 646 | ctx = templ.ClearChildren(ctx) | ||
| 796 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<section class=\"sv-timeline-group\" data-sv-history-date=\"") | 647 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<section class=\"sv-timeline-group\" data-sv-history-date=\"") |
| 797 | if templ_7745c5c3_Err != nil { | 648 | if templ_7745c5c3_Err != nil { | ||
| 798 | return templ_7745c5c3_Err | 649 | return templ_7745c5c3_Err | ||
| 799 | } | 650 | } | ||
| 800 | - | var templ_7745c5c3_Var31 string | 651 | + | var templ_7745c5c3_Var27 string |
| 801 | - | templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) | 652 | + | templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date) |
| 802 | if templ_7745c5c3_Err != nil { | 653 | if templ_7745c5c3_Err != nil { | ||
| 803 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 152, Col: 69} | 654 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 125, Col: 69} |
| 804 | } | 655 | } | ||
| 805 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) | 656 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) |
| 806 | if templ_7745c5c3_Err != nil { | 657 | if templ_7745c5c3_Err != nil { | ||
| 807 | return templ_7745c5c3_Err | 658 | return templ_7745c5c3_Err | ||
| 808 | } | 659 | } | ||
| 809 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "\">") | 660 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\">") |
| 810 | if templ_7745c5c3_Err != nil { | 661 | if templ_7745c5c3_Err != nil { | ||
| 811 | return templ_7745c5c3_Err | 662 | return templ_7745c5c3_Err | ||
| 812 | } | 663 | } | ||
| 813 | if showHeading { | 664 | if showHeading { | ||
| 814 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<h3>") | 665 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<h3>") |
| 815 | if templ_7745c5c3_Err != nil { | 666 | if templ_7745c5c3_Err != nil { | ||
| 816 | return templ_7745c5c3_Err | 667 | return templ_7745c5c3_Err | ||
| 817 | } | 668 | } | ||
| 818 | - | var templ_7745c5c3_Var32 string | 669 | + | var templ_7745c5c3_Var28 string |
| 819 | - | templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(group.Label) | 670 | + | templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(group.Label) |
| 820 | if templ_7745c5c3_Err != nil { | 671 | if templ_7745c5c3_Err != nil { | ||
| 821 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 154, Col: 20} | 672 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 127, Col: 20} |
| 822 | } | 673 | } | ||
| 823 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) | 674 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) |
| 824 | if templ_7745c5c3_Err != nil { | 675 | if templ_7745c5c3_Err != nil { | ||
| 825 | return templ_7745c5c3_Err | 676 | return templ_7745c5c3_Err | ||
| 826 | } | 677 | } | ||
| 827 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</h3>") | 678 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</h3>") |
| 828 | if templ_7745c5c3_Err != nil { | 679 | if templ_7745c5c3_Err != nil { | ||
| 829 | return templ_7745c5c3_Err | 680 | return templ_7745c5c3_Err | ||
| 830 | } | 681 | } | ||
| 831 | } | 682 | } | ||
| 832 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<ul class=\"sv-list\">") | 683 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<ul class=\"sv-list\">") |
| 833 | if templ_7745c5c3_Err != nil { | 684 | if templ_7745c5c3_Err != nil { | ||
| 834 | return templ_7745c5c3_Err | 685 | return templ_7745c5c3_Err | ||
| 835 | } | 686 | } | ||
| @@ -841,7 +692,7 @@ func HistoryTimelineGroup(group historyTimelineGroup, showHeading bool) templ.Co | |||||
| 841 | } | 692 | } | ||
| 842 | } | 693 | } | ||
| 843 | } | 694 | } | ||
| 844 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</ul></section>") | 695 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</ul></section>") |
| 845 | if templ_7745c5c3_Err != nil { | 696 | if templ_7745c5c3_Err != nil { | ||
| 846 | return templ_7745c5c3_Err | 697 | return templ_7745c5c3_Err | ||
| 847 | } | 698 | } | ||
| @@ -865,40 +716,40 @@ func HistoryLoadMore(data historyRenderData) templ.Component { | |||||
| 865 | }() | 716 | }() | ||
| 866 | } | 717 | } | ||
| 867 | ctx = templ.InitializeContext(ctx) | 718 | ctx = templ.InitializeContext(ctx) | ||
| 868 | - | templ_7745c5c3_Var33 := templ.GetChildren(ctx) | 719 | + | templ_7745c5c3_Var29 := templ.GetChildren(ctx) |
| 869 | - | if templ_7745c5c3_Var33 == nil { | 720 | + | if templ_7745c5c3_Var29 == nil { |
| 870 | - | templ_7745c5c3_Var33 = templ.NopComponent | 721 | + | templ_7745c5c3_Var29 = templ.NopComponent |
| 871 | } | 722 | } | ||
| 872 | ctx = templ.ClearChildren(ctx) | 723 | ctx = templ.ClearChildren(ctx) | ||
| 873 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<div class=\"sv-history-load-more\" data-sv-history-load-more-container>") | 724 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<div class=\"sv-history-load-more\" data-sv-history-load-more-container>") |
| 874 | if templ_7745c5c3_Err != nil { | 725 | if templ_7745c5c3_Err != nil { | ||
| 875 | return templ_7745c5c3_Err | 726 | return templ_7745c5c3_Err | ||
| 876 | } | 727 | } | ||
| 877 | if showHistoryLoadMore(data) { | 728 | if showHistoryLoadMore(data) { | ||
| 878 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<button type=\"button\" class=\"sv-button sv-button-secondary\" data-sv-action=\"history.loadMore\" data-before=\"") | 729 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<button type=\"button\" class=\"sv-button sv-button-secondary\" data-sv-action=\"history.loadMore\" data-before=\"") |
| 879 | if templ_7745c5c3_Err != nil { | 730 | if templ_7745c5c3_Err != nil { | ||
| 880 | return templ_7745c5c3_Err | 731 | return templ_7745c5c3_Err | ||
| 881 | } | 732 | } | ||
| 882 | - | var templ_7745c5c3_Var34 string | 733 | + | var templ_7745c5c3_Var30 string |
| 883 | - | templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(historyLoadMoreCursor(data)) | 734 | + | templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(historyLoadMoreCursor(data)) |
| 884 | if templ_7745c5c3_Err != nil { | 735 | if templ_7745c5c3_Err != nil { | ||
| 885 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 169, Col: 138} | 736 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 142, Col: 138} |
| 886 | } | 737 | } | ||
| 887 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) | 738 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) |
| 888 | if templ_7745c5c3_Err != nil { | 739 | if templ_7745c5c3_Err != nil { | ||
| 889 | return templ_7745c5c3_Err | 740 | return templ_7745c5c3_Err | ||
| 890 | } | 741 | } | ||
| 891 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\" data-sv-history-load-more>Load older visits</button>") | 742 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\" data-sv-history-load-more>Load older visits</button>") |
| 892 | if templ_7745c5c3_Err != nil { | 743 | if templ_7745c5c3_Err != nil { | ||
| 893 | return templ_7745c5c3_Err | 744 | return templ_7745c5c3_Err | ||
| 894 | } | 745 | } | ||
| 895 | } else if strings.TrimSpace(data.Query) == "" && countHistoryEntries(data.Entries) > 0 { | 746 | } else if strings.TrimSpace(data.Query) == "" && countHistoryEntries(data.Entries) > 0 { | ||
| 896 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<p class=\"sv-meta\">End of history</p>") | 747 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<p class=\"sv-meta\">End of history</p>") |
| 897 | if templ_7745c5c3_Err != nil { | 748 | if templ_7745c5c3_Err != nil { | ||
| 898 | return templ_7745c5c3_Err | 749 | return templ_7745c5c3_Err | ||
| 899 | } | 750 | } | ||
| 900 | } | 751 | } | ||
| 901 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "</div>") | 752 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</div>") |
| 902 | if templ_7745c5c3_Err != nil { | 753 | if templ_7745c5c3_Err != nil { | ||
| 903 | return templ_7745c5c3_Err | 754 | return templ_7745c5c3_Err | ||
| 904 | } | 755 | } | ||
| @@ -922,162 +773,162 @@ func HistoryItem(entry *entity.HistoryEntry) templ.Component { | |||||
| 922 | }() | 773 | }() | ||
| 923 | } | 774 | } | ||
| 924 | ctx = templ.InitializeContext(ctx) | 775 | ctx = templ.InitializeContext(ctx) | ||
| 925 | - | templ_7745c5c3_Var35 := templ.GetChildren(ctx) | 776 | + | templ_7745c5c3_Var31 := templ.GetChildren(ctx) |
| 926 | - | if templ_7745c5c3_Var35 == nil { | 777 | + | if templ_7745c5c3_Var31 == nil { |
| 927 | - | templ_7745c5c3_Var35 = templ.NopComponent | 778 | + | templ_7745c5c3_Var31 = templ.NopComponent |
| 928 | } | 779 | } | ||
| 929 | ctx = templ.ClearChildren(ctx) | 780 | ctx = templ.ClearChildren(ctx) | ||
| 930 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<li class=\"sv-list-row\"><article class=\"sv-history-item\" data-sv-history-row data-history-id=\"") | 781 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<li class=\"sv-list-row\"><article class=\"sv-history-item\" data-sv-history-row data-history-id=\"") |
| 931 | if templ_7745c5c3_Err != nil { | 782 | if templ_7745c5c3_Err != nil { | ||
| 932 | return templ_7745c5c3_Err | 783 | return templ_7745c5c3_Err | ||
| 933 | } | 784 | } | ||
| 934 | - | var templ_7745c5c3_Var36 string | 785 | + | var templ_7745c5c3_Var32 string |
| 935 | - | templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) | 786 | + | templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) |
| 936 | if templ_7745c5c3_Err != nil { | 787 | if templ_7745c5c3_Err != nil { | ||
| 937 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 178, Col: 100} | 788 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 151, Col: 100} |
| 938 | } | 789 | } | ||
| 939 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36)) | 790 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) |
| 940 | if templ_7745c5c3_Err != nil { | 791 | if templ_7745c5c3_Err != nil { | ||
| 941 | return templ_7745c5c3_Err | 792 | return templ_7745c5c3_Err | ||
| 942 | } | 793 | } | ||
| 943 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\"><div class=\"sv-history-content\">") | 794 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "\"><div class=\"sv-history-content\">") |
| 944 | if templ_7745c5c3_Err != nil { | 795 | if templ_7745c5c3_Err != nil { | ||
| 945 | return templ_7745c5c3_Err | 796 | return templ_7745c5c3_Err | ||
| 946 | } | 797 | } | ||
| 947 | faviconURL := historyItemFaviconURL(entry) | 798 | faviconURL := historyItemFaviconURL(entry) | ||
| 948 | - | var templ_7745c5c3_Var37 = []any{historyFaviconClass(faviconURL)} | 799 | + | var templ_7745c5c3_Var33 = []any{historyFaviconClass(faviconURL)} |
| 949 | - | templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var37...) | 800 | + | templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var33...) |
| 950 | if templ_7745c5c3_Err != nil { | 801 | if templ_7745c5c3_Err != nil { | ||
| 951 | return templ_7745c5c3_Err | 802 | return templ_7745c5c3_Err | ||
| 952 | } | 803 | } | ||
| 953 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<span class=\"") | 804 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<span class=\"") |
| 954 | if templ_7745c5c3_Err != nil { | 805 | if templ_7745c5c3_Err != nil { | ||
| 955 | return templ_7745c5c3_Err | 806 | return templ_7745c5c3_Err | ||
| 956 | } | 807 | } | ||
| 957 | - | var templ_7745c5c3_Var38 string | 808 | + | var templ_7745c5c3_Var34 string |
| 958 | - | templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var37).String()) | 809 | + | templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var33).String()) |
| 959 | if templ_7745c5c3_Err != nil { | 810 | if templ_7745c5c3_Err != nil { | ||
| 960 | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 1, Col: 0} | 811 | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 1, Col: 0} | ||
| 961 | } | 812 | } | ||
| 962 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38)) | 813 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) |
| 963 | if templ_7745c5c3_Err != nil { | 814 | if templ_7745c5c3_Err != nil { | ||
| 964 | return templ_7745c5c3_Err | 815 | return templ_7745c5c3_Err | ||
| 965 | } | 816 | } | ||
| 966 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "\" aria-hidden=\"true\"><span class=\"sv-history-favicon-fallback\">") | 817 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\" aria-hidden=\"true\"><span class=\"sv-history-favicon-fallback\">") |
| 967 | if templ_7745c5c3_Err != nil { | 818 | if templ_7745c5c3_Err != nil { | ||
| 968 | return templ_7745c5c3_Err | 819 | return templ_7745c5c3_Err | ||
| 969 | } | 820 | } | ||
| 970 | - | var templ_7745c5c3_Var39 string | 821 | + | var templ_7745c5c3_Var35 string |
| 971 | - | templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(historyFaviconFallback(entry)) | 822 | + | templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(historyFaviconFallback(entry)) |
| 972 | if templ_7745c5c3_Err != nil { | 823 | if templ_7745c5c3_Err != nil { | ||
| 973 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 182, Col: 78} | 824 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 155, Col: 78} |
| 974 | } | 825 | } | ||
| 975 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39)) | 826 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35)) |
| 976 | if templ_7745c5c3_Err != nil { | 827 | if templ_7745c5c3_Err != nil { | ||
| 977 | return templ_7745c5c3_Err | 828 | return templ_7745c5c3_Err | ||
| 978 | } | 829 | } | ||
| 979 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</span> ") | 830 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</span> ") |
| 980 | if templ_7745c5c3_Err != nil { | 831 | if templ_7745c5c3_Err != nil { | ||
| 981 | return templ_7745c5c3_Err | 832 | return templ_7745c5c3_Err | ||
| 982 | } | 833 | } | ||
| 983 | if faviconURL != "" { | 834 | if faviconURL != "" { | ||
| 984 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "<img src=\"") | 835 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<img src=\"") |
| 985 | if templ_7745c5c3_Err != nil { | 836 | if templ_7745c5c3_Err != nil { | ||
| 986 | return templ_7745c5c3_Err | 837 | return templ_7745c5c3_Err | ||
| 987 | } | 838 | } | ||
| 988 | - | var templ_7745c5c3_Var40 string | 839 | + | var templ_7745c5c3_Var36 string |
| 989 | - | templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(templ.SafeURL(faviconURL)) | 840 | + | templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(templ.SafeURL(faviconURL)) |
| 990 | if templ_7745c5c3_Err != nil { | 841 | if templ_7745c5c3_Err != nil { | ||
| 991 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 184, Col: 42} | 842 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 157, Col: 42} |
| 992 | } | 843 | } | ||
| 993 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) | 844 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36)) |
| 994 | if templ_7745c5c3_Err != nil { | 845 | if templ_7745c5c3_Err != nil { | ||
| 995 | return templ_7745c5c3_Err | 846 | return templ_7745c5c3_Err | ||
| 996 | } | 847 | } | ||
| 997 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "\" alt=\"\" width=\"24\" height=\"24\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"same-origin\" onerror=\"this.parentElement.classList.remove('sv-history-favicon-has-image'); this.remove()\">") | 848 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\" alt=\"\" width=\"24\" height=\"24\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"same-origin\" onerror=\"this.parentElement.classList.remove('sv-history-favicon-has-image'); this.remove()\">") |
| 998 | if templ_7745c5c3_Err != nil { | 849 | if templ_7745c5c3_Err != nil { | ||
| 999 | return templ_7745c5c3_Err | 850 | return templ_7745c5c3_Err | ||
| 1000 | } | 851 | } | ||
| 1001 | } | 852 | } | ||
| 1002 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</span><div class=\"sv-history-main\"><a class=\"sv-link sv-history-open\" href=\"") | 853 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</span><div class=\"sv-history-main\"><a class=\"sv-link sv-history-open\" href=\"") |
| 1003 | if templ_7745c5c3_Err != nil { | 854 | if templ_7745c5c3_Err != nil { | ||
| 1004 | return templ_7745c5c3_Err | 855 | return templ_7745c5c3_Err | ||
| 1005 | } | 856 | } | ||
| 1006 | - | var templ_7745c5c3_Var41 templ.SafeURL | 857 | + | var templ_7745c5c3_Var37 templ.SafeURL |
| 1007 | - | templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) | 858 | + | templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) |
| 1008 | if templ_7745c5c3_Err != nil { | 859 | if templ_7745c5c3_Err != nil { | ||
| 1009 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 188, Col: 85} | 860 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 161, Col: 85} |
| 1010 | } | 861 | } | ||
| 1011 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) | 862 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37)) |
| 1012 | if templ_7745c5c3_Err != nil { | 863 | if templ_7745c5c3_Err != nil { | ||
| 1013 | return templ_7745c5c3_Err | 864 | return templ_7745c5c3_Err | ||
| 1014 | } | 865 | } | ||
| 1015 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\">") | 866 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "\">") |
| 1016 | if templ_7745c5c3_Err != nil { | 867 | if templ_7745c5c3_Err != nil { | ||
| 1017 | return templ_7745c5c3_Err | 868 | return templ_7745c5c3_Err | ||
| 1018 | } | 869 | } | ||
| 1019 | - | var templ_7745c5c3_Var42 string | 870 | + | var templ_7745c5c3_Var38 string |
| 1020 | - | templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemLabel(entry)) | 871 | + | templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemLabel(entry)) |
| 1021 | if templ_7745c5c3_Err != nil { | 872 | if templ_7745c5c3_Err != nil { | ||
| 1022 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 188, Col: 113} | 873 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 161, Col: 113} |
| 1023 | } | 874 | } | ||
| 1024 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42)) | 875 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38)) |
| 1025 | if templ_7745c5c3_Err != nil { | 876 | if templ_7745c5c3_Err != nil { | ||
| 1026 | return templ_7745c5c3_Err | 877 | return templ_7745c5c3_Err | ||
| 1027 | } | 878 | } | ||
| 1028 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</a><p class=\"sv-history-url\" title=\"") | 879 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</a><p class=\"sv-history-url\" title=\"") |
| 1029 | if templ_7745c5c3_Err != nil { | 880 | if templ_7745c5c3_Err != nil { | ||
| 1030 | return templ_7745c5c3_Err | 881 | return templ_7745c5c3_Err | ||
| 1031 | } | 882 | } | ||
| 1032 | - | var templ_7745c5c3_Var43 string | 883 | + | var templ_7745c5c3_Var39 string |
| 1033 | - | templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(entry.URL) | 884 | + | templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(entry.URL) |
| 1034 | if templ_7745c5c3_Err != nil { | 885 | if templ_7745c5c3_Err != nil { | ||
| 1035 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 189, Col: 48} | 886 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 162, Col: 48} |
| 1036 | } | 887 | } | ||
| 1037 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) | 888 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39)) |
| 1038 | if templ_7745c5c3_Err != nil { | 889 | if templ_7745c5c3_Err != nil { | ||
| 1039 | return templ_7745c5c3_Err | 890 | return templ_7745c5c3_Err | ||
| 1040 | } | 891 | } | ||
| 1041 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "\">") | 892 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\">") |
| 1042 | if templ_7745c5c3_Err != nil { | 893 | if templ_7745c5c3_Err != nil { | ||
| 1043 | return templ_7745c5c3_Err | 894 | return templ_7745c5c3_Err | ||
| 1044 | } | 895 | } | ||
| 1045 | - | var templ_7745c5c3_Var44 string | 896 | + | var templ_7745c5c3_Var40 string |
| 1046 | - | templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemURL(entry)) | 897 | + | templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemURL(entry)) |
| 1047 | if templ_7745c5c3_Err != nil { | 898 | if templ_7745c5c3_Err != nil { | ||
| 1048 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 189, Col: 74} | 899 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 162, Col: 74} |
| 1049 | } | 900 | } | ||
| 1050 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44)) | 901 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) |
| 1051 | if templ_7745c5c3_Err != nil { | 902 | if templ_7745c5c3_Err != nil { | ||
| 1052 | return templ_7745c5c3_Err | 903 | return templ_7745c5c3_Err | ||
| 1053 | } | 904 | } | ||
| 1054 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</p><p class=\"sv-history-meta\">") | 905 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</p><p class=\"sv-history-meta\">") |
| 1055 | if templ_7745c5c3_Err != nil { | 906 | if templ_7745c5c3_Err != nil { | ||
| 1056 | return templ_7745c5c3_Err | 907 | return templ_7745c5c3_Err | ||
| 1057 | } | 908 | } | ||
| 1058 | - | var templ_7745c5c3_Var45 string | 909 | + | var templ_7745c5c3_Var41 string |
| 1059 | - | templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemMeta(entry)) | 910 | + | templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(historyItemMeta(entry)) |
| 1060 | if templ_7745c5c3_Err != nil { | 911 | if templ_7745c5c3_Err != nil { | ||
| 1061 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 190, Col: 56} | 912 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 163, Col: 56} |
| 1062 | } | 913 | } | ||
| 1063 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45)) | 914 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) |
| 1064 | if templ_7745c5c3_Err != nil { | 915 | if templ_7745c5c3_Err != nil { | ||
| 1065 | return templ_7745c5c3_Err | 916 | return templ_7745c5c3_Err | ||
| 1066 | } | 917 | } | ||
| 1067 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "</p></div></div><div class=\"sv-history-row-actions\"><a class=\"sv-button sv-button-secondary\" href=\"") | 918 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</p></div></div><div class=\"sv-history-row-actions\"><a class=\"sv-button sv-button-secondary\" href=\"") |
| 1068 | if templ_7745c5c3_Err != nil { | 919 | if templ_7745c5c3_Err != nil { | ||
| 1069 | return templ_7745c5c3_Err | 920 | return templ_7745c5c3_Err | ||
| 1070 | } | 921 | } | ||
| 1071 | - | var templ_7745c5c3_Var46 templ.SafeURL | 922 | + | var templ_7745c5c3_Var42 templ.SafeURL |
| 1072 | - | templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) | 923 | + | templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(sanitizeHref(entry.URL))) |
| 1073 | if templ_7745c5c3_Err != nil { | 924 | if templ_7745c5c3_Err != nil { | ||
| 1074 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 194, Col: 90} | 925 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 167, Col: 90} |
| 1075 | } | 926 | } | ||
| 1076 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46)) | 927 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42)) |
| 1077 | if templ_7745c5c3_Err != nil { | 928 | if templ_7745c5c3_Err != nil { | ||
| 1078 | return templ_7745c5c3_Err | 929 | return templ_7745c5c3_Err | ||
| 1079 | } | 930 | } | ||
| 1080 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "\">") | 931 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "\">") |
| 1081 | if templ_7745c5c3_Err != nil { | 932 | if templ_7745c5c3_Err != nil { | ||
| 1082 | return templ_7745c5c3_Err | 933 | return templ_7745c5c3_Err | ||
| 1083 | } | 934 | } | ||
| @@ -1085,30 +936,30 @@ func HistoryItem(entry *entity.HistoryEntry) templ.Component { | |||||
| 1085 | if templ_7745c5c3_Err != nil { | 936 | if templ_7745c5c3_Err != nil { | ||
| 1086 | return templ_7745c5c3_Err | 937 | return templ_7745c5c3_Err | ||
| 1087 | } | 938 | } | ||
| 1088 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "</a> <button type=\"button\" class=\"sv-button sv-button-secondary sv-button-danger sv-button-icon-only\" data-sv-action=\"history.deleteEntry\" data-id=\"") | 939 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</a> <button type=\"button\" class=\"sv-button sv-button-secondary sv-button-danger sv-button-icon-only\" data-sv-action=\"history.deleteEntry\" data-id=\"") |
| 1089 | if templ_7745c5c3_Err != nil { | 940 | if templ_7745c5c3_Err != nil { | ||
| 1090 | return templ_7745c5c3_Err | 941 | return templ_7745c5c3_Err | ||
| 1091 | } | 942 | } | ||
| 1092 | - | var templ_7745c5c3_Var47 string | 943 | + | var templ_7745c5c3_Var43 string |
| 1093 | - | templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) | 944 | + | templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", entry.ID)) |
| 1094 | if templ_7745c5c3_Err != nil { | 945 | if templ_7745c5c3_Err != nil { | ||
| 1095 | - | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 195, Col: 175} | 946 | + | return templ.Error{Err: templ_7745c5c3_Err, FileName: `history.templ`, Line: 168, Col: 175} |
| 1096 | } | 947 | } | ||
| 1097 | - | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47)) | 948 | + | _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) |
| 1098 | if templ_7745c5c3_Err != nil { | 949 | if templ_7745c5c3_Err != nil { | ||
| 1099 | return templ_7745c5c3_Err | 950 | return templ_7745c5c3_Err | ||
| 1100 | } | 951 | } | ||
| 1101 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\" data-sv-confirm=\"Delete this history entry?\" aria-label=\"Delete this history entry\"") | 952 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "\" data-sv-confirm=\"Delete this history entry?\" aria-label=\"Delete this history entry\"") |
| 1102 | if templ_7745c5c3_Err != nil { | 953 | if templ_7745c5c3_Err != nil { | ||
| 1103 | return templ_7745c5c3_Err | 954 | return templ_7745c5c3_Err | ||
| 1104 | } | 955 | } | ||
| 1105 | if entry.ID <= 0 { | 956 | if entry.ID <= 0 { | ||
| 1106 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, " disabled") | 957 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, " disabled") |
| 1107 | if templ_7745c5c3_Err != nil { | 958 | if templ_7745c5c3_Err != nil { | ||
| 1108 | return templ_7745c5c3_Err | 959 | return templ_7745c5c3_Err | ||
| 1109 | } | 960 | } | ||
| 1110 | } | 961 | } | ||
| 1111 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, ">") | 962 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, ">") |
| 1112 | if templ_7745c5c3_Err != nil { | 963 | if templ_7745c5c3_Err != nil { | ||
| 1113 | return templ_7745c5c3_Err | 964 | return templ_7745c5c3_Err | ||
| 1114 | } | 965 | } | ||
| @@ -1116,7 +967,7 @@ func HistoryItem(entry *entity.HistoryEntry) templ.Component { | |||||
| 1116 | if templ_7745c5c3_Err != nil { | 967 | if templ_7745c5c3_Err != nil { | ||
| 1117 | return templ_7745c5c3_Err | 968 | return templ_7745c5c3_Err | ||
| 1118 | } | 969 | } | ||
| 1119 | - | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "</button></div></article></li>") | 970 | + | templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</button></div></article></li>") |
| 1120 | if templ_7745c5c3_Err != nil { | 971 | if templ_7745c5c3_Err != nil { | ||
| 1121 | return templ_7745c5c3_Err | 972 | return templ_7745c5c3_Err | ||
| 1122 | } | 973 | } | ||
M internal/ui/systemviews/history_view.go +13 -29
| @@ -12,8 +12,6 @@ import ( | |||
| 12 | 12 | ||
| 13 | 13 | const historyURLDisplayMaxRunes = 180 | |
| 14 | 14 | ||
| 15 | - | const historySearchTitleMaxRunes = 48 | |
| 16 | - | ||
| 17 | 15 | type historyRenderData struct { | |
| 18 | 16 | Entries []*entity.HistoryEntry | |
| 19 | 17 | Stats *entity.HistoryStats | |
| @@ -55,37 +53,23 @@ func historyTimelineAppendHTML(data historyRenderData) string { | |||
| 55 | 53 | ||
| 56 | 54 | func historyDocumentTitle(data historyRenderData) string { | |
| 57 | 55 | if data.Loading { | |
| 58 | - | return "History — Loading" | |
| 59 | - | } | |
| 60 | - | if query := strings.TrimSpace(data.Query); query != "" { | |
| 61 | - | return "History — search: " + truncateTitle(query, historySearchTitleMaxRunes) | |
| 56 | + | return "History - Loading" | |
| 62 | 57 | } | |
| 63 | - | if domain := strings.TrimSpace(data.DomainFilter); domain != "" { | |
| 64 | - | label := browserurl.DisplayDomain(domain) | |
| 65 | - | if label == "" { | |
| 66 | - | label = domain | |
| 67 | - | } | |
| 68 | - | return "History — " + label | |
| 69 | - | } | |
| 70 | - | ||
| 71 | - | entries := int64(countHistoryEntries(data.Entries)) | |
| 72 | - | if data.Stats != nil { | |
| 73 | - | entries = data.Stats.TotalEntries | |
| 74 | - | } else if data.Analytics != nil { | |
| 75 | - | entries = data.Analytics.TotalEntries | |
| 76 | - | } | |
| 77 | - | if entries == 1 { | |
| 78 | - | return "History — 1 entry" | |
| 79 | - | } | |
| 80 | - | return fmt.Sprintf("History — %d entries", entries) | |
| 58 | + | entries, visits, days := historySummaryValues(data) | |
| 59 | + | return fmt.Sprintf( | |
| 60 | + | "History - %s, %s, %s", | |
| 61 | + | historyCountLabel(entries, "entry", "entries"), | |
| 62 | + | historyCountLabel(visits, "visit", "visits"), | |
| 63 | + | historyCountLabel(days, "day", "days"), | |
| 64 | + | ) | |
| 81 | 65 | } | |
| 82 | 66 | ||
| 83 | - | func truncateTitle(value string, maxRunes int) string { | |
| 84 | - | runes := []rune(strings.TrimSpace(value)) | |
| 85 | - | if maxRunes <= 0 || len(runes) <= maxRunes { | |
| 86 | - | return string(runes) | |
| 67 | + | func historyCountLabel(count int64, singular, plural string) string { | |
| 68 | + | label := plural | |
| 69 | + | if count == 1 { | |
| 70 | + | label = singular | |
| 87 | 71 | } | |
| 88 | - | return string(runes[:maxRunes]) + "…" | |
| 72 | + | return fmt.Sprintf("%d %s", count, label) | |
| 89 | 73 | } | |
| 90 | 74 | ||
| 91 | 75 | var historyCleanupRanges = []historyCleanupItem{ | |
| @@ -12,8 +12,6 @@ import ( | |||||
| 12 | 12 | ||||
| 13 | const historyURLDisplayMaxRunes = 180 | 13 | const historyURLDisplayMaxRunes = 180 | ||
| 14 | 14 | ||||
| 15 | - | const historySearchTitleMaxRunes = 48 | |||
| 16 | - | ||||
| 17 | type historyRenderData struct { | 15 | type historyRenderData struct { | ||
| 18 | Entries []*entity.HistoryEntry | 16 | Entries []*entity.HistoryEntry | ||
| 19 | Stats *entity.HistoryStats | 17 | Stats *entity.HistoryStats | ||
| @@ -55,37 +53,23 @@ func historyTimelineAppendHTML(data historyRenderData) string { | |||||
| 55 | 53 | ||||
| 56 | func historyDocumentTitle(data historyRenderData) string { | 54 | func historyDocumentTitle(data historyRenderData) string { | ||
| 57 | if data.Loading { | 55 | if data.Loading { | ||
| 58 | - | return "History — Loading" | 56 | + | return "History - Loading" |
| 59 | - | } | |||
| 60 | - | if query := strings.TrimSpace(data.Query); query != "" { | |||
| 61 | - | return "History — search: " + truncateTitle(query, historySearchTitleMaxRunes) | |||
| 62 | } | 57 | } | ||
| 63 | - | if domain := strings.TrimSpace(data.DomainFilter); domain != "" { | 58 | + | entries, visits, days := historySummaryValues(data) |
| 64 | - | label := browserurl.DisplayDomain(domain) | 59 | + | return fmt.Sprintf( |
| 65 | - | if label == "" { | 60 | + | "History - %s, %s, %s", |
| 66 | - | label = domain | 61 | + | historyCountLabel(entries, "entry", "entries"), |
| 67 | - | } | 62 | + | historyCountLabel(visits, "visit", "visits"), |
| 68 | - | return "History — " + label | 63 | + | historyCountLabel(days, "day", "days"), |
| 69 | - | } | 64 | + | ) |
| 70 | - | ||||
| 71 | - | entries := int64(countHistoryEntries(data.Entries)) | |||
| 72 | - | if data.Stats != nil { | |||
| 73 | - | entries = data.Stats.TotalEntries | |||
| 74 | - | } else if data.Analytics != nil { | |||
| 75 | - | entries = data.Analytics.TotalEntries | |||
| 76 | - | } | |||
| 77 | - | if entries == 1 { | |||
| 78 | - | return "History — 1 entry" | |||
| 79 | - | } | |||
| 80 | - | return fmt.Sprintf("History — %d entries", entries) | |||
| 81 | } | 65 | } | ||
| 82 | 66 | ||||
| 83 | - | func truncateTitle(value string, maxRunes int) string { | 67 | + | func historyCountLabel(count int64, singular, plural string) string { |
| 84 | - | runes := []rune(strings.TrimSpace(value)) | 68 | + | label := plural |
| 85 | - | if maxRunes <= 0 || len(runes) <= maxRunes { | 69 | + | if count == 1 { |
| 86 | - | return string(runes) | 70 | + | label = singular |
| 87 | } | 71 | } | ||
| 88 | - | return string(runes[:maxRunes]) + "…" | 72 | + | return fmt.Sprintf("%d %s", count, label) |
| 89 | } | 73 | } | ||
| 90 | 74 | ||||
| 91 | var historyCleanupRanges = []historyCleanupItem{ | 75 | var historyCleanupRanges = []historyCleanupItem{ | ||