diff options
-rw-r--r-- | requirements.txt | 11 | ||||
-rw-r--r-- | src/api/urls.py | 10 | ||||
-rw-r--r-- | src/pharos_dashboard/settings.py | 3 | ||||
-rw-r--r-- | src/templates/notifier/inbox.html | 20 |
4 files changed, 22 insertions, 22 deletions
diff --git a/requirements.txt b/requirements.txt index 55e5fc9..a64d33f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,20 +1,17 @@ celery==3.1.23 -cryptography==2.3.1 -Django==2.1 +cryptography==2.6.1 +Django==2.2 django-bootstrap4==0.0.8 -django-crispy-forms==1.7.2 django-filter==2.0.0 -django-registration==2.1.2 djangorestframework==3.8.2 gunicorn==19.6.0 jira==1.0.7 -jsonpickle==0.9.3 oauth2==1.9.0.post1 oauthlib==1.1.2 pika==0.10.0 psycopg2==2.6.2 PyJWT==1.4.2 -requests==2.11.0 -django-fernet-fields==0.5 +requests==2.22.0 +django-fernet-fields==0.6 pyyaml==3.13 pytz==2018.5 diff --git a/src/api/urls.py b/src/api/urls.py index 7a48425..778f6eb 100644 --- a/src/api/urls.py +++ b/src/api/urls.py @@ -24,13 +24,10 @@ Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ -from django.conf.urls import url, include +from django.conf.urls import url from django.urls import path -from rest_framework import routers from api.views import ( - BookingViewSet, - UserViewSet, lab_profile, lab_status, lab_inventory, @@ -46,12 +43,7 @@ from api.views import ( GenerateTokenView ) -router = routers.DefaultRouter() -router.register(r'bookings', BookingViewSet) -router.register(r'user', UserViewSet) - urlpatterns = [ - url(r'^', include(router.urls)), path('labs/<slug:lab_name>/profile', lab_profile), path('labs/<slug:lab_name>/status', lab_status), path('labs/<slug:lab_name>/inventory', lab_inventory), diff --git a/src/pharos_dashboard/settings.py b/src/pharos_dashboard/settings.py index 86de78c..6bd0a2a 100644 --- a/src/pharos_dashboard/settings.py +++ b/src/pharos_dashboard/settings.py @@ -36,9 +36,6 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.humanize', 'bootstrap4', - 'crispy_forms', - 'rest_framework', - 'rest_framework.authtoken', ] MIDDLEWARE = [ diff --git a/src/templates/notifier/inbox.html b/src/templates/notifier/inbox.html index 9d7b426..26b6d32 100644 --- a/src/templates/notifier/inbox.html +++ b/src/templates/notifier/inbox.html @@ -18,6 +18,7 @@ <div class="row flex-grow-1" id="fixHeight"> <!-- Notification list && Controls --> <div class="mb-2 mb-lg-0 col-lg-2 px-0 mh-100"> + <span class="text-muted d-none" id="noMessages">No messages available</span> <div class="list-group rounded-0 rounded-left overflow-auto mh-100 notifications" id="unreadNotifications" data-read="0"> {% for notification in unread_notifications %} <a @@ -56,18 +57,31 @@ $(obj).addClass("active"); } + // Shows messages in the given notification list. + // Shows/hides the 'no messages' span after checking children amount + // given the .notification classed element + function showMessages(notificationList) { + $(".notifications").addClass("d-none"); + if (notificationList.children().length < 1) { + $("#noMessages").removeClass("d-none"); + } else { + $("#noMessages").addClass("d-none"); + notificationList.removeClass("d-none"); + } + } + $(document).ready(function(){ // For all / unread / read $("#filterGroup button").click(function(){ let read = $(this).attr("data-read"); $(this).siblings().removeClass("active"); - $(".notifications").addClass("d-none"); $(this).addClass("active"); if (read === "-1") { - return $(".notifications").removeClass("d-none"); + return showMessages($(".notifications")); } - $(`.notifications[data-read="${read}"]`).removeClass("d-none"); + return showMessages($(`.notifications[data-read="${read}"]`)); }); + showMessages($(".notifications")); }); </script> {% endblock %}
\ No newline at end of file |