More work on notifications - polling doesn't work
It looks like it might be an intercooler limitation/bug. May try removing the pjaxing to see if that works
This commit is contained in:
parent
86ec6aed95
commit
5ced45c50b
|
@ -1,4 +1,5 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load taglinks %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
@ -7,30 +8,31 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>
|
<title>
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% if own_acct %}
|
{% if own_acct %}
|
||||||
brutaldon ('{{ own_acct.username }}')
|
brutaldon ('{{ own_acct.username }}')
|
||||||
{% else %}
|
{% else %}
|
||||||
brutaldon
|
brutaldon
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}</title>
|
{% endblock %}</title>
|
||||||
<link rel="manifest" href="{% static 'manifest.webmanifest' %}">
|
<link rel="manifest" href="{% static 'manifest.webmanifest' %}">
|
||||||
{% if not preferences %}
|
{% if not preferences %}
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/bulma.min.css' %}">
|
href="{% static 'css/bulma.min.css' %}">
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/fork-awesome.min.css' %}">
|
href="{% static 'css/fork-awesome.min.css' %}">
|
||||||
<link rel="stylesheet" href="{% static "css/brutaldon.css" %}">
|
<link rel="stylesheet" href="{% static "css/brutaldon.css" %}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static preferences.theme.main_css %}">
|
href="{% static preferences.theme.main_css %}">
|
||||||
<link rel="stylesheet" href="{% static preferences.theme.tweaks_css %}">
|
<link rel="stylesheet" href="{% static preferences.theme.tweaks_css %}">
|
||||||
{% if not preferences.theme.is_brutalist %}
|
{% if not preferences.theme.is_brutalist %}
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/fork-awesome.min.css' %}">
|
href="{% static 'css/fork-awesome.min.css' %}">
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/bulma-badge.min.css' %}">
|
href="{% static 'css/bulma-badge.min.css' %}">
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/bulma-badge.min.css' %}">
|
href="{% static 'css/bulma-badge.min.css' %}">
|
||||||
|
<link rel="stylesheet"
|
||||||
href="{% static 'css/photobox.css' %}">
|
href="{% static 'css/photobox.css' %}">
|
||||||
<script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
|
<script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
|
||||||
<script type="text/javascript" src="{% static 'js/intercooler.js' %}"></script>
|
<script type="text/javascript" src="{% static 'js/intercooler.js' %}"></script>
|
||||||
|
@ -101,13 +103,18 @@
|
||||||
ic-indicator="#page-load-indicator">
|
ic-indicator="#page-load-indicator">
|
||||||
<span class="fa fa-bell-o"></span>
|
<span class="fa fa-bell-o"></span>
|
||||||
{% if not preferences.theme.is_brutalist %}
|
{% if not preferences.theme.is_brutalist %}
|
||||||
<span class="badge"
|
<span ic-src="{% url 'notes_count' %}"
|
||||||
data-badge="{{ notifications }}"
|
|
||||||
ic-src="{% url 'notes_count' %}"
|
|
||||||
ic-poll="60s"
|
ic-poll="60s"
|
||||||
|
ic-target="find span"
|
||||||
|
id="notes-count"
|
||||||
ic-push-url="false">
|
ic-push-url="false">
|
||||||
Notifications
|
<span
|
||||||
</span>
|
{% if notifications != '0' %}
|
||||||
|
class="badge is-badge-warning"
|
||||||
|
{% endif %}
|
||||||
|
data-badge="{{ notifications }}">
|
||||||
|
Notifications</span>
|
||||||
|
</span>
|
||||||
{% elif notifications %}
|
{% elif notifications %}
|
||||||
<span > Notifications ({{ notifications }})</span>
|
<span > Notifications ({{ notifications }})</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<span class="badge"
|
<span
|
||||||
data-badge="{{ notifications }}"
|
{% if notifications != '0' %}
|
||||||
ic-src="{% url 'notes_count' %}"
|
class="badge is-badge-warning"
|
||||||
ic-poll="60s"
|
{% endif %}
|
||||||
ic-push-url="false">
|
data-badge="{{ notifications }}">
|
||||||
Notifications
|
Notifications</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -108,6 +108,8 @@ def timeline(request, timeline='home', timeline_name='Home', max_id=None, since_
|
||||||
except (IndexError, AttributeError):
|
except (IndexError, AttributeError):
|
||||||
next = None
|
next = None
|
||||||
|
|
||||||
|
notifications = _notes_count(request)
|
||||||
|
|
||||||
# This filtering has to be done *after* getting next/prev links
|
# This filtering has to be done *after* getting next/prev links
|
||||||
if account.preferences.filter_replies:
|
if account.preferences.filter_replies:
|
||||||
data = [x for x in data if not x.in_reply_to_id]
|
data = [x for x in data if not x.in_reply_to_id]
|
||||||
|
@ -118,6 +120,7 @@ def timeline(request, timeline='home', timeline_name='Home', max_id=None, since_
|
||||||
'timeline_name': timeline_name,
|
'timeline_name': timeline_name,
|
||||||
'own_acct': request.session['user'],
|
'own_acct': request.session['user'],
|
||||||
'preferences': account.preferences,
|
'preferences': account.preferences,
|
||||||
|
'notifications': notifications,
|
||||||
'prev': prev, 'next': next})
|
'prev': prev, 'next': next})
|
||||||
|
|
||||||
@br_login_required
|
@br_login_required
|
||||||
|
|
Loading…
Reference in New Issue