<commit_before>from django.conf import settings
from django.core.urlresolvers import resolve, reverse
from django.http import Http404
from corehq.apps.accounting.utils import domain_has_privilege
from corehq import toggles, privileges

from corehq.apps.hqwebapp.templatetags.hq_shared_tags import static

RAVEN = bool(getattr(settings, 'SENTRY_DSN', None))

def base_template(request):
    """This sticks the base_template variable defined in the settings
       into the request context."""

    return {
        'base_template': settings.BASE_TEMPLATE,
        'login_template': settings.LOGIN_TEMPLATE,
        'less_debug': settings.LESS_DEBUG,
    }


def get_per_domain_context(project, request=None):
    if project and project.commtrack_enabled:
        domain_type = 'commtrack'
        logo_url = static('hqstyle/img/commtrack-logo.png')
        site_name = "CommTrack"
        public_site = "http://www.commtrack.org"
        can_be_your = "mobile logistics solution"
    elif project and project.commconnect_enabled:
        domain_type = 'commconnect'
        logo_url = static('hqstyle/img/commconnect-logo.png')
        site_name = "CommConnect"
        public_site = "http://www.commcarehq.org"
        can_be_your = "mobile health solution"
    else:
        domain_type = 'commcare'
        logo_url = static('hqstyle/img/commcare-logo.png')
        site_name = "CommCare HQ"
        public_site = "http://www.commcarehq.org"
        can_be_your = "mobile health solution"
<commit_msg>add context processor to set use_bootstrap_3 template variable<commit_after>from django.conf import settings
from django.core.urlresolvers import resolve, reverse
from django.http import Http404
from corehq.apps.accounting.utils import domain_has_privilege
from corehq import toggles, privileges

from corehq.apps.hqwebapp.templatetags.hq_shared_tags import static

RAVEN = bool(getattr(settings, 'SENTRY_DSN', None))

def base_template(request):
    """This sticks the base_template variable defined in the settings
       into the request context."""

    return {
        'base_template': settings.BASE_TEMPLATE,
        'login_template': settings.LOGIN_TEMPLATE,
        'less_debug': settings.LESS_DEBUG,
        'use_bootstrap_3': (
            hasattr(request, 'use_bootstrap_3')
            and request.use_bootstrap_3
            and hasattr(request, 'user')
            and toggles.BOOTSTRAP3_PREVIEW.enabled(request.user.username)
        ),
    }


def get_per_domain_context(project, request=None):
    if project and project.commtrack_enabled:
        domain_type = 'commtrack'
        logo_url = static('hqstyle/img/commtrack-logo.png')
        site_name = "CommTrack"
        public_site = "http://www.commtrack.org"
        can_be_your = "mobile logistics solution"
    elif project and project.commconnect_enabled:
        domain_type = 'commconnect'
        logo_url = static('hqstyle/img/commconnect-logo.png')
        site_name = "CommConnect"
        public_site = "http://www.commcarehq.org"
        can_be_your = "mobile health solution"
    else:
        domain_type = 'commcare'
        logo_url = static('hqstyle/img/commcare-logo.png')
        site_name = "CommCare HQ"
        public_site = "http://www.commcarehq.org"
        can_be_your = "mobile health solution"

{'fraction_non_alphanumeric': 0.09187386294724076, 'fraction_numerical': 0.0033353547604608852, 'mean_word_length': 3.278858625162127, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '2866133', 'n_tokens_mistral': 1017, 'n_tokens_neox': 1001, 'n_words': 219}