{{* This is a little bit hacky. This is needed to have some sort comments container. It would be better if it would be done in friendica core but since core lacks this functionality it is done in the theme In short: the piece of code counts the total number of children of the toplevelpost - this are usually all posts with thread_level = 2 - and stores it in variable $top_children_total. The first time a children which hits thread_level = 2 and $top_child = 1 opens the div. Everytime when a children with top_level = 2 comes up $top_child_nr rises with 1. The div get's closed if thread_level = 2 and the value of $top_child_nr is the same as the value of $top_child_total (this is done at the end of this file) *}} {{if $item.thread_level==1}} {{assign var="top_child_total" value=count($item.children)}} {{assign var="top_child_nr" value=0}} {{/if}} {{if $item.thread_level==2}} {{assign var="top_child_nr" value=$top_child_nr+1 scope=parent}} {{/if}} {{if $item.thread_level==2 && $top_child_nr==1}}
{{* The avatar picture and the photo-menu *}}
{{$item.name}} {{if $item.owner_url}} {{$item.via}} {{$item.owner_name}} {{/if}} {{if $item.connector}} {{else}} {{/if}}
{{$item.name}} {{if $item.connector}} {{else}} {{/if}}
{{if $item.location_html}} — ({{$item.location_html nofilter}}){{/if}} {{if $item.owner_self}} {{include file="sub/delivery_count.tpl" delivery=$item.delivery}} {{/if}} {{if $item.direction}} {{include file="sub/direction.tpl" direction=$item.direction}} {{/if}}
{{$item.name}} {{if $item.connector}} {{else}} {{/if}}
{{if $item.parentguid}} {{$item.inreplyto}} • {{else}} {{if $item.isunknown}} {{$item.isunknown}} • {{/if}} {{/if}} {{if $item.location_html}} — ({{$item.location_html nofilter}}){{/if}} {{if $item.owner_self}} {{include file="sub/delivery_count.tpl" delivery=$item.delivery}} {{/if}} {{if $item.direction}} {{include file="sub/direction.tpl" direction=$item.direction}} {{/if}}{{/if}} {{* item content *}}
{{$item.title}}
{{/if}}
{{if $item.edpost}} {{* edit the posting *}}-
{{$item.edpost.1}}
{{/if}}
{{if $item.tagger}} {{* tag the post *}}
-
{{$item.tagger.add}}
{{/if}}
{{if $item.filer}}
-
{{$item.filer}}
{{/if}}
{{if $item.pin}}
-
{{$item.pin.do}}
{{$item.pin.undo}}
{{/if}}
{{if $item.star}}
-
{{$item.star.do}}
{{$item.star.undo}}
{{/if}}
{{if $item.follow_thread}}
-
{{$item.follow_thread.title}}
{{/if}}
{{if $item.language}}
-
{{$item.language.0}}
{{/if}}
{{if $item.browsershare}}
-
{{$item.browsershare.0}}
{{/if}}
{{if ($item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread) && ($item.ignore || ($item.drop && $item.drop.dropping))}}
{{/if}}
{{if $item.ignore}}
-
{{$item.ignore.do}}
-
{{$item.ignore.undo}}
{{/if}}
{{if $item.drop && $item.drop.dropping}}
-
{{$item.drop.label}}
{{/if}}
{{if $item.block}}
-
{{$item.block.label}}
{{/if}}
{{if $item.ignore_author}}
-
{{$item.ignore_author.label}}
{{/if}}
{{if $item.collapse}}
-
{{$item.collapse.label}}
{{/if}}
{{if $item.ignore_server}}
-
{{$item.ignore_server.label}}
{{/if}}
{{if $item.report}}
-
{{$item.report.label}}
{{/if}}
{{* Event attendance buttons *}} {{if $item.isevent}} {{/if}} {{if $item.drop && $item.drop.pagedrop}} {{/if}}{{if $item.vote.announce}} {{* edit the posting *}}-
{{if $item.responses.announce.self}}
{{$item.vote.unannounce.1}}
{{else}}
{{$item.vote.announce.1}}
{{/if}}
{{/if}}
{{if $item.vote.share}}
-
{{$item.vote.share.1}}
{{/if}}
{{if $item.browsershare}}
-
{{/if}}
{{if $item.edpost}} {{* edit the posting *}}-
{{$item.edpost.1}}
{{/if}}
{{if $item.tagger}} {{* tag the post *}}
-
{{$item.tagger.add}}
{{/if}}
{{if $item.filer}}
-
{{$item.filer}}
{{/if}}
{{if $item.pin}}
-
{{$item.pin.do}}
{{$item.pin.undo}}
{{/if}}
{{if $item.star}}
-
{{$item.star.do}}
{{$item.star.undo}}
{{/if}}
{{if $item.follow_thread}}
-
{{$item.follow_thread.title}}
{{/if}}
{{if $item.language}}
-
{{$item.language.0}}
{{/if}}
{{if $item.ignore || ($item.drop && $item.drop.dropping)}}
{{/if}}
{{if $item.ignore}}
-
{{$item.ignore.do}}
-
{{$item.ignore.undo}}
{{/if}}
{{if $item.drop && $item.drop.dropping}}
-
{{$item.drop.label}}
{{/if}}