diff options
author | Mario <mario@mariovavti.com> | 2024-07-22 19:07:19 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-07-22 19:07:19 +0000 |
commit | 4e35d342269be73a6d6561b8f7587b5edbb50346 (patch) | |
tree | f144ecdae8aefebc0e82b43c7d37b6ac82c536a5 /include | |
parent | 3708896a658bb7ae8f61377bc85da0bc898a721e (diff) | |
download | volse-hubzilla-4e35d342269be73a6d6561b8f7587b5edbb50346.tar.gz volse-hubzilla-4e35d342269be73a6d6561b8f7587b5edbb50346.tar.bz2 volse-hubzilla-4e35d342269be73a6d6561b8f7587b5edbb50346.zip |
item buttons redesign - initial checkin
Diffstat (limited to 'include')
-rw-r--r-- | include/conversation.php | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/include/conversation.php b/include/conversation.php index c631d53a2..a4f54fd85 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1525,6 +1525,12 @@ function get_responses($conv_responses,$response_verbs,$ob,$item) { $ret = array(); foreach($response_verbs as $v) { + if ($v === 'answer') { + // we require the structure to collect the response hashes + // but we do not use them for display - do not collect them. + continue; + } + $ret[$v] = []; $ret[$v]['count'] = $conv_responses[$v][$item['mid']] ?? 0; $ret[$v]['list'] = ((isset($conv_responses[$v][$item['mid']])) ? $conv_responses[$v][$item['mid'] . '-l'] : ''); @@ -1533,14 +1539,6 @@ function get_responses($conv_responses,$response_verbs,$ob,$item) { $ret[$v]['modal'] = (($ret[$v]['count'] > MAX_LIKERS) ? true : false); } - $count = 0; - foreach ($ret as $key) { - if ($key['count'] == true) - $count++; - } - - $ret['count'] = $count; - //logger('ret: ' . print_r($ret,true)); return $ret; @@ -1549,25 +1547,25 @@ function get_responses($conv_responses,$response_verbs,$ob,$item) { function get_response_button_text($v,$count) { switch($v) { case 'like': - return ['label' => tt('Like','Likes',$count,'noun'), 'icon' => 'thumbs-o-up', 'class' => 'like']; + return ['label' => tt('Like','Likes',$count,'noun'), 'icon' => 'thumbs-o-up', 'class' => 'like', 'onclick' => 'dolike']; break; case 'announce': - return ['label' => tt('Repeat','Repeats',$count,'noun'), 'icon' => 'retweet', 'class' => 'announce']; + return ['label' => tt('Repeat','Repeats',$count,'noun'), 'icon' => 'retweet', 'class' => 'announce', 'onclick' => 'jotShare']; break; case 'dislike': - return ['label' => tt('Dislike','Dislikes',$count,'noun'), 'icon' => 'thumbs-o-down', 'class' => 'dislike']; + return ['label' => tt('Dislike','Dislikes',$count,'noun'), 'icon' => 'thumbs-o-down', 'class' => 'dislike', 'onclick' => 'dolike']; break; case 'attendyes': - return ['label' => tt('Attending','Attending',$count,'noun'), 'icon' => 'calendar-check-o', 'class' => 'attendyes']; + return ['label' => tt('Attending','Attending',$count,'noun'), 'icon' => 'calendar-check-o', 'class' => 'attendyes', 'onclick' => 'dolike']; break; case 'attendno': - return ['label' => tt('Not Attending','Not Attending',$count,'noun'), 'icon' => 'calendar-times-o', 'class' => 'attendno']; + return ['label' => tt('Not Attending','Not Attending',$count,'noun'), 'icon' => 'calendar-times-o', 'class' => 'attendno', 'onclick' => 'dolike']; break; case 'attendmaybe': - return ['label' => tt('Undecided','Undecided',$count,'noun'), 'icon' => 'calendar-o', 'class' => 'attendmaybe']; + return ['label' => tt('Undecided','Undecided',$count,'noun'), 'icon' => 'calendar-o', 'class' => 'attendmaybe', 'onclick' => 'dolike']; break; default: - return ''; + return []; break; } } |