From 538a22b85384008533aeef2ac356ff668766e0cb Mon Sep 17 00:00:00 2001 From: pete Date: Wed, 7 Apr 2010 14:10:51 +0000 Subject: 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 --- views/default/annotation/annotate.php | 5 +++-- views/default/annotation/likes.php | 10 +++++----- views/default/css.php | 29 +++++++++++------------------ views/default/js/initialise_elgg.php | 20 -------------------- views/default/likes/forms/display.php | 25 +++++++++++++++++++++++++ views/default/likes/forms/edit.php | 13 +++++++------ views/default/likes/forms/link.php | 19 +++++++++++++++++++ 7 files changed, 70 insertions(+), 51 deletions(-) create mode 100644 views/default/likes/forms/display.php create mode 100644 views/default/likes/forms/link.php (limited to 'views') 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 = "getURL()}\">{$performed_by->name}"; $string = sprintf(elgg_echo("river:posted:generic"),$url) . " "; - $string .= elgg_echo("{$subtype}:river:annotate") . " getURL()}\">" . $title . " " . friendly_time($object->time_created); + $string .= elgg_echo("{$subtype}:river:annotate") . " getURL()}\">" . $title . " ". friendly_time($object->time_created) ." Comment"; + $string .= elgg_view('likes/forms/link', array('entity' => $object)); if(get_context() != 'riverdashboard'){ $string .= "
"; 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)) . "…"; 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); ?> -
-
+
+
$owner, @@ -16,19 +16,19 @@ $owner = get_user($vars['annotation']->owner_guid); ?>
-
+
canEdit()) { ?> - + 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 @@ + + * @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 ""; + } +} \ 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 "" . elgg_echo('likes:likethis') . "
"; + if (!elgg_annotation_exists($guid, 'likes') ) { + echo "" . elgg_echo('likes:likethis') . ""; } //display the number of likes $numoflikes = elgg_count_likes($vars['entity']); @@ -26,9 +26,10 @@ if (isset($vars['entity']) && isloggedin()) { } echo ""; + + //show the users who liked the object + echo ""; } - //show the users who liked the object - echo ""; } \ 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 @@ + + * @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 " | " . elgg_echo('likes:likethis') . ""; + } +} \ No newline at end of file -- cgit v1.2.3