add service URL changelog linked service

This commit is contained in:
pluja 2025-01-09 18:03:39 +01:00
parent ecede95fbc
commit acdb1c0981
No known key found for this signature in database

View File

@ -11,7 +11,7 @@ func changeTitle(change *ent.Change) string {
}
// If the service is not found, use the default title format.
return fmt.Sprintf("%s: %s", change.Edges.Service.Name, change.Title)
return fmt.Sprintf("<a class='underline' href='/service/%s'>%s</a>: %s", change.Edges.Service.Slug, change.Edges.Service.Name, change.Title)
}
templ Changelog(changes []*ent.Change) {
@ -29,10 +29,11 @@ templ Changelog(changes []*ent.Change) {
}
>
<h3 class="text-xs text-white/50">
{ change.CreatedAt.Format("January 2, 2006 - 15:04") } {
change.CreatedAt.Location().String() }
{ change.CreatedAt.Format("January 2, 2006 - 15:04") } { change.CreatedAt.Location().String() } // <date> UTC
</h3>
<h2 class="font-bold uppercase">{ changeTitle(change) }</h2>
<h2 class="font-bold uppercase">
@templ.Raw(changeTitle(change))
</h2>
<p class="mt-1 text-sm font-normal text-white/80">
@templ.Raw(change.Summary)
</p>