You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/01/20 10:59:11 UTC

[whimsy] branch mod-gui updated: Add indication of private messages

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch mod-gui
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/mod-gui by this push:
     new 402edf8  Add indication of private messages
402edf8 is described below

commit 402edf84dbec54bfbcbdd19c9fe26f370597728f
Author: Sebb <se...@apache.org>
AuthorDate: Sun Jan 20 10:59:09 2019 +0000

    Add indication of private messages
---
 www/moderation/desk/public/secmail.css |  4 ++++
 www/moderation/desk/views/body.html.rb | 18 ++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/www/moderation/desk/public/secmail.css b/www/moderation/desk/public/secmail.css
index 344d537..57c63e5 100644
--- a/www/moderation/desk/public/secmail.css
+++ b/www/moderation/desk/public/secmail.css
@@ -27,6 +27,10 @@ header h1, header h3 {
   opacity: 0.5;
 }
 
+.private {
+  background-image: url(private.png);
+}
+
 .doctype label {
   display: block
 }
diff --git a/www/moderation/desk/views/body.html.rb b/www/moderation/desk/views/body.html.rb
index 48ef3a3..d6dba34 100644
--- a/www/moderation/desk/views/body.html.rb
+++ b/www/moderation/desk/views/body.html.rb
@@ -6,10 +6,23 @@ _html do
   _link rel: 'stylesheet', type: 'text/css', 
     href: "../../secmail.css?#{@cssmtime}"
 
+  options = {}
+  unless @headers[:public]
+    options = {:class => 'private'}
+  end
+ _div options do
   #
   # Selected headers
   #
   _table do
+    if @headers[:public]
+      # TODO ?
+    else
+      _tr do
+        _td 'Private'
+        _td 'YES'
+      end
+    end
     if @headers[:list]
       _tr do
         _td 'Mailing-list:'
@@ -96,7 +109,7 @@ _html do
       body.force_encoding(container.charset) rescue nil
     end
 
-    _pre.bg_info body.encode('utf-8', invalid: :replace, :undef => :replace)
+    _pre body.encode('utf-8', invalid: :replace, :undef => :replace)
   else # must be a non-multi part mail
     container = @message.mail
     body = container.body.to_s
@@ -110,7 +123,7 @@ _html do
     
     if container.mime_type == 'text/plain'
 
-      _pre.bg_info body.encode('utf-8', invalid: :replace, :undef => :replace)
+      _pre body.encode('utf-8', invalid: :replace, :undef => :replace)
 
     elsif container.mime_type == 'text/html'
 
@@ -126,4 +139,5 @@ _html do
 
     end
   end
+ end
 end