From 36af6a6efdac06222844893180d39f611dd29a42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 19 Jan 2011 15:57:00 +0100 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9Cmark=20as=20read=E2=80=9D=20butto?= =?utf8?q?ns=20to=20new=20post,=20reply,=20and=20Sone=20notifications.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/resources/i18n/sone.en.properties | 1 + src/main/resources/static/css/sone.css | 4 ++++ src/main/resources/static/javascript/sone.js | 5 +++++ src/main/resources/templates/include/head.html | 2 +- src/main/resources/templates/notify/newPostNotification.html | 11 +++++++++-- src/main/resources/templates/notify/newReplyNotification.html | 11 +++++++++-- src/main/resources/templates/notify/newSoneNotification.html | 11 +++++++++-- 7 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 7b8450f..e608358 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -233,6 +233,7 @@ Notification.NewSone.ShortText=New Sones have been discovered: Notification.NewSone.Text=New Sones have been discovered: Notification.NewPost.ShortText=New posts have been discovered. Notification.NewPost.Text=New posts have been discovered by the following Sones: +Notification.NewPost.Button.MarkRead=Mark as read Notification.NewReply.ShortText=New replies have been discovered. Notification.NewReply.Text=New replies have been discovered by the following Sones: Notification.SoneIsBeingRescued.Text=The following Sones are currently being rescued: diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 323cb0e..a83d3a1 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -108,6 +108,10 @@ textarea { margin-left: 1ex; } +#sone #notification-area .notification .mark-as-read { + float: right; +} + #sone #plugin-warning { border: solid 0.5em red; padding: 0.5em; diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 9d00c5a..b48dac3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -680,6 +680,11 @@ function ajaxifyNotification(notification) { notification.find("form.dismiss").submit(function() { return false; }); + notification.find("input[name=returnPage]").val($.url.attr("relative")); + if (notification.find(".short-text").length > 0) { + notification.find(".short-text").removeClass("hidden"); + notification.find(".text").addClass("hidden"); + } notification.find("form.dismiss button").click(function() { $.getJSON("dismissNotification.ajax", { "formPassword" : getFormPassword(), "notification" : notification.attr("id") }, function(data, textStatus) { /* dismiss in case of error, too. */ diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index 4e43da4..aec46cf 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -27,7 +27,7 @@ <%/if> - <% notification> + <%include notification request=request> <%/foreach> diff --git a/src/main/resources/templates/notify/newPostNotification.html b/src/main/resources/templates/notify/newPostNotification.html index 94f7a1f..e5d7792 100644 --- a/src/main/resources/templates/notify/newPostNotification.html +++ b/src/main/resources/templates/notify/newPostNotification.html @@ -1,8 +1,15 @@ -
+ -