<?php /* @var $theView \fpcm\view\viewVars */ ?>
<?php if (!empty($descriptions['top'])) : ?>
<div class="row g-0">
    <div class="col-12">
        <div class="m-3">
            <?php $theView->button('topDescr')
                ->setText($descriptions['top']['headline'])
                ->setAria(['controls' => 'topDescrCollapse'])
                ->setData(['bs-toggle' => 'collapse', 'bs-target' => '#topDescrCollapse'])
                ->setIcon('chevron-down')
                ->setPrimary(); ?>

            <div class="collapse" id="topDescrCollapse">
                <div class="card card-body">
                    <div class="row g-0">
                        <div class="col-12">
                            <?php $theView->write($descriptions['top']['text']); ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php endif; ?>            

<div class="row row-cols-1 row-cols-lg-2">
    <div class="col mt-3">
        <fieldset>            
            <?php foreach ($fields as $option => $field) : ?>
            <div class="row">
                <div class="col g-0">
                    <?php print $field; ?>                    
                </div>                
            </div>
            <?php endforeach; ?>
        </fieldset>
    </div>
</div>

<?php if (!empty($descriptions['buttom'])) : ?>
<div class="row g-0">
    <div class="col-12">
        <div class="m-3">

            <?php $theView->button('topDescr')
                ->setText($descriptions['buttom']['headline'])
                ->setAria(['controls' => 'bottomDescrCollapse'])
                ->setData(['bs-toggle' => 'collapse', 'bs-target' => '#bottomDescrCollapse'])
                ->setIcon('chevron-down')
                ->setPrimary(); ?>

            <div class="collapse mt-3" id="bottomDescrCollapse">
                <div class="card card-body">
                    <div class="row g-0">
                        <div class="col-12">
                            <?php $theView->write($descriptions['buttom']['text']); ?>
                        </div>
                    </div>
                </div>
            </div>        
        </div>
    </div>
</div>
<?php endif; ?>