mod: вынести cookies и счётчики в static js

This commit is contained in:
2026-04-12 16:45:29 +03:00
parent 3f72d2e963
commit 038b53e74d
5 changed files with 134 additions and 27 deletions

View File

@@ -1,15 +1,13 @@
{% load static %}
<!-- СОГЛАСИЕ НА КУКИ: НАЧАЛО -- соглашение о сборе технической информации -->
<noindex id="cookies_accept" class="fixed-bottom container-fluid">
<div class="row bg-dark text-white">
<div class="col p-4 mb-0 text-center">
<small>Тут используют cookie и&nbsp;ведут сбор технических данных о&nbsp;посещениях, потому как без этого <nobr>интернет-сайты</nobr> вообще почти не&nbsp;работают&hellip;</small>
<button onclick="CookieAcceptDate = new Date();
CookieAcceptDate.setTime(CookieAcceptDate.getTime() + 7948800000);
document.cookie = 'cookie_accept=yes;expires=' + CookieAcceptDate;
document.getElementById('cookies_accept').remove();"
class="btn ml-4 py-2 px-4 btn-warning">
<small>В&nbsp;соответствии с&nbsp;<abbr title="General Data Protection Regulation">GDPR</abbr> и&nbsp;152-<abbr title="Федеральный закон">ФЗ</abbr>, уведомляем вас, что настоящий сайт использует инструменты для&nbsp;сбора данных о&nbsp;поведении пользо­вателей, с&nbsp;целью аналитики и&nbsp;улучшения своей работы&hellip;</small>
<button id="cookies_accept_button" class="btn ml-4 py-2 px-4 ms-5 btn-warning">
Я согласен!
</button>
</div>
</div>
</noindex><!-- СОГЛАСИЕ НА КУКИ: КОНЕЦ -->
</noindex>
<script defer src="{% static 'js/accept-cookies.js' %}"></script><!-- СОГЛАСИЕ НА КУКИ: КОНЕЦ -->

View File

@@ -1,32 +1,16 @@
{# <!-- ПОДВАЛ: НАЧАЛО -->#}
{% load static %}{# <!-- ПОДВАЛ: НАЧАЛО -->#}
<footer class="container">
<nav class="row">
<div class="col-12 x d-flex align-items-center">
&copy; Sergei Erjemin, 2009 &mdash; {% now 'Y' %}
<div class="b88x31 ms-auto">{#<!-- Global site tag (gtag.js) - Google Analytics --> #}
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-9116991-1"></script>
<script>
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','UA-9116991-1');
</script>
Google Analytics
</div>
<div class="b88x31">{# <!-- Yandex.Metrika counter id=198477 (было code 1612438 --> #}<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");ym(198477, "init", {clickmap:true,trackLinks:true,accurateTrackBounce:true,webvisor:true});
</script><noscript><div><img src="https://mc.yandex.ru/watch/198477" style="position:absolute; left:-9999px;" alt="" /></div></noscript>{# <!-- /Yandex.Metrika counter --> #}{# <!-- Yandex.Metrika informer --> #}
<div class="b88x31">{# <!-- Yandex.Metrika counter id=198477 (было code 1612438 --> #}<noscript><div><img src="https://mc.yandex.ru/watch/198477" style="position:absolute; left:-9999px;" alt="" /></div></noscript>{# <!-- /Yandex.Metrika counter --> #}{# <!-- Yandex.Metrika informer --> #}
<a href="https://metrika.yandex.ru/stat/?id=198477&from=informer" target="_blank" rel="nofollow"><img src="https://informer.yandex.ru/informer/198477/3_1_000000AA_CCCCCCDD_0_pageviews" style="width:88px;height:31px;border:0;" alt="Яндекс.Метрика" title="Яндекс.Метрика: данные за сегодня (просмотры, визиты и уникальные посетители)"/></a>{# <!-- /Yandex.Metrika informer --> #}
</div>
<div class="b88x31">{# <!-- Rating Mail.ru counter --> #}
<script type="text/javascript">
var _tmr = window._tmr || (window._tmr = []);
_tmr.push({id: "1612438", type: "pageView", start: (new Date()).getTime()});
(function (d, w, id) {
if (d.getElementById(id)) return;
var ts = d.createElement("script"); ts.type = "text/javascript"; ts.async = true; ts.id = id;
ts.src = "https://top-fwz1.mail.ru/js/code.js";
var f = function () {var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ts, s);};
if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); }
})(document, window, "topmailru-code");
</script><noscript>
<noscript>
<img src="https://top-fwz1.mail.ru/counter?id=1612438;js=na" style="border:0;position:absolute;left:-9999px;" alt="Top.Mail.Ru" />
</noscript>{# <!-- //Rating Mail.ru counter --> #}
{# <!-- Rating Mail.ru logo --> #}<a href="https://top.mail.ru/jump?from=1612438"><img src="https://top-fwz1.mail.ru/counter?id=1612438;t=479;l=1" alt="Top.Mail.Ru"/></a>{# <!-- //Rating Mail.ru logo --> #}
@@ -36,4 +20,5 @@
</div>
</div>
</nav>
</footer>{#<!-- ПОДВАЛ: КОНЕЦ -->#}
</footer>{#<!-- ПОДВАЛ: КОНЕЦ -->#}
<script defer src="{% static 'js/footer-counters.js' %}"></script>