<?php
/**
 * Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *
 */

/** @var $this \Zend\View\Renderer\PhpRenderer */

$this->headScript()
    ->appendFile('/js/underscore-min.js')
    ->appendFile('/js/script-main.js')
;

$this->headLink()
    ->appendStylesheet('/css/styles-main.css')
;

$form_save_link = $this->url('adm.main.save');
$form_load_link = $this->url('adm.main.loadfolder');
$form_loadlist_link = $this->url('adm.main.loadfolderslist');

$colors_active = $this->colors_active;
$folders_new = $this->folders_new;
$folders_arch = $this->folders_arch;
$dir = $this->dir;

?>

<!-- Main content index  -->
<section class="b-content container-fluid">
    <div class="row row-center">
        <div class="b-list">
            <select class="b-list_select-folders form-control">
                <option value="new">Новые</option>
                <option value="arch">Архив</option>
            </select>
            
            <ul class="b-list_folders new" data-type="new">
                <?php foreach ($folders_new as $folder): ?>
                <li class="b-list_folders-item" data-folder="<?= $folder ?>"><?= $folder ?><b></b></li>
                <?php endforeach; ?>    
            </ul>
            
            <ul class="b-list_folders arch" data-type="arch">
                <?php foreach ($folders_arch as $folder): ?>
                <li class="b-list_folders-item" data-folder="<?= $folder ?>"><?= $folder ?><b></b></li>
                <?php endforeach; ?>    
            </ul>
            
            <form id="load-folders-list-form" action="<?= $form_loadlist_link ?>" method="POST"></form>
            <form id="load-folder-form" action="<?= $form_load_link ?>" method="POST"></form>
            <form id="save-folders-form" action="<?= $form_save_link ?>" method="POST"></form>
            
            
            <a class="btn btn-primary save-folders disabled" href="#" disabled>Сохранить</a>
            
        </div>
        <div class="b-preview col" data-colors=<?= ($colors_active ? json_encode($colors_active) : '')?> data-pairs_count=<?= ($pairs_count ? json_encode($pairs_count) : '')?>>
            
            <div class="b-loading"></div>
            
            <div class="b-preview_inner new col">
            </div>
            
            <div class="b-preview_inner arch col">
            </div>
            
        </div>
    </div>
</section>




