<?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',['lang' => $this->lang]);
$form_load_link = $this->url('adm.main.loadfolder',['lang' => $this->lang]);

$colors_active = $this->colors_active;
$folders = $this->folders;
$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="archive">Архив</option>
            </select>
            
            <ul class="b-list_folders">
                <?php foreach ($folders as $folder): ?>
                <li class="b-list_folders-item" data-folder="<?= $folder ?>"><?= $folder ?></li>
                <?php endforeach; ?>    
            </ul>
            
            <form id="save-folders-form" action="<?= $form_save_link ?>" method="POST"></form>
            <form id="load-folder-form" action="<?= $form_load_link ?>" method="POST"></form>
            <a class="btn btn-primary save-folders" href="#">Сохранить</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>
    </div>
</section>




