aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-07 14:10:51 +0000
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-07 14:10:51 +0000
commit538a22b85384008533aeef2ac356ff668766e0cb (patch)
tree0070a18c9d09241a15df94fcbeeeda16feed4138
parent90cb880ec6b629376df97c89bc4a0b3e2db32c8e (diff)
downloadelgg-538a22b85384008533aeef2ac356ff668766e0cb.tar.gz
elgg-538a22b85384008533aeef2ac356ff668766e0cb.tar.bz2
Riverdashboard refreshed, and updated display of comments and likes (the loading of these needs to be moved to ajax callbacks)
git-svn-id: http://code.elgg.org/elgg/trunk@5643 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--languages/en.php4
-rw-r--r--mod/blog/views/default/river/object/blog/create.php5
-rw-r--r--mod/groups/views/default/river/forum/create.php7
-rw-r--r--mod/groups/views/default/river/forum/topic/create.php7
-rw-r--r--mod/pages/views/default/river/object/page/create.php5
-rw-r--r--mod/riverdashboard/views/default/river/item/wrapper.php99
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/css.php191
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/js.php30
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/rivercomment.php11
-rw-r--r--views/default/annotation/annotate.php5
-rw-r--r--views/default/annotation/likes.php10
-rw-r--r--views/default/css.php29
-rw-r--r--views/default/js/initialise_elgg.php20
-rw-r--r--views/default/likes/forms/display.php25
-rw-r--r--views/default/likes/forms/edit.php13
-rw-r--r--views/default/likes/forms/link.php19
16 files changed, 255 insertions, 225 deletions
diff --git a/languages/en.php b/languages/en.php
index e0742d909..6564cd95f 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -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',
/**
diff --git a/mod/blog/views/default/river/object/blog/create.php b/mod/blog/views/default/river/object/blog/create.php
index d59d601f5..1071deb30 100644
--- a/mod/blog/views/default/river/object/blog/create.php
+++ b/mod/blog/views/default/river/object/blog/create.php
@@ -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;
}
diff --git a/mod/groups/views/default/river/forum/create.php b/mod/groups/views/default/river/forum/create.php
index fb6cd707c..e51d9fe72 100644
--- a/mod/groups/views/default/river/forum/create.php
+++ b/mod/groups/views/default/river/forum/create.php
@@ -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
@@ -12,12 +12,13 @@
$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;
}
diff --git a/mod/groups/views/default/river/forum/topic/create.php b/mod/groups/views/default/river/forum/topic/create.php
index f4c4aadfd..7b06cd275 100644
--- a/mod/groups/views/default/river/forum/topic/create.php
+++ b/mod/groups/views/default/river/forum/topic/create.php
@@ -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;
@@ -13,10 +13,11 @@
$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;
}
diff --git a/mod/pages/views/default/river/object/page/create.php b/mod/pages/views/default/river/object/page/create.php
index 27352cef6..25efc216a 100644
--- a/mod/pages/views/default/river/object/page/create.php
+++ b/mod/pages/views/default/river/object/page/create.php
@@ -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;
}
diff --git a/mod/riverdashboard/views/default/river/item/wrapper.php b/mod/riverdashboard/views/default/river/item/wrapper.php
index 0dba70e5c..dba6f9953 100644
--- a/mod/riverdashboard/views/default/river/item/wrapper.php
+++ b/mod/riverdashboard/views/default/river/item/wrapper.php
@@ -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
diff --git a/mod/riverdashboard/views/default/riverdashboard/css.php b/mod/riverdashboard/views/default/riverdashboard/css.php
index c8c004213..9a6109de0 100644
--- a/mod/riverdashboard/views/default/riverdashboard/css.php
+++ b/mod/riverdashboard/views/default/riverdashboard/css.php
@@ -36,6 +36,11 @@
.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 {
@@ -58,148 +64,95 @@
}
/* 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;
}
-
*/
+
diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php
index ad96a6069..b1bace04a 100644
--- a/mod/riverdashboard/views/default/riverdashboard/js.php
+++ b/mod/riverdashboard/views/default/riverdashboard/js.php
@@ -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
diff --git a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php b/mod/riverdashboard/views/default/riverdashboard/rivercomment.php
index 32d1b4675..d440e7ab6 100644
--- a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php
+++ b/mod/riverdashboard/views/default/riverdashboard/rivercomment.php
@@ -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
diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php
index e66035204..2cb35798b 100644
--- a/views/default/annotation/annotate.php
+++ b/views/default/annotation/annotate.php
@@ -12,13 +12,14 @@
$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;
}
diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php
index 4cf27e82b..2808664df 100644
--- a/views/default/annotation/likes.php
+++ b/views/default/annotation/likes.php
@@ -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
?>
diff --git a/views/default/css.php b/views/default/css.php
index cc3c82d4b..70cc7ab4d 100644
--- a/views/default/css.php
+++ b/views/default/css.php
@@ -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
+
diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php
index 19b2224d9..c7dbed4aa 100644
--- a/views/default/js/initialise_elgg.php
+++ b/views/default/js/initialise_elgg.php
@@ -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
index 000000000..f8fc661fd
--- /dev/null
+++ b/views/default/likes/forms/display.php
@@ -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
diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php
index 97497eca5..be019d749 100644
--- a/views/default/likes/forms/edit.php
+++ b/views/default/likes/forms/edit.php
@@ -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
index 000000000..6f5d41829
--- /dev/null
+++ b/views/default/likes/forms/link.php
@@ -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