<commit_before><template>

    <div>

        <loading-overlay v-show="loading"></loading-overlay>

        <div class="dashhead">
            <div class="dashhead-titles">
                <h6 class="dashhead-subtitle">Manage</h6>
                <h2 class="dashhead-title">Students</h2>
            </div>
        </div>

        <hr class="m-t">

        <alert type="danger" v-bind:message="errorMessage" v-bind:show="errorMessage" v-on:close="errorMessage = ''"></alert>

        <div class="flextable table-actions">
            <div class="flextable-item flextable-primary">
                <div class="btn-toolbar-item input-with-icon">
                    <input type="text" class="form-control input-block" placeholder="Search students" v-model="query" v-on:keyup.enter="handleSearch">
                    <i class="icon icon-magnifying-glass"></i>
                </div>
                <select class="m-l-s" v-model="limit" v-on:change="handleRefresh()">
                    <option v-bind:value="15">Show 15 items</option>
                    <option v-bind:value="25">Show 25 items</option>
                    <option v-bind:value="50">Show 50 items</option>
                </select>
            </div>
            <div class="flextable-item" v-if="hasAnyRole(user, roles.Administrator)">
                <div class="btn-group">
                    <router-link to="/manage/students/import" class="btn btn-primary-outline"><i class="fa fa-plus m-r-s"></i>Import</router-link>
                    <a href="/api/export/students" class="btn btn-primary-outline"><i class="fa fa-download m-r-s"></i>Export</a>
                </div>
            </div>
        </div>

        <div class="flextable table-actions">
            <div class="flextable-item flextable-primary">
            </div>
            <div class="flextable-item" v-if="hasAnyRole(user, roles.Administrator)">
                <select v-model="actionMode">
                    <option v-bind:value="1">With selected items only:</option>
                    <option v-bind:value="2">With all matching items:</option>
                </select>
                <div class="btn-group">
                    <a class="btn btn-primary-outline" v-on:click.prevent="handlePublish"><i class="fa fa-eye m-r-s"></i>Publish</a>
                    <a class="btn btn-primary-outline" v-on:click.prevent="handleUnpublish"><i class="fa fa-eye-slash m-r-s"></i>Unpublish</a>
                    <a class="btn btn-primary-outline" v-on:click.prevent="handleRemove"><i class="fa fa-trash"></i></a>
                </div>
            </div>
        </div>

        <div class="table-full">
            <div class="table-responsive">
                <table class="table" data-sort="table">
                    <thead>
                    <tr>
                        <th class="header"><input type="checkbox" ref="selectAll" v-on:change="handleSelectAll"></th>
                        <th v-bind:class="headerClass('student_number')" v-on:click.prevent="handleOrder('student_number')">#</th>
                        <th v-bind:class="headerClass('display_name')" v-on:click.prevent="handleOrder('display_name')">Name</th>
                        <th v-bind:class="headerClass('program_name')" v-on:click.prevent="handleOrder('program_name')">Program</th>
                        <th v-bind:class="headerClass('cohort')" v-on:click.prevent="handleOrder('cohort')">Cohort</th>
                        <th v-bind:class="headerClass('year')" v-on:click.prevent="handleOrder('year')">Year</th>
                        <th v-bind:class="headerClass('second_year_credits_expected')" v-on:click.prevent="handleOrder('second_year_credits_expected')">Prognosis</th>
                        <th v-bind:class="headerClass('is_published')" v-on:click.prevent="handleOrder('is_published')">Published</th>
                        <th class="header">View as</th>
                    </tr>
                    </thead>
                    <tbody>

                    <tr v-for="item in items" v-bind:key="item.id" v-bind:data-id="item.id">
                        <td><input type="checkbox" class="select-row"></td>
                        <td>
                            <router-link v-bind:to="'/manage/students/' + item.id">{{ item.student_number }}</router-link>
                        </td>
                        <td v-bind:title="item.display_name">{{ _.truncate(item.display_name, {length: 30}) }}</td>
                        <td v-bind:title="item.program_name">{{ _.truncate(item.program_name, {length: 30}) }}</td>
                        <td>{{ item.cohort }}</td>
                        <td>{{ item.year }}</td>
                        <td>
                            <i class="fa fa-circle" style="color: green;" v-if="item.second_year_credits_expected >= 54"></i>
                            <i class="fa fa-circle" style="color: yellow;" v-else-if="item.second_year_credits_expected >= 30"></i>
                            <i class="fa fa-circle" style="color: red;" v-else></i>
                        </td>
                        <td>
                            <i class="fa fa-check" v-if="item.is_published"></i>
                        </td>
                        <td><a class="btn btn-default-outline" v-on:click.prevent="handleViewAs(item)"><i class="fa fa-eye"></i></a></td>
                    </tr>

                    <tr v-if="items.length === 0">
                        <td colspan="8">No results</td>
                    </tr>

                    </tbody>
                </table>
            </div>
        </div>

        <pagination v-bind:pagination="pagination" v-on:goToPage="handleGoToPage"></pagination>

    </div>
