1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-18 20:59:42 +02:00

change twig

This commit is contained in:
exezzz 2025-06-25 14:52:40 +03:00
parent ce7ba5489d
commit 3a5fe8e325

View file

@ -20,7 +20,7 @@
{% endif %}
</div>
<time class="page__header-time">
Изменена: {{ (page.body.time / 1000) | date("M d Y") }}
Изменена: {{ (page.body.time / 1000) | date("d.m.Y") }}
</time>
{% if isAuthorized == true %}
{% include 'components/button.twig' with {label: 'Редактировать', icon: 'pencil', size: 'small', url: '/page/edit/' ~ page._id, class: 'page__header-button'} %}
@ -47,23 +47,4 @@
{% include '../components/navigator.twig' with {previousPage: previousPage, nextPage: nextPage} %}
</article>
<script>
// Замена английских месяцев на русские
document.addEventListener('DOMContentLoaded', function() {
const monthsMap = {
'Jan': 'Янв', 'Feb': 'Фев', 'Mar': 'Мар',
'Apr': 'Апр', 'May': 'Май', 'Jun': 'Июн',
'Jul': 'Июл', 'Aug': 'Авг', 'Sep': 'Сен',
'Oct': 'Окт', 'Nov': 'Ноя', 'Dec': 'Дек'
};
const timeElement = document.querySelector('.page__header-time');
if (timeElement) {
const text = timeElement.textContent;
const updatedText = text.replace(/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/,
match => monthsMap[match]);
timeElement.textContent = updatedText;
}
});
</script>
{% endblock %}
{% endblock %}