Files
edx-platform/lms/templates/wiki/base.html
Dmytro bb4beab5eb fix: Incorrect symbols on wiki create article page (#32628)
The message was being double-escaped by React with the
StatusAlertRenderer. This fixes the problem by removing the
first layer of HTML-escaping so it is only escaped once.
2023-07-10 17:25:06 -04:00

107 lines
3.0 KiB
HTML

{% extends "main_django.html" %}
{% with online_help_token="wiki" %}
{% load theme_pipeline %}{% load sekizai_tags i18n configuration %}{% load static %}
{% block title %}
{% block pagetitle %}{% endblock %} | {% trans "Wiki" as tmsg%}{{tmsg|force_escape}} | {% platform_name %}
{% endblock %}
{% block bodyclass %}view-in-course view-wiki{% endblock %}
{% block headextra %}
{% stylesheet 'course' %}
{% stylesheet 'style-course-vendor' %}
{% stylesheet 'style-course' %}
<link rel="stylesheet" type="text/css" href="{% static 'paragon/static/paragon.min.css' %}" />
<script type="text/javascript">
function ajaxError(){}
$.ajaxSetup({
timeout: 7000,
cache: false,
error: function(e, xhr, settings, exception) {
ajaxError();
}
});
function jsonWrapper(url, callback) {
$.getJSON(url, function(data) {
if (data == null) {
ajaxError();
} else {
callback(data);
}
});
}
</script>
{% comment %} The wiki page does not use the main.html template {% endcomment %}
<script type="text/javascript" src="{% static 'js/header/header.js' %}"></script>
{% addtoblock 'js' %}
{% comment %} These scripts load at the bottom of the body {% endcomment %}
<script src="{% static 'js/bootstrap-alert.js' %}"></script>
<script src="{% static 'js/bootstrap-collapse.js' %}"></script>
<script src="{% static 'js/bootstrap-modal.js' %}"></script>
{% with mathjax_mode='wiki' %}
{% include "mathjax_include.html" %}
{% endwith %}
{% endaddtoblock %}
{% endblock %}
{% block body %}
{% if request.course %}
{% with course=request.course %}
{% include "courseware/course_navigation.html" with active_page_context="wiki" %}
{% endwith %}
{% endif %}
<div class="container">
{% load render_bundle from webpack_loader %}
{% render_bundle "AlertStatusBar" %}
<div class="wiki-wrapper">
<main id="main" aria-label="Content" tabindex="-1">
<section class="wiki {{ selected_tab }}" id="wiki-content"
{% if request.course.language %}
lang="{{ request.course.language }}"
{% endif %}
>
{% block wiki_body %}
{% block wiki_breadcrumbs %}{% endblock %}
{% if messages %}
{% comment %}
The message is not actually safe, but StatusAlertRenderer uses react which adds escaping,
so marking as safe keeps the message from being double-escaped.
{% endcomment %}
{% for message in messages %}
<div id="alert_stat_bar"></div>
<script type="text/javascript">
new StatusAlertRenderer(
"{{ message|safe }}",
"#alert_stat_bar",
".nav nav-tabs"
);
</script>
{% endfor %}
{% endif %}
{% block wiki_contents %}{% endblock %}
{% endblock %}
</section>
</main>
</div>
</div>
{% endblock %}
{% endwith %}