<commit_before>/**
 * window.c.ProjectDashboardMenu component
 * build dashboard project menu for project owners
 * and admin.
 *
 * Example:
 * m.component(c.ProjectDashboardMenu, {
 *     project: projectDetail Object,
 * })
 */
window.c.ProjectDashboardMenu = ((m, _, h) => {
    return {
        controller: (args) => {
            let body = document.getElementsByTagName('body')[0],
                editLinksToggle = h.toggleProp(false, true),
                bodyToggleForNav = h.toggleProp('body-project open', 'body-project closed');

            if (!args.project.is_published) {
                editLinksToggle.toggle();
            }

            return {
                body: body,
                editLinksToggle: editLinksToggle,
                bodyToggleForNav: bodyToggleForNav
            };
        },
        view: (ctrl, args) => {
            const project = args.project,
                  projectRoute = '/projects/' + project.id,
                  editRoute = projectRoute + '/edit',
                  editLinkClass = 'dashboard-nav-link-left ' + (project.is_published ? 'indent' : '');
            let optionalOpt = (project.mode === 'flex' ? m('span.fontsize-smallest.fontcolor-secondary', ' (opcional)') : '');

            ctrl.body.className = ctrl.bodyToggleForNav();

            return m('#project-nav', [
                m('.project-nav-wrapper', [
                    m('nav.w-section.dashboard-nav.side', [
                        m('a#dashboard_preview_link.w-inline-block.dashboard-project-name[href="' + (project.is_published ? '/' + project.permalink : editRoute + '#preview') + '"]', [
                            m('img.thumb-project-dashboard[src="' + (_.isNull(project.large_image) ? '/assets/thumb-project.png' : project.large_image) + '"][width="114"]'),
                            m('.fontcolor-negative.lineheight-tight.fontsize-small', project.name),
                            m(`img[src="/assets/catarse_bootstrap/badge-${project.mode}-h.png"][width=80]`)

                        ]),
                        m('#info-links', [
                            m('a#dashboard_home_link[class="dashboard-nav-link-left ' + (h.locationActionMatch('insights') ? 'selected' : '') + '"][href="' + projectRoute + '/insights"]', [
                                m('span.fa.fa-bar-chart.fa-lg.fa-fw'), ' Minha Campanha'
                            ]), (project.is_published ? [
                                m('a#dashboard_reports_link.dashboard-nav-link-left[href="' + editRoute + '#reports' + '"]', [
                                    m('span.fa.fa.fa-table.fa-lg.fa-fw'), ' Relatórios de apoios'
                                ]),
                                m('a#dashboard_reports_link.dashboard-nav-link-left.u-marginbottom-30[href="' + editRoute + '#posts' + '"]', [
                                    m('span.fa.fa-bullhorn.fa-fw.fa-lg'), ' Novidades ', m('span.badge', project.posts_count)
                                ])
                            ] : '')
                        ]),
                        m('.edit-project-div', [
                            (!project.is_published ? '' : m('button#toggle-edit-menu.dashboard-nav-link-left', {
                                onclick: ctrl.editLinksToggle.toggle
                            }, [
                                m('span.fa.fa-pencil.fa-fw.fa-lg'), ' Editar projeto'
                            ])), (ctrl.editLinksToggle() ? m('#edit-menu-items', [
                                m('#dashboard-links', [
                                    ((!project.is_published || project.is_admin_role) ? [
                                        m('a#basics_link[class="' + editLinkClass + '"][href="' + editRoute + '#basics' + '"]', 'Básico'),<commit_msg>use margintop class to badge at dasboard [#108288206]<commit_after>/**
 * window.c.ProjectDashboardMenu component
 * build dashboard project menu for project owners
 * and admin.
 *
 * Example:
 * m.component(c.ProjectDashboardMenu, {
 *     project: projectDetail Object,
 * })
 */
window.c.ProjectDashboardMenu = ((m, _, h) => {
    return {
        controller: (args) => {
            let body = document.getElementsByTagName('body')[0],
                editLinksToggle = h.toggleProp(false, true),
                bodyToggleForNav = h.toggleProp('body-project open', 'body-project closed');

            if (!args.project.is_published) {
                editLinksToggle.toggle();
            }

            return {
                body: body,
                editLinksToggle: editLinksToggle,
                bodyToggleForNav: bodyToggleForNav
            };
        },
        view: (ctrl, args) => {
            const project = args.project,
                  projectRoute = '/projects/' + project.id,
                  editRoute = projectRoute + '/edit',
                  editLinkClass = 'dashboard-nav-link-left ' + (project.is_published ? 'indent' : '');
            let optionalOpt = (project.mode === 'flex' ? m('span.fontsize-smallest.fontcolor-secondary', ' (opcional)') : '');

            ctrl.body.className = ctrl.bodyToggleForNav();

            return m('#project-nav', [
                m('.project-nav-wrapper', [
                    m('nav.w-section.dashboard-nav.side', [
                        m('a#dashboard_preview_link.w-inline-block.dashboard-project-name[href="' + (project.is_published ? '/' + project.permalink : editRoute + '#preview') + '"]', [
                            m('img.thumb-project-dashboard[src="' + (_.isNull(project.large_image) ? '/assets/thumb-project.png' : project.large_image) + '"][width="114"]'),
                            m('.fontcolor-negative.lineheight-tight.fontsize-small', project.name),
                            m(`img.u-margintop-10[src="/assets/catarse_bootstrap/badge-${project.mode}-h.png"][width=80]`)

                        ]),
                        m('#info-links', [
                            m('a#dashboard_home_link[class="dashboard-nav-link-left ' + (h.locationActionMatch('insights') ? 'selected' : '') + '"][href="' + projectRoute + '/insights"]', [
                                m('span.fa.fa-bar-chart.fa-lg.fa-fw'), ' <NAME>anha'
                            ]), (project.is_published ? [
                                m('a#dashboard_reports_link.dashboard-nav-link-left[href="' + editRoute + '#reports' + '"]', [
                                    m('span.fa.fa.fa-table.fa-lg.fa-fw'), ' Relatórios de apoios'
                                ]),
                                m('a#dashboard_reports_link.dashboard-nav-link-left.u-marginbottom-30[href="' + editRoute + '#posts' + '"]', [
                                    m('span.fa.fa-bullhorn.fa-fw.fa-lg'), ' Novidades ', m('span.badge', project.posts_count)
                                ])
                            ] : '')
                        ]),
                        m('.edit-project-div', [
                            (!project.is_published ? '' : m('button#toggle-edit-menu.dashboard-nav-link-left', {
                                onclick: ctrl.editLinksToggle.toggle
                            }, [
                                m('span.fa.fa-pencil.fa-fw.fa-lg'), ' Editar projeto'
                            ])), (ctrl.editLinksToggle() ? m('#edit-menu-items', [
                                m('#dashboard-links', [
                                    ((!project.is_published || project.is_admin_role) ? [
                                        m('a#basics_link[class="' + editLinkClass + '"][href="' + editRoute + '#basics' + '"]', 'Básico'),
{'fraction_non_alphanumeric': 0.15512028394899435, 'fraction_numerical': 0.003549362429341396, 'mean_word_length': 1.519205298013245, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7035633', 'n_tokens_mistral': 2140, 'n_tokens_neox': 2052, 'n_words': 263}