<commit_before># -*- coding: utf-8 -*-
"""
    Akvo RSR is covered by the GNU Affero General Public License.
    See more details in the license.txt file located at the root folder of the
    Akvo RSR module. For additional details on the GNU license please
    see < http://www.gnu.org/licenses/agpl.html >.
"""
from __future__ import absolute_import

from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.template.defaulttags import WidthRatioNode
from django.template.base import TemplateSyntaxError
from django.utils.translation import ugettext as _

register = template.Library()


@register.inclusion_tag('inclusion_tags/more_partners.html', takes_context=True)
def more_link(context, project, project_page=False):
    """Generate the more links."""
    num_other_partners = 0
    partners_dict = {}

    for partnership in project.partnerships.all():
        organisation = partnership.organisation

        if partnership.iati_organisation_role_label():
            label = partnership.iati_organisation_role_label()
        else:
            label = _(u'No partner role')

        if organisation != project.primary_organisation:
            if organisation in partners_dict.keys():
                partners_dict[organisation].append(label)
            else:
                partners_dict[organisation] = [label]
                num_other_partners += 1

    return {
        'project': project,
        'project_page': project_page,
        'num_other_partners': num_other_partners,
        'partners_dict': partners_dict
    }

@register.inclusion_tag('inclusion_tags/counter_badge.html', takes_context=True)
def counter_badge(context, object):
    '''show the counter_badge'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'object': object}


@register.inclusion_tag('inclusion_tags/funding_box.html', takes_context=True)
def funding_box(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_table.html',
                        takes_context=True)
def funding_table(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_project.html',
                        takes_context=True)
def funding_project(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_box_narrow.html',
                        takes_context=True)
def funding_box_narrow(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_box_narrow2.html',
                        takes_context=True)
def funding_box_narrow2(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css   '''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag(
    'partner_sites/inclusion_tags/partner_sites_funding_box.html',
    takes_context=True)
def partner_sites_funding_box(context, project):
    '''Funding box used on partner sites'''
    return {
        'MEDIA_URL': context['MEDIA_URL'],
        'project': project,
        'request': context['request'],
        'domain_url': context['domain_url'],
        'akvoapp_root_url': context['akvoapp_root_url']
        }


@register.inclusion_tag('inclusion_tags/individual_donate_button.html',
                        takes_context=True)
def individual_donate_button(context, project):
    '''Show the individual doante button. CSS in widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/institutions_sponsor.html',
                        takes_context=True)
def institutions_sponsor(context, project):
    '''Show the individual doante button. CSS in widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/project_budget.html',
                        takes_context=True)
def project_budget(context, project):
    '''Show the individual doante button. CSS in widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}

<commit_msg>[#1885] Remove unused inclusion_tags<commit_after># -*- coding: utf-8 -*-
"""
    Akvo RSR is covered by the GNU Affero General Public License.
    See more details in the license.txt file located at the root folder of the
    Akvo RSR module. For additional details on the GNU license please
    see < http://www.gnu.org/licenses/agpl.html >.
"""
from __future__ import absolute_import

from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.template.defaulttags import WidthRatioNode
from django.template.base import TemplateSyntaxError
from django.utils.translation import ugettext as _

register = template.Library()


@register.inclusion_tag('inclusion_tags/more_partners.html', takes_context=True)
def more_link(context, project, project_page=False):
    """Generate the more links."""
    num_other_partners = 0
    partners_dict = {}

    for partnership in project.partnerships.all():
        organisation = partnership.organisation

        if partnership.iati_organisation_role_label():
            label = partnership.iati_organisation_role_label()
        else:
            label = _(u'No partner role')

        if organisation != project.primary_organisation:
            if organisation in partners_dict.keys():
                partners_dict[organisation].append(label)
            else:
                partners_dict[organisation] = [label]
                num_other_partners += 1

    return {
        'project': project,
        'project_page': project_page,
        'num_other_partners': num_other_partners,
        'partners_dict': partners_dict
    }

@register.inclusion_tag('inclusion_tags/counter_badge.html', takes_context=True)
def counter_badge(context, object):
    '''show the counter_badge'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'object': object}


@register.inclusion_tag('inclusion_tags/funding_box.html', takes_context=True)
def funding_box(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_table.html',
                        takes_context=True)
def funding_table(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_project.html',
                        takes_context=True)
def funding_project(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_box_narrow.html',
                        takes_context=True)
def funding_box_narrow(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag('inclusion_tags/funding_box_narrow2.html',
                        takes_context=True)
def funding_box_narrow2(context, project):
    '''Show the funding box used in the widgets. Css definition in
    widget_global.css   '''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


@register.inclusion_tag(
    'partner_sites/inclusion_tags/partner_sites_funding_box.html',
    takes_context=True)
def partner_sites_funding_box(context, project):
    '''Funding box used on partner sites'''
    return {
        'MEDIA_URL': context['MEDIA_URL'],
        'project': project,
        'request': context['request'],
        'domain_url': context['domain_url'],
        'akvoapp_root_url': context['akvoapp_root_url']
        }


@register.inclusion_tag('inclusion_tags/institutions_sponsor.html',
                        takes_context=True)
def institutions_sponsor(context, project):
    '''Show the individual doante button. CSS in widget_global.css'''
    return {'MEDIA_URL': context['MEDIA_URL'], 'project': project}


{'fraction_non_alphanumeric': 0.10693542876665528, 'fraction_numerical': 0.0015943514406104088, 'mean_word_length': 3.726587728740581, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6253773', 'n_tokens_mistral': 2558, 'n_tokens_neox': 2509, 'n_words': 611}