Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming. Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
"pageswiki/internal/store"
|
|
)
|
|
|
|
func (s *Server) decorateTaskNotification(r *http.Request, n *store.Notification) {
|
|
if n.Kind == store.TaskFocusEventType {
|
|
n.Href = ""
|
|
n.Message = "Timer completed"
|
|
if s.getLocale(s.domainUUIDForRequest(r)) == "ja" {
|
|
n.Message = "タイマーが終了しました"
|
|
}
|
|
if s.systemExtensionEnabled(s.domainUUIDForRequest(r), "organizer.tasks") {
|
|
n.Href = "/v/plan/today"
|
|
}
|
|
return
|
|
}
|
|
if n.Kind != "task.due" && n.Kind != "task.planned" {
|
|
return
|
|
}
|
|
domain := s.domainUUIDForRequest(r)
|
|
locale := s.getLocale(domain)
|
|
n.Href = ""
|
|
n.Message = translate(locale, "tasks.reminder_unavailable")
|
|
if !s.systemExtensionEnabled(domain, "organizer.tasks") {
|
|
return
|
|
}
|
|
// The notification has already been fetched under its authenticated
|
|
// recipient. Recheck the live task ownership/membership before projecting.
|
|
title, err := s.store.TaskReminderTitle(r.Context(), domain, n.RecipientUUID, n.EventUUID)
|
|
if err != nil {
|
|
return
|
|
}
|
|
n.Message = translate(locale, "tasks.reminder_"+n.Kind[5:]) + ": " + title
|
|
n.Href = "/v/plan/task/" + n.RequestUUID
|
|
}
|