<commit_before>Ext.define('devilry.statistics.activeperiods.Overview', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.activeperiods-overview',
    frame: false,
    border: false,
    autoScroll: true,
    //cls: 'selectable-grid',

    requires: [
        'devilry.extjshelpers.DateTime',
        'devilry.statistics.activeperiods.AggregatedPeriodModel',
        'devilry.extjshelpers.RestProxy',
        'devilry.extjshelpers.SearchField',
        'devilry.extjshelpers.GridSelectionModel'
    ],
    
    /**
     * @cfg
     */
    nodeRecord: undefined,


    linkTpl: Ext.create('Ext.XTemplate',
        '<a href="{DevilrySettings.DEVILRY_URLPATH_PREFIX}/administrator/period/{data.period_id}?open_students=yes&students_hidesidebar=yes">',
        '{data.subject_long_name} ({data.period_long_name})',
        '</a>'
    ),

    readyForExportTpl: Ext.create('Ext.XTemplate',
        '<tpl if="qualifies_for_exam_ready_for_export"><span class="goodInlineItem">yes</span></tpl>',
        '<tpl if="!qualifies_for_exam_ready_for_export"><span class="warningInlineItem">no</span></tpl>'
    ),

    emailLinkTpl: Ext.create('Ext.XTemplate',
        'mailto:{from}?',
        'bcc={emailAddresses}'
    ),
    
    initComponent: function() {
        this._createStore();
        this.selModel = Ext.create('Ext.selection.CheckboxModel', {
            checkOnly: true
        });

        Ext.apply(this, {
            tbar: [
                //xtype: 'searchfield',
                //searchdelay: 30,
                //emptyText: 'Search...',
                //width: 200,
                //listeners: {
                    //scope: this,
                    //newSearchValue: this._onNewSearchValue,
                    //emptyInput: this._onEmptySearchValue
                //}
            {
                xtype: 'button',
                iconCls: 'icon-email-16',
                text: 'Send email to admin(s) on selected',
                listeners: {
                    scope: this,
                    click: this._sendEmailsToSelected<commit_msg>apps.statistics...activeperiods.Overview: Tooltip for email sending.<commit_after>Ext.define('devilry.statistics.activeperiods.Overview', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.activeperiods-overview',
    frame: false,
    border: false,
    autoScroll: true,
    //cls: 'selectable-grid',

    requires: [
        'devilry.extjshelpers.DateTime',
        'devilry.statistics.activeperiods.AggregatedPeriodModel',
        'devilry.extjshelpers.RestProxy',
        'devilry.extjshelpers.SearchField',
        'devilry.extjshelpers.GridSelectionModel'
    ],
    
    /**
     * @cfg
     */
    nodeRecord: undefined,


    linkTpl: Ext.create('Ext.XTemplate',
        '<a href="{DevilrySettings.DEVILRY_URLPATH_PREFIX}/administrator/period/{data.period_id}?open_students=yes&students_hidesidebar=yes">',
        '{data.subject_long_name} ({data.period_long_name})',
        '</a>'
    ),

    readyForExportTpl: Ext.create('Ext.XTemplate',
        '<tpl if="qualifies_for_exam_ready_for_export"><span class="goodInlineItem">yes</span></tpl>',
        '<tpl if="!qualifies_for_exam_ready_for_export"><span class="warningInlineItem">no</span></tpl>'
    ),

    emailLinkTpl: Ext.create('Ext.XTemplate',
        'mailto:{from}?',
        'bcc={emailAddresses}'
    ),

    emailTooltip: 'Opens your email application to send email to all admins on selected rows. Use the checkbox in the upper left corner to select all visible rows.' +
        (Ext.isIE8? '<p>WARNING: Your browser, Internet Explorer, can not handle email links containing many addresses. Use another browser if you encounter this problem.</p>': ''),
    
    initComponent: function() {
        this._createStore();
        this.selModel = Ext.create('Ext.selection.CheckboxModel', {
            checkOnly: true
        });

        Ext.apply(this, {
            tbar: [
                //xtype: 'searchfield',
                //searchdelay: 30,
                //emptyText: 'Search...',
                //width: 200,
                //listeners: {
                    //scope: this,
                    //newSearchValue: this._onNewSearchValue,
                    //emptyInput: this._onEmptySearchValue
                //}
            {
                xtype: 'button',
                iconCls: 'icon-email-16',
                text: 'Send email to admin(s) on selected',
                listeners: {
                    scope: this,
                    click: this._sendEmailsToSelected,
                    render: function(button) {
                        Ext.tip.QuickTipManager.register({
                            target: button.getEl(),
                            title: 'Click to send email to admins on selected',
                            text: this.emailTooltip,
                            width: 350,
                            dismissDelay: 30000 // Hide after 30 seconds hover
                        });
                    }
{'fraction_non_alphanumeric': 0.12620192307692307, 'fraction_numerical': 0.005008012820512821, 'mean_word_length': 1.8911407064273307, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6892705', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1412, 'n_words': 239}