<commit_before>Ext.define('devilry.extjshelpers.assignmentgroup.AssignmentGroupTodoList', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.assignmentgrouptodolist',
    cls: 'widget-assignmentgrouptodolist',
    hideHeaders: true, // Hide column header
    rowTpl: Ext.create('Ext.XTemplate',
        '<section class="popuplistitem">',
        '    <tpl if="name">',
        '        {name}: ',
        '    </tpl>',
        '    <ul style="display: inline-block;">',
        '    <tpl for="candidates__identifier">',
        '        <li>{.}</li>',
        '    </tpl>',
        '    </ul>',
        '    <tpl if="id == current_assignment_group_id">',
        '        &mdash; <strong>(currently selected)</strong>',
        '    </tpl>',
        '</section>'
    ),

    requires: [
        'devilry.extjshelpers.formfields.StoreSearchField'
    ],

    config: {
        /**
         * @cfg
         * AssignmentGroup ``Ext.data.Store``. (Required).
         */
        store: undefined,

        /**
         * @cfg
         * A {@link devilry.extjshelpers.SingleRecordContainer} for AssignmentGroup. (Optional).
         *
         * Used to show current assignmentgroup.
         */
        assignmentgroup_recordcontainer: undefined,

        pageSize: 10,
        tbarExtra: undefined
    },

    constructor: function(config) {
        this.callParent([config]);
        this.initConfig(config);
    },

    initComponent: function() {
        var me = this;

        this.tbarItems = [{
            xtype: 'storesearchfield',
            emptyText: 'Search...',
            store: this.store,
            width: 300,
            autoLoad: false
        }];
        if(this.tbarExtra) {
            Ext.Array.insert(this.tbarItems, 1, this.tbarExtra);
        }

        Ext.apply(this, {
            columns: [{
                header: 'Data',
                dataIndex: 'id',
                flex: 1,
                tdCls: 'selectable-gridcell',
                renderer: function(value, metaData, grouprecord) {
                    //console.log(grouprecord.data);
                    var data = {};
                    if(me.assignmentgroup_recordcontainer) {
                        data.current_assignment_group_id = me.assignmentgroup_recordcontainer.record.data.id;
                    }
                    Ext.apply(data, grouprecord.data);
                    return this.rowTpl.apply(data);
                }
            }],
            listeners: {
                scope: this,
                itemmouseup: this.onSelectGroup
            },


            dockedItems: [{
                xtype: 'toolbar',
                dock: 'top',
                items: this.tbarItems
            }, {
                xtype: 'pagingtoolbar',
                store: this.store,
                dock: 'bottom',
                displayInfo: true
            }]
        });

        this.callParent(arguments);

        if(this.assignmentgroup_recordcontainer) {
            if(this.assignmentgroup_recordcontainer.record) {
                this.onSetAssignmentGroup();
            }
            this.assignmentgroup_recordcontainer.addListener('setRecord', this.onSetAssignmentGroup, this);
        }
    },
<commit_msg>apps.extjshelpers: Todo styling.<commit_after>Ext.define('devilry.extjshelpers.assignmentgroup.AssignmentGroupTodoList', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.assignmentgrouptodolist',
    cls: 'widget-assignmentgrouptodolist',
    //hideHeaders: true, // Hide column header
    rowTpl: Ext.create('Ext.XTemplate',
        '<section class="popuplistitem">',
        '    <tpl if="name">',
        '        {name}: ',
        '    </tpl>',
        '    <ul style="display: inline-block;">',
        '    <tpl for="candidates__identifier">',
        '        <li>{.}</li>',
        '    </tpl>',
        '    </ul>',
        '    <tpl if="id == current_assignment_group_id">',
        '        &mdash; <strong>(currently selected)</strong>',
        '    </tpl>',
        '</section>'
    ),

    requires: [
        'devilry.extjshelpers.formfields.StoreSearchField'
    ],

    deliveriesColTpl: Ext.create('Ext.XTemplate', 
        '<span class="deliveriescol">',
        '    <tpl if="number_of_deliveries &gt; 0">',
        '       {number_of_deliveries}',
        '    </tpl>',
        '    <tpl if="number_of_deliveries == 0">',
        '       <span class="nodeliveries">0</div>',
        '   </tpl>',
        '</span>'
    ),

    config: {
        /**
         * @cfg
         * AssignmentGroup ``Ext.data.Store``. (Required).
         */
        store: undefined,

        /**
         * @cfg
         * A {@link devilry.extjshelpers.SingleRecordContainer} for AssignmentGroup. (Optional).
         *
         * Used to show current assignmentgroup.
         */
        assignmentgroup_recordcontainer: undefined,

        pageSize: 10,
        tbarExtra: undefined
    },

    constructor: function(config) {
        this.callParent([config]);
        this.initConfig(config);
    },

    initComponent: function() {
        var me = this;

        this.tbarItems = [{
            xtype: 'storesearchfield',
            emptyText: 'Search...',
            store: this.store,
            width: 300,
            autoLoad: false
        }];
        if(this.tbarExtra) {
            Ext.Array.insert(this.tbarItems, 1, this.tbarExtra);
        }

        Ext.apply(this, {
            columns: [{
                header: 'Students',
                dataIndex: 'id',
                flex: 2,
                //tdCls: 'selectable-gridcell',
                renderer: function(value, metaData, grouprecord) {
                    //console.log(grouprecord.data);
                    var data = {};
                    if(me.assignmentgroup_recordcontainer) {
                        data.current_assignment_group_id = me.assignmentgroup_recordcontainer.record.data.id;
                    }
                    Ext.apply(data, grouprecord.data);
                    return this.rowTpl.apply(data);
                }
            }, {
                text: 'Group name', dataIndex: 'name', flex: 1
            }, {
                text: 'Deliveries', dataIndex: 'id', width: 70,
                renderer: function(v, p, record) { return this.deliveriesColTpl.apply(record.data); }
            }],

            listeners: {
                scope: this,
                itemmouseup: this.onSelectGroup
            },

            dockedItems: [{
                xtype: 'toolbar',
                dock: 'top',
                items: this.tbarItems
            }, {
                xtype: 'pagingtoolbar',
                store: this.store,
                dock: 'bottom',
                displayInfo: true
            }]
        });

        this.callParent(arguments);

        if(this.assignmentgroup_recordcontainer) {
            if(this.assignmentgroup_recordcontainer.record) {
                this.onSetAssignmentGroup();
            }
            this.assignmentgroup_recordcontainer.addListener('setRecord', this.onSetAssignmentGroup, this);
        }
    },

{'fraction_non_alphanumeric': 0.1287281935846933, 'fraction_numerical': 0.0028137310073157004, 'mean_word_length': 1.491763056431826, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '3962407', 'n_tokens_mistral': 2027, 'n_tokens_neox': 1976, 'n_words': 314}