[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm doc/loncapafiles loncapafiles.lpml

www www at source.lon-capa.org
Tue Jan 10 15:06:08 EST 2012


www		Tue Jan 10 20:06:08 2012 EDT

  Modified files:              
    /doc/loncapafiles	loncapafiles.lpml 
    /loncom/interface	lonfeedback.pm 
  Log:
  User testing:
  * you should vote on whether or not you "like" something AFTER you read it
  * the you-know-you-have-done-this-because-you-cannot-do-it-anymore logic escaped users
  
  
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.781 doc/loncapafiles/loncapafiles.lpml:1.782
--- doc/loncapafiles/loncapafiles.lpml:1.781	Tue Jan 10 14:52:49 2012
+++ doc/loncapafiles/loncapafiles.lpml	Tue Jan 10 20:05:59 2012
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.781 2012/01/10 14:52:49 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.782 2012/01/10 20:05:59 www Exp $ -->
 
 <!--
 
@@ -7082,7 +7082,9 @@
 srvr.png;
 subm.png;
 thumbsup.png;
+thumbsup_gray.png;
 thumbsdown.png;
+thumbsdown_gray.png;
 back.png;
 catalog.png;
 com.png;
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.333 loncom/interface/lonfeedback.pm:1.334
--- loncom/interface/lonfeedback.pm:1.333	Tue Jan 10 14:52:57 2012
+++ loncom/interface/lonfeedback.pm	Tue Jan 10 20:06:07 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.333 2012/01/10 14:52:57 www Exp $
+# $Id: lonfeedback.pm,v 1.334 2012/01/10 20:06:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1155,22 +1155,12 @@
                                 @{$$namesort{$lastname}{$firstname}} = ("$idx");
                             }
                             if ($outputtarget ne 'tex') {
+# Add karma stars
                                 my $karma=&userkarma($contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'});
                                 for (my $i=1;$i<=$karma;$i++) {
                                     $sender.='<img border="0" src="/res/adm/pages/star.gif" alt="'.&mt('Contributor Kudos').'" />';
                                 }
-                                unless ($likes{$symb.':'.$idx.':likers'}=~/\,\Q$thisuser\E\,/) {
-                                    $sender.=' '.&discussion_link($symb,'<img border="0" src="/res/adm/pages/thumbsup.png" alt="'.&mt('Like').'" />','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting"));
-                                }
-                                unless ($likes{$symb.':'.$idx.':unlikers'}=~/\,\Q$thisuser\E\,/) {
-                                    $sender.=' '.&discussion_link($symb,'<img border="0" src="/res/adm/pages/thumbsdown.png" alt="'.&mt('Unlike').'" />',,'unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting"));
-                                }
-                                my $thislikes=$likes{$symb.':'.$idx.':likes'};
-                                if ($thislikes>0) { 
-                                    $sender.=' ('.&mt("[_1] likes",$thislikes).')';
-                                } elsif ($thislikes<0) {
-                                    $sender.=' ('.&mt("[_1] unlikes",abs($thislikes)).')';
-                                }
+# Can people edit this?
                                 if (&editing_allowed($escsymb.':::'.$idx,$group)) {
                                     if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
                                         $sender.=' '.
@@ -1366,13 +1356,32 @@
                             } elsif ($thislikes<$oneminus) {
                                 $likesize="75";
                             }
+# Actually glue in the message itself
                             $$discussionitems[$idx].= '<br /><blockquote>'.
                                     "<div style='font-size:$likesize%'>".
                                     $message.
                                     '</div></blockquote>';
+# Put in the like and unlike buttons
+                            unless ($likes{$symb.':'.$idx.':likers'}=~/\,\Q$thisuser\E\,/) {
+                                $$discussionitems[$idx].=' '.&discussion_link($symb,'<img border="0" src="/res/adm/pages/thumbsup.png" alt="'.&mt('Like').'" />','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting"));
+                            } else {
+                                $$discussionitems[$idx].='<img border="0" src="/res/adm/pages/thumbsup_gray.png" alt="'.&mt('You like this posting').'" />';
+                            }
+                            unless ($likes{$symb.':'.$idx.':unlikers'}=~/\,\Q$thisuser\E\,/) {
+                                $$discussionitems[$idx].=' '.&discussion_link($symb,'<img border="0" src="/res/adm/pages/thumbsdown.png" alt="'.&mt('Unlike').'" />',,'unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting"));
+                            } else {
+                                $$discussionitems[$idx].='<img border="0" src="/res/adm/pages/thumbsdown_gray.png" alt="'.&mt('You unlike this posting').'" />';
+                            }
+                            my $thislikes=$likes{$symb.':'.$idx.':likes'};
+                            if ($thislikes>0) {
+                                $$discussionitems[$idx].=' ('.&mt("[_1] likes",$thislikes).')';
+                            } elsif ($thislikes<0) {
+                                $$discussionitems[$idx].=' ('.&mt("[_1] unlikes",abs($thislikes)).')';
+                            }
+# If there is any history to this post, inform the reader
                             if ($contrib{$idx.':history'}) {
                                 my @postversions = ();
-                                $$discussionitems[$idx] .= &mt('This post has been edited by the author.');
+                                $$discussionitems[$idx] .= '  '.&mt('This post has been edited by the author.');
                                 if ($seeid) {
                                     $$discussionitems[$idx] .= '  '.
                                          &discussion_link($symb,&mt('Display all versions'),'allversions',$idx,$$newpostsflag,$prevread,&group_args($group));




More information about the LON-CAPA-cvs mailing list