diff options
-rwxr-xr-x | boot.php | 3 | ||||
-rw-r--r-- | doc/roadmap.bb | 3 | ||||
-rw-r--r-- | include/ItemObject.php | 28 | ||||
-rw-r--r-- | include/conversation.php | 181 | ||||
-rwxr-xr-x | mod/like.php | 22 | ||||
-rwxr-xr-x | view/tpl/conv_item.tpl | 103 | ||||
-rwxr-xr-x | view/tpl/conv_list.tpl | 90 |
7 files changed, 259 insertions, 171 deletions
@@ -485,6 +485,9 @@ define ( 'ACTIVITY_DISLIKE', NAMESPACE_ZOT . '/activity/dislike' ); define ( 'ACTIVITY_AGREE', NAMESPACE_ZOT . '/activity/agree' ); define ( 'ACTIVITY_DISAGREE', NAMESPACE_ZOT . '/activity/disagree' ); define ( 'ACTIVITY_ABSTAIN', NAMESPACE_ZOT . '/activity/abstain' ); +define ( 'ACTIVITY_ATTEND', NAMESPACE_ZOT . '/activity/attendyes' ); +define ( 'ACTIVITY_ATTENDNO', NAMESPACE_ZOT . '/activity/attendno' ); +define ( 'ACTIVITY_ATTENDMAYBE', NAMESPACE_ZOT . '/activity/attendmaybe' ); define ( 'ACTIVITY_OBJ_HEART', NAMESPACE_ZOT . '/activity/heart' ); diff --git a/doc/roadmap.bb b/doc/roadmap.bb index fb4b83bb4..e38f5a981 100644 --- a/doc/roadmap.bb +++ b/doc/roadmap.bb @@ -21,9 +21,6 @@ Migration tools Friendica importer Diaspora importer -Poco reputation - Make it happen - Webpage design UI improvements If practical, separate "conversation" sub-themes from overall themes so one can choose different conversation and content layouts within a base theme. Make webpage building easy, with point-n-click selectors to build PDLs diff --git a/include/ItemObject.php b/include/ItemObject.php index 344664fd2..3638b2ffb 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -134,6 +134,31 @@ class Item extends BaseObject { $profile_name = $item['author']['xchan_name']; $location = format_location($item); + $isevent = false; + $attend = null; + + // process action responses - e.g. like/dislike/attend/agree/whatever + $response_verbs = array('like'); + if(feature_enabled($conv->get_profile_owner(),'dislike')) + $response_verbs[] = 'dislike'; + if($item['obj_type'] === ACTIVITY_OBJ_EVENT) { + $response_verbs[] = 'attendyes'; + $response_verbs[] = 'attendno'; + $response_verbs[] = 'attendmaybe'; + $isevent = true; + $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); + } + $consensus = (($item['item_flags'] & ITEM_CONSENSUS)? true : false); + if($consensus) { + $response_verbs[] = 'agree'; + $response_verbs[] = 'disagree'; + $response_verbs[] = 'abstain'; + } + + $responses = get_responses($conv_responses,$response_verbs,$this,$item); + + + $like_button_label = tt('Like','Likes',$like_count,'noun'); $like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : ''); $like_list = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid'] . '-l'] : ''); @@ -253,6 +278,8 @@ class Item extends BaseObject { 'body' => $body, 'text' => strip_tags($body), 'id' => $this->get_id(), + 'isevent' => $isevent, + 'attend' => $attend, 'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, $item['author']['xchan_addr']), 'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), $item['owner']['xchan_addr']), 'llink' => $item['llink'], @@ -307,6 +334,7 @@ class Item extends BaseObject { 'comment_count_txt' => $comment_count_txt, 'list_unseen_txt' => $list_unseen_txt, 'markseen' => t('Mark all seen'), + 'responses' => $responses, 'like_count' => $like_count, 'like_list' => $like_list, 'like_list_part' => $like_list_part, diff --git a/include/conversation.php b/include/conversation.php index 27b52ba6e..4da6636fa 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -402,7 +402,7 @@ function visible_activity($item) { // likes (etc.) can apply to other things besides posts. Check if they are post children, // in which case we handle them specially - $hidden_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN); + $hidden_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE); foreach($hidden_activities as $act) { if((activity_match($item['verb'],$act)) && ($item['mid'] != $item['parent_mid'])) { return false; @@ -552,7 +552,12 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $items = $cb['items']; - $conv_responses = array(array('like'),array('dislike'),array('agree'),array('disagree'),array('abstain')); + $conv_responses = array( + 'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')), + 'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')), + 'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title')) + ); + // array with html for each thread (parent+comments) $threads = array(); @@ -779,14 +784,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ } } - like_puller($a, $item, $conv_responses, 'like'); - - if(feature_enabled($profile_owner, 'dislike')) - like_puller($a, $item, $conv_responses, 'dislike'); - - like_puller($a, $item, $conv_responses, 'agree'); - like_puller($a, $item, $conv_responses, 'disagree'); - like_puller($a, $item, $conv_responses, 'abstain'); + builtin_activity_puller($item, $conv_responses); if(! visible_activity($item)) { continue; @@ -964,69 +962,82 @@ function item_photo_menu($item){ } /** - * @brief Returns a like/dislike entry. - * It gives back a HTML link to the channel that liked/disliked. + * @brief Checks item to see if it is one of the builtin activities (like/dislike, event attendance, consensus items, etc.) + * Increments the count of each matching activity and adds a link to the author as needed. * * @param array $a (not used) * @param array $item - * @param array &$arr - * @param string $mode like/dislike + * @param array &$conv_responses (already created with builtin activity structure) * @return void */ -function like_puller($a, $item, &$arr, $mode) { +function builtin_activity_puller($item, &$conv_responses) { - $url = ''; - switch($mode) { - case 'like': - case 'unlike': - $verb = ACTIVITY_LIKE; - break; - case 'dislike': - case 'undislike': - $verb = ACTIVITY_DISLIKE; - break; - case 'agree': - case 'unagree': - $verb = ACTIVITY_AGREE; - break; - case 'disagree': - case 'undisagree': - $verb = ACTIVITY_DISAGREE; - break; - case 'abstain': - case 'unabstain': - $verb = ACTIVITY_ABSTAIN; - break; - default: - return; - break; - } - if((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) { + foreach($conv_responses as $mode => $v) { - if($item['author']['xchan_url']) - $url = chanlink_url($item['author']['xchan_url']); + $url = ''; - if(! $item['thr_parent']) - $item['thr_parent'] = $item['parent_mid']; + switch($mode) { + case 'like': + $verb = ACTIVITY_LIKE; + break; + case 'dislike': + $verb = ACTIVITY_DISLIKE; + break; + case 'agree': + $verb = ACTIVITY_AGREE; + break; + case 'disagree': + $verb = ACTIVITY_DISAGREE; + break; + case 'abstain': + $verb = ACTIVITY_ABSTAIN; + break; + case 'attendyes': + $verb = ACTIVITY_ATTEND; + break; + case 'attendno': + $verb = ACTIVITY_ATTENDNO; + break; + case 'attendmaybe': + $verb = ACTIVITY_ATTENDMAYBE; + break; + default: + return; + break; + } - if(! ((isset($arr[$mode][$item['thr_parent'] . '-l'])) && (is_array($arr[$mode][$item['thr_parent'] . '-l'])))) - $arr[$mode][$item['thr_parent'] . '-l'] = array(); - if(! isset($arr[$mode][$item['thr_parent']])) - $arr[$mode][$item['thr_parent']] = 1; - else - $arr[$mode][$item['thr_parent']] ++; - $name = (($item['author']['xchan_name']) ? $item['author']['xchan_name'] : t('Unknown')); + if((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) { - if($url) - $arr[$mode][$item['thr_parent'] . '-l'][] = '<a href="'. $url . '">' . $name . '</a>'; - else - $arr[$mode][$item['thr_parent'] . '-l'][] = '<a href="#" class="disabled">' . $name . '</a>'; + + $name = (($item['author']['xchan_name']) ? $item['author']['xchan_name'] : t('Unknown')); + $url = (($item['author']['xchan_url']) + ? '<a href="' . chanlink_url($item['author']['xchan_url']) . '">' . $name . '</a>' + : '<a href="#" class="disabled">' . $name . '</a>' + ); + + if(! $item['thr_parent']) + $item['thr_parent'] = $item['parent_mid']; + + if(! ((isset($conv_responses[$mode][$item['thr_parent'] . '-l'])) + && (is_array($conv_responses[$mode][$item['thr_parent'] . '-l'])))) + $conv_responses[$mode][$item['thr_parent'] . '-l'] = array(); + + // only list each unique author once + if(in_array($url,$conv_responses[$mode][$item['thr_parent'] . '-l'])) + continue; + + if(! isset($conv_responses[$mode][$item['thr_parent']])) + $conv_responses[$mode][$item['thr_parent']] = 1; + else + $conv_responses[$mode][$item['thr_parent']] ++; + + $conv_responses[$mode][$item['thr_parent'] . '-l'][] = $url; + } } - return; } // Format the like/dislike text for a profile item @@ -1629,3 +1640,57 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ return replace_macros($tpl,array('$tabs' => $arr['tabs'])); } + + +function get_responses($conv_responses,$response_verbs,$ob,$item) { + $ret = array(); + foreach($response_verbs as $v) { + $ret[$v] = array(); + $ret[$v]['count'] = ((x($conv_responses[$v],$item['mid'])) ? $conv_responses[$v][$item['mid']] : ''); + $ret[$v]['list'] = ((x($conv_responses[$v],$item['mid'])) ? $conv_responses[$v][$item['mid'] . '-l'] : ''); + if(count($ret[$v]['list']) > MAX_LIKERS) { + $ret[$v]['list_part'] = array_slice($ret[$v]['list'], 0, MAX_LIKERS); + array_push($ret[$v]['list_part'], '<a href="#" data-toggle="modal" data-target="#' . $v . 'Modal-' + . $ob->get_id() . '"><b>' . t('View all') . '</b></a>'); + } + else { + $ret[$v]['list_part'] = ''; + } + $ret[$v]['button'] = get_response_button_text($v,$ret[$v]['count']); + $ret[$v]['title'] = $conv_responses[$v]['title']; + } + $ret['count'] = count($ret); + return $ret; +} + +function get_response_button_text($v,$count) { + switch($v) { + case 'like': + return tt('Like','Likes',$count,'noun'); + break; + case 'dislike': + return tt('Dislike','Dislikes',$count,'noun'); + break; + case 'attendyes': + return tt('Attending','Attending',$count,'noun'); + break; + case 'attendno': + return tt('Not Attending','Not Attending',$count,'noun'); + break; + case 'attendmaybe': + return tt('Undecided','Undecided',$count,'noun'); + break; + case 'agree': + return tt('Agree','Agrees',$count,'noun'); + break; + case 'agree': + return tt('Disagree','Disagrees',$count,'noun'); + break; + case 'abstain': + return tt('Abstain','Abstains',$count,'noun'); + break; + default: + return ''; + break; + } +} diff --git a/mod/like.php b/mod/like.php index b3afd910f..725551d6d 100755 --- a/mod/like.php +++ b/mod/like.php @@ -49,6 +49,18 @@ function like_content(&$a) { case 'unabstain': $activity = ACTIVITY_ABSTAIN; break; + case 'attendyes': + case 'unattendyes': + $activity = ACTIVITY_ATTEND; + break; + case 'attendno': + case 'unattendno': + $activity = ACTIVITY_ATTENDNO; + break; + case 'attendmaybe': + case 'unattendmaybe': + $activity = ACTIVITY_ATTENDMAYBE; + break; default: return; break; @@ -300,6 +312,8 @@ function like_content(&$a) { } else { $post_type = (($item['resource_type'] === 'photo') ? t('photo') : t('status')); + if($item['obj_type'] === ACTIVITY_OBJ_EVENT) + $post_type = t('event'); $links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $item['plink'])); $objtype = (($item['resource_type'] === 'photo') ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); @@ -354,8 +368,12 @@ function like_content(&$a) { $bodyverb = t('%1$s doesn\'t agree with %2$s\'s %3$s'); if($verb === 'abstain') $bodyverb = t('%1$s abstains from a decision on %2$s\'s %3$s'); - - + if($verb === 'attendyes') + $bodyverb = t('%1$s is attending %2$s\'s %3$s'); + if($verb === 'attendno') + $bodyverb = t('%1$s is not attending %2$s\'s %3$s'); + if($verb === 'attendmaybe') + $bodyverb = t('%1$s may attend %2$s\'s %3$s'); if(! isset($bodyverb)) killme(); diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index f30ca7fc0..df20eadbb 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -56,13 +56,24 @@ <div class="wall-item-tools"> <div class="wall-item-tools-right btn-group pull-right"> {{if $item.like}} - <button type="button" class="btn btn-default btn-sm" onclick="dolike({{$item.id}},'like'); return false"> - <i class="icon-thumbs-up-alt" title="{{$item.like.0}}"></i> + <button type="button" title="{{$item.like.0}}" class="btn btn-default btn-sm" onclick="dolike({{$item.id}},'like'); return false;"> + <i class="icon-thumbs-up-alt" ></i> </button> {{/if}} {{if $item.dislike}} - <button type="button" class="btn btn-default btn-sm" onclick="dolike({{$item.id}},'dislike'); return false"> - <i class="icon-thumbs-down-alt" title="{{$item.dislike.0}}"></i> + <button type="button" title="{{$item.dislike.0}}" class="btn btn-default btn-sm" onclick="dolike({{$item.id}},'dislike'); return false;"> + <i class="icon-thumbs-down-alt" ></i> + </button> + {{/if}} + {{if $item.isevent}} + <button type="button" title="{{$item.attend.0}}" class="btn btn-default btn-sm" onclick="itemAddToCal({{$item.id}}); dolike({{$item.id}},'attendyes'); return false;"> + <i class="icon-check" ></i> + </button> + <button type="button" title="{{$item.attend.1}}" class="btn btn-default btn-sm" onclick="dolike({{$item.id}},'attendno'); return false;"> + <i class="icon-check-empty" ></i> + </button> + <button type="button" title="{{$item.attend.2}}" class="btn btn-default btn-sm" onclick="itemAddToCal({{$item.id}}); dolike({{$item.id}},'attendmaybe'); return false;"> + <i class="icon-question" ></i> </button> {{/if}} <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="wall-item-menu-{{$item.id}}"> @@ -104,70 +115,44 @@ </ul> </div> <div id="like-rotator-{{$item.id}}" class="like-rotator"></div> - <div class="wall-item-tools-left{{if $item.like_count && $item.dislike_count}} btn-group{{/if}}"> - {{if $item.like_count}} + + {{if $item.responses }} + <div class="wall-item-tools-left{{if $item.responses.count > 1}} btn-group{{/if}}"> + {{foreach $item.responses as $verb=>$response}} + {{if $response.count}} <div class="btn-group"> - <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-like-{{$item.id}}">{{$item.like_count}} {{$item.like_button_label}}</button> - {{if $item.like_list_part}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$item.id}}">{{foreach $item.like_list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> + <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-{{$verb}}-{{$item.id}}">{{$response.count}} {{$response.button}}</button> + {{if $response.list_part}} + <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$item.id}}">{{foreach $response.list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> {{else}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$item.id}}">{{foreach $item.like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> + <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$item.id}}">{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> {{/if}} </div> {{/if}} - {{if $item.dislike_count}} - <div class="btn-group"> - <button type="button" class="btn btn-default btn-sm wall-item-dislike dropdown-toggle" data-toggle="dropdown" id="wall-item-dislike-{{$item.id}}">{{$item.dislike_count}} {{$item.dislike_button_label}}</button> - {{if $item.dislike_list_part}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$item.id}}">{{foreach $item.dislike_list_part as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul> - {{else}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$item.id}}">{{foreach $item.dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul> - {{/if}} - </div> + + {{if $response.list_part}} + <div class="modal" id="{{$verb}}Modal-{{$item.id}}"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title">{{$response.title}}</h4> + </div> + <div class="modal-body"> + <ul>{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> + </div> + <div class="modal-footer clear"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{$item.modal_dismiss}}</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> + </div><!-- /.modal --> {{/if}} + {{/foreach}} </div> - {{if $item.like_list_part}} - <div class="modal" id="likeModal-{{$item.id}}"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title">{{$item.like_modal_title}}</h4> - </div> - <div class="modal-body"> - <ul>{{foreach $item.like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> - </div> - <div class="modal-footer clear"> - <button type="button" class="btn btn-default" data-dismiss="modal">{{$item.modal_dismiss}}</button> - </div> - </div><!-- /.modal-content --> - </div><!-- /.modal-dialog --> - </div><!-- /.modal --> - {{/if}} - {{if $item.dislike_list_part}} - <div class="modal" id="dislikeModal-{{$item.id}}"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title">{{$item.dislike_modal_title}}</h4> - </div> - <div class="modal-body"> - <ul>{{foreach $item.dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul> - </div> - <div class="modal-footer clear"> - <button type="button" class="btn btn-default" data-dismiss="modal">{{$item.modal_dismiss}}</button> - </div> - </div><!-- /.modal-content --> - </div><!-- /.modal-dialog --> - </div><!-- /.modal --> {{/if}} + </div> - {{* we dont' use this do we? - {{if $item.drop.pagedrop}} - <input type="checkbox" onclick="checkboxhighlight(this);" title="{{$item.drop.select}}" class="item-select" name="itemselected[]" value="{{$item.id}}" /> - {{/if}} - *}} <div class="clear"></div> </div> <div class="wall-item-wrapper-end"></div> diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl index 59bb8f918..ad086ee0a 100755 --- a/view/tpl/conv_list.tpl +++ b/view/tpl/conv_list.tpl @@ -65,6 +65,19 @@ <i class="icon-thumbs-down-alt" title="{{$item.dislike.0}}"></i> </button> {{/if}} + + {{if $item.isevent}} + <button type="button" title="{{$item.attend.0}}" class="btn btn-default btn-sm" onclick="itemAddToCal({{$item.id}}); dolike({{$item.id}},'attendyes'); return false;"> + <i class="icon-plus" ></i> + </button> + <button type="button" title="{{$item.attend.1}}" class="btn btn-default btn-sm" onclick="itemAddToCal({{$item.id}}); dolike({{$item.id}},'attendno'); return false;"> + <i class="icon-minus" ></i> + </button> + <button type="button" title="{{$item.attend.2}}" class="btn btn-default btn-sm" onclick="itemAddToCal({{$item.id}}); dolike({{$item.id}},'attendmaybe'); return false;"> + <i class="icon-question" ></i> + </button> + {{/if}} + <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="wall-item-menu-{{$item.id}}"> <i class="icon-caret-down"></i> </button> @@ -110,64 +123,43 @@ <div class="wall-item-list-comments btn-group"><button class="btn btn-default btn-sm" onclick="window.location.href='{{$item.viewthread}}'; return false;">{{$item.comment_count_txt}}{{if $item.unseen_comments}} <span class="unseen-wall-indicator-{{$item.id}}">, {{$item.list_unseen_txt}}{{/if}}</span></button></div>{{if $item.unseen_comments}}<div class="unseen-wall-indicator-{{$item.id}} btn-group"><button class="btn btn-default btn-sm" title="{{$item.markseen}}" onclick="markItemRead({{$item.id}}); return false;"><i class="icon-check"></i></div>{{/if}} - {{if $item.like_count}} + {{if $item.responses }} + <div class="wall-item-tools-left{{if $item.responses.count > 1}} btn-group{{/if}}"> + {{foreach $item.responses as $verb=>$response}} + {{if $response.count}} <div class="btn-group"> - <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-like-{{$item.id}}">{{$item.like_count}} {{$item.like_button_label}}</button> - {{if $item.like_list_part}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$item.id}}">{{foreach $item.like_list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> + <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-{{$verb}}-{{$item.id}}">{{$response.count}} {{$response.button}}</button> + {{if $response.list_part}} + <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$item.id}}">{{foreach $response.list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> {{else}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-like-{{$item.id}}">{{foreach $item.like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> + <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$item.id}}">{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> {{/if}} </div> {{/if}} - {{if $item.dislike_count}} - <div class="btn-group"> - <button type="button" class="btn btn-default btn-sm wall-item-dislike dropdown-toggle" data-toggle="dropdown" id="wall-item-dislike-{{$item.id}}">{{$item.dislike_count}} {{$item.dislike_button_label}}</button> - {{if $item.dislike_list_part}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$item.id}}">{{foreach $item.dislike_list_part as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul> - {{else}} - <ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-dislike-{{$item.id}}">{{foreach $item.dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul> - {{/if}} - </div> + + {{if $response.list_part}} + <div class="modal" id="{{$verb}}Modal-{{$item.id}}"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title">{{$response.title}}</h4> + </div> + <div class="modal-body"> + <ul>{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> + </div> + <div class="modal-footer clear"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{$item.modal_dismiss}}</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> + </div><!-- /.modal --> {{/if}} + {{/foreach}} </div> - {{if $item.like_list_part}} - <div class="modal" id="likeModal-{{$item.id}}"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title">{{$item.like_modal_title}}</h4> - </div> - <div class="modal-body"> - <ul>{{foreach $item.like_list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul> - </div> - <div class="modal-footer clear"> - <button type="button" class="btn btn-default" data-dismiss="modal">{{$item.modal_dismiss}}</button> - </div> - </div><!-- /.modal-content --> - </div><!-- /.modal-dialog --> - </div><!-- /.modal --> - {{/if}} - {{if $item.dislike_list_part}} - <div class="modal" id="dislikeModal-{{$item.id}}"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title">{{$item.dislike_modal_title}}</h4> - </div> - <div class="modal-body"> - <ul>{{foreach $item.dislike_list as $disliker}}<li role="presentation">{{$disliker}}</li>{{/foreach}}</ul> - </div> - <div class="modal-footer clear"> - <button type="button" class="btn btn-default" data-dismiss="modal">{{$item.modal_dismiss}}</button> - </div> - </div><!-- /.modal-content --> - </div><!-- /.modal-dialog --> - </div><!-- /.modal --> {{/if}} </div> + </div> <div class="clear"></div> </div> <div class="wall-item-wrapper-end"></div> |