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 taglinks %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -7,30 +8,31 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>
|
||||
{% block title %}
|
||||
{% if own_acct %}
|
||||
brutaldon ('{{ own_acct.username }}')
|
||||
{% else %}
|
||||
brutaldon
|
||||
{% endif %}
|
||||
{% if own_acct %}
|
||||
brutaldon ('{{ own_acct.username }}')
|
||||
{% else %}
|
||||
brutaldon
|
||||
{% endif %}
|
||||
{% endblock %}</title>
|
||||
<link rel="manifest" href="{% static 'manifest.webmanifest' %}">
|
||||
{% if not preferences %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/bulma.min.css' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/fork-awesome.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static "css/brutaldon.css" %}">
|
||||
{% else %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static preferences.theme.main_css %}">
|
||||
<link rel="stylesheet" href="{% static preferences.theme.tweaks_css %}">
|
||||
{% if not preferences.theme.is_brutalist %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/fork-awesome.min.css' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/bulma-badge.min.css' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/bulma-badge.min.css' %}">
|
||||
<link rel="manifest" href="{% static 'manifest.webmanifest' %}">
|
||||
{% if not preferences %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/bulma.min.css' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/fork-awesome.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static "css/brutaldon.css" %}">
|
||||
{% else %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static preferences.theme.main_css %}">
|
||||
<link rel="stylesheet" href="{% static preferences.theme.tweaks_css %}">
|
||||
{% if not preferences.theme.is_brutalist %}
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/fork-awesome.min.css' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/bulma-badge.min.css' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/bulma-badge.min.css' %}">
|
||||
<link rel="stylesheet"
|
||||
href="{% static 'css/photobox.css' %}">
|
||||
<script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'js/intercooler.js' %}"></script>
|
||||
|
@ -101,13 +103,18 @@
|
|||
ic-indicator="#page-load-indicator">
|
||||
<span class="fa fa-bell-o"></span>
|
||||
{% if not preferences.theme.is_brutalist %}
|
||||
<span class="badge"
|
||||
data-badge="{{ notifications }}"
|
||||
ic-src="{% url 'notes_count' %}"
|
||||
<span ic-src="{% url 'notes_count' %}"
|
||||
ic-poll="60s"
|
||||
ic-target="find span"
|
||||
id="notes-count"
|
||||
ic-push-url="false">
|
||||
Notifications
|
||||
</span>
|
||||
<span
|
||||
{% if notifications != '0' %}
|
||||
class="badge is-badge-warning"
|
||||
{% endif %}
|
||||
data-badge="{{ notifications }}">
|
||||
Notifications</span>
|
||||
</span>
|
||||
{% elif notifications %}
|
||||
<span > Notifications ({{ notifications }})</span>
|
||||
{% else %}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<span class="badge"
|
||||
data-badge="{{ notifications }}"
|
||||
ic-src="{% url 'notes_count' %}"
|
||||
ic-poll="60s"
|
||||
ic-push-url="false">
|
||||
Notifications
|
||||
<span
|
||||
{% if notifications != '0' %}
|
||||
class="badge is-badge-warning"
|
||||
{% endif %}
|
||||
data-badge="{{ notifications }}">
|
||||
Notifications</span>
|
||||
</span>
|
||||
|
|
|
@ -108,6 +108,8 @@ def timeline(request, timeline='home', timeline_name='Home', max_id=None, since_
|
|||
except (IndexError, AttributeError):
|
||||
next = None
|
||||
|
||||
notifications = _notes_count(request)
|
||||
|
||||
# This filtering has to be done *after* getting next/prev links
|
||||
if account.preferences.filter_replies:
|
||||
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,
|
||||
'own_acct': request.session['user'],
|
||||
'preferences': account.preferences,
|
||||
'notifications': notifications,
|
||||
'prev': prev, 'next': next})
|
||||
|
||||
@br_login_required
|
||||
|
|
Loading…
Reference in New Issue