digitalfabrik/integreat-cms

View on GitHub
integreat_cms/cms/templates/_tinymce_config.html

Summary

Maintainability
Test Coverage
{% 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' %}
    {% firstof "body { font-family: 'Noto Sans SC', sans-serif; }" as font_style %}
{% elif language.slug == 'am' or language.slug == 'ti' %}
    {% firstof "body { font-family: 'Noto Sans Ethiopic', sans-serif; }" as font_style %}
{% elif language.slug == 'ka' %}
    {% firstof "body { font-family: 'Noto Sans Georgian', 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='{% translate "Do not translate the selected text." %}'
     data-no-translate-text='{% translate "Do not translate" %}'
     data-pin-icon-text='{% translate "Location" %}'
     data-pin-icon-src="{% get_base_url %}{% static 'svg/pin.svg' %}"
     data-pin-icon-alt="{% translate "Location" %}"
     data-www-icon-text='{% translate "Link" %}'
     data-www-icon-src="{% get_base_url %}{% static 'svg/www.svg' %}"
     data-www-icon-alt="{% translate "Link to the website" %}"
     data-email-icon-text='{% translate "Email" %}'
     data-email-icon-src="{% get_base_url %}{% static 'svg/email.svg' %}"
     data-email-icon-alt="{% translate "Email Address" %}"
     data-call-icon-text='{% translate "Phone" %}'
     data-call-icon-src="{% get_base_url %}{% static 'svg/call.svg' %}"
     data-call-icon-alt="{% translate "Phone Number" %}"
     data-clock-icon-text='{% translate "Opening Hours" %}'
     data-clock-icon-src="{% get_base_url %}{% static 'svg/clock.svg' %}"
     data-clock-icon-alt="{% translate "Opening Hours" %}"
     data-idea-icon-text='{% translate "Hint" %}'
     data-idea-icon-src="{% get_base_url %}{% static 'svg/idea.svg' %}"
     data-idea-icon-alt="{% translate "A small advice" %}"
     data-group-icon-text='{% translate "Group" %}'
     data-group-icon-src="{% get_base_url %}{% static 'svg/group.svg' %}"
     data-group-icon-alt="{% translate "A group of people" %}"
     data-contact-icon-text='{% translate "Contact Person" %}'
     data-contact-icon-src="{% get_base_url %}{% static 'svg/contact.svg' %}"
     data-contact-icon-alt="{% translate "Contact Person" %}"
     data-speech-icon-text='{% translate "Spoken Languages" %}'
     data-speech-icon-src="{% get_base_url %}{% static 'svg/speech.svg' %}"
     data-speech-icon-alt="{% translate "Spoken Languages" %}"
     data-update-text='{% translate "Update" %}'
     data-dialog-submit-text='{% translate "Submit" %}'
     data-dialog-cancel-text='{% translate "Cancel" %}'
     data-link-no-results-text='{% translate "- no results -" %}'
     data-link-ajax-url="{% url 'search_content_ajax' region_slug=request.region.slug language_slug=language.slug %}"
     data-link-menu-text='{% translate "Link..." %}'
     data-link-remove-text='{% translate "Remove link" %}'
     data-link-open-text='{% translate "Open link" %}'
     data-link-dialog-title-text='{% translate "Add Link" %}'
     data-link-dialog-url-text='{% translate "URL" %}'
     data-link-dialog-text-text='{% translate "Text to display" %}'
     data-link-dialog-internal_link-text='{% translate "Or link to existing content" %}'
     data-link-dialog-autoupdate-text='{% translate "Automatically use the title of the linked content for the link" %}'
     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='{% translate "Media Library" %}'
     data-media-item-translation='{% translate "Media Library..." %}'
     {% if readonly %}data-readonly="1"{% endif %}>
</div>