<commit_before><?php if (!$event): ?>

    <?php foreach($resources as $resource): ?>
        <?php
        $download = '';
        foreach ($resource['versions'] as $version) {
            foreach ($version['translations'] as $translation) {
                foreach ($translation['links'] as $link) {
                    if ($link['rel'] == 'web_download'){
                        $download = $link['href'];
                        break;
                    }
                }
            }
        }
        ?>

        <?php if ($download): ?>
            <p><a href="<?php echo h($download); ?>" target="_blank"><?php echo h($resource['name']['text']); ?></a></p>
        <?php endif; ?>

    <?php endforeach; ?>

<?php else: ?>

    <?php foreach ($skills as $skill): ?>
        <?php if ($lastSector != $skill['sector']['id']): ?>
            <h2><?php echo h($skill['sector']['name']['text']); ?></h2>
        <?php endif; ?>
        <?php
        $lastSector = $skill['sector']['id'];
        ?>

        <div class="row">
            <div class="col-md-6">
                <p>
                    <?php echo h($skill['name']['text']); ?>
                </p>
            </div>

            <?php
            $skillTag = 'Skill ' . $skill['number'];
            ?>

            <div class="col-md-6">
                <?php foreach($resources as $resource): ?>
                    <?php
                    $found = false;
                    foreach ($resource['tags'] as $tag) {
                        if ($tag == $skillTag) {
                            $found = true;
                            break;
                        }
                    }
                    ?>
                    <?php if ($found): ?>
                        <?php
                        $download = '';
                        foreach ($resource['versions'] as $version) {
                            foreach ($version['translations'] as $translation) {
                                foreach ($translation['links'] as $link) {
                                    if ($link['rel'] == 'web_download'){
                                        $download = $link['href'];
                                        break;
                                    }
                                }
                            }
                        }
                        ?>

                        <?php if ($download): ?>
                            <p><a href="<?php echo h($download); ?>" target="_blank"><?php echo h($resource['name']['text']); ?></a></p>
                        <?php endif; ?>
                    <?php endif; ?>

                <?php endforeach; ?>
            </div>
        </div>

    <?php endforeach; ?>

<?php endif; ?>

<?php if (count($resources) == 0): ?>
    <div class="ccm-edit-mode-disabled-item"><?php echo t('Empty Resources block.')?></div>
<?php endif; ?>
<commit_msg>Add rel="noopener"<commit_after><?php if (!$event): ?>

    <?php foreach($resources as $resource): ?>
        <?php
        $download = '';
        foreach ($resource['versions'] as $version) {
            foreach ($version['translations'] as $translation) {
                foreach ($translation['links'] as $link) {
                    if ($link['rel'] == 'web_download'){
                        $download = $link['href'];
                        break;
                    }
                }
            }
        }
        ?>

        <?php if ($download): ?>
            <p><a href="<?php echo h($download); ?>" target="_blank" rel="noopener"><?php echo h($resource['name']['text']); ?></a></p>
        <?php endif; ?>

    <?php endforeach; ?>

<?php else: ?>

    <?php foreach ($skills as $skill): ?>
        <?php if ($lastSector != $skill['sector']['id']): ?>
            <h2><?php echo h($skill['sector']['name']['text']); ?></h2>
        <?php endif; ?>
        <?php
        $lastSector = $skill['sector']['id'];
        ?>

        <div class="row">
            <div class="col-md-6">
                <p>
                    <?php echo h($skill['name']['text']); ?>
                </p>
            </div>

            <?php
            $skillTag = 'Skill ' . $skill['number'];
            ?>

            <div class="col-md-6">
                <?php foreach($resources as $resource): ?>
                    <?php
                    $found = false;
                    foreach ($resource['tags'] as $tag) {
                        if ($tag == $skillTag) {
                            $found = true;
                            break;
                        }
                    }
                    ?>
                    <?php if ($found): ?>
                        <?php
                        $download = '';
                        foreach ($resource['versions'] as $version) {
                            foreach ($version['translations'] as $translation) {
                                foreach ($translation['links'] as $link) {
                                    if ($link['rel'] == 'web_download'){
                                        $download = $link['href'];
                                        break;
                                    }
                                }
                            }
                        }
                        ?>

                        <?php if ($download): ?>
                            <p><a href="<?php echo h($download); ?>" target="_blank" rel="noopener"><?php echo h($resource['name']['text']); ?></a></p>
                        <?php endif; ?>
                    <?php endif; ?>

                <?php endforeach; ?>
            </div>
        </div>

    <?php endforeach; ?>

<?php endif; ?>

<?php if (count($resources) == 0): ?>
    <div class="ccm-edit-mode-disabled-item"><?php echo t('Empty Resources block.')?></div>
<?php endif; ?>

{'fraction_non_alphanumeric': 0.1727909759015553, 'fraction_numerical': 0.0017091095539224065, 'mean_word_length': 1.0461538461538462, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '805641', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1393, 'n_words': 309}