{$current_sub_folder = ''}
{if !empty($breadcrumbs.0)}
    <p  style="margin-bottom:15px">
    {*Add root folder link*}
    <a href='javascript:drawings_select_existing.view_table("")' class="dialog_make_text_btn ui-corner-all" style="margin:0px">
        {$folder}
    </a> 
    {foreach from=$breadcrumbs item=item key=key name="breadcrumbs"}
            {$current_sub_folder = "`$current_sub_folder``$item`/"}
            {if $smarty.foreach.breadcrumbs.last === false}
            {$path = "`$current_sub_folder`/"}    
            <a href='javascript:drawings_select_existing.view_table("{base64_encode($path)}")' class="dialog_make_text_btn ui-corner-all"  style="margin:0px">            
                {$item}
            </a>      
            /
            {else}{*no link for current folder*}
                {$item}
            {/if}
        
    {/foreach} 
    </p>
{/if}

{if is_array($drwngs_data_list) && count($drwngs_data_list) > 0}
<table class="select_existing_table tablesorter">
    <thead>
        <tr>
            <th>{$i.filter_name}</th>
            <th>{$i.drawings_drawing_size}</th>
            <th>{$i.basic_change_date}</th>
        </tr>
    </thead>
    <tbody>
    {foreach from=$drwngs_data_list item=item key=key}
        <tr>
            <td data-tablesortval="{if $item.is_folder}a_{else}b_{/if}{$item.name}">
                {if $item.is_folder}
                    {$path = "`$current_sub_folder``$item.name`/"}
                    <a href="#" onclick='drawings_select_existing.view_table("{base64_encode($path)}", event)'>
                        <ins class="jstree-icon" style="background: transparent url('{$item.icon}') no-repeat scroll center center; background-position:-56px -19px;"> </ins>
                        {$item.name}
                    </a>
                {else}
                    {$path = "`$folder``$current_sub_folder``$item.name`"}
                    <a href="#" onclick='drawings_select_existing.use(this, "{base64_encode($path)}", event)'>
                        <ins class="jstree-icon" style="background: transparent url('{$item.icon}') no-repeat scroll center center;"> </ins>
                        {$item.name}
                    </a>                    
                {/if}
            </td>
            <td data-tablesortval="{if $item.is_folder}a_{else}b_{/if}{$item.filesize}">
                {$item.filesize_format} 
            </td>            
            <td data-tablesortval="{if $item.is_folder}a_{else}b_{/if}{$item.change_date}">
                {$item.change_date_str}
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>
{/if}
    
