1.0.6 push routines

This commit is contained in:
SDE
2024-05-08 11:23:01 +03:00
parent 4b588eb6e4
commit 2f421bb0ac
3 changed files with 9 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ def get_inter_http_respose(template_obj, context_Dict, request):
title = getattr(context_Dict['page'], 'title', None)
text = getattr(context_Dict['page'], 'description', None)
# if text and title and not request.user.is_anonymous:
# send_push(user=request.user, title=title, text=text)
if text and title and not request.user.is_anonymous:
send_push(user=request.user, title=title, text=text)
return HttpResponse(template_obj.render(context_Dict, request))

View File

@@ -1,5 +1,7 @@
{% load i18n %}
{% load base_tags_extra %}
{% load webpush_notifications %}
<div class="header_big_background">
</div>
<header id="header_bg">
@@ -123,14 +125,15 @@
</div>
<div class="menu_profile_btn">
<a class="btn_menu_profile" href="{% url "login_profile" %}" >{% trans "Войти" %}</a>
<a class="btn_menu_profile" href="{% url "registration_page" %}">{% trans "Регистрация" %}</a>
<a class="btn_menu_profile" href="{% url "login_profile" %}" >{% trans "Войти" %}</a>
<a class="btn_menu_profile" href="{% url "registration_page" %}">{% trans "Регистрация" %}</a>
</div>
{% endif %}
</div>
<div style="text-align: right;">{% webpush_button %}</div>
<div class="clear_both"></div>
</div>

View File

@@ -1,6 +1,7 @@
{% load static %}
{% load tt_chat %}
{% load i18n %}
{% load webpush_notifications %}
<!DOCTYPE html>
<html lang="{{ request.LANGUAGE_CODE }}">
@@ -10,6 +11,7 @@
<meta name="viewport" content="width=device-width,maximum-scale=1,minimum-scale=1,initial-scale=1,height=device-height">
<meta name="vapid-key" content="{{ vapid_key }}">
{% webpush_header %}
{% include "inter/meta_names.html" %}
{# <script src='{% static "js/jquery_v3_6_4.js" %}'> </script>#}