{* * This template is rendered twice. * Once for sidebar that is always visible on wide screens. * Once for slide-open drawer for narrow screens. * Both present in DOM but only one is visible at a time. *} {$user.waid_invite_datetime = $user_settings.waid_invite_datetime|default:''} {$wrapper_id = uniqid('t-sidebar-waid-')} {strip}
{if $is_connected_to_webasyst_id} {*if waid is enabled*} {if $is_bound_with_webasyst_contact}

{if $is_own_profile || $is_app_admin} [`Webasyst ID is connected`] {if (!empty($webasyst_id_data['email']))} {$webasyst_id_data['email']} {/if} {if (!empty($webasyst_id_data['phone']))} {$webasyst_id_data['phone']} {/if} {else} [`Webasyst ID is connected`] {/if}

[`Last sign-in`] {$user.last_datetime|wa_date:"humandatetime"|lower} {* if !$is_webasyst_id_forced} [`Disconnect`] {/if *}

{*if $webasyst_id_email} {sprintf(_w('Webasyst ID account %s is connected.'), $webasyst_id_email)} {else} {sprintf(_w('%sSign-in with Webasyst ID%s is connected.'), '', '')} {/if*} {if $is_own_profile && !empty($webasyst_id_qrcode_url)}
[`Mobile app sign-in via QR`]
{/if} {elseif $contact['is_user'] > 0} {if $is_own_profile} {*if own account not connected to waid*}  [`Connect Webasyst ID`]

[`Sign into your Webasyst backend with 2-factor authentication (2FA) and get convenient access to all Webasyst services and mobile apps.`]

[`Mobile app sign-in via QR`]
{else}

[`Webasyst ID is not connected`]

{sprintf('[`User %s has not connected Webasyst ID yet. Secure sign-in option with 2-factor authentication (2FA) for your Webasyst backend and access to all Webasyst services and mobile apps will become available only when Webasyst ID is connected.`]', $user.login|escape)}

{$_is_team_admin = $wa->user()->isAdmin($wa->app())} {if $_is_team_admin && $contact['is_user'] == '1'} {* * Sendind email invitations are available for Team admins. *} {if !empty($user.email)} {if !$user.waid_invite_datetime} {$_link_text = '[`Email instructions`]'} {else} {$_link_text = '[`Email again`]'} {/if}

{$_link_text} {if $user.waid_invite_datetime}{$user.waid_invite_datetime|wa_date:'humandatetime'|lower}{/if}

{/if} {* * Connect by code is for global admin only. *} {$_is_global_admin = $wa->user()->isAdmin()} {if $_is_global_admin}
[`Mobile app code`]

{sprintf_wp("The invitation code for %s to connect a Webasyst mobile app to %s.", $user.name|escape, str_replace(['http://','https://'], '', $wa->domainUrl()))}

{/if} {/if}

{/if} {/if} {else} {if $contact['is_user'] > 0}

[`Webasyst ID is not connected`]

{sprintf('[`%sEnable sign-in with Webasyst ID%s so that your teammates can use all Webasyst services and mobile apps and can enable secure sign-in with 2-factor authentication (2FA).`]', "", '')}

[`What is Webasyst ID?`]

{/if} {/if}
{/strip}