<commit_before>/**
 * Devilry page header.
 */
Ext.define('devilry_header.Header', {
    extend: 'Ext.container.Container',
    alias: 'widget.devilryheader',
    cls: 'devilryheader',
    margins: '0 0 0 0',
    height: 30,

    requires: [
        'devilry_header.FlatButton',
        'devilry_header.HoverMenu',
        'devilry_header.Roles',
        'devilry_authenticateduserinfo.UserInfo',
        'devilry_header.Breadcrumbs'
    ],


    navclass_to_rolename: {
        'student': gettext('Student'),
        'examiner': gettext('Examiner'),
        'administrator': gettext('Administrator'),
        'superuser': gettext('Superuser')
    },

    /**
     * @cfg {string} [navclass]
     * The css class to style the header buttons with.
     */

    /**
     * @cfg {Object} [breadcrumbs=devilry_header.Breadcrumbs]
     * The object to use for breadcrumbs. You can also set this after load with #setBreadcrumbComponent.
     * Defaults to an instance of devilry_header.Breadcrumbs.
     */

    constructor: function(config) {
        if(!this.navclass_to_rolename[config.navclass]) {
            throw "Invalid navclass: " + config.navclass;
        }
        devilry_authenticateduserinfo.UserInfo.load(); // Load the userinfo as soon as possible.
        this.callParent(arguments);
    },

    initComponent: function() {
        var breadcrumbareaItem;
        if(this.breadcrumbs) {
            breadcrumbareaItem = this.breadcrumbs;
        } else {
            breadcrumbareaItem = Ext.widget('breadcrumbs');
        }
        Ext.apply(this, {
            layout: {
                type: 'hbox',
                align: 'stretch'
            },
            items: [{
                xtype: 'box',
                //width: 110,
                cls: 'devilrylogo',
                tpl: '<span class="logotext">{text}</span>',<commit_msg>devilry_header...Header: Default dashboard breadcrumb.<commit_after>/**
 * Devilry page header.
 */
Ext.define('devilry_header.Header', {
    extend: 'Ext.container.Container',
    alias: 'widget.devilryheader',
    cls: 'devilryheader',
    margins: '0 0 0 0',
    height: 30,

    requires: [
        'devilry_header.FlatButton',
        'devilry_header.HoverMenu',
        'devilry_header.Roles',
        'devilry_authenticateduserinfo.UserInfo',
        'devilry_header.Breadcrumbs'
    ],


    navclass_to_rolename: {
        'student': gettext('Student'),
        'examiner': gettext('Examiner'),
        'administrator': gettext('Administrator'),
        'superuser': gettext('Superuser')
    },

    navclass_to_dashboard_url: {
        'student': DevilrySettings.DEVILRY_URLPATH_PREFIX + '/student/',
        'examiner': DevilrySettings.DEVILRY_URLPATH_PREFIX + '/examiner/',
        'administrator': DevilrySettings.DEVILRY_URLPATH_PREFIX + '/administrator/',
        'superuser': DevilrySettings.DEVILRY_URLPATH_PREFIX + '/superuser/'
    },

    /**
     * @cfg {string} [navclass]
     * The css class to style the header buttons with.
     */

    /**
     * @cfg {Object} [breadcrumbs=devilry_header.Breadcrumbs]
     * The object to use for breadcrumbs. You can also set this after load with #setBreadcrumbComponent.
     * Defaults to an instance of devilry_header.Breadcrumbs.
     */

    constructor: function(config) {
        if(!this.navclass_to_rolename[config.navclass]) {
            throw "Invalid navclass: " + config.navclass;
        }
        devilry_authenticateduserinfo.UserInfo.load(); // Load the userinfo as soon as possible.
        this.callParent(arguments);
    },

    initComponent: function() {
        var breadcrumbareaItem;
        if(this.breadcrumbs) {
            breadcrumbareaItem = this.breadcrumbs;
        } else {
            var defaultBreadcrumbs = [{
                url: this.navclass_to_dashboard_url[this.navclass],
                text: gettext('Dashboard')
            }];
            breadcrumbareaItem = Ext.widget('breadcrumbs', {
                defaultBreadcrumbs: defaultBreadcrumbs
            });
        }
        Ext.apply(this, {
            layout: {
                type: 'hbox',
                align: 'stretch'
            },
            items: [{
                xtype: 'box',
                //width: 110,
                cls: 'devilrylogo',
                tpl: '<span class="logotext">{text}</span>',
{'fraction_non_alphanumeric': 0.12102351313969571, 'fraction_numerical': 0.004149377593360996, 'mean_word_length': 2.1694667640613585, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '532533', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1321, 'n_words': 245}