From e04d3c45a4fe7e503ea727c54e4c541d40e14661 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 13 Apr 2018 11:58:12 +0200 Subject: [PATCH] provide visible star status for starred posts --- Zotlabs/Lib/ThreadItem.php | 6 +++--- include/conversation.php | 2 +- view/js/main.js | 7 +++++-- view/tpl/conv_item.tpl | 40 +++++++++++--------------------------- view/tpl/conv_list.tpl | 37 ++++++++++------------------------- 5 files changed, 30 insertions(+), 62 deletions(-) diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index c2aa920b9..61a012f9d 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -238,9 +238,9 @@ class ThreadItem { 'do' => t("Add Star"), 'undo' => t("Remove Star"), 'toggle' => t("Toggle Star Status"), - 'classdo' => (intval($item['item_starred']) ? "hidden" : ""), - 'classundo' => (intval($item['item_starred']) ? "" : "hidden"), - 'isstarred' => (intval($item['item_starred']) ? "starred fa-star" : "unstarred fa-star-o"), + 'classdo' => ((intval($item['item_starred'])) ? "hidden" : ""), + 'classundo' => ((intval($item['item_starred'])) ? "" : "hidden"), + 'isstarred' => ((intval($item['item_starred'])) ? true : false), 'starred' => t('starred'), ); diff --git a/include/conversation.php b/include/conversation.php index 4aa097d07..30acd6329 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1724,7 +1724,7 @@ function network_tabs() { if(feature_enabled(local_channel(),'star_posts')) { $tabs[] = array( 'label' => t('Starred'), - 'url'=>z_root() . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1', + 'url'=>z_root() . '/' . $cmd . '/?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&star=1', 'sel'=>$starred_active, 'title' => t('Favourite Posts'), ); diff --git a/view/js/main.js b/view/js/main.js index 02f2f6a3d..6493d2f0f 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1075,18 +1075,21 @@ function dostar(ident) { if(data.result == 1) { $('#starred-' + ident).addClass('starred'); $('#starred-' + ident).removeClass('unstarred'); - $('#starred-' + ident).addClass('fa-star-full'); + $('#starred-' + ident).addClass('fa-star'); $('#starred-' + ident).removeClass('fa-star-o'); $('#star-' + ident).addClass('hidden'); $('#unstar-' + ident).removeClass('hidden'); + var btn_tpl = '
' + $('#wall-item-tools-left-' + ident).prepend(btn_tpl); } else { $('#starred-' + ident).addClass('unstarred'); $('#starred-' + ident).removeClass('starred'); $('#starred-' + ident).addClass('fa-star-o'); - $('#starred-' + ident).removeClass('fa-star-full'); + $('#starred-' + ident).removeClass('fa-star'); $('#star-' + ident).removeClass('hidden'); $('#unstar-' + ident).addClass('hidden'); + $('#star-button-' + ident).remove(); } $('#like-rotator-' + ident).hide(); }); diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 7b3d545ac..cfafa5ffd 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -27,9 +27,9 @@ {{/if}} {{/if}}
-
-
- {{$item.name}} +
+
+ {{$item.name}} {{if $item.thread_author_menu}}