<commit_before><?php
namespace Transvision;

// Helper anonymous variable to output a formatted table cell
$td = function ($key, $value) {
    return "<td><span class=\"celltitle\">{$key}</span>"
           . "<div class=\"string\">{$value}</div></td>";
};

?>
<form id ="searchform" name="searchform" method="get" action="">
    <fieldset id="main_search">
        <fieldset>
            <label>Locale:</label>
            <select name='locale'>
            <?=$target_locales_list?>
            </select>
        </fieldset>
        <fieldset>
            <label>Channel 1:</label>
            <select name='chan1'>
            <?=$chan_selector1?>
            </select>
        </fieldset>
        <fieldset>
            <label>Channel 2:</label>
            <select name='chan2'>
            <?=$chan_selector2?>
            </select>
        </fieldset>
        <input type="submit" value="Go" alt="Go" />
    </fieldset>
</form>

<?php if (empty($common_strings)) : ?>
<h3>Comparison is empty</h3>
<p class='subtitle'>There are no string differences for this locale between the <?=$repos_nice_names[$chan1]?> and <?=$repos_nice_names[$chan2]?> channels.</p>

<?php else: ?>
<h3>Locale: <?=$locale?></h3>
<table class='collapsable sortable' id='modified_strings_table'>
    <thead>
        <tr class='column_headers'>
            <th>Key</th>
            <th class='select_header'><a href="#">Select column</a><?=$chan1?></th>
            <th class='select_header'><a href="#">Select column</a><?=$chan2?></th>
        </tr>
    </thead>
    <tbody>
    <?php foreach ($common_strings as $key => $value) : ?>
    <tr>
        <?=$td('Key', ShowResults::formatEntity($key))?>
        <?=$td($chan1, Utils::secureText($value))?>
        <?=$td($chan2, Utils::secureText($strings[$chan2][$key]))?>
    </tr>
    <?php endforeach; ?>
    </tbody>
</table>
<?php endif; ?>

<?php if (empty($new_strings)): ?>
<h3 id="new_strings">No new strings have been added</h3>

<?php else : ?>
<h3 id="new_strings">New strings added in <em><?=$locale?></em> between <?=$repos_nice_names[$chan1]?> and <?=$repos_nice_names[$chan2]?></h3>
<table class='collapsable sortable' id='new_strings_table'>
    <thead>
        <tr class='column_headers'>
            <th>Entity</th>
            <th class='select_header'>en-US<span>Select column</span></th>
            <th class='select_header'><?=$locale?><span>Select column</span></th>
        </tr>
    </thead>
    <tbody>
    <?php foreach ($new_strings as $string_id => $string_values): ?><commit_msg>Fix select column button on /comparison<commit_after><?php
namespace Transvision;

// Helper anonymous variable to output a formatted table cell
$td = function ($key, $value) {
    return "<td><span class=\"celltitle\">{$key}</span>"
           . "<div class=\"string\">{$value}</div></td>";
};

?>
<form id ="searchform" name="searchform" method="get" action="">
    <fieldset id="main_search">
        <fieldset>
            <label>Locale:</label>
            <select name='locale'>
            <?=$target_locales_list?>
            </select>
        </fieldset>
        <fieldset>
            <label>Channel 1:</label>
            <select name='chan1'>
            <?=$chan_selector1?>
            </select>
        </fieldset>
        <fieldset>
            <label>Channel 2:</label>
            <select name='chan2'>
            <?=$chan_selector2?>
            </select>
        </fieldset>
        <input type="submit" value="Go" alt="Go" />
    </fieldset>
</form>

<?php if (empty($common_strings)) : ?>
<h3>Comparison is empty</h3>
<p class='subtitle'>There are no string differences for this locale between the <?=$repos_nice_names[$chan1]?> and <?=$repos_nice_names[$chan2]?> channels.</p>

<?php else: ?>
<h3>Locale: <?=$locale?></h3>
<table class='collapsable sortable' id='modified_strings_table'>
    <thead>
        <tr class='column_headers'>
            <th>Key</th>
            <th class='select_header'><a href="#">Select column</a><?=$chan1?></th>
            <th class='select_header'><a href="#">Select column</a><?=$chan2?></th>
        </tr>
    </thead>
    <tbody>
    <?php foreach ($common_strings as $key => $value) : ?>
    <tr>
        <?=$td('Key', ShowResults::formatEntity($key))?>
        <?=$td($chan1, Utils::secureText($value))?>
        <?=$td($chan2, Utils::secureText($strings[$chan2][$key]))?>
    </tr>
    <?php endforeach; ?>
    </tbody>
</table>
<?php endif; ?>

<?php if (empty($new_strings)): ?>
<h3 id="new_strings">No new strings have been added</h3>

<?php else : ?>
<h3 id="new_strings">New strings added in <em><?=$locale?></em> between <?=$repos_nice_names[$chan1]?> and <?=$repos_nice_names[$chan2]?></h3>
<table class='collapsable sortable' id='new_strings_table'>
    <thead>
        <tr class='column_headers'>
            <th>Entity</th>
            <th class='select_header'><a href="#">Select column</a>en-US</th>
            <th class='select_header'><a href="#">Select column</a><?=$locale?></th>
        </tr>
    </thead>
    <tbody>
    <?php foreach ($new_strings as $string_id => $string_values): ?>
{'fraction_non_alphanumeric': 0.2053641346906813, 'fraction_numerical': 0.009005481597494126, 'mean_word_length': 2.975875486381323, 'pattern_counts': {'":': 0, '<': 205, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5807714', 'n_tokens_mistral': 1651, 'n_tokens_neox': 1633, 'n_words': 341}