<xf:macro name="user_info"
    arg-user="!"
    arg-threadUserId=""
    arg-fallbackName=""
    arg-includeMicrodata="{{ true }}"
    arg-itemProp="">
    <section {{ $includeMicrodata ? 'itemprop="' . $itemProp . '" itemscope itemtype="https://schema.org/Person" itemid="' . ($user ? link('canonical:members', $user) : '') . '"' : '' }} class="message-user {{ !$__globals.uix_postbitCollapsed ? 'userExtra--expand' : ''}}">
        
        <xf:if is="$includeMicrodata && $user">
            <meta itemprop="url" content="{{ link('canonical:members', $user) }}" />
        </xf:if>
        
        <div class="message-avatar {{ ($xf.options.showMessageOnlineStatus && $user && $user.isOnline()) ? 'message-avatar--online' : '' }}">
            <div class="message-avatar-wrapper">
                <xf:if is="property('uix_postBitAvatarSize') == 'small'">
                    <xf:avatar user="$user" size="s" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? 'image' : '' }}" />
                <xf:elseif is="property('uix_postBitAvatarSize') == 'medium'" />
                    <xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? 'image' : '' }}" />
                <xf:elseif is="property('uix_postBitAvatarSize') == 'large'" />
                    <xf:avatar user="$user" size="l" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? 'image' : '' }}" />
                </xf:if>
                <xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">
                    <span class="message-avatar-online" tabindex="0" data-xf-init="tooltip" data-trigger="auto" title="{{ phrase('online_now')|for_attr }}"></span>
                </xf:if>
            </div>
        </div>
        <div class="uix_messagePostBitWrapper">
            <div class="message-userDetails">
                <h4 class="message-name"><xf:username user="$user" rich="true" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? 'name' : '' }}" /></h4>
                <xf:usertitle user="$user" tag="h5" class="message-userTitle" banner="true" itemprop="{{ $includeMicrodata ? 'jobTitle' : '' }}" />
                <xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline() && ( {{ property('uix_onlineIndicator') }} == 'userbanner')">
                    <div class="userBanner message-userBanner uix_userBanner--online">
                        <span class="userBanner-before"></span>
                        <strong>{{ phrase('online_now')}}</strong>
                        <span class="userBanner-after"></span>
                    </div>
                </xf:if>
                <xf:if is="($user.user_id == $threadUserId) && (property('uix_originalPoster') != 'none')">
                    <xf:if is="property('uix_originalPoster') == 'userbanner'">
                        <div class="userBanner message-userBanner uix_userBanner--op">
                            <span class="userBanner-before"></span>
                                <strong>{{ phrase('th_original_poster')}}</strong>
                            <span class="userBanner-after"></span>
                        </div>
                    <xf:elseif is="property('uix_originalPoster') == 'icon'" />
                        <div class="uix_originalPoster__icon" data-xf-init="tooltip" title="{{ phrase('th_original_poster') }}">
                            <xf:fa icon="fa-user-edit" class="mdi mdi-account-edit" />
                        </div>
                    </xf:if>
                </xf:if>
                <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
                <xf:if is="{$dateHtml}"><div class="message-date">{$dateHtml}</div></xf:if>
            </div>
            <xf:if is="{$linkHtml}"><div class="message-permalink">{$linkHtml}</div></xf:if>
            <xf:if is="$user.user_id">
                <xf:set var="$extras" value="{{ property('messageUserElements') }}" />
                <xf:if contentcheck="true">
                    <xf:if is="{{ property('uix_collapseExtraInfo')}}">
                        <div class="thThreads__message-userExtras">
                    </xf:if>
                            <div class="message-userExtras">
                                <xf:contentcheck>
                                    <xf:if is="$extras.register_date">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('joined')|for_attr }}">
                                                        <xf:fa icon="fa-user" />
                                                    </span>
                                                </dt>
                                            <xf:else />
                                                <dt>{{ phrase('joined') }}</dt>
                                            </xf:if>
                                            <dd>{{ date($user.register_date) }}</dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.message_count">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('messages')|for_attr }}">
                                                        <xf:fa icon="fa-comments" />
                                                    </span>
                                                </dt>
                                                <xf:else />
                                                <dt>{{ phrase('messages') }}</dt>
                                            </xf:if>
                                            <dd>{$user.message_count|number}</dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.solutions AND $user.question_solution_count">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('solutions')|for_attr }}">
                                                        <xf:fa icon="fa-star" />
                                                    </span>
                                                </dt>
                                                <xf:else />
                                                <dt>{{ phrase('solutions') }}</dt>
                                            </xf:if>
                                            <dd>{$user.question_solution_count|number}</dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.reaction_score">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('reaction_score')|for_attr }}">
                                                        <xf:fa icon="fa-thumbs-up" />
                                                    </span>
                                                </dt>
                                                <xf:else />
                                                <dt>{{ phrase('reaction_score') }}</dt>
                                            </xf:if>
                                            <dd>{$user.reaction_score|number}</dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.trophy_points && $xf.options.enableTrophies">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('points')|for_attr }}">
                                                        <xf:fa icon="fa-trophy" />
                                                    </span>
                                                </dt>
                                            <xf:else />
                                                <dt>{{ phrase('points') }}</dt>
                                            </xf:if>
                                            <dd>{$user.trophy_points|number}</dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.age && $user.Profile.age">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('age')|for_attr }}">
                                                        <xf:fa icon="fa-birthday-cake" />
                                                    </span>
                                                </dt>
                                            <xf:else />
                                                <dt>{{ phrase('age') }}</dt>
                                            </xf:if>
                                            <dd>{$user.Profile.age}</dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.location && $user.Profile.location">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('location')|for_attr }}">
                                                        <xf:fa icon="fa-map-marker" />
                                                    </span>
                                                </dt>
                                            <xf:else />
                                                <dt>{{ phrase('location') }}</dt>
                                            </xf:if>
                                            <dd data-xf-init="tooltip" title="{$user.Profile.location}">
                                                <xf:if is="$xf.options.geoLocationUrl">
                                                    <a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow noreferrer" target="_blank" class="u-concealed">{$user.Profile.location}</a>
                                                <xf:else />
                                                    {$user.Profile.location}
                                                </xf:if>
                                            </dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.website && $user.Profile.website">
                                        <dl class="pairs pairs--justified">
                                            <xf:if is="property('uix_postBitIcons')">
                                                <dt>
                                                    <span data-xf-init="tooltip" title="{{ phrase('website')|for_attr }}">
                                                        <xf:fa icon="fa-browser" />
                                                    </span>
                                                </dt>
                                            <xf:else />
                                                <dt>{{ phrase('website') }}</dt>
                                            </xf:if>
                                            <dd data-xf-init="tooltip" title="{$user.Profile.website|url('host', phrase('visit_site'))}"><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url_display('host', phrase('visit_site'))}</a></dd>
                                        </dl>
                                    </xf:if>
                                    <xf:if is="$extras.custom_fields">
                                        <xf:macro template="custom_fields_macros" name="custom_fields_values"
                                            arg-type="users"
                                            arg-group="personal"
                                            arg-set="{$user.Profile.custom_fields}"
                                            arg-additionalFilters="{{ ['message'] }}"
                                            arg-valueClass="pairs pairs--justified"
                                        />
                                        <xf:if is="$user.canViewIdentities()">
                                            <xf:macro template="custom_fields_macros" name="custom_fields_view"
                                                arg-type="users"
                                                arg-group="contact"
                                                arg-set="{$user.Profile.custom_fields}"
                                                arg-additionalFilters="{{ ['message'] }}"
                                                arg-valueClass="pairs pairs--justified"
                                            />
                                        </xf:if>
                                    </xf:if>
                                </xf:contentcheck>
                            </div>
                        <xf:if is="{{ property('uix_collapseExtraInfo')}}">
                            </div>
                            <div class="thThreads__userExtra--toggle">
                                <a href="javascript:;" class="thThreads__userExtra--trigger" data-xf-click="ththreads-userextra-trigger"></a>
                            </div>
                        </xf:if>
                </xf:if>
            </xf:if>
        </div>
        <span class="message-userArrow"></span>
    </section>
