<commit_before><?php
$defaultLocale = $this->localization()->getDefaultLocale();
$availableLocales = [];
foreach ($this->localization()->getAvailableLocalesDisplay() as $locale => $localeDisplay) {
    if(!$this->permission('admin42')->isGranted('sitemap/locale/' . $locale)) continue;

    $availableLocales[$locale] = $localeDisplay;
}

if (!in_array($defaultLocale, array_keys($availableLocales))) {
    $defaultLocale = key($availableLocales);
    reset($availableLocales);
}
?>

<div class="hbox hbox-auto-xs" ng-init="app.appContentFull = true">
    <div class="col">
        <div class="vbox">
            <div class="wrapper-md bg-white b-b">
                <h1 class="m-n font-thin h3">
                    <i class="flag-icon flag-icon-<?= strtolower(\Locale::getRegion($this->page->getLocale()))?>"></i>
                    <?= $this->translate('title.edit-sitemap', 'admin') ?>
                    <?php if (strlen($this->page->getName())): ?>
                        : "<?= $this->page->getName() ?>"
                    <?php endif; ?>
                    <?php if($this->permission('admin42')->isGranted('route/' . $this->routes['preview'])): ?>
                    <a class="btn btn-default" href="<?= $this->url($this->routes['preview'], ['id' => $this->page->getId()])?>" target="_blank">
                        <i class="fa fa-mail-forward"></i>
                    </a>
                    <?php endif; ?>
                </h1>
            </div>

            <?php if($this->versions->count() > 2 && $this->versions->current()->getApproved() === null): ?>
            <div class="alert alert-warning">
                <?= $this->translate('alert.unpublished-version', 'admin') ?>
            </div>
            <?php endif; ?>
            <?php $this->versions->rewind() ?>

            <div class="row-row">

                <div class="wrapper-md">

                    <?php if (count($this->pageForm->getMessages())): ?>
                        <?php foreach ($this->pageForm->getMessages() as $fieldsetName => $fields): ?>
                            <?php $fieldset = $this->pageForm->get($fieldsetName) ?>
                            <?php foreach ($fields as $fieldName => $messages): ?>
                                <?php $field = $fieldset->get($fieldName) ?>
                                <?php foreach ($messages as $message): ?>
                                    <div class="alert alert-danger">
                                        <?= $field->getLabel() ?> in <?= $this->translate($fieldset->getLabel(), 'admin') ?> Tab: <?= $message ?>
                                    </div>
                                <?php endforeach ?>
                            <?php endforeach ?>
                        <?php endforeach ?>
                    <?php endif ?>

                    <form class="form-horizontal" action="<?= $this->url(null, [], [], true)?>" method="post">
                        <uib-tabset uib-tabset-persist="<?= md5($this->url(null, [], [], true)) ?>" class="tab-container">
                            <?php
                            $this->pageForm->prepare();
                            ?>
                            <?php foreach ($this->pageForm as $fieldset): ?>
                                <uib-tab class="<?= count($fieldset->getMessages()) ? 'has-errors' : '' ?>">
                                    <uib-tab-heading>
                                        <?= $this->translate($fieldset->getLabel(), 'admin') ?>
                                    </uib-tab-heading>
                                    <?= $this->formCollection($fieldset) ?>
                                </uib-tab>
                            <?php endforeach; ?>
                        </uib-tabset>
                        <div class="panel panel-default">
                            <div class="panel-body">
                                <button class="btn btn-success" type="submit" name="save" value="save">
                                    <span class="fa fa-save"></span>
                                    <?= $this->translate('button.save', 'admin') ?>
                                </button>
                                <?php if($this->permission('admin42')->isGranted('route/' . $this->routes['approve'])): ?>
                                <button class="btn btn-success" type="submit" name="save" value="approve">
                                    <span class="fa fa-save"></span>
                                    <?= $this->translate('button.save-approve', 'admin') ?>
                                </button>
                                <?php endif; ?>
                                <?php if($this->permission('admin42')->isGranted('route/' . $this->routes['delete'])): ?>
                                <delete
                                    url="<?= $this->url($this->routes['delete']) ?>"
                                    title="<?= $this->translate("sitemap.modal.delete.title", "admin") ?>"
                                    content="<?= $this->translate("sitemap.modal.delete.content", "admin") ?>"
                                    request-id="<?= $this->page->getSitemapId() ?>"
                                    >
                                </delete>
                                <?php endif; ?>
                            </div>
                        </div>
