<commit_before><?php

$this->headScript()
     ->prependFile($this->basePath() . '/vendor/selectize/dist/js/standalone/selectize.min.js')
     ->appendFile($this->basePath() . '/js/funds.js');

// set default order if not set and inverse the order based on the previous value
$order = isset($query['order']) ? $query['order'] : 'ASC';
$order = ($order == 'ASC') ? 'DESC' : 'ASC';

$form->setAttribute('method', 'GET');
$form->setAttribute('action', $this->url('funds', array(), array('query' => $query)));
$form->prepare();

?>

<div class="container">
    <div class="alert alert-info" role="alert">
        <?php echo $this->translate('Valda hållbarhetskategorier') ?>:
        <?php echo implode(', ', $sustainability) ?>
    </div>
    <div class="row">
        <div class="col-md-4 col-md-push-8">

            <?php echo $this->form()->openTag($form) ?>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $this->translate('Fondkategori') ?></h3>
                </div>
                <div class="panel-body">
                    <div class="checkbox">
                        <?php
                            $this->formMultiCheckbox()->setSeparator('</div><div class="checkbox">');
                            echo $this->formMultiCheckbox($form->get('fondoutcategory'));
                        ?>
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $this->translate('Fondbolag') ?></h3>
                </div>
                <div class="panel-body">
                    <?php echo $this->formSelect($form->get('company')) ?>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $this->translate('Fondstorlek') ?></h3>
                </div>
                <div class="panel-body">
                    <div class="checkbox">
                        <?php
                            $this->formMultiCheckbox()->setSeparator('</div><div class="checkbox">');
                            echo $this->formMultiCheckbox($form->get('size'));
                        ?>
                    </div>
                </div>
            </div>

            <?php echo $this->formHidden($form->get('category')) ?>
            <?php echo $this->formSubmit($form->get('submit')) ?>
            <?php echo $this->form()->closeTag() ?>
        </div>
        <div class="col-md-8 col-md-pull-4">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'name', 'order' => $order) + $query))); ?>">
                                <?php echo $this->translate('Fond') ?>
                            </a>
                        </th>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'company', 'order' => $order) + $query))); ?>">
                                <?php echo $this->translate('Fondbolag') ?>
                            </a>
                        </th>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'fondoutcategory', 'order' => $order) + $query))); ?>">
                                <?php echo $this->translate('Fondkategori') ?>
                            </a>
                        </th>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'sustainability', 'order' => $order)  + $query))); ?>">
                                <?php echo $this->translate('Hållbarhetspoäng') ?>
                            </a>
                        </th>
                        <th>
                            Storlek
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($funds as $fund): ?>
                        <tr>
                            <td>
                                <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array('id' => $fund->id))) ?>" title="">
                                    <?php echo $this->translate($fund->name) ?>
                                </a>
                            </td>
                            <td>
                                <?php echo $this->translate($fund->company->name) ?>
                            </td>
                            <td>
                                <?php echo $this->translate($fund->fondoutcategory->title) ?>
                            </td>
                            <td>
                                <?php
                                echo $this->numberFormat(
                                    $fund->getSustainability(),
                                    NumberFormatter::PERCENT,
                                    NumberFormatter::TYPE_DEFAULT,
                                    "en_US"
                                    );
                                ?>
                            </td>
                            <td>
                                <?php echo $this->numberFormat($fund->fundInstances[0]->totalMarketValue) ?> SEK
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>

            <?php if ($funds->getPages()->pageCount): ?>
                <ul class="pagination pagination-centered">
                    <!-- Previous page link -->
                    <?php if (isset($funds->getPages()->previous)): ?>
                        <li>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('page' => $funds->getPages()->previous) + $query))); ?>">
                                &laquo;
                            </a>
                        </li>
                        <?php
                        else: ?>
                        <li class="disabled">
                            <a href="#">
                                &laquo;<commit_msg>Added labels to view on fund size Small medium large instead of numbers<commit_after><?php

$this->headScript()
     ->prependFile($this->basePath() . '/vendor/selectize/dist/js/standalone/selectize.min.js')
     ->appendFile($this->basePath() . '/js/funds.js');

// set default order if not set and inverse the order based on the previous value
$order = isset($query['order']) ? $query['order'] : 'ASC';
$order = ($order == 'ASC') ? 'DESC' : 'ASC';