</xf:macro>
<xf:macro name="user_info_simple" arg-user="!" arg-fallbackName="" arg-includeMicrodata="{{ true }}" arg-itemProp="">
    <header class="message-user"
        {{ $includeMicrodata ? 'itemprop="' . $itemProp . '" itemscope itemtype="https://schema.org/Person" itemid="' . ($user ? link('canonical:members', $user) : '') . '"' : '' }}>
        <xf:if is="$includeMicrodata">
            <meta itemprop="name" content="{{ $user.username ?: $fallbackName }}" />
            <xf:if is="$user">
                <meta itemprop="url" content="{{ link('canonical:members', $user) }}" />
            </xf:if>
        </xf:if>
        
        <div class="message-avatar">
            <div class="message-avatar-wrapper">
                <xf:avatar user="$user" size="s" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? 'image' : '' }}" />
            </div>
        </div>
        <span class="message-userArrow"></span>
    </header>
</xf:macro>
<xf:macro name="attachments" arg-attachments="!" arg-message="!" arg-canView="!">
    <xf:if contentcheck="true">
        <xf:css src="attachments.less" />
        <section class="message-attachments">
            <h4 class="block-textHeader">{{ phrase('attachments') }}</h4>
            <ul class="attachmentList">
                <xf:contentcheck>
                    <xf:foreach loop="$attachments" value="$attachment" if="!$message.isAttachmentEmbedded($attachment)">
                        <xf:macro template="attachment_macros" name="attachment_list_item"
                            arg-attachment="{$attachment}"
                            arg-canView="{$canView}" />
                    </xf:foreach>
                </xf:contentcheck>
            </ul>
        </section>
    </xf:if>
</xf:macro>
<xf:macro name="signature" arg-user="!">
    <xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
        <xf:if contentcheck="true">
            <aside class="message-signature">
                <div class="uix_signatureExpand">{{ phrase('th_uix_expand_signature')}}</div>
                <xf:contentcheck>
                    {{ bb_code($user.Profile.signature, 'user:signature', $user) }}
                </xf:contentcheck>
            </aside>
        </xf:if>
    </xf:if>
</xf:macro>