o
    }i+                     @   s8   d Z ddlmZ ddlmZ ddlmZ edd ZdS )z
Notifications Views
    )render)login_required_web)Notificationc                 C   s   | j dd}| j dd}tjj| jdd}|r!|j|d}|dkr,|jdd	}n
|d
kr6|jdd	}| j ddkrD|jdd	 tjj| jdd }dd||||d}t	| d|S )zUser notifications listtype is_read)userz-created_at)r   falseF)r   trueT	mark_readall)r   r   u"   الإشعارات - دليلك IQu   إشعاراتك)titledescriptionnotificationsunread_counttype_filteris_read_filterznotifications/list.html)
GETgetr   objectsfilterr   order_byupdatecountr   )requestr   r   r   r   context r   ?/var/www/newdalilibackend/backend/config/views/notifications.pynotifications_view	   s:   r   N)__doc__django.shortcutsr   config.decoratorsr   notifications.modelsr   r   r   r   r   r   <module>   s    