<!-- Modal -->
<div class="modal fade" id="modalSection" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title d-none" id="modalTitleNew"><?= lang('Wiki.new_section') ?></h5>
                <h5 class="modal-title d-none" id="modalTitleEdit"><?= lang('Wiki.edit_section') ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="alert alert-primary" role="alert">
                    <?= lang('Wiki.need_reload') ?>
                </div>
                <form id="formSection">
                    <div class="form-group">
                        <div class="row">
                            <div class="col-12 mb-2">
                                <label for="section-name" class="form-label"><?= lang('Wiki.section_name')." (". lang('Wiki.spanish').")" ?></label>
                                <input type="text" id="section-name-es" name="name-es" placeholder="<?= lang('Wiki.section_placeholder') ?>" class="form-control" required />
                            </div>
                            <div class="col-12 mb-2">
                                <label for="section-name" class="form-label"><?= lang('Wiki.section_name')." (". lang('Wiki.english').")" ?></label>
                                <input type="text" id="section-name-en" name="name-en" placeholder="<?= lang('Wiki.section_placeholder') ?>" class="form-control" required />
                            </div>
                            <div class="mb-3">
                                <label for="section-icon" class="form-label"><?= lang('Wiki.icon') ?></label>
                                <select id="section-icon" class="select2-icons form-select">
                                </select>
                          
                            </div>
                            <div class="mb-3">
                                <label for="section-roles" class="form-label"><?= lang('Wiki.roles') ?></label>
                                <select id="section-roles" class="select2-icons form-select" name="roles[]" multiple>
                                    <?php 
                                    foreach(config('AuthGroups')->groups as $key => $value):?>
                                        <option value="<?=$key?>"><?=isset($value['title']) ? $value['title'] : $key?></option>
                                    <?php endforeach; ?>
                                </select>
                               
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <?php if (auth()->user()->inGroup('admin')): ?>
                    <button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
                    <button type="button" id="submit-new-section" class="btn btn-primary d-none"><?= lang('App.global_save') ?></button>
                    <button type="button" id="submit-update-section" class="btn btn-primary d-none"><?= lang('App.global_save') ?></button>
                <?php endif ?>
            </div>
        </div>
    </div>
</div>