]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Riverdashboard refreshed, and updated display of comments and likes (the loading...
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 7 Apr 2010 14:10:51 +0000 (14:10 +0000)
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 7 Apr 2010 14:10:51 +0000 (14:10 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5643 36083f99-b078-4883-b0ff-0f9b5a30f544

16 files changed:
languages/en.php
mod/blog/views/default/river/object/blog/create.php
mod/groups/views/default/river/forum/create.php
mod/groups/views/default/river/forum/topic/create.php
mod/pages/views/default/river/object/page/create.php
mod/riverdashboard/views/default/river/item/wrapper.php
mod/riverdashboard/views/default/riverdashboard/css.php
mod/riverdashboard/views/default/riverdashboard/js.php
mod/riverdashboard/views/default/riverdashboard/rivercomment.php
views/default/annotation/annotate.php
views/default/annotation/likes.php
views/default/css.php
views/default/js/initialise_elgg.php
views/default/likes/forms/display.php [new file with mode: 0644]
views/default/likes/forms/edit.php
views/default/likes/forms/link.php [new file with mode: 0644]

index e0742d9097031a6650df8f0abbb19ae7cd63a259..6564cd95ffb43830cff304cc03a4eaf125f73e21 100644 (file)
@@ -843,9 +843,9 @@ If you requested this click on the link below, otherwise ignore this email.
        'likes:failure' => 'There was a problem liking this item',
        'likes:alreadyliked' => 'You have already liked this item',
        'likes:notfound' => 'The item you are trying to like cannot be found',
-       'likes:likethis' => 'Like this',
+       'likes:likethis' => 'Like',
        'likes:userlikedthis' => 'user liked this',
-       'likes:userslikethis' => 'users liked this',
+       'likes:userslikedthis' => 'users liked this',
        'likes:river:annotate' => 'likes',
 
 /**
index d59d601f5d340d86fa98c20487fea91b0d263953..1071deb3057179aecf14dc888112595eea8c07d3 100644 (file)
@@ -10,11 +10,12 @@ $contents = strip_tags($object->description); //strip tags from the contents to
 
 $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
 $title = sprintf(elgg_echo('blog:river:create'), $url);
-$string .= $title . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a> <span class='entity_subtext'>" . friendly_time($object->publish_time) . "</span>";
+$string .= $title . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a> <span class='entity_subtext'>" . friendly_time($object->publish_time) . "</span> <a class='river_comment_form_button link'>Comment</a>";
+$string .= elgg_view('likes/forms/link', array('entity' => $object));
 $string .= "<div class=\"river_content_display\">";
        $string .= "<div class='river_object_blog_create'></div>";
        if(strlen($contents) > 200) {
-               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
+               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "&hellip;";
     }else{
            $string .= $contents;
     }
index fb6cd707c73b6d3b2ed04abe5b5fe86a45be253f..e51d9fe72ca966afbb8656c389b2ee44072a854d 100644 (file)
@@ -2,7 +2,7 @@
 
        $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
        $object = get_entity($vars['item']->object_guid);
-       //$url = $object->getURL();
+       $object_url = $object->getURL();
        $forumtopic = $object->guid;
        $group_guid = $object->container_guid;
        //grab the annotation, if one exists
        $url = $vars['url'] . "mod/groups/topicposts.php?topic=" . $forumtopic . "&group_guid=" . $group_guid;
        $url_user = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
        $string = sprintf(elgg_echo("groupforum:river:posted"),$url_user) . " ";
-       $string .= elgg_echo("groupforum:river:annotate:create") . " | <a href=\"" . $url . "\">" . $object->title . "</a>";
+       $string .= elgg_echo("groupforum:river:annotate:create") . " | <a href=\"" . $url . "\">" . $object->title . "</a> <span class='entity_subtext'>". friendly_time($object->time_created) ."</span> <a class='river_comment_form_button link' href=\"{$object_url}\">Visit discussion</a>";
+       $string .= elgg_view('likes/forms/link', array('entity' => $object));
        $string .= "<div class=\"river_content_display\">";
        if($comment){
                $contents = strip_tags($comment);//this is so we don't get large images etc in the activity river
                if(strlen($contents) > 200)
-                       $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
+                       $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "&hellip;";
            else
                    $string .= $contents;
     }
index f4c4aadfd863858562f45472ee12705a48d9a242..7b06cd275b6946f2f63f1a44256c57303519d873 100644 (file)
@@ -2,7 +2,7 @@
 
        $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
        $object = get_entity($vars['item']->object_guid);
-       //$url = $object->getURL();
+       $object_url = $object->getURL();
        $forumtopic = $object->guid;
        $group_guid = $object->container_guid;
        $url = $vars['url'] . "mod/groups/topicposts.php?topic=" . $forumtopic . "&group_guid=" . $group_guid;
        $contents = strip_tags($contents);//this is so we don't get large images etc in the activity river
        $url_user = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
        $string = sprintf(elgg_echo("groupforum:river:postedtopic"),$url_user) . ": ";
-       $string .= "<a href=\"" . $url . "\">" . $object->title . "</a>";
+       $string .= "<a href=\"" . $url . "\">" . $object->title . "</a> <span class='entity_subtext'>" . friendly_time($object->time_created) . "</span> <a class='river_comment_form_button link' href=\"{$object_url}\">Visit discussion</a>";
+       $string .= elgg_view('likes/forms/link', array('entity' => $object));
        $string .= "<div class=\"river_content_display\">";
        if(strlen($contents) > 200) {
-               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
+               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "&hellip;";
        }else{
                $string .= $contents;
        }
index 27352cef6e2c2be08a71f4b53c52564e691ca41f..25efc216ab31dbac46c435d1ffec37caee748353 100644 (file)
@@ -8,10 +8,11 @@
        $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
        $contents = strip_tags($object->description); //strip tags from the contents to stop large images etc blowing out the river view
        $string = sprintf(elgg_echo("pages:river:created"),$url) . " ";
-       $string .= elgg_echo("pages:river:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
+       $string .= elgg_echo("pages:river:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a> <span class='entity_subtext'>". friendly_time($object->time_created) ."</span> <a class='river_comment_form_button link'>Comment</a>";
+       $string .= elgg_view('likes/forms/link', array('entity' => $object));
        $string .= "<div class=\"river_content_display\">";
        if(strlen($contents) > 200) {
-               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
+               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "&hellip;";
     }else{
            $string .= $contents;
     }
index 0dba70e5cc8350753396fa9f56a7804d246b3504..dba6f995334144e2d1e17d76e79be4f1da4e45c6 100644 (file)
@@ -8,6 +8,8 @@
 $object = get_entity($vars['item']->object_guid);
 //get object url
 $object_url = $object->getURL();
+$numoflikes = elgg_count_likes($object);
+
 //user
 //if displaying on the profile get the object owner, else the subject_guid
 if(get_context() == 'profile' && $object->getSubtype() ==  'thewire')
@@ -29,7 +31,7 @@ switch($vars['item']->subtype){
 //count comment annotations
 $comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, $annotation_comment);
 
-//get last two comments display
+//get last three comments display
 $get_comments = get_annotations($vars['item']->object_guid, "", "", $annotation_comment, "", "", 3, 0, "desc");
 
 if($get_comments){
@@ -37,7 +39,7 @@ if($get_comments){
        $get_comments = array_reverse($get_comments);   
 }
 
-//minus two off the comment total as we display two by default
+//minus 3 off the comment total as we display 3 by default
 if($comment_count < 3)
        $num_comments = 0;
 else
@@ -48,32 +50,40 @@ else
                <?php echo elgg_view("profile/icon",array('entity' => $user, 'size' => 'small')); ?>
        </span>
        <div class="river_item_contents clearfloat">
-               <!-- body contents, generated by the river view in each plugin -->
-               <?php echo $vars['body']; ?>
-       </div>
+       <?php 
+               // body contents, generated by the river view in each plugin
+               echo $vars['body'];     
        
-<!-- display comments and likes -->
-<?php
-       //likes
-       echo "<div class='river_comments'>";
-       echo "<div class='river_comment latest clearfloat'>";
-       echo elgg_view_likes($object);
-       echo "</div></div>";
-       //display latest 2 comments if there are any
+       //display latest 3 comments if there are any
        if($get_comments){
                $counter = 0;
-               $background = "";
-               echo "<div class='river_comments'>";
+               //$background = "";
                        
-               //display the number of comments if there are any
-               if($num_comments != 0){
-                       //set the correct context comment or comments
-                       if($num_comments == 1)
-                               echo "<a class='river_more_comments' href=\"{$object_url}\">+{$num_comments} more comment</a>";
-                       else
-                               echo "<a class='river_more_comments' href=\"{$object_url}\">+{$num_comments} more comments</a>";
+               echo "<div class='river_comments_tabs clearfloat'>";
+               
+               if($comment_count <= 3) {
+                       echo "<a class='river_more_comments show_comments_button link'>Comments</a>";
+               }       
+               
+               //display 'more comments' if there are any
+               if($num_comments != 0){                 
+                       echo "<a class='river_more_comments show_comments_button link'>Comments (+{$num_comments} more)</a>";
                }
-                       
+               
+               if($numoflikes != 0){
+                       echo elgg_view('likes/forms/display', array('entity' => $object));
+               }
+               echo "</div>"; // close river_comments_tabs
+               
+               echo "<div class='river_comments'>";
+
+               if($numoflikes != 0){
+                       //show the users who liked the object
+                       echo "<div class='likes_list hidden'>";
+                       echo list_annotations($object->getGUID(), 'likes', 99);
+                       echo "</div>";
+               }
+               
                foreach($get_comments as $gc){
                        //get the comment owner
                        $comment_owner = get_user($gc->owner_guid);
@@ -92,7 +102,7 @@ else
                        echo "</span>";
                        //truncate comment to 150 characters
                        if(strlen($gc->value) > 150) {
-                               $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "...";
+                               $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "&hellip;";
                    }
                        $contents = strip_tags($gc->value);
                    echo "<div class='river_comment_contents'>";
@@ -101,20 +111,33 @@ else
                        echo "</div></div>";
                        $counter++;
                }
+                       echo elgg_make_river_comment($object);
+                       echo "</div>"; // close river_comments
+       } else {
+               // tab bar nav - for users that liked object
+               echo "<div class='river_comments_tabs clearfloat'>";
+                       $numoflikes = elgg_count_likes($object);
+                       if($numoflikes != 0){
+                               echo elgg_view('likes/forms/display', array('entity' => $object));
+                       }       
+               echo "</div>"; // close river_comments_tabs
+               
+               echo "<div class='river_comments'>";
+               
+               if($numoflikes != 0){
+                       //show the users who liked the object
+                       echo "<div class='likes_list hidden'>";
+                       echo list_annotations($object->getGUID(), 'likes', 99);
                        echo "</div>";
                }
-                       //display the comment link
-               if($vars['item']->type != 'user'){
-                       //for now don't display the comment link on wire and conversations for now
-                       if($vars['item']->subtype != 'thewire' && $vars['item']->subtype != 'conversations' && $vars['item']->subtype != '')
-                               //don't display the comment option on group discussions atm
-                               if($vars['item']->subtype == 'groupforumtopic'){
-                                       echo "<a class='comment_link' href=\"{$object_url}\">Visit discussion</a>";
-                               }else{
-                                       echo "<div class='river_post_comment'>";
-                                       echo elgg_make_river_comment($object);
-                                       echo "</div>";
-                               }
-                       }
-               ?>
+               
+               // if there are no comments to display
+               // and this is not a user or a group discussion entry - include the inline comment form
+               if($vars['item']->type != 'user' && $vars['item']->subtype != 'groupforumtopic') {
+                       echo elgg_make_river_comment($object);
+               }
+               echo "</div>";
+       }
+echo "</div>"; // close river_item_contents
+?>
 </div>
\ No newline at end of file
index c8c004213b323235f5128a002ae918fb2a939fad..9a6109de00cc4724c90a7071e4c4ee7bed832fef 100644 (file)
 .river_item p {
        margin:0;
 }
+.river_item .entity_subtext {
+       padding-left:5px;
+       padding-right:5px;
+       font-size:85%;
+}
 .river_item_useravatar {
        float:left;
        margin-top:3px;
@@ -46,8 +51,9 @@
 }
 .river_content_display {
        border-left:1px solid #DDDDDD;
-       font-size:90%;
-       margin:8px 0 6px 0;
+       font-size:85%;
+       line-height:1.5em;
+       margin:8px 0 5px 0;
        padding-left:5px;
 }
 .following_icon {
 }
 
 /* LATEST COMMENTS IN RIVER */
+.river_comments_tabs {
+       max-height: 19px;
+       overflow:hidden;
+}
 .river_comments {
-       margin:5px 0 0 55px;
-       width:auto;
+       -moz-border-radius-bottomleft:5px;
+       -moz-border-radius-bottomright:5px;
+       -moz-border-radius-topleft:5px;
+       -moz-border-radius-topright:0;
+       -webkit-border-top-left-radius:5px;
+       -webkit-border-top-right-radius:0;
+       -webkit-border-bottom-right-radius:5px;
+       -webkit-border-bottom-left-radius:5px; 
+    background-color: #eeeeee;
 }
 .river_comment {
-       background-color: #f8f8f8;
        padding:3px;
-       margin-bottom:3px;
-       -webkit-border-radius: 4px; 
-       -moz-border-radius: 4px;        
+       border-bottom:1px solid white;  
 }
 .river_comment.penultimate {
-       background-color: #eeeeee;
+
 }
 .river_comment.latest {
-       background-color: #dedede;
-       margin-bottom:0;
-}
-a.river_more_comments {
-       display:block;
-       float:right;
-       padding:2px 4px 7px 30px;
-       text-align:right;
-       width:auto;
-}
-.river_comment_owner_icon {
-       float:left;
-       margin:3px 8px 4px 2px;
-}
-.river_comment_contents {
-       margin-left:34px;
-}
-.river_item .comment_link {
-       margin-left:55px;
-}
-.river_comments .entity_subtext {
-       display: block;
-}
 
-/*  ACTIVITY WIDGET?
-       @todo 
-       
-.collapsable_box_content .river_user_update {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_user_profileupdate {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_user_profileiconupdate {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_annotate {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_bookmarks_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_bookmarks.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_bookmarks_comment {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_status_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_status.gif) no-repeat left -1px;
 }
-.collapsable_box_content .river_object_file_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px;
+/* hidden inline comment form */
+.river_comment_form.hidden {
+       padding:5px;    
 }
-.collapsable_box_content .river_object_file_update {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_file_comment {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_widget_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_forums_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_forums_update {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_widget_update {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px;    
-}
-.collapsable_box_content .river_object_blog_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_blog_update {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_blog_comment {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_forumtopic_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_user_friend {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px;
-}
-.collapsable_box_content .river_object_relationship_friend_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px;
+.river_comment_form.hidden .input_text {
+       width:560px;
+       padding:3px;
 }
-.collapsable_box_content .river_object_relationship_member_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+.river_comment_form.hidden .submit_button {
+       margin:0 0 0 10px;
+       float:right;
 }
-.collapsable_box_content .river_object_thewire_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_thewire.gif) no-repeat left -1px;
+.river_link_divider {
+       color:#999999;
 }
-.collapsable_box_content .river_group_join {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+.river_comment_form_button,
+.river_user_like_button {
+       font-size:85%;
 }
-.collapsable_box_content .river_object_groupforumtopic_annotate {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+.elgg_likes_user {
+       border-bottom:1px solid white;
+       padding:3px;
 }
-.collapsable_box_content .river_object_groupforumtopic_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+.elgg_likes_user .entity_listing_icon {
+       margin:3px 0 4px 2px;
 }
-.collapsable_box_content .river_object_sitemessage_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;      
+.elgg_likes_user .entity_listing_info {
+       width:635px;
 }
-.collapsable_box_content .river_user_messageboard {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;   
+.elgg_likes_user .entity_metadata {
+       margin-top:3px;
 }
-.collapsable_box_content .river_object_page_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+.river_item p.elgg_likes_owner {
+       padding-top:4px;
 }
-.collapsable_box_content .river_object_page_update {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+a.river_more_comments {
+       display:block;
+       float:right;
+       padding:1px 7px 1px 7px;
+       margin-left:6px;
+       text-align:right;
+       font-size:85%;
+       width:auto;
+       background-color: #eeeeee;
+       -moz-border-radius-topleft:4px;
+       -moz-border-radius-topright:4px;
+       -webkit-border-top-left-radius:4px;
+       -webkit-border-top-right-radius:4px;
 }
-.collapsable_box_content .river_object_page_top_create {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+a.river_more_comments.off {
+       background-color: white;
 }
-.collapsable_box_content .river_object_page_top_update {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+.river_comment_owner_icon {
+       float:left;
+       margin:3px 8px 4px 2px;
 }
-.collapsable_box_content .river_object_page_top_comment {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+.river_comment_contents {
+       margin-left:34px;
 }
-.collapsable_box_content .river_object_page_comment {
-       background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+/*
+.river_item .comment_link {
+       margin-left:55px;
 }
-
 */
 
 
+
index ad96a606923041425a0459b0944057447c688787..b1bace04a8dcb52439b66daa2a96d6f185fa1514 100644 (file)
@@ -1,7 +1,35 @@
 <script type="text/javascript">
        $(document).ready(function() {
                $('.river_comment_form_button').click(function() {
-                       $(this).next('.river_comment_form').toggle();
+                       elgg_slide_toggle(this,'.river_item','.river_comment_form');                    
                });
+               
+               $('.likes_user_list_button').click(function() {
+                       var myParent = $(this).closest('.river_item');
+                       if (myParent.find('.likes_list').css('display') == 'none') {
+                               // hide comments
+                               myParent.find('.river_comment').animate({"height": "toggle", "opacity": "toggle"}, { duration: 400 });
+                               // change selected tab
+                               myParent.find('.show_comments_button').addClass('off');
+                               myParent.find('.likes_user_list_button').removeClass('off');
+                               // show users that liked object
+                               elgg_slide_toggle(this,'.river_item','.likes_list');
+                       }
+               });
+               
+               
+               $('.show_comments_button').click(function() {
+                       var myParent = $(this).closest('.river_item');
+                       if (myParent.find('.river_comment').css('display') == 'none') {
+                               // hide comments
+                               myParent.find('.likes_list').animate({"height": "toggle", "opacity": "toggle"}, { duration: 400 });
+                               // change selected tab
+                               myParent.find('.show_comments_button').removeClass('off');
+                               myParent.find('.likes_user_list_button').addClass('off');
+                               // show users that liked object
+                               elgg_slide_toggle(this,'.river_item','.river_comment');
+                       }
+               });             
+               
        });
 </script>
\ No newline at end of file
index 32d1b4675827e2c1124779aa533aac7657a09de7..d440e7ab66828ab1c7a1f098f6db9ca1f82c29ff 100644 (file)
@@ -5,11 +5,14 @@
  */
 
 if (isset($vars['entity']) && isloggedin()) {
-       $form_body = "<a class=\"river_comment_form_button\">Add comment</a>";
-       $form_body .= "<div class=\"river_comment_form\" style=\"display:none;\">";
-       $form_body .= elgg_view('input/text',array('internalname' => 'generic_comment', 'value' => 'Add a comment...'));
+       $form_body = "<div class='river_comment_form hidden'>";
+       $form_body .= elgg_view('input/text',array(
+                                                       'internalname' => 'generic_comment',
+                                                       'value' => 'Add a comment...',
+                                                       'js' => "onfocus=\"if (this.value=='Add a comment...') { this.value='' };\" onblur=\"if (this.value=='') { this.value='Add a comment...' }\""
+                                                       ));
        $form_body .= elgg_view('input/hidden', array('internalname' => 'entity_guid', 'value' => $vars['entity']->getGUID()));
-       $form_body .= elgg_view('input/submit', array('value' => elgg_echo("post")));
+       $form_body .= elgg_view('input/submit', array('value' => elgg_echo("Comment")));
        $form_body .= "</div>";
        echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/comments/add"));
 }
\ No newline at end of file
index e66035204a9eeee17f6d6500504e2b6ac727db16..2cb35798b550957fbc86fb6b771cd984e90ac761 100644 (file)
                $comment = get_annotation($vars['item']->annotation_id)->value; 
        $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
        $string = sprintf(elgg_echo("river:posted:generic"),$url) . " ";
-       $string .= elgg_echo("{$subtype}:river:annotate") . "  <a href=\"{$object->getURL()}\">" . $title . "</a> " . friendly_time($object->time_created);
+       $string .= elgg_echo("{$subtype}:river:annotate") . "  <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity_subtext'>". friendly_time($object->time_created) ."</span> <a class='river_comment_form_button link'>Comment</a>";
+       $string .= elgg_view('likes/forms/link', array('entity' => $object));
        if(get_context() != 'riverdashboard'){
                $string .= "<div class='river_content_display'>";
                if($comment){
                        $contents = strip_tags($comment);//this is so we don't get large images etc in the activity river
                        if(strlen($contents) > 200)
-                               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
+                               $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "&hellip;";
                        else
                                $string .= $contents;
                }
index 4cf27e82b85ca18da53862c2dae8dbdbb6923715..2808664dfe86a5aef3d5cac1c77beeca8a160cb5 100644 (file)
@@ -6,8 +6,8 @@
 $owner = get_user($vars['annotation']->owner_guid);
 
 ?>
-<div class="elgg_likes clearfloat">
-       <div class="elgg_likes_icon">
+<div class="elgg_likes_user clearfloat">
+       <div class="entity_listing_icon">
                <?php
                        echo elgg_view("profile/icon", array(
                                        'entity' => $owner,
@@ -16,19 +16,19 @@ $owner = get_user($vars['annotation']->owner_guid);
                ?>
        </div>
        
-       <div class="elgg_likes_details">
+       <div class="entity_listing_info">
                <?php
                // if the user looking at the like listing can edit, show the delete link
                if ($vars['annotation']->canEdit()) {
                ?>
-                       <span class="delete_button">
+                       <div class="entity_metadata"><span class="delete_button">
                                <?php echo elgg_view("output/confirmlink",array(
                                                'href' => $vars['url'] . "action/likes/delete?annotation_id=" . $vars['annotation']->id,
                                                'text' => elgg_echo('remove'),
                                                'confirm' => elgg_echo('deleteconfirm')
                                                ));
                                ?>
-                       </span>
+                       </span></div>
                <?php
                        } //end of can edit if statement
                ?>
index cc3c82d4b380c268813aea441c8b9ed61dacb2c3..70cc7ab4d2a13bb410189db4e60f5c7a3e58daf0 100644 (file)
@@ -10,7 +10,7 @@
        PAGE LAYOUT                                     main page content blocks: header, sidebar, footer...
        GENERIC SELECTORS                       reusable generic classes
        ELGG TOPBAR                                     elgg topbar
-       TOOLS MENU                                      drop-down tools menu in topbar
+       [ TOOLS MENU                                    drop-down tools menu in topbar ]
        HEADER CONTENTS
        ELGG SITE NAVIGATION            Primary site navigation in header
        FOOTER CONTENTS
@@ -354,7 +354,7 @@ h2 {
        width:100%;
 }
 #elgg_topbar_contents a {
-       margin-right:20px;
+       margin-right:30px;
        padding-top:2px;
        display:inline;
        float:left;
@@ -410,6 +410,7 @@ h2 {
 /* ***************************************
        TOOLS MENU
 *************************************** */
+/*
 #elgg_topbar_contents ul.tools_menu,
 #elgg_topbar_contents ul.tools_menu ul {
        margin:0;
@@ -448,7 +449,9 @@ h2 {
 #elgg_topbar_contents ul.tools_menu ul li {
        float: none;
 }
+*/
 /* elgg toolbar drop-down menu style */
+/*
 #elgg_topbar_contents ul.tools_menu ul {
        width: 150px;
        top: 24px;
@@ -469,7 +472,7 @@ h2 {
        text-decoration: none;
 }
 #elgg_topbar_contents ul.tools_menu ul li a {
-       background-color: #333333; /* menu off-state color */
+       background-color: #333333; 
        font-weight: bold;
        padding-left:6px;
        padding-top:4px;
@@ -480,11 +483,12 @@ h2 {
        border-bottom: 1px solid white;
 }
 #elgg_topbar_contents ul.tools_menu ul a.hover {
-       background-color: #0054a7; /* menu hover-state color */
+       background-color: #0054a7;
 }
 #elgg_topbar_contents ul.tools_menu ul a {
        opacity: 0.9;
 }
+*/
 
 
 
@@ -1058,7 +1062,8 @@ li.navigation_more ul li {
 }
 .entity_subtext {
        color:#666666;
-       font-size: 90%;
+       font-size: 85%;
+       font-style: italic;
 }
 /* entity metadata block */
 .entity_metadata {
@@ -1614,16 +1619,4 @@ a.action_button:focus {
 .admin_settings.menuitems li.custom_menuitem {
        margin-bottom:20px;
 }
-.plugin_info_label {
-       font-weight: bold;
-}
-.plugin_description {
-       font-style: italic;
-}
-.plugin_screenshot {
-       display: inline;
-       margin: 3px;
-}
-.plugin_screenshot img {
-       width: 100px;
-}
\ No newline at end of file
+
index 19b2224d945cc5a69832dbe91168e3a3b132cfcb..c7dbed4aa32ceafb7db638acf8705f7bb0f6cf53 100644 (file)
@@ -4,26 +4,6 @@ $(document).ready(function () {
        // toggle widget box contents
        $('a.toggle_box_contents').bind('click', toggleContent);
 
-/*  // replaced with elgg_slide_toggle
-       @todo - PH update widget canvases with the new toggle function
-       // toggle widget box edit panel
-       $('a.toggle_box_edit_panel').click(function () {
-               $(this.parentNode.parentNode).children(".collapsable_box_editpanel").slideToggle("fast");
-               return false;
-       });
-
-       // toggle customise edit panel
-       $('a.toggle_customise_edit_panel').click(function () {
-               $('div#customise_editpanel').slideToggle("fast");
-               return false;
-       });
-
-       $('a.collapsibleboxlink').click(function () {
-               $(this.parentNode.parentNode).children(".collapsible_box").slideToggle("fast");
-               return false;
-       });
-*/
-
        // WIDGET GALLERY EDIT PANEL
        // Sortable widgets
        var els = ['#leftcolumn_widgets', '#middlecolumn_widgets', '#rightcolumn_widgets', '#widget_picker_gallery' ];
diff --git a/views/default/likes/forms/display.php b/views/default/likes/forms/display.php
new file mode 100644 (file)
index 0000000..f8fc661
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Elgg likes - display users liked link/text
+ *
+ * @package Elgg
+ * @author Curverider Ltd <info@elgg.com>
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity']
+ */
+
+if (isset($vars['entity']) && isloggedin()) {
+
+       //display the number of likes
+       $numoflikes = elgg_count_likes($vars['entity']);
+       if ($numoflikes != 0) {
+               if ($numoflikes == 1) {
+                       $user_string = elgg_echo('likes:userlikedthis');
+               } else {
+                       $user_string = elgg_echo('likes:userslikedthis');
+               }
+
+               echo "<a class='river_more_comments off likes_user_list_button link'>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>";
+       }
+}
\ No newline at end of file
index 97497eca5aabbe8cd1d10d852e2ab548153b2e79..be019d7492ea2d2e27f7e3cd80d6ff491e1edd2b 100644 (file)
@@ -13,8 +13,8 @@ if (isset($vars['entity']) && isloggedin()) {
        $guid = $vars['entity']->getGuid();
        $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}");
        //check to see if the user has already liked
-       if (!elgg_annotation_exists($guid, 'likes')) {
-               echo "<a href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a><br />";
+       if (!elgg_annotation_exists($guid, 'likes') ) {
+               echo "<a class='user_like link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>";
        }
        //display the number of likes
        $numoflikes = elgg_count_likes($vars['entity']);
@@ -26,9 +26,10 @@ if (isset($vars['entity']) && isloggedin()) {
                }
 
                echo "<a class='likes_list_button link'>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>";
+
+               //show the users who liked the object
+               echo "<div class='likes_list hidden'>";
+               echo list_annotations($vars['entity']->getGUID(), 'likes', 99);
+               echo "</div>";  
        }
-       //show the users who liked the object
-       echo "<div class='likes_list hidden'>";
-       echo list_annotations($vars['entity']->getGUID(), 'likes', 99);
-       echo "</div>";
 }
\ No newline at end of file
diff --git a/views/default/likes/forms/link.php b/views/default/likes/forms/link.php
new file mode 100644 (file)
index 0000000..6f5d418
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Elgg likes link form - used on riverdashboard where we want the likes link separate from the list of users that liked the object
+ *
+ * @package Elgg
+ * @author Curverider Ltd <info@elgg.com>
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity']
+ */
+
+if (isset($vars['entity']) && isloggedin()) {
+       $guid = $vars['entity']->getGuid();
+       $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}");
+       //check to see if the user has already liked
+       if (!elgg_annotation_exists($guid, 'likes') ) {
+               echo "<span class='river_link_divider'> | </span><a class='river_user_like_button link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>";
+       }
+}
\ No newline at end of file