<commit_before>import m from 'mithril';
import models from '../models';
import postgrest from 'mithril-postgrest';
import _ from 'underscore';
import h from '../h';
import contributionVM from '../vms/contribution-vm';
import inlineError from './inline-error';
import userContributedBox from './user-contributed-box';

const userPrivateContributed = {
    controller(args) {
        const user_id = args.userId,
            online = postgrest.paginationVM(models.project),
            onlinePages = postgrest.paginationVM(models.userContribution),
            successfulPages = postgrest.paginationVM(models.userContribution),
            failedPages = postgrest.paginationVM(models.userContribution),
            error = m.prop(false),
            loader = m.prop(true),
            handleError = () => {
              error(true);
              loader(false);
              m.redraw();
            },
            contextVM = postgrest.filtersVM({
                user_id: 'eq',
                state: 'in',
                project_state: 'in'
            });

        models.userContribution.pageSize(9);
        contextVM.user_id(user_id).order({
            created_at: 'desc'
        }).state(['refunded', 'pending_refund', 'paid', 'refused', 'pending']);

        contextVM.project_state(['online']);
        onlinePages.firstPage(contextVM.parameters()).then(() => {
            loader(false);
        }).catch(handleError);

        contextVM.project_state(['successful']);
        successfulPages.firstPage(contextVM.parameters()).then(() => {
            loader(false);
        }).catch(handleError);

        contextVM.project_state(['failed']);
        failedPages.firstPage(contextVM.parameters()).then(() => {
            loader(false);
        }).catch(handleError);

        return {
            onlinePages: onlinePages,
            successfulPages: successfulPages,
            failedPages: failedPages,
            error: error,
            loader: loader
        };
    },
    view(ctrl, args) {
        let onlineCollection = ctrl.onlinePages.collection(),
            successfulCollection = ctrl.successfulPages.collection(),<commit_msg>show waiting_funds projects on private profile [#137390975]<commit_after>import m from 'mithril';
import models from '../models';
import postgrest from 'mithril-postgrest';
import _ from 'underscore';
import h from '../h';
import contributionVM from '../vms/contribution-vm';
import inlineError from './inline-error';
import userContributedBox from './user-contributed-box';

const userPrivateContributed = {
    controller(args) {
        const user_id = args.userId,
            online = postgrest.paginationVM(models.project),
            onlinePages = postgrest.paginationVM(models.userContribution),
            successfulPages = postgrest.paginationVM(models.userContribution),
            failedPages = postgrest.paginationVM(models.userContribution),
            error = m.prop(false),
            loader = m.prop(true),
            handleError = () => {
              error(true);
              loader(false);
              m.redraw();
            },
            contextVM = postgrest.filtersVM({
                user_id: 'eq',
                state: 'in',
                project_state: 'in'
            });

        models.userContribution.pageSize(9);
        contextVM.user_id(user_id).order({
            created_at: 'desc'
        }).state(['refunded', 'pending_refund', 'paid', 'refused', 'pending']);

        contextVM.project_state(['online', 'waiting_funds']);
        onlinePages.firstPage(contextVM.parameters()).then(() => {
            loader(false);
        }).catch(handleError);

        contextVM.project_state(['successful']);
        successfulPages.firstPage(contextVM.parameters()).then(() => {
            loader(false);
        }).catch(handleError);

        contextVM.project_state(['failed']);
        failedPages.firstPage(contextVM.parameters()).then(() => {
            loader(false);
        }).catch(handleError);

        return {
            onlinePages: onlinePages,
            successfulPages: successfulPages,
            failedPages: failedPages,
            error: error,
            loader: loader
        };
    },
    view(ctrl, args) {
        let onlineCollection = ctrl.onlinePages.collection(),
            successfulCollection = ctrl.successfulPages.collection(),
{'fraction_non_alphanumeric': 0.12925325416761818, 'fraction_numerical': 0.002511989038593286, 'mean_word_length': 2.293233082706767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2470895', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1128, 'n_words': 206}