X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetStatusAjaxPage.java;h=fd9ae7695b0fcb55d0f55aaa41aa0c9eb3713f12;hb=33f333b35a73d3d4a4e79f41e9dd7b342db87b1a;hp=71cc156e3c6d28d4efc59f1a0c392151c666c8b5;hpb=ecf753a31601e558b681daab0598009fe9eec99a;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java index 71cc156..fd9ae76 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -37,6 +37,7 @@ import net.pterodactylus.util.json.JsonArray; import net.pterodactylus.util.json.JsonObject; import net.pterodactylus.util.notify.Notification; import net.pterodactylus.util.notify.TemplateNotification; +import net.pterodactylus.util.template.TemplateContext; /** * The “get status” AJAX handler returns all information that is necessary to @@ -171,7 +172,9 @@ public class GetStatusAjaxPage extends JsonPage { StringWriter notificationWriter = new StringWriter(); try { if (notification instanceof TemplateNotification) { - ((TemplateNotification) notification).render(webInterface.getTemplateContextFactory().createTemplateContext().mergeContext(((TemplateNotification) notification).getTemplateContext()), notificationWriter); + TemplateContext templateContext = webInterface.getTemplateContextFactory().createTemplateContext().mergeContext(((TemplateNotification) notification).getTemplateContext()); + templateContext.set("notification", notification); + ((TemplateNotification) notification).render(templateContext, notificationWriter); } else { notification.render(notificationWriter); }