samizdat-devel
[Top][All Lists]
Advanced

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

anonymous user invited to choose focus and then ignored + proposed fix


From: boud
Subject: anonymous user invited to choose focus and then ignored + proposed fix
Date: Sun, 1 Jul 2007 01:42:23 +0200 (CEST)

hi samizdat-devel,

Another small annoying bug which seems easy to fix.

https://savannah.nongnu.org/bugs/index.php?20305

PROBLEM:

In 070618-1 or earlier (since 070501?), in both the basic and advanced
interfaces, when publishing an article, an anonymous user ("guest") is
given an option "Select focus that this resource will be related
to". If s/he does choose a focus, then that focus is ignored at the
preview stage and in turn after confirmation.


DISCUSSION:

This is likely to be frustrating to anonymous users. Either we could
choose to allow anonymous users to choose one focus when publishing
(without allowing them to add new foci), or we should not give them a
select box for choosing a focus.

i don't have a strong feeling one way or the other. However, since
config.yaml says, "Guests are never allowed to vote." we should be
consistent with this - either change this comment or else hide the
select box. For simplicity, i chose the latter.

PROPOSED FIX (vs 070618-1):

The proposed fix is in application_helper, to not propose a
focus selection to a guest user.


cheers
boud


--- /tmp/tmp_snapshot/samizdat/lib/samizdat/helpers/application_helper.rb       
2007-06-17 17:14:42.000000000 +0200
+++ /usr/lib/ruby/1.8/samizdat/helpers/application_helper.rb    2007-07-01 
00:52:58.994326896 +0200

@@ -191,9 +191,15 @@
       focuses.unshift( [(focus.id or focus.uriref), focus.name] )
     end
     focuses.unshift [nil, _('SELECT FOCUS')]
-    fields =
-      [ [:label, 'focus', _('Select focus that this resource will be related 
to')],
+
+    if @request.access('vote')
+      fields =
+        [ [:label, 'focus', _('Select focus that this resource will be related 
to')],
           [:select, 'focus', focuses, (focus ? (focus.id or focus.uriref) : 
nil)] ]
+    else
+      fields = []
+    end
+
     if advanced
       fields.push(
         [:label, 'focus_id', _("Enter focus id if it's not in the list")],





reply via email to

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