<commit_before>'use strict';

var _         = require('underscore'),
    path      = require('path'),
    winston   = module.parent.require('winston'),
    meta      = module.parent.require('./meta'),

    settings  = null,
    namespace = 'ns:custom-fields';

(function (Plugin) {
    Plugin.hooks = {
        filters: {
            menu   : function (custom_header, callback) {
                custom_header.plugins.push({
                    route: '/plugins/custom-fields',
                    icon : 'fa-plus-square',
                    name : 'Custom Fields'
                });
                callback(null, custom_header);
            },
            statics: {
                load: function (params, callback) {
                    var router      = params.router,
                        middleware  = params.middleware,
                        controllers = params.controllers;

                    meta.settings.get(namespace, function (err, config) {
                        if (err) {
                            winston.warn('[' + namespace + '] Error has been occurred! There is no configuration.');
                            return callback(err);
                        }

                        settings = config;

                        router.get('/admin/plugins/custom-fields', middleware.applyCSRF, middleware.admin.buildHeader, Plugin.renderAdmin);
                        router.get('/api/admin/plugins/custom-fields', middleware.applyCSRF, Plugin.renderAdmin);

                        callback();
                    });
                }
            }
        }
    };

    Plugin.renderAdmin = function (req, res, next) {
        res.render(<commit_msg>Fix statics<commit_after>'use strict';

var _         = require('underscore'),
    path      = require('path'),
    winston   = module.parent.require('winston'),
    meta      = module.parent.require('./meta'),

    settings  = null,
    namespace = 'ns:custom_fields';

(function (Plugin) {
    Plugin.hooks = {
        filters: {
            menu: function (custom_header, callback) {
                custom_header.plugins.push({
                    route: '/plugins/custom-fields',
                    icon : 'fa-plus-square',
                    name : 'Custom Fields'
                });
                callback(null, custom_header);
            }
        },
        statics: {
            load: function (params, callback) {
                var router      = params.router,
                    middleware  = params.middleware,
                    controllers = params.controllers;

                meta.settings.get(namespace, function (err, config) {
                    if (err) {
                        winston.warn('[' + namespace + '] Error has been occurred! There is no configuration.');
                        return callback(err);
                    }

                    settings = config;

                    router.get('/admin/plugins/custom-fields', middleware.applyCSRF, middleware.admin.buildHeader, Plugin.renderAdmin);
                    router.get('/api/admin/plugins/custom-fields', middleware.applyCSRF, Plugin.renderAdmin);

                    callback();
                });
            }
        }
    };

    Plugin.renderAdmin = function (req, res, next) {
        res.render(
{'fraction_non_alphanumeric': 0.11232213139570088, 'fraction_numerical': 0.0, 'mean_word_length': 1.3333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1003511', 'n_tokens_mistral': 830, 'n_tokens_neox': 768, 'n_words': 156}