samizdat-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

message_hide-0.4


From: boud
Subject: message_hide-0.4
Date: Wed, 24 Jan 2007 03:00:54 +0100 (CET)

hi samizdat-devel,

On Mon, 22 Jan 2007, Dmitry Borodaenko wrote:

On 1/21/07, boud <address@hidden> wrote:
However, i also added a bit more to common.css - "font-size: 70%".
There are some pretty horrible things that get published, and IMHO it
should be possible to make sure that people trying to discredit
open publishing/open editing by showing openly published rubbish
have a difficult time.

I agree in principle, but in practice this solution isn't very good.
First of all, the "hidden-message" class applies to the whole message,
including its info line which already is rendered in reduced font.
Goes to show that mixing representation and markup is always a bad
idea, and while strike-through is an example of markup with a clear
meaning, playing with font sizes is as representation-specific as it
gets. Font sizes and user's preferences vary greatly, and many sites
use annoyingly small fonts for no good reason, so any message you're
trying to convey by font size will most likely be lost in the noise.

OK.  i tried (unsuccessfully) with a background image (including updating
xhtml.yaml to allow it) but didn't succeed. However, that's not a high
priority so i didn't continue.

One other thing that probably is worth doing is to hide images behind
a link the way it's done for pdfs and movies.

i agree.

Secondly, there's something missing from 0.6.0 (i haven't yet tried the new
snapshot) is that old copies of a hidden article (if that article happens
to be an article which has been openly edited, or edited by the non-anonymous
author), then someone could still link to *old* versions of the article
and innocent third parties would not necessarily realise that this is an
old version of an article which later on became hidden - unless they click
on "parent article".

Well-spotted, the issue is still there in the current version.

Once again, I can't agree with the proposed solution. Look at it from
RDF perspective. isVersionOf is a property that declares a certain
relation between to messages. This relation is external to both
messages, it can be added at one point and removed at another. The
rule that any version of a hidden message should also be treated as
hidden is even more external to the messages involved.

Well, i guess this is my instinct for computational speed - by writing
the property locally as an internal property of each old version, the
question of whether or not it's a versionOf a hidden article does not
need to be recomputed each time someone views it. But i agree that the
object-oriented approach is probably more important than computational
speed. mir was good for "some-to-many" publishing, but if we really
want many-to-many and robust long term growth of the code, then oo is better.


From this follows that instead of applying irreversible changes to the

i don't quite see why the suggestion i made was irreversible. Unhiding
also unhides all the versions of a hidden article. It would only become
difficult-to-reverse if the versionOf property can be removed.

underlying data, we should infer this decision at run time, for
example, in Message#new.

Hmmm.  Well, here's a new solution, i'm not sure if it's consistent with
what you had in mind.

In addition to hiding old versions during when rendering, it also hides them when comparing them in the history.

i was thinking of someone who modifies an article of unacceptable content,
but making zero changes, and then provides a link of the type:

http://my.site.org/history.rb?old=25&new=20

where the two versions have no differences - so that the naive
internet user following this link does not realise that both versions
are hidden versions.

i may sound paranoid, but remember that hierarchical publishers are eager to discredit open publishing/open editing - even certain wikipedia
people try to discredit indymedia, despite the nearly identical goals
and methods. IMHO it's important that the moderator collective can be
reasonably sure that its decisions on "hiding" content are made clear
to anyone looking at that content, while at the same time keeping the
content available unless it's really extreme (in which case the "replace"
function is used).

Anyway, this is my mesage-hide-0.4 patch.  It's written for the 061207
snapshot, but i think it should apply to 070120 apart from possible
line number shifts.

Both cgi-bin/history.rb and engine/template.rb are modified.

cheers
boud




--- /tmp/s061207/samizdat/cgi-bin/history.rb    2006-11-29 18:31:53.000000000 
+0100
+++ /usr/share/samizdat/cgi-bin/history.rb      2007-01-24 02:03:01.455856632 
+0100
@@ -66,8 +66,12 @@
     fn = rdf.get_property(new, 'dc::format')
     cn = rdf.get_property(new, 's::content')

-    page = t.diff({:info => ro.render, :format => fo, :content => co},
-      {:info => rn.render, :format => fn, :content => cn})
+    current_id = rdf.get_property(old, 'dct::isVersionOf')
+    ho = rdf.get_property(current_id, 's::hidden')
+    hn = ho
+
+    page = t.diff({:info => ro.render, :format => fo, :content => co, :hidden 
=> ho},
+      {:info => rn.render, :format => fn, :content => cn, :hidden => hn})
   end

   t.page(title, page)


--- /tmp/s061207/samizdat/lib/samizdat/engine/template.rb       2006-12-06 
03:08:05.000000000 +0100
+++ /usr/lib/ruby/1.8/samizdat/engine/template.rb       2007-01-24 
02:03:43.473468984 +0100
@@ -10,6 +10,9 @@

 require 'samizdat/engine'

+require 'samizdat/engine/expand_aliases'
+
+
 begin
   require 'redcloth'

@@ -498,10 +505,19 @@
       else
         message_content(translation, mode)
       end
+     html=
 %{<div class="message" id="id#{message.id}">
 #{title}<div class="info">#{info}</div>
 <div class="content">#{content}</div>
 </div>\n}
+     if(message.current)
+        current_message_hidden = rdf.get_property(message.current, 's::hidden')
+     end
+     if message.hidden  or  current_message_hidden
+        html = %{<div class="message-hidden">\n#{html}</div>\n}
+    end
+    html
+
   end

   # language selection
@@ -597,12 +613,20 @@
       left = left.join if left.kind_of? Array
       right = right.join if right.kind_of? Array
       width = right ? ' style="width: 50%"' : ' colspan="2"'
+
+      if old[:hidden] or new[:hidden]
+ div_hide = %{<div class="message-hidden">} + else + div_hide = "<div>" + end
+
       left and left = {:format => old[:format], :content => left,
         :class => (right ? ' class="delete"' : '')}
       right and right = {:format => new[:format], :content => right,
         :class => ' class="add"'}
       %{<tr>\n} + [left, right].compact.collect {|line|
-%{<td#{width}#{line[:class] if line[:content].size > 0}><div 
class="content">#{MessageContent.render_cacheable(line[:content], line[:format])}#{'&nbsp;' unless 
line[:content].size > 0}</div></td>\n}
+ %{<td#{width}#{line[:class] if line[:content].size > 0}><div class="content">} + + div_hide + %{#{MessageContent.render_cacheable(line[:content], line[:format])}#{'&nbsp;' unless line[:content].size > 0}</div></div></td>\n}
       }.join + "</tr>\n"
     }.join + %{</tbody></table>\n}
   end




reply via email to

[Prev in Thread] Current Thread [Next in Thread]