<div class="box">
    <div class="box-header bg-transparent">
        <!-- tools box -->
        <h3 class="box-title"><i class="icon-cogs"></i>
            <span><?php echo $view['translator']->trans('configuration.list.active', [], 'config'); ?></span>
        </h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body " style="display: block;">
        <div class="row">
            <div class="columns tableResp">
                <table>
                    <thead>
                    <tr>
                        <th><?php echo $view['translator']->trans('configuration.table.lp', [], 'config'); ?></th>
                        <th><?php echo $view['translator']->trans('configuration.table.groupName', [], 'config'); ?></th>
                        <th><?php echo $view['translator']->trans('configuration.table.name', [], 'config'); ?></th>
                        <th><?php echo $view['translator']->trans('configuration.table.value', [], 'config'); ?></th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach ($configuration as $i => $config): ?>
                        <tr data-id="<?php echo $config->getId(); ?>" data-group-name="<?php echo $config->getGroupName(); ?>" data-name="<?php echo $config->getName(); ?>">
                            <td><?php echo $i+1; ?></td>
                            <td><?php echo $config->getGroupName(); ?></td>
                            <td><?php echo $config->getName(); ?></td>
                            <td>
                                <?php echo $config->getValue(); ?>
                                <input type="hidden" class="value" value="<?php echo $config->getValue(); ?>">
                            </td>
                            <td><a href="#" class="button tiny open-modal">Edit</a></td>
                        </tr>
                    <?php endforeach ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="reveal" id="edit-modal" data-reveal>

    <div class="edit-configuration-modal-box">
        <?php echo $view['form']->start($form); ?>
            <div class="row">
                <div class="large-3 columns">
                    <p><strong><?php echo $view['translator']->trans('configuration.table.groupName', [], 'config'); ?></strong></p>
                </div>
                <div class="large-9 columns">
                    <p id="edit_configuration_modal_groupName"></p>
                </div>
            </div>
            <div class="row">
                <div class="large-3 columns">
                    <p><strong><?php echo $view['translator']->trans('configuration.table.name', [], 'config'); ?></strong></p>
                </div>
                <div class="large-9 columns">
                    <p id="edit_configuration_modal_name"></p>
                </div>
            </div>
            <div class="row">
                <div class="large-3 columns">
                    <p><strong><?php echo $view['translator']->trans('configuration.table.value', [], 'config'); ?></strong></p>
                </div>
                <div class="large-9 columns">
                    <?php echo $view['form']->widget($form['value']); ?>
                </div>
            </div>
            <input type="submit" value="Save" class="button">
        <?php echo $view['form']->end($form); ?>
    </div>

    <button type="button" class="close-button" data-close aria-label="Close modal">
        <span aria-hidden="true">&times;</span>
    </button>
</div>
