Render notifications.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 14 Nov 2010 14:39:58 +0000 (15:39 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 14 Nov 2010 14:39:58 +0000 (15:39 +0100)
src/main/resources/i18n/sone.en.properties
src/main/resources/static/css/sone.css
src/main/resources/templates/dismissNotification.html [new file with mode: 0644]
src/main/resources/templates/include/head.html
src/main/resources/templates/notify/startupNotification.html [new file with mode: 0644]

index 2da12e4..2c2f514 100644 (file)
@@ -142,6 +142,8 @@ Page.NoPermission.Title=Unauthorized Access - Sone
 Page.NoPermission.Page.Title=Unauthorized Access
 Page.NoPermission.Text.NoPermission=You tried to do something that you do not have sufficient authorization for. Please refrain from such actions in the future or we will be forced to take counter-measures!
 
+Page.DismissNotification.Title=Dismiss Notification - Sone
+
 Page.WotPluginMissing.Title=Web of Trust Plugin Missing - Sone
 Page.WotPluginMissing.Page.Title=Web of Trust Plugin Missing
 Page.WotPluginMissing.Text.WotRequired=Because the Web of Trust is an integral part of Sone, the Web of Trust plugin has to be loaded in order to run Sone.
@@ -201,3 +203,6 @@ WebInterface.Notification.NewPostCount=You have new posts:
 WebInterface.Notification.NewReplyCount=You have new replies:
 
 Warning.PluginNotConnected.Text=The Web of Trust plugin could not be found! This can happen if the Web of Trust plugin is not loaded or if your node is currently still starting up. In the first case, load the Web of Trust plugin using the {link}plugin manager{/link}, in the second case wait until the Web of Trust plugin has been loaded, because in either case Sone will not be working unless the Web of Trust plugin is loaded!
+
+Notification.Startup.Text=Sone is currently starting up. It may take a while to retrieve all identities and Sones from the web of trust. If you are missing some elements, please be patient, they will probably reappear very soon.
+Notification.Button.Dismiss=Dismiss
index c6b65ff..75a0bfd 100644 (file)
@@ -60,6 +60,10 @@ textarea {
        margin-bottom: 1ex;
 }
 
+#sone #notification-area .notification .dismiss {
+       float: right;
+}
+
 #sone #notification-area .notification > div {
        display: inline;
 }
diff --git a/src/main/resources/templates/dismissNotification.html b/src/main/resources/templates/dismissNotification.html
new file mode 100644 (file)
index 0000000..196af72
--- /dev/null
@@ -0,0 +1,3 @@
+<%include include/head.html>
+
+<%include include/tail.html>
index 858851a..2a2d3b6 100644 (file)
                        </div>
                <%/if>
 
-               <div id="notification-area"></div>
+               <div id="notification-area">
+                       <%foreach webInterface.core.notifications.all notification>
+                               <div class="notification">
+                                       <%if notification.dismissable>
+                                               <form class="dismiss" action="dismissNotification.html" method="post">
+                                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                                                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+                                                       <input type="hidden" name="notification" value="<% notification.id|html>" />
+                                                       <button type="submit"><%= Notification.Button.Dismiss|l10n|html></button>
+                                               </form>
+                                       <%/if>
+                                       <% notification.render>
+                               </div>
+                       <%/foreach>
+               </div>
 
                <div id="profile" class="<%ifnull currentSone>offline<%else>online<%/if>">
                        <a class="picture" href="index.html">
diff --git a/src/main/resources/templates/notify/startupNotification.html b/src/main/resources/templates/notify/startupNotification.html
new file mode 100644 (file)
index 0000000..8210f8f
--- /dev/null
@@ -0,0 +1 @@
+<div class="text"><%= Notification.Startup.Text|l10n|html></div>