#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Configuration settings for applications used by Pootle."""

#
# Pootle
#

# Custom template context
# The key-values of this context are available in the templates as
# {{ custom.<key> }}
CUSTOM_TEMPLATE_CONTEXT = {}

# Number of rows in top contributors table
TOPSTAT_SIZE = 5

# Terminology config
MIN_AUTOTERMS = 60
MAX_AUTOTERMS = 600

# Fuzzy matching
# Maximum character length to consider
FUZZY_MATCH_MAX_LENGTH = 70
# Minimum similarity required for a match (% * 100)
FUZZY_MATCH_MIN_SIMILARITY = 75

# Two-tuple defining the markup filter to apply in certain textareas.
#
# - Accepted values for the first element are 'textile', 'markdown',
#   'restructuredtext' and None.
# - The second element should be a dictionary of keyword arguments that will be
#   passed to the markup function.
#
# IMPORTANT: If you want to use one of these markup filters you must install on
# your own the required packages.
#
# Examples:
#    MARKUP_FILTER = (None, {})
#    MARKUP_FILTER = ('markdown', {'safe_mode': 'escape'})
#    MARKUP_FILTER = ('restructuredtext', {
#                         'settings_overrides': {
#                             'report_level': 'quiet',
#                         }
#                     })
MARKUP_FILTER = (None, {})

# Set this to True to enable spam prevention through captcha, only
# useful for public Pootle instances.
USE_CAPTCHA = True

# Legal Page Agreements
#
# List of paths prefixes where no checks for legal document agreements
# will be enforced
LEGALPAGE_NOCHECK_PREFIXES = (
    '/about',
    '/accounts',
    '/admin',
    '/api',
    '/contact',
    '/django_admin',
    '/jsi18n',
    '/pages',
)


#
# webassets
#

# Whether to debug assets or not. Set to False in production environments
# for better performance, but make sure 'cssmin' is installed.
#
# Valid options are True, False, and "merge".
# You can set more configuration options for webassets if needed.
# Read its documentation for further details:
#   http://elsdoerfer.name/docs/webassets/django/settings.html
ASSETS_DEBUG = False

# Controls whether bundles should be automatically built, and rebuilt, when
# required (if set to True), or whether they must be built manually be the
# user, for example via a management command.
#
# This is a good setting to have enabled during debugging, and can be very
# convenient for low-traffic sites in production as well. However, there is a
# cost in checking whether the source files have changed, so if you care about
# performance, or if your build process takes very long, then you may want to
# disable this.
ASSETS_AUTO_BUILD = False


#
# django-registration
#

# Number of days users will have to activate their accounts after registering
ACCOUNT_ACTIVATION_DAYS = 10

# By default Pootle sends only text emails. If your organization would
# prefer to send mixed HTML/TEXT emails, set this to True, and update
# activation_email.txt and activation_email.html in the templates/registration/
# directory.
# NOTE: Password reset emails will still be sent in plain text. This is a limitation
# of the underlying system.
EMAIL_SEND_HTML = False


#
# South
#

# If this is True the SQL run by South is logged to a file
SOUTH_LOGGING_ON = False

# The file where the logging information will be written to
SOUTH_LOGGING_FILE = working_path('dbs/south.log')


#
# Tastypie
#

# Set this to True to enable the Pootle API.
POOTLE_ENABLE_API = False

# Allowed serialization formats for your entire site.
# Check Tastypie docs for available formats and its required dependencies.
TASTYPIE_DEFAULT_FORMATS = ['json']

# Number of records Tastypie will show in a list view.
# Set to 0 to have no limit.
API_LIMIT_PER_PAGE = 0

# The value of X-Frame-Options header
X_FRAME_OPTIONS = 'SAMEORIGIN'
