<commit_before><?= $this->headLink()->appendStylesheet($this->basePath() . '/redactor/redactor.css'); ?>
<?php
/**@var $form Zend\Form\Form */
$form = $this->form;
$scripts = $this->scripts ? $this->scripts : [];
$ajax = $this->ajax ? $this->ajax : false;
?>
<div class="container form-container">
    <div class="row">
        <?php if (!$ajax): ?>
            <h1><?= !$this->title ? 'Create' : $this->escapeHtml($this->title); ?></h1>
        <?php endif; ?>
        <form action="" method="post" class="form-horizontal" id="crudForm">
            <?php foreach ($form->getElements() as $element) : ?>
                <?php
                switch ($element) {
                    case $element instanceof Zend\Form\Element\Select :
                        $formElement = $this->formSelect($element);
                        break;
                    case $element instanceof Zend\Form\Element\Email :
                        $formElement = $this->formEmail($element);
                        break;
                    case $element instanceof Zend\Form\Element\Password :
                        $formElement = $this->formPassword($element);
                        break;
                    case $element instanceof \Starter\Form\Element\Redactor :
                        array_push($scripts, 'redactorContent');
                        $formElement = $this->formTextarea($element);
                        break;
                    case $element instanceof Zend\Form\Element\Textarea :
                        $formElement = $this->formTextarea($element);
                        break;
                    case $element instanceof Zend\Form\Element\Hidden :
                        $formElement = $this->formHidden($element);
                        break;
                    case $element instanceof Zend\Form\Element\Checkbox :
                        $formElement = $this->formCheckbox($element);
                        break;
                    default :
                        $formElement = $this->formInput($element);
                        break;
                }
                ?>
                <?php $element->getAttributes()['type'] == 'submit' ? $submit = true : $submit = false; ?>
                <div class="form-group">
                    <?php if ($element->getAttributes()['type'] !== 'submit'): ?>
                        <?php if ($element->getAttributes()['type'] !== 'hidden'): ?>
                            <label for="<?= $element->getName(); ?>" class="col-sm-2 control-label">
                                <?= $element->getLabel() ? $element->getLabel() : ucfirst($element->getName()); ?>
                            </label>
                        <?php endif; ?>
                    <?php else: ?>
                        <div class="col-sm-2"></div>
                    <?php endif; ?>
                    <div class="col-sm-4">
                        <?= $formElement; ?>
                        <div class="error-field error-form-message">
                            <?= $this->formElementErrors($element); ?>
                        </div>
                    </div>
                </div>
            <?php endforeach; ?>
            <?php if (!$submit && !$ajax): ?>
                <div class="form-group">
                    <div class="col-sm-4 col-md-offset-2">
                        <input type="submit" name="submit" class="btn btn-lg btn-primary btn-block"
                               value="<?= $this->title == 'Edit' ? 'Save' : 'Create'; ?>">
                    </div>
                </div>
            <?php endif; ?>
        </form>
    </div>
</div>
<script>
    require([
        'frontend',
        'dashboard',
        <?= implode(',', array_map(function($a) { return "'$a'"; }, $scripts));?>
    ]);
</script><commit_msg>Create.phtml - get rid frontent.js<commit_after><?= $this->headLink()->appendStylesheet($this->basePath() . '/redactor/redactor.css'); ?>
<?php
$scripts = $this->scripts ? $this->scripts : [];
$ajax = $this->ajax ? $this->ajax : false;
?>
<div class="container form-container">
    <div class="row">
        <?php if (!$ajax): ?>
            <h1><?= !$this->title ? 'Create' : $this->escapeHtml($this->title); ?></h1>
        <?php endif; ?>
        <form action="" method="post" class="form-horizontal" id="crudForm">
            <?php foreach ($this->form->getElements() as $element) : ?>
                <?php
                switch ($element) {
                    case $element instanceof Zend\Form\Element\Select :
                        $formElement = $this->formSelect($element);
                        break;
                    case $element instanceof Zend\Form\Element\Email :
                        $formElement = $this->formEmail($element);
                        break;
                    case $element instanceof Zend\Form\Element\Password :
                        $formElement = $this->formPassword($element);
                        break;
                    case $element instanceof \Starter\Form\Element\Redactor :
                        array_push($scripts, 'redactorContent');
                        $formElement = $this->formTextarea($element);
                        break;
                    case $element instanceof Zend\Form\Element\Textarea :
                        $formElement = $this->formTextarea($element);
                        break;
                    case $element instanceof Zend\Form\Element\Hidden :
                        $formElement = $this->formHidden($element);
                        break;
                    case $element instanceof Zend\Form\Element\Checkbox :
                        $formElement = $this->formCheckbox($element);
                        break;
                    default :
                        $formElement = $this->formInput($element);
                        break;
                }
                ?>
                <?php $element->getAttributes()['type'] == 'submit' ? $submit = true : $submit = false; ?>
                <div class="form-group">
                    <?php if ($element->getAttributes()['type'] !== 'submit'): ?>
                        <?php if ($element->getAttributes()['type'] !== 'hidden'): ?>
                            <label for="<?= $element->getName(); ?>" class="col-sm-2 control-label">
                                <?= $element->getLabel() ? $element->getLabel() : ucfirst($element->getName()); ?>
                            </label>
                        <?php endif; ?>
                    <?php else: ?>
                        <div class="col-sm-2"></div>
                    <?php endif; ?>
                    <div class="col-sm-4">
                        <?= $formElement; ?>
                        <div class="error-field error-form-message">
                            <?= $this->formElementErrors($element); ?>
                        </div>
                    </div>
                </div>
            <?php endforeach; ?>
            <?php if (!$submit && !$ajax): ?>
                <div class="form-group">
                    <div class="col-sm-4 col-md-offset-2">
                        <input type="submit" name="submit" class="btn btn-lg btn-primary btn-block"
                               value="<?= $this->title == 'Edit' ? 'Save' : 'Create'; ?>">
                    </div>
                </div>
            <?php endif; ?>
        </form>
    </div>
</div>
<script>
    require([
        'dashboard',
        <?= implode(',', array_map(function($a) { return "'$a'"; }, $scripts));?>
    ]);
</script>
{'fraction_non_alphanumeric': 0.1589587737843552, 'fraction_numerical': 0.0018498942917547568, 'mean_word_length': 1.3090298962782185, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1078448', 'n_tokens_mistral': 1910, 'n_tokens_neox': 1806, 'n_words': 362}