$form->setAttribute('method', 'GET');
$form->setAttribute('action', $this->url('funds', array(), array('query' => $query)));
$form->prepare();

?>

<div class="container">
    <div class="alert alert-info" role="alert">
        <?php echo $this->translate('Valda hållbarhetskategorier') ?>:
        <?php echo implode(', ', $sustainability) ?>
    </div>
    <div class="row">
        <div class="col-md-4 col-md-push-8">

            <?php echo $this->form()->openTag($form) ?>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $this->translate('Fondkategori') ?></h3>
                </div>
                <div class="panel-body">
                    <div class="checkbox">
                        <?php
                            $this->formMultiCheckbox()->setSeparator('</div><div class="checkbox">');
                            echo $this->formMultiCheckbox($form->get('fondoutcategory'));
                        ?>
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $this->translate('Fondbolag') ?></h3>
                </div>
                <div class="panel-body">
                    <?php echo $this->formSelect($form->get('company')) ?>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $this->translate('Fondstorlek') ?></h3>
                </div>
                <div class="panel-body">
                    <div class="checkbox">
                        <?php
                            $this->formMultiCheckbox()->setSeparator('</div><div class="checkbox">');
                            echo $this->formMultiCheckbox($form->get('size'));
                        ?>
                    </div>
                </div>
            </div>

            <?php echo $this->formHidden($form->get('category')) ?>
            <?php echo $this->formSubmit($form->get('submit')) ?>
            <?php echo $this->form()->closeTag() ?>
        </div>
        <div class="col-md-8 col-md-pull-4">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'name', 'order' => $order) + $query))); ?>">
                                <?php echo $this->translate('Fond') ?>
                            </a>
                        </th>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'company', 'order' => $order) + $query))); ?>">
                                <?php echo $this->translate('Fondbolag') ?>
                            </a>
                        </th>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'fondoutcategory', 'order' => $order) + $query))); ?>">
                                <?php echo $this->translate('Fondkategori') ?>
                            </a>
                        </th>
                        <th>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('sort' => 'sustainability', 'order' => $order)  + $query))); ?>">
                                <?php echo $this->translate('Hållbarhetspoäng') ?>
                            </a>
                        </th>
                        <th>
                            Storlek
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($funds as $fund): ?>
                        <tr>
                            <td>
                                <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array('id' => $fund->id))) ?>" title="">
                                    <?php echo $this->translate($fund->name) ?>
                                </a>
                            </td>
                            <td>
                                <?php echo $this->translate($fund->company->name) ?>
                            </td>
                            <td>
                                <?php echo $this->translate($fund->fondoutcategory->title) ?>
                            </td>
                            <td>
                                <?php
                                echo $this->numberFormat(
                                    $fund->getSustainability(),
                                    NumberFormatter::PERCENT,
                                    NumberFormatter::TYPE_DEFAULT,
                                    "en_US"
                                    );
                                ?>
                            </td>
                            <td>
                                <?php
                                    if ($fund->totalMarketValue <= 600000000) {
                                        echo $this->translate('Liten');
                                    } elseif ($fund->totalMarketValue >= 2500000000) {
                                        echo $this->translate('Stor');
                                    } else {
                                        echo $this->translate('Mellan');
                                    }

                                //echo $this->numberFormat($fund->totalMarketValue) ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>

            <?php if ($funds->getPages()->pageCount): ?>
                <ul class="pagination pagination-centered">
                    <!-- Previous page link -->
                    <?php if (isset($funds->getPages()->previous)): ?>
                        <li>
                            <a href="<?php echo $this->escapeHtmlAttr($this->url('funds', array(), array('query' => array('page' => $funds->getPages()->previous) + $query))); ?>">
                                &laquo;
                            </a>
                        </li>
                        <?php
                        else: ?>
                        <li class="disabled">
                            <a href="#">
                                &laquo;
{'fraction_non_alphanumeric': 0.16001744059298015, 'fraction_numerical': 0.0029067654966935543, 'mean_word_length': 1.047307349003273, 'pattern_counts': {'":': 0, '<': 244, '<?xml version=': 0, '>': 414, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1202199', 'n_tokens_mistral': 3419, 'n_tokens_neox': 3256, 'n_words': 621}