<commit_before><?php
/**
 * @package     Mautic
 * @copyright   2014 Mautic Contributors. All rights reserved.
 * @author      Mautic
 * @link        http://mautic.org
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
$view->extend('MauticCoreBundle:Default:content.html.php');
$header = ($lead->getId()) ?
    $view['translator']->trans('mautic.lead.lead.header.edit',
        array('%name%' => $view['translator']->trans($lead->getPrimaryIdentifier()))) :
    $view['translator']->trans('mautic.lead.lead.header.new');
$view['slots']->set('headerTitle', $header);
$view['slots']->set('mauticContent', 'lead');

$groups = array_keys($fields);
sort($groups);

$img = $view['lead_avatar']->getAvatar($lead);
?>
<?php echo $view['form']->start($form); ?>
<!-- start: box layout -->
<div class="box-layout">
    <!-- step container -->
    <div class="col-md-3 bg-white height-auto">
        <div class="pr-lg pl-lg pt-md pb-md">
            <div class="media">
                <div class="media-body">
                    <img class="img-rounded img-bordered img-responsive media-object" src="<?php echo $img; ?>" alt="">
                </div>
            </div>

            <div class="row mt-xs">
                <div class="col-sm-12">
                    <?php echo $view['form']->label($form['preferred_profile_image']); ?>
                    <?php echo $view['form']->widget($form['preferred_profile_image']); ?>
                </div>
                <div class="col-sm-12<?php if ($view['form']->containsErrors($form['custom_avatar'])) echo ' has-error'; ?>" id="customAvatarContainer" style="<?php if ($form['preferred_profile_image']->vars['data'] != 'custom') echo 'display: none;'; ?>">
                    <?php echo $view['form']->widget($form['custom_avatar']); ?>
                    <?php echo $view['form']->errors($form['custom_avatar']); ?>
                </div>
            </div>

            <hr />

            <ul class="list-group list-group-tabs">
                <?php $step = 1; ?>
                <?php foreach ($groups as $g): ?>
                    <?php if (!empty($fields[$g])): ?>
                        <li class="list-group-item <?php if ($step === 1) echo "active"; ?>">
                            <a href="#<?php echo $g; ?>" class="steps" data-toggle="tab">
                                <?php echo $view['translator']->trans('mautic.lead.field.group.' . $g); ?>
                            </a>
                        </li>
                        <?php $step++; ?>
                    <?php endif; ?>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
    <!--/ step container -->

    <!-- container -->
    <div class="col-md-9 bg-auto height-auto bdr-l">
        <div class="tab-content">
            <!-- pane -->
            <?php
            foreach ($groups as $key => $group):
            if (isset($fields[$group])):
                $groupFields = $fields[$group];
                if (!empty($groupFields)): ?>
                <div class="tab-pane fade<?php if ($key === 0) echo ' in active'; ?> bdr-rds-0 bdr-w-0" id="<?php echo $group; ?>">
                    <div class="pa-md bg-auto bg-light-xs bdr-b">
                        <h4 class="fw-sb"><?php echo $view['translator']->trans('mautic.lead.field.group.' . $group); ?></h4>
                    </div>
                    <div class="pa-md">
                    <?php if ($group == 'core'): ?>

                        <?php if (isset($form['title']) || isset($form['firstname']) || isset($form['lastname'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.core.name'); ?></label>
                            <div class="row">
                                <?php if (isset($form['title'])): ?>
                                <div class="col-sm-2">
                                    <?php echo $view['form']->widget($form['title'], array('attr' => array('placeholder' => $form['title']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['firstname'])): ?>
                                <div class="col-sm-3">
                                    <?php echo $view['form']->widget($form['firstname'], array('attr' => array('placeholder' => $form['firstname']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['lastname'])): ?>
                                <div class="col-sm-3">
                                    <?php echo $view['form']->widget($form['lastname'], array('attr' => array('placeholder' => $form['lastname']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                            <hr class="mnr-md mnl-md">
                            <div class="row">

                                <div class="col-sm-8">
                                    <?php echo $view['form']->label($form['stage']); ?>
                                    <?php echo $view['form']->widget($form['stage']); ?>
                                </div>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                        <?php endif; ?>

                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $form['email']->vars['label']; ?></label>
                            <div class="row">
                                <div class="col-sm-8">
                                    <?php echo $view['form']->widget($form['email'], array('attr' => array('placeholder' => $form['email']->vars['label']))); ?>
                                </div>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">

                        <?php if (isset($form['company']) || isset($form['position'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.core.company'); ?></label>
                            <div class="row">
                                <?php if (isset($form['company'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['company'], array('attr' => array('placeholder' => $view['translator']->trans('mautic.core.company')))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['position'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['position'], array('attr' => array('placeholder' => $form['position']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                        <?php endif; ?>
                        <?php if (isset($form['address1']) || isset($form['address2']) || isset($form['city']) || isset($form['state']) || isset($form['zipcode']) || isset($form['country'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.lead.field.address'); ?></label>
                            <?php if (isset($form['address1'])): ?>
                            <div class="row mb-xs">
                                <div class="col-sm-8">
                                    <?php echo $view['form']->widget($form['address1'], array('attr' => array('placeholder' => $form['address1']->vars['label']))); ?>
                                </div>
                            </div>
                            <?php endif; ?>
                            <?php if (isset($form['address2'])): ?>
                            <div class="row mb-xs">
                                <div class="col-sm-8">
                                    <?php echo $view['form']->widget($form['address2'], array('attr' => array('placeholder' => $form['address2']->vars['label']))); ?>
                                </div>
                            </div>
                            <?php endif; ?>
                            <div class="row mb-xs">
                                <?php if (isset($form['city'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['city'], array('attr' => array('placeholder' => $form['city']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['state'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['state'], array('attr' => array('placeholder' => $form['state']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                            <div class="row">
                                <?php if (isset($form['zipcode'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['zipcode'], array('attr' => array('placeholder' => $form['zipcode']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['country'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['country'], array('attr' => array('placeholder' => $form['country']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php if (isset($form['attribution']) && isset($form['attribution_date'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.lead.attribution'); ?></label>
                            <div class="row">
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['attribution'], array('attr' => array('placeholder' => $form['attribution']->vars['label'], 'preaddon' => 'fa fa-money'))); ?>
                                </div>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['attribution_date'], array('attr' => array('placeholder' => $form['attribution_date']->vars['label']))); ?>
                                </div>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                    <?php endif; ?>

                        <div class="row">
                        <?php foreach ($groupFields as $alias => $field): ?>
                        <?php if ($form[$alias]->isRendered()) continue; ?>
                            <div class="col-sm-8">
                                <?php echo $view['form']->row($form[$alias]); ?>
                            </div>
                        <?php endforeach; ?>
                        </div>

                        <?php if ($group == 'core'): ?>

                        <hr class="mnr-md mnl-md">

                        <div class="row">
                            <div class="col-sm-4">
                                <?php echo $view['form']->label($form['owner']); ?>
                                <?php echo $view['form']->widget($form['owner']); ?>
                            </div>
                            <div class="col-sm-4">
                                <?php echo $view['form']->label($form['tags']); ?>
                                <?php echo $view['form']->widget($form['tags']); ?>
                            </div>
                        </div>

                        <?php endif; ?>
                    </div>
                </div>
            <?php
                endif;
                endif;
                endforeach;
            ?>
            <!--/ #pane -->
        </div>
    </div>
    <!--/ end: container -->
</div>
<?php echo $view['form']->end($form); ?>
<!--/ end: box layout -->
<commit_msg>moved stage from place in edit mode<commit_after><?php
/**
 * @package     Mautic
 * @copyright   2014 Mautic Contributors. All rights reserved.
 * @author      Mautic
 * @link        http://mautic.org
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
$view->extend('MauticCoreBundle:Default:content.html.php');
$header = ($lead->getId()) ?
    $view['translator']->trans('mautic.lead.lead.header.edit',
        array('%name%' => $view['translator']->trans($lead->getPrimaryIdentifier()))) :
    $view['translator']->trans('mautic.lead.lead.header.new');
$view['slots']->set('headerTitle', $header);
$view['slots']->set('mauticContent', 'lead');

$groups = array_keys($fields);
sort($groups);

$img = $view['lead_avatar']->getAvatar($lead);
?>
<?php echo $view['form']->start($form); ?>
<!-- start: box layout -->
<div class="box-layout">
    <!-- step container -->
    <div class="col-md-3 bg-white height-auto">
        <div class="pr-lg pl-lg pt-md pb-md">
            <div class="media">
                <div class="media-body">
                    <img class="img-rounded img-bordered img-responsive media-object" src="<?php echo $img; ?>" alt="">
                </div>
            </div>

            <div class="row mt-xs">
                <div class="col-sm-12">
                    <?php echo $view['form']->label($form['preferred_profile_image']); ?>
                    <?php echo $view['form']->widget($form['preferred_profile_image']); ?>
                </div>
                <div class="col-sm-12<?php if ($view['form']->containsErrors($form['custom_avatar'])) echo ' has-error'; ?>" id="customAvatarContainer" style="<?php if ($form['preferred_profile_image']->vars['data'] != 'custom') echo 'display: none;'; ?>">
                    <?php echo $view['form']->widget($form['custom_avatar']); ?>
                    <?php echo $view['form']->errors($form['custom_avatar']); ?>
                </div>
            </div>

            <hr />

            <ul class="list-group list-group-tabs">
                <?php $step = 1; ?>
                <?php foreach ($groups as $g): ?>
                    <?php if (!empty($fields[$g])): ?>
                        <li class="list-group-item <?php if ($step === 1) echo "active"; ?>">
                            <a href="#<?php echo $g; ?>" class="steps" data-toggle="tab">
                                <?php echo $view['translator']->trans('mautic.lead.field.group.' . $g); ?>
                            </a>
                        </li>
                        <?php $step++; ?>
                    <?php endif; ?>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
    <!--/ step container -->

    <!-- container -->
    <div class="col-md-9 bg-auto height-auto bdr-l">
        <div class="tab-content">
            <!-- pane -->
            <?php
            foreach ($groups as $key => $group):
            if (isset($fields[$group])):
                $groupFields = $fields[$group];
                if (!empty($groupFields)): ?>
                <div class="tab-pane fade<?php if ($key === 0) echo ' in active'; ?> bdr-rds-0 bdr-w-0" id="<?php echo $group; ?>">
                    <div class="pa-md bg-auto bg-light-xs bdr-b">
                        <h4 class="fw-sb"><?php echo $view['translator']->trans('mautic.lead.field.group.' . $group); ?></h4>
                    </div>
                    <div class="pa-md">
                    <?php if ($group == 'core'): ?>

                        <?php if (isset($form['title']) || isset($form['firstname']) || isset($form['lastname'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.core.name'); ?></label>
                            <div class="row">
                                <?php if (isset($form['title'])): ?>
                                <div class="col-sm-2">
                                    <?php echo $view['form']->widget($form['title'], array('attr' => array('placeholder' => $form['title']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['firstname'])): ?>
                                <div class="col-sm-3">
                                    <?php echo $view['form']->widget($form['firstname'], array('attr' => array('placeholder' => $form['firstname']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['lastname'])): ?>
                                <div class="col-sm-3">
                                    <?php echo $view['form']->widget($form['lastname'], array('attr' => array('placeholder' => $form['lastname']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                            <hr class="mnr-md mnl-md">
                        <?php endif; ?>

                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $form['email']->vars['label']; ?></label>
                            <div class="row">
                                <div class="col-sm-8">
                                    <?php echo $view['form']->widget($form['email'], array('attr' => array('placeholder' => $form['email']->vars['label']))); ?>
                                </div>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">

                        <?php if (isset($form['company']) || isset($form['position'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.core.company'); ?></label>
                            <div class="row">
                                <?php if (isset($form['company'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['company'], array('attr' => array('placeholder' => $view['translator']->trans('mautic.core.company')))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['position'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['position'], array('attr' => array('placeholder' => $form['position']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                        <?php endif; ?>
                        <?php if (isset($form['address1']) || isset($form['address2']) || isset($form['city']) || isset($form['state']) || isset($form['zipcode']) || isset($form['country'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.lead.field.address'); ?></label>
                            <?php if (isset($form['address1'])): ?>
                            <div class="row mb-xs">
                                <div class="col-sm-8">
                                    <?php echo $view['form']->widget($form['address1'], array('attr' => array('placeholder' => $form['address1']->vars['label']))); ?>
                                </div>
                            </div>
                            <?php endif; ?>
                            <?php if (isset($form['address2'])): ?>
                            <div class="row mb-xs">
                                <div class="col-sm-8">
                                    <?php echo $view['form']->widget($form['address2'], array('attr' => array('placeholder' => $form['address2']->vars['label']))); ?>
                                </div>
                            </div>
                            <?php endif; ?>
                            <div class="row mb-xs">
                                <?php if (isset($form['city'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['city'], array('attr' => array('placeholder' => $form['city']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['state'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['state'], array('attr' => array('placeholder' => $form['state']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                            <div class="row">
                                <?php if (isset($form['zipcode'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['zipcode'], array('attr' => array('placeholder' => $form['zipcode']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                                <?php if (isset($form['country'])): ?>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['country'], array('attr' => array('placeholder' => $form['country']->vars['label']))); ?>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php if (isset($form['attribution']) && isset($form['attribution_date'])): ?>
                        <div class="form-group mb-0">
                            <label class="control-label mb-xs"><?php echo $view['translator']->trans('mautic.lead.attribution'); ?></label>
                            <div class="row">
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['attribution'], array('attr' => array('placeholder' => $form['attribution']->vars['label'], 'preaddon' => 'fa fa-money'))); ?>
                                </div>
                                <div class="col-sm-4">
                                    <?php echo $view['form']->widget($form['attribution_date'], array('attr' => array('placeholder' => $form['attribution_date']->vars['label']))); ?>
                                </div>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                    <?php endif; ?>

                        <div class="row">
                        <?php foreach ($groupFields as $alias => $field): ?>
                        <?php if ($form[$alias]->isRendered()) continue; ?>
                            <div class="col-sm-8">
                                <?php echo $view['form']->row($form[$alias]); ?>
                            </div>
                        <?php endforeach; ?>
                        </div>
                            <div class="row">

                                <div class="col-sm-8">
                                    <?php echo $view['form']->label($form['stage']); ?>
                                    <?php echo $view['form']->widget($form['stage']); ?>
                                </div>
                            </div>
                        </div>
                        <hr class="mnr-md mnl-md">
                        <?php if ($group == 'core'): ?>

                        <hr class="mnr-md mnl-md">

                        <div class="row">
                            <div class="col-sm-4">
                                <?php echo $view['form']->label($form['owner']); ?>
                                <?php echo $view['form']->widget($form['owner']); ?>
                            </div>
                            <div class="col-sm-4">
                                <?php echo $view['form']->label($form['tags']); ?>
                                <?php echo $view['form']->widget($form['tags']); ?>
                            </div>
                        </div>

                        <?php endif; ?>
                    </div>
                </div>
            <?php
                endif;
                endif;
                endforeach;
            ?>
            <!--/ #pane -->
        </div>
    </div>
    <!--/ end: container -->
</div>
<?php echo $view['form']->end($form); ?>
<!--/ end: box layout -->

{'fraction_non_alphanumeric': 0.18815251061226052, 'fraction_numerical': 0.0039007227809858885, 'mean_word_length': 1.152617714850181, 'pattern_counts': {'":': 0, '<': 435, '<?xml version=': 0, '>': 619, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2486577', 'n_tokens_mistral': 6795, 'n_tokens_neox': 6445, 'n_words': 1188}