<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 django import template
from django.conf import settings

register = template.Library()

from akvo.rsr.models import Project, Organisation

@register.inclusion_tag('inclusion_tags/google_map.html')
def google_map(object, width, height, zoom):
    project_marker_icon = getattr(settings, 'GOOGLE_MAPS_PROJECT_MARKER_ICON', '')
    organisation_marker_icon = getattr(settings, 'GOOGLE_MAPS_ORGANISATION_MARKER_ICON', '')
    template_context = dict(object=object, width=width, height=height,
        zoom=zoom, project_marker_icon=project_marker_icon,
        organisation_marker_icon=organisation_marker_icon)
    return template_context

@register.inclusion_tag('inclusion_tags/google_global_project_map.html')
def google_global_project_map(map_type, width, height, zoom):
    projects = Project.objects.published().has_primary_location()
    marker_icon = getattr(settings, 'GOOGLE_MAPS_PROJECT_MARKER_ICON', '')
    template_context = dict(map_type=map_type,
        marker_icon=marker_icon,
        projects=projects,
        width=width,
        height=height,<commit_msg>Added branching in google_maps inclusion tag to use separate coloured icons for projects and organisations.<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 django import template
from django.conf import settings

register = template.Library()

from akvo.rsr.models import Project, Organisation

@register.inclusion_tag('inclusion_tags/google_map.html')
def google_map(object, width, height, zoom, marker_icon=None):
    object_type = object.__class__.__name__.lower()
    if object_type == 'project':
        marker_icon = getattr(settings, 'GOOGLE_MAPS_PROJECT_MARKER_ICON', '')
    elif object_type == 'organisation':
        marker_icon = getattr(settings, 'GOOGLE_MAPS_ORGANISATION_MARKER_ICON', '')
    template_context = dict(object=object, width=width, height=height,
        zoom=zoom, marker_icon=marker_icon)
    return template_context

@register.inclusion_tag('inclusion_tags/google_global_project_map.html')
def google_global_project_map(map_type, width, height, zoom):
    projects = Project.objects.published().has_primary_location()
    marker_icon = getattr(settings, 'GOOGLE_MAPS_PROJECT_MARKER_ICON', '')
    template_context = dict(map_type=map_type,
        marker_icon=marker_icon,
        projects=projects,
        width=width,
        height=height,
{'fraction_non_alphanumeric': 0.09259896729776247, 'fraction_numerical': 0.0006884681583476765, 'mean_word_length': 4.979423868312757, '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': '2120280', 'n_tokens_mistral': 871, 'n_tokens_neox': 859, 'n_words': 209}