Fix cache + problem pdf

This commit is contained in:
cuom1999 2024-02-28 14:13:59 -06:00
parent 85bee3e77c
commit 6dbe3932de
3 changed files with 9 additions and 7 deletions

View file

@ -30,7 +30,7 @@
{% endif %} {% endif %}
<div class="blog-description"> <div class="blog-description">
<div class='content-description'> <div class='content-description'>
{% cache 86400 'problem_html' problem.id MATH_ENGINE LANGUAGE_CODE %} {% cache 86400 'problem_html' problem.id LANGUAGE_CODE %}
{{ problem.description|markdown(lazy_load=True)|reference|str|safe }} {{ problem.description|markdown(lazy_load=True)|reference|str|safe }}
{% endcache %} {% endcache %}
{% if problem.pdf_description %} {% if problem.pdf_description %}

View file

@ -65,13 +65,15 @@
e.preventDefault(); e.preventDefault();
if (!$('#raw_problem').attr('src')) { if (!$('#raw_problem').attr('src')) {
$('#raw_problem').attr('src', '{{problem.code}}/raw') $('#raw_problem').attr('src', '{{problem.code}}/raw')
$('#raw_problem').on('load', function() {
renderKatex(frames['raw_problem'].document);
frames['raw_problem'].print();
});
} }
// while(!$('.math-loaded', frames['raw_problem'].document).length){ else {
// await new Promise(r => setTimeout(r, 200));
// }
setTimeout(() => {
frames['raw_problem'].print(); frames['raw_problem'].print();
}, 1000); return;
}
}); });
$('#clarification_header').on('click', function() { $('#clarification_header').on('click', function() {
$('#clarification_header_container').hide(); $('#clarification_header_container').hide();

View file

@ -39,7 +39,7 @@
<td class="user-problem-count">{{ user.problem_count }}</td> <td class="user-problem-count">{{ user.problem_count }}</td>
<td> <td>
<div class="about-td"> <div class="about-td">
{% cache 86400 'user_about' user.id MATH_ENGINE %} {% cache 86400 'user_about' user.id %}
{% if user.about %} {% if user.about %}
{{ user.about|markdown(lazy_load=True)|reference|str|safe }} {{ user.about|markdown(lazy_load=True)|reference|str|safe }}
{% endif %} {% endif %}