{% load i18n %}
{% load static %}
{% load settings_tags %}
{% load get_files from webpack_loader %}

{% get_current_language as LANGUAGE_CODE %}
{% get_files 'editor_content' 'js' as editor_content_js_files %}
{% get_files 'editor_content' 'css' as editor_content_css_files %}

{% if language.slug == 'zh-CN' %}
    {% firstof "body { font-family: 'Noto Sans SC', sans-serif; }" as font_style %}
{% elif right_to_left %}
    {% firstof "body { font-family: 'Lateef', sans-serif; font-size: 1.2rem; }" as font_style %}
{% else %}
    {% firstof "body { font-family: 'Open Sans', sans-serif; }" as font_style %}
{% endif %}

{% comment %} Styling for text diff taken from style.scss {% endcomment %}
{% firstof font_style|add:"del { background-color: rgb(252 165 165); } ins { background-color: rgb(134 239 172); text-decoration-line: none; }" as content_style %}

<div
        id="tinymce-config-options"
        data-webapp-url="{% get_webapp_url %}"
        data-language="{{ LANGUAGE_CODE|slice:'0:2' }}"
        data-directionality="{% if right_to_left %}rtl{% else %}ltr{% endif %}"
        data-no-translate-tooltip="{% trans 'Do not translate the selected text.' %}"
        data-no-translate-text="{% trans 'Do not translate' %}"
        data-pin-icon-text="{% trans 'Location' %}"
        data-pin-icon-src="{% get_base_url %}{% static 'svg/pin.svg' %}"
        data-www-icon-text="{% trans 'Link' %}"
        data-www-icon-src="{% get_base_url %}{% static 'svg/www.svg' %}"
        data-email-icon-text="{% trans 'Email' %}"
        data-email-icon-src="{% get_base_url %}{% static 'svg/email.svg' %}"
        data-call-icon-text="{% trans 'Phone' %}"
        data-call-icon-src="{% get_base_url %}{% static 'svg/call.svg' %}"
        data-clock-icon-text="{% trans 'Opening Hours' %}"
        data-clock-icon-src="{% get_base_url %}{% static 'svg/clock.svg' %}"
        data-idea-icon-text="{% trans 'Hint' %}"
        data-idea-icon-src="{% get_base_url %}{% static 'svg/idea.svg' %}"
        data-group-icon-text="{% trans 'Group' %}"
        data-group-icon-src="{% get_base_url %}{% static 'svg/group.svg' %}"
        data-update-text="{% trans 'Update' %}"
        data-dialog-submit-text="{% trans 'Submit' %}"
        data-dialog-cancel-text="{% trans 'Cancel' %}"
        data-link-no-results-text="{% trans '- no results -' %}"
        data-link-ajax-url="{% url 'search_content_ajax' region_slug=request.region.slug language_slug=language.slug %}"
        data-link-menu-text="{% trans 'Link...' %}"
        data-link-remove-text="{% trans 'Remove link' %}"
        data-link-open-text="{% trans 'Open link' %}"
        data-link-dialog-title-text="{% trans 'Add Link' %}"
        data-link-dialog-url-text="{% trans 'URL' %}"
        data-link-dialog-text-text="{% trans 'Text to display' %}"
        data-link-dialog-internal_link-text="{% trans 'Or link to existing content' %}"
        data-custom-plugins="{% get_base_url %}{{ editor_content_js_files.0.url }}"
        data-content-css="{% get_base_url %}{{ editor_content_css_files.0.url }}"
        data-content-style="{{ content_style }}"
        data-media-button-translation="{% trans 'Media Library' %}"
        data-media-item-translation="{% trans 'Media Library...' %}"
        {% if readonly %}
        data-readonly="1"
        {% endif %}
></div>