X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=6085ff82c99ac6e2d2d562c5b4e44f1334695bed;hb=3af098881713ac16350da6decf652b97e6cba4ce;hp=c11a3cc309b69fcfb176272d369ebfcd73d9d0f8;hpb=0697b26de3127e2a9cebb7a1e500416f2acf9320;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index c11a3cc..6085ff8 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -142,6 +142,9 @@ public class WebInterface implements CoreListener { /** The “Sone locked” notification. */ private final ListNotification lockedSonesNotification; + /** The “new version” notification. */ + private final TemplateNotification newVersionNotification; + /** * Creates a new web interface. * @@ -190,6 +193,9 @@ public class WebInterface implements CoreListener { Template lockedSonesTemplate = templateFactory.createTemplate(createReader("/templates/notify/lockedSonesNotification.html")); lockedSonesNotification = new ListNotification("sones-locked-notification", "sones", lockedSonesTemplate); + + Template newVersionTemplate = templateFactory.createTemplate(createReader("/templates/notify/newVersionNotification.html")); + newVersionNotification = new TemplateNotification("new-version-notification", newVersionTemplate); } // @@ -706,6 +712,9 @@ public class WebInterface implements CoreListener { */ @Override public void updateFound(Version version, long releaseTime) { + newVersionNotification.set("version", version); + newVersionNotification.set("releaseTime", releaseTime); + notificationManager.addNotification(newVersionNotification); } /**