<commit_msg>new submit button<commit_after><?php
$defaultLocale = $this->localization()->getDefaultLocale();
$availableLocales = [];
foreach ($this->localization()->getAvailableLocalesDisplay() as $locale => $localeDisplay) {
    if(!$this->permission('admin42')->isGranted('sitemap/locale/' . $locale)) continue;

    $availableLocales[$locale] = $localeDisplay;
}

if (!in_array($defaultLocale, array_keys($availableLocales))) {
    $defaultLocale = key($availableLocales);
    reset($availableLocales);
}
?>

<div class="hbox hbox-auto-xs" ng-init="app.appContentFull = true">
    <div class="col">
        <div class="vbox">
            <div class="wrapper-md bg-white b-b">
                <h1 class="m-n font-thin h3">
                    <i class="flag-icon flag-icon-<?= strtolower(\Locale::getRegion($this->page->getLocale()))?>"></i>
                    <?= $this->translate('title.edit-sitemap', 'admin') ?>
                    <?php if (strlen($this->page->getName())): ?>
                        : "<?= $this->page->getName() ?>"
                    <?php endif; ?>
                    <?php if($this->permission('admin42')->isGranted('route/' . $this->routes['preview'])): ?>
                    <a class="btn btn-default" href="<?= $this->url($this->routes['preview'], ['id' => $this->page->getId()])?>" target="_blank">
                        <i class="fa fa-mail-forward"></i>
                    </a>
                    <?php endif; ?>
                </h1>
            </div>

            <?php if($this->versions->count() > 2 && $this->versions->current()->getApproved() === null): ?>
            <div class="alert alert-warning">
                <?= $this->translate('alert.unpublished-version', 'admin') ?>
            </div>
            <?php endif; ?>
            <?php $this->versions->rewind() ?>

            <div class="row-row">

                <div class="wrapper-md">

                    <?php if (count($this->pageForm->getMessages())): ?>
                        <?php foreach ($this->pageForm->getMessages() as $fieldsetName => $fields): ?>
                            <?php $fieldset = $this->pageForm->get($fieldsetName) ?>
                            <?php foreach ($fields as $fieldName => $messages): ?>
                                <?php $field = $fieldset->get($fieldName) ?>
                                <?php foreach ($messages as $message): ?>
                                    <div class="alert alert-danger">
                                        <?= $field->getLabel() ?> in <?= $this->translate($fieldset->getLabel(), 'admin') ?> Tab: <?= $message ?>
                                    </div>
                                <?php endforeach ?>
                            <?php endforeach ?>
                        <?php endforeach ?>
                    <?php endif ?>

                    <form class="form-horizontal" action="<?= $this->url(null, [], [], true)?>" method="post">
                        <uib-tabset uib-tabset-persist="<?= md5($this->url(null, [], [], true)) ?>" class="tab-container">
                            <?php
                            $this->pageForm->prepare();
                            ?>
                            <?php foreach ($this->pageForm as $fieldset): ?>
                                <uib-tab class="<?= count($fieldset->getMessages()) ? 'has-errors' : '' ?>">
                                    <uib-tab-heading>
                                        <?= $this->translate($fieldset->getLabel(), 'admin') ?>
                                    </uib-tab-heading>
                                    <?= $this->formCollection($fieldset) ?>
                                </uib-tab>
                            <?php endforeach; ?>
                        </uib-tabset>
                        <div class="panel panel-default">
                            <div class="panel-body">
                                <submit submit-text="<?= $this->translate('button.save', 'admin') ?>" name="save" value="save"></submit>
                                <?php if($this->permission('admin42')->isGranted('route/' . $this->routes['approve'])): ?>
                                <submit submit-text="<?= $this->translate('button.save-approve', 'admin') ?>" name="save" value="approve"></submit>
                                <?php endif; ?>
                                <?php if($this->permission('admin42')->isGranted('route/' . $this->routes['delete'])): ?>
                                <delete
                                    url="<?= $this->url($this->routes['delete']) ?>"
                                    title="<?= $this->translate("sitemap.modal.delete.title", "admin") ?>"
                                    content="<?= $this->translate("sitemap.modal.delete.content", "admin") ?>"
                                    request-id="<?= $this->page->getSitemapId() ?>"
                                    >
                                </delete>
                                <?php endif; ?>
                            </div>
                        </div>

{'fraction_non_alphanumeric': 0.17861227601982463, 'fraction_numerical': 0.0024780785360274493, 'mean_word_length': 1.3026113671274961, 'pattern_counts': {'":': 0, '<': 167, '<?xml version=': 0, '>': 299, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 34, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3204474', 'n_tokens_mistral': 2655, 'n_tokens_neox': 2548, 'n_words': 420}