<commit_before>{**
 * @param array    $columns           Available columns
 * @param array    $actions           Available actions
 * @param array    $exports           Available exports
 * @param Row[]    $rows              List of rows (each contain a item from data source)
 * @param DataGrid $control           Parent (DataGrid)
 * @param string   $original_template Original template file path
 * @param string   $icon_prefix       Icon prefix (fa fa-)
 *}

{extends $original_template}

<div class="datagrid-tree-item-children datagrid-tree" n:snippet="table" n:block="data" {if $control->isSortable()}data-sortable-tree data-sortable-url="{plink $control->getSortableHandler()}"{/}>
	{snippetArea items}
		<div class="datagrid-tree-item datagrid-tree-header" n:snippet="item-header">
			<div class="datagrid-tree-item-content" data-has-children="">
				<div class="datagrid-tree-item-left">
					{foreach $columns as $key => $column}
						<strong>{_$column->getName()}</strong>
						{breakIf TRUE}
					{/foreach}
				</div>

				<div class="datagrid-tree-item-right">
					<div class="datagrid-tree-item-right-columns">
						{foreach $columns as $key => $column}
							{continueIf $iterator->isFirst()}
							<div class="datagrid-tree-item-right-columns-column col-{$column->getColumnName()} text-{$column->hasAlign() ? $column->getAlign() : 'left'}">
								<strong>{_$column->getName()}</strong>
							</div>
						{/foreach}
					</div>
					<div class="datagrid-tree-item-right-actions" n:if="($actions || $control->isSortable()) && $rows">
						<div class="datagrid-tree-item-right-actions-action">
							{var $tmp_row = reset($rows)}

							{foreach $actions as $action}
								{if $action->hasTemplate()}
									{include $action->getTemplate(), item => $tmp_row->getItem()}
								{else}
									{!$action->render($tmp_row)}
								{/if}
							{/foreach}

							<span class="handle-sort btn btn-xs btn-default" n:if="$control->isSortable()">
								<span class="{$icon_prefix}arrows"></span>
							</span>
						</div>
					</div>
				</div>
			</div>
		</div>

		{foreach $rows as $row}
			{var $has_children = $control->hasTreeViewChildrenCallback() ? $control->treeViewChildrenCallback($row->getItem()) : $row->getValue($tree_view_has_children_column)}
			{var $item = $row->getItem()}

			<div n:class="$has_children ? has-children, 'datagrid-tree-item'" data-id="{$row->getId()}" n:snippet="item-{$row->getId()}">
				<div n:class="datagrid-tree-item-content, $row->getControlClass()" data-id="{$row->getId()}" data-has-children="{$has_children ? true : false}">
					<div class="datagrid-tree-item-left">
						<a n:href="getChildren! parent => $row->getId()" data-toggle-tree="true" n:class="!$has_children ? hidden, 'chevron ajax'">
							<i class="fa fa-chevron-right"></i>
						</a>
						{foreach $columns as $key => $column}
							{var $col = 'col-' . $key}

							{if $column->hasTemplate()}<commit_msg>Block that defines chevron icon in tree veiw<commit_after>{**
 * @param array    $columns           Available columns
 * @param array    $actions           Available actions
 * @param array    $exports           Available exports
 * @param Row[]    $rows              List of rows (each contain a item from data source)
 * @param DataGrid $control           Parent (DataGrid)
 * @param string   $original_template Original template file path
 * @param string   $icon_prefix       Icon prefix (fa fa-)
 *}

{extends $original_template}

<div class="datagrid-tree-item-children datagrid-tree" n:snippet="table" n:block="data" {if $control->isSortable()}data-sortable-tree data-sortable-url="{plink $control->getSortableHandler()}"{/}>
	{snippetArea items}
		<div class="datagrid-tree-item datagrid-tree-header" n:snippet="item-header">
			<div class="datagrid-tree-item-content" data-has-children="">
				<div class="datagrid-tree-item-left">
					{foreach $columns as $key => $column}
						<strong>{_$column->getName()}</strong>
						{breakIf TRUE}
					{/foreach}
				</div>

				<div class="datagrid-tree-item-right">
					<div class="datagrid-tree-item-right-columns">
						{foreach $columns as $key => $column}
							{continueIf $iterator->isFirst()}
							<div class="datagrid-tree-item-right-columns-column col-{$column->getColumnName()} text-{$column->hasAlign() ? $column->getAlign() : 'left'}">
								<strong>{_$column->getName()}</strong>
							</div>
						{/foreach}
					</div>
					<div class="datagrid-tree-item-right-actions" n:if="($actions || $control->isSortable()) && $rows">
						<div class="datagrid-tree-item-right-actions-action">
							{var $tmp_row = reset($rows)}

							{foreach $actions as $action}
								{if $action->hasTemplate()}
									{include $action->getTemplate(), item => $tmp_row->getItem()}
								{else}
									{!$action->render($tmp_row)}
								{/if}
							{/foreach}

							<span class="handle-sort btn btn-xs btn-default" n:if="$control->isSortable()">
								<span class="{$icon_prefix}arrows"></span>
							</span>
						</div>
					</div>
				</div>
			</div>
		</div>

		{foreach $rows as $row}
			{var $has_children = $control->hasTreeViewChildrenCallback() ? $control->treeViewChildrenCallback($row->getItem()) : $row->getValue($tree_view_has_children_column)}
			{var $item = $row->getItem()}

			<div n:class="$has_children ? has-children, 'datagrid-tree-item'" data-id="{$row->getId()}" n:snippet="item-{$row->getId()}">
				<div n:class="datagrid-tree-item-content, $row->getControlClass()" data-id="{$row->getId()}" data-has-children="{$has_children ? true : false}">
					<div class="datagrid-tree-item-left">
						<a n:href="getChildren! parent => $row->getId()" data-toggle-tree="true" n:class="!$has_children ? hidden, 'chevron ajax'">
							<i n:block="chevron-cion" class="{$icon_prefix}chevron-right"></i>
						</a>
						{foreach $columns as $key => $column}
							{var $col = 'col-' . $key}

							{if $column->hasTemplate()}
{'fraction_non_alphanumeric': 0.18569993302076357, 'fraction_numerical': 0.0, 'mean_word_length': 3.3282608695652174, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 127, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4649058', 'n_tokens_mistral': 2382, 'n_tokens_neox': 1944, 'n_words': 386}