{extends 'tpl.main'} {block 'vars'} {set $name = $_modx->resource.common_name ~~ $_modx->resource.pagetitle} {set $title = 'app.player_title' | lexicon : ['name' => $name]} {set $description = 'app.player_desc' | lexicon : ['name' => $_modx->resource.common_name_p ?: $name]} {parent} {/block} {block 'critical'} {/block} {block 'styles'} {/block} {block 'content'}
{include 'common_breadcrumbs'}
{if $_modx->resource.coach_intro_image?} {'app_picture' | chunk : [ 'picture_class' => 'coach-intro__photo__picture', 'img_class' => 'contain-pic', 'src' => $_modx->resource.coach_intro_image, 'alt' => $_modx->resource.pagetitle, 'sizes' => [ '0' => [399, 367], '400' => [767, 705], '1280' => [748, 687], '1600' => [936, 860], ], ]} {/if}
{if $_modx->resource.player_position?} {('app.player_position_' ~ $_modx->resource.player_position) | lexicon} {/if}

{$_modx->resource.common_name} {$_modx->resource.pagetitle}

{if $_modx->resource.player_number?}

{$_modx->resource.player_number}

{/if}
{*if $_modx->resource.player_position?} {/if*}
    {if $_modx->resource.common_birth_date?}
  • {'app.age' | lexicon} {$_modx->resource.common_birth_date | age | decl : ('app.age_decl' | lexicon) : true}
  • {/if} {if $_modx->resource.player_height_weight?}
  • {'app.height_weight' | lexicon} {$_modx->resource.player_height_weight}
  • {/if} {if $_modx->resource.player_grip?}
  • {'app.grip' | lexicon} {('app.grip_' ~ $_modx->resource.player_grip) | lexicon}
  • {/if} {if $_modx->resource.common_citizenship?}
  • {'app.citizenship' | lexicon} {('app.citizenship_' ~ $_modx->resource.common_citizenship) | lexicon}
  • {/if} {if $_modx->resource.player_contract_date?}
  • {'app.contract' | lexicon} {'app.until' | lexicon} {$_modx->resource.player_contract_date | date_format : '%m/%Y'}
  • {/if}
{* контентные блоки *} {set $contentBlocks = $_modx->resource.news_blocks | fromJSON | filter_published} {if $contentBlocks?}
{foreach $contentBlocks as $block}
{('block_' ~ $block.MIGX_formname) | chunk : $block}
{/foreach}
{/if} {* статистика и контентные блоки игрока *}
{if $_modx->resource.player_number? && $_modx->resource.player_khl?} {set $khl = $.app->services->get('khl')} {set $tournaments = $khl->getTnPlayerStat($_modx->resource.player_number, $_modx->resource.player_khl)} {if $tournaments?} {*$tournaments | print*} {set $tournamentId = 0}
{set $stat = $khl->getStatPlayerTn($tournamentId, $_modx->resource.player_khl)} {*$stat | print*} {if $stat?} {* нет данных
Время на льду 14 часов 23 минуты
*}
{set $cards = ['gp', 'pts', 'g']} {if $stat.pos === 'в'} {set $cards = ['gp']} {/if} {foreach $cards as $k} {if $stat[$k]!}
{('app.player_stat_' ~ $k) | lexicon} {$stat[$k]}
{/if} {/foreach}
{/if}
{if $stat?}
{set $cards = [ 'a' => 0, 'sog' => 0, 'sog_pct' => 1, 'sds' => 0, 'fow' => 0, 'tka' => 0, 'hits' => 0, 'bls' => 0, 'pim' => 1, 'toi_avg' => 0, ]} {if $stat.pos === 'в'} {set $cards = [ 'ga' => 0, 'sv' => 0, 'sv_pct' => 1, 'gaa' => 0, 'pim' => 1, 'toi' => 0, 'toi_avg' => 0, ]} {/if} {foreach $cards as $k => $show_meas} {if $stat[$k]!}

{('app.player_stat_' ~ $k) | lexicon} {switch $k} {case 'toi'} {$khl->formatToi($stat[$k])} {case 'toi_avg'} {$khl->formatToiAvg($stat[$k])} {default} {$stat[$k]} {/switch} {if $show_meas? and $stat[$k] !== '-'} {('app.player_stat_' ~ $k ~ '_meas') | lexicon} {/if}

{/if} {/foreach}
{/if}
{/if} {/if} {set $contentBlocks = $_modx->resource.player_blocks | fromJSON | filter_published} {if $contentBlocks?} {foreach $contentBlocks as $block} {('block_' ~ $block.MIGX_formname) | chunk : $block} {/foreach} {/if}
{* новости о... *} {include 'news_about' key='player'}
{/block}