<commit_msg>Improved students table<commit_after><template>

    <div>

        <loading-overlay v-show="loading"></loading-overlay>

        <div class="dashhead">
            <div class="dashhead-titles">
                <h6 class="dashhead-subtitle">Manage</h6>
                <h2 class="dashhead-title">Students</h2>
            </div>
        </div>

        <hr class="m-t">

        <alert type="danger" v-bind:message="errorMessage" v-bind:show="errorMessage" v-on:close="errorMessage = ''"></alert>

        <div class="flextable table-actions">
            <div class="flextable-item flextable-primary">
                <div class="btn-toolbar-item input-with-icon">
                    <input type="text" class="form-control input-block" placeholder="Search students" v-model="query" v-on:keyup.enter="handleSearch">
                    <i class="icon icon-magnifying-glass"></i>
                </div>
                <select class="m-l-s" v-model="limit" v-on:change="handleRefresh()">
                    <option v-bind:value="15">Show 15 items</option>
                    <option v-bind:value="25">Show 25 items</option>
                    <option v-bind:value="50">Show 50 items</option>
                </select>
            </div>
            <div class="flextable-item" v-if="hasAnyRole(user, roles.Administrator)">
                <div class="btn-group">
                    <router-link to="/manage/students/import" class="btn btn-primary-outline"><i class="fa fa-plus m-r-s"></i>Import</router-link>
                    <a href="/api/export/students" class="btn btn-primary-outline"><i class="fa fa-download m-r-s"></i>Export</a>
                </div>
            </div>
        </div>

        <div class="flextable table-actions">
            <div class="flextable-item flextable-primary">
            </div>
            <div class="flextable-item" v-if="hasAnyRole(user, roles.Administrator)">
                <select v-model="actionMode">
                    <option v-bind:value="1">With selected items only:</option>
                    <option v-bind:value="2">With all matching items:</option>
                </select>
                <div class="btn-group">
                    <a class="btn btn-primary-outline" v-on:click.prevent="handlePublish"><i class="fa fa-eye m-r-s"></i>Publish</a>
                    <a class="btn btn-primary-outline" v-on:click.prevent="handleUnpublish"><i class="fa fa-eye-slash m-r-s"></i>Unpublish</a>
                    <a class="btn btn-primary-outline" v-on:click.prevent="handleRemove"><i class="fa fa-trash"></i></a>
                </div>
            </div>
        </div>

        <div class="table-full">
            <div class="table-responsive">
                <table class="table" data-sort="table">
                    <thead>
                    <tr>
                        <th class="header"><input type="checkbox" ref="selectAll" v-on:change="handleSelectAll"></th>
                        <th v-bind:class="headerClass('student_number')" v-on:click.prevent="handleOrder('student_number')"></th>
                        <th v-bind:class="headerClass('display_name')" v-on:click.prevent="handleOrder('display_name')"></th>
                        <th v-bind:class="headerClass('program_name')" v-on:click.prevent="handleOrder('program_name')">Program</th>
                        <th class="header">Satisfaction</th>
                        <th v-bind:class="headerClass('cohort')" v-on:click.prevent="handleOrder('cohort')">Cohort</th>
                        <th v-bind:class="headerClass('year')" v-on:click.prevent="handleOrder('year')">Year</th>
                        <th class="header">Goal</th>
                        <th v-bind:class="headerClass('second_year_credits_expected')" v-on:click.prevent="handleOrder('second_year_credits_expected')"></th>
                        <th v-bind:class="headerClass('is_published')" v-on:click.prevent="handleOrder('is_published')">Published</th>
                        <th class="header"></th>
                    </tr>
                    </thead>
                    <tbody>

                    <tr v-for="item in items" v-bind:key="item.id" v-bind:data-id="item.id">
                        <td><input type="checkbox" class="select-row"></td>
                        <td>
                            <router-link v-bind:to="'/manage/students/' + item.id">{{ item.student_number }}</router-link>
                        </td>
                        <td v-bind:title="item.display_name">{{ _.truncate(item.display_name, {length: 30}) }}</td>
                        <td v-bind:title="item.program_name">{{ _.truncate(item.program_name, {length: 30}) }}</td>
                        <td>{{ item.program_satisfaction }}</td>
                        <td>{{ item.cohort }}</td>
                        <td>{{ item.year }}</td>
                        <td>{{ (item.year === 1) ? item.first_year_credits_goal : item.second_year_credits_goal }}</td>
                        <td>
                            <i class="fa fa-circle" style="color: green;" v-if="item.second_year_credits_expected >= 54"></i>
                            <i class="fa fa-circle" style="color: yellow;" v-else-if="item.second_year_credits_expected >= 30"></i>
                            <i class="fa fa-circle" style="color: red;" v-else></i>
                        </td>
                        <td>
                            <i class="fa fa-check" v-if="item.is_published"></i>
                        </td>
                        <td><a class="btn btn-default-outline" v-on:click.prevent="handleViewAs(item)"><i class="fa fa-eye"></i></a></td>
                    </tr>

                    <tr v-if="items.length === 0">
                        <td colspan="8">No results</td>
                    </tr>

                    </tbody>
                </table>
            </div>
        </div>

        <pagination v-bind:pagination="pagination" v-on:goToPage="handleGoToPage"></pagination>

    </div>

{'fraction_non_alphanumeric': 0.16831514324693042, 'fraction_numerical': 0.004860163710777626, 'mean_word_length': 1.7404205607476635, 'pattern_counts': {'":': 0, '<': 297, '<?xml version=': 0, '>': 301, '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': '412804', 'n_tokens_mistral': 3552, 'n_tokens_neox': 3297, 'n_words': 530}