Add "Mark all as read"

This commit is contained in:
Skia 2016-12-13 17:53:44 +01:00
parent bf9aa29a54
commit e3c86c1d05
3 changed files with 71 additions and 57 deletions

View File

@ -47,7 +47,8 @@
n.date|time(DATETIME_FORMAT) }}</span><br> n.date|time(DATETIME_FORMAT) }}</span><br>
{{ n }}</a></li> {{ n }}</a></li>
{% endfor %} {% endfor %}
<li><a href="{{ url('core:notification_list') }}">{% trans %}View more{% endtrans %}</a></li> <li><a href="{{ url('core:notification_list') }}">{% trans %}View more{% endtrans %}</a>
<a href="{{ url('core:notification_list') }}?see_all">{% trans %}Mark all as read{% endtrans %}</a></li>
</ul> </ul>
<a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a> <a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a>
<a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a> <a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>

View File

@ -21,6 +21,8 @@ class NotificationList(ListView):
template_name = "core/notification_list.jinja" template_name = "core/notification_list.jinja"
def get_queryset(self): def get_queryset(self):
if 'see_all' in self.request.GET.keys():
self.request.user.notifications.update(viewed=True)
return self.request.user.notifications.order_by('-id')[:20] return self.request.user.notifications.order_by('-id')[:20]
def notification(request, notif_id): def notification(request, notif_id):

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-13 00:42+0100\n" "POT-Creation-Date: 2016-12-13 17:52+0100\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n" "Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@ -123,8 +123,8 @@ msgstr "numéro"
msgid "journal" msgid "journal"
msgstr "classeur" msgstr "classeur"
#: accounting/models.py:194 core/models.py:530 core/models.py:858 #: accounting/models.py:194 core/models.py:530 core/models.py:863
#: core/models.py:898 counter/models.py:243 counter/models.py:291 #: core/models.py:903 counter/models.py:243 counter/models.py:291
#: counter/models.py:416 eboutic/models.py:15 eboutic/models.py:48 #: counter/models.py:416 eboutic/models.py:15 eboutic/models.py:48
msgid "date" msgid "date"
msgstr "date" msgstr "date"
@ -305,7 +305,7 @@ msgstr "Compte en banque : "
#: accounting/templates/accounting/label_list.jinja:21 #: accounting/templates/accounting/label_list.jinja:21
#: club/templates/club/club_sellings.jinja:49 #: club/templates/club/club_sellings.jinja:49
#: core/templates/core/file_detail.jinja:25 #: core/templates/core/file_detail.jinja:25
#: core/templates/core/file_detail.jinja:53 #: core/templates/core/file_detail.jinja:62
#: core/templates/core/file_moderation.jinja:24 #: core/templates/core/file_moderation.jinja:24
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:66 #: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:66
#: core/templates/core/user_account_detail.jinja:38 #: core/templates/core/user_account_detail.jinja:38
@ -313,8 +313,9 @@ msgstr "Compte en banque : "
#: counter/templates/counter/last_ops.jinja:29 #: counter/templates/counter/last_ops.jinja:29
#: counter/templates/counter/last_ops.jinja:59 #: counter/templates/counter/last_ops.jinja:59
#: launderette/templates/launderette/launderette_admin.jinja:16 #: launderette/templates/launderette/launderette_admin.jinja:16
#: launderette/views.py:144 sas/templates/sas/moderation.jinja:36 #: launderette/views.py:144 sas/templates/sas/album.jinja:24
#: sas/templates/sas/picture.jinja:66 sas/templates/sas/picture.jinja:111 #: sas/templates/sas/moderation.jinja:36 sas/templates/sas/picture.jinja:66
#: sas/templates/sas/picture.jinja:111
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
@ -844,7 +845,7 @@ msgstr "Membres"
msgid "Old members" msgid "Old members"
msgstr "Anciens membres" msgstr "Anciens membres"
#: club/views.py:49 core/templates/core/base.jinja:52 core/views/user.py:146 #: club/views.py:49 core/templates/core/base.jinja:53 core/views/user.py:146
#: sas/templates/sas/picture.jinja:85 #: sas/templates/sas/picture.jinja:85
msgid "Tools" msgid "Tools"
msgstr "Outils" msgstr "Outils"
@ -859,7 +860,7 @@ msgstr "Propriétés"
msgid "Select user" msgid "Select user"
msgstr "Choisir un utilisateur" msgstr "Choisir un utilisateur"
#: club/views.py:150 sas/views.py:79 sas/views.py:129 sas/views.py:171 #: club/views.py:150 sas/views.py:79 sas/views.py:129 sas/views.py:177
msgid "You do not have the permission to do that" msgid "You do not have the permission to do that"
msgstr "Vous n'avez pas la permission de faire cela" msgstr "Vous n'avez pas la permission de faire cela"
@ -1178,7 +1179,7 @@ msgstr "Montrez vos statistiques de compte aux autres"
msgid "file name" msgid "file name"
msgstr "nom du fichier" msgstr "nom du fichier"
#: core/models.py:520 core/models.py:705 #: core/models.py:520 core/models.py:710
msgid "parent" msgid "parent"
msgstr "parent" msgstr "parent"
@ -1198,11 +1199,11 @@ msgstr "miniature"
msgid "owner" msgid "owner"
msgstr "propriétaire" msgstr "propriétaire"
#: core/models.py:525 core/models.py:711 #: core/models.py:525 core/models.py:716
msgid "edit group" msgid "edit group"
msgstr "groupe d'édition" msgstr "groupe d'édition"
#: core/models.py:526 core/models.py:712 #: core/models.py:526 core/models.py:717
msgid "view group" msgid "view group"
msgstr "groupe de vue" msgstr "groupe de vue"
@ -1252,64 +1253,64 @@ msgstr "Un fichier de ce nom existe déjà"
msgid "You must provide a file" msgid "You must provide a file"
msgstr "Vous devez fournir un fichier" msgstr "Vous devez fournir un fichier"
#: core/models.py:654 #: core/models.py:659
msgid "Folder: " msgid "Folder: "
msgstr "Dossier : " msgstr "Dossier : "
#: core/models.py:656 #: core/models.py:661
msgid "File: " msgid "File: "
msgstr "Fichier : " msgstr "Fichier : "
#: core/models.py:704 core/models.py:708 #: core/models.py:709 core/models.py:713
msgid "page name" msgid "page name"
msgstr "nom de la page" msgstr "nom de la page"
#: core/models.py:709 #: core/models.py:714
msgid "owner group" msgid "owner group"
msgstr "groupe propriétaire" msgstr "groupe propriétaire"
#: core/models.py:713 #: core/models.py:718
msgid "lock user" msgid "lock user"
msgstr "utilisateur bloquant" msgstr "utilisateur bloquant"
#: core/models.py:714 #: core/models.py:719
msgid "lock_timeout" msgid "lock_timeout"
msgstr "décompte du déblocage" msgstr "décompte du déblocage"
#: core/models.py:741 #: core/models.py:746
msgid "Duplicate page" msgid "Duplicate page"
msgstr "Une page de ce nom existe déjà" msgstr "Une page de ce nom existe déjà"
#: core/models.py:747 #: core/models.py:752
msgid "Loop in page tree" msgid "Loop in page tree"
msgstr "Boucle dans l'arborescence des pages" msgstr "Boucle dans l'arborescence des pages"
#: core/models.py:855 #: core/models.py:860
msgid "revision" msgid "revision"
msgstr "révision" msgstr "révision"
#: core/models.py:856 #: core/models.py:861
msgid "page title" msgid "page title"
msgstr "titre de la page" msgstr "titre de la page"
#: core/models.py:857 #: core/models.py:862
msgid "page content" msgid "page content"
msgstr "contenu de la page" msgstr "contenu de la page"
#: core/models.py:895 #: core/models.py:900
msgid "url" msgid "url"
msgstr "url" msgstr "url"
#: core/models.py:896 #: core/models.py:901
msgid "param" msgid "param"
msgstr "param" msgstr "param"
#: core/models.py:897 launderette/models.py:60 launderette/models.py:85 #: core/models.py:902 launderette/models.py:60 launderette/models.py:85
#: launderette/models.py:121 #: launderette/models.py:121
msgid "type" msgid "type"
msgstr "type" msgstr "type"
#: core/models.py:899 #: core/models.py:904
msgid "viewed" msgid "viewed"
msgstr "vue" msgstr "vue"
@ -1342,74 +1343,78 @@ msgstr "S'enregister"
msgid "View more" msgid "View more"
msgstr "Voir plus" msgstr "Voir plus"
#: core/templates/core/base.jinja:53 #: core/templates/core/base.jinja:51
msgid "Mark all as read"
msgstr "Marquer tout commme lu"
#: core/templates/core/base.jinja:54
msgid "Logout" msgid "Logout"
msgstr "Déconnexion" msgstr "Déconnexion"
#: core/templates/core/base.jinja:55 core/templates/core/base.jinja.py:56 #: core/templates/core/base.jinja:56 core/templates/core/base.jinja.py:57
msgid "Search" msgid "Search"
msgstr "Recherche" msgstr "Recherche"
#: core/templates/core/base.jinja:78 #: core/templates/core/base.jinja:79
msgid "Main" msgid "Main"
msgstr "Accueil" msgstr "Accueil"
#: core/templates/core/base.jinja:79 #: core/templates/core/base.jinja:80
msgid "Matmatronch" msgid "Matmatronch"
msgstr "Matmatronch" msgstr "Matmatronch"
#: core/templates/core/base.jinja:80 #: core/templates/core/base.jinja:81
msgid "Wiki" msgid "Wiki"
msgstr "Wiki" msgstr "Wiki"
#: core/templates/core/base.jinja:81 sas/templates/sas/album.jinja:4 #: core/templates/core/base.jinja:82 sas/templates/sas/album.jinja:4
#: sas/templates/sas/main.jinja:4 sas/templates/sas/main.jinja.py:8 #: sas/templates/sas/main.jinja:4 sas/templates/sas/main.jinja.py:8
#: sas/templates/sas/picture.jinja:26 #: sas/templates/sas/picture.jinja:26
msgid "SAS" msgid "SAS"
msgstr "SAS" msgstr "SAS"
#: core/templates/core/base.jinja:82 #: core/templates/core/base.jinja:83
msgid "Forum" msgid "Forum"
msgstr "Forum" msgstr "Forum"
#: core/templates/core/base.jinja:83 #: core/templates/core/base.jinja:84
msgid "Services" msgid "Services"
msgstr "Services" msgstr "Services"
#: core/templates/core/base.jinja:84 core/templates/core/file.jinja:20 #: core/templates/core/base.jinja:85 core/templates/core/file.jinja:20
#: core/views/files.py:48 #: core/views/files.py:48
msgid "Files" msgid "Files"
msgstr "Fichiers" msgstr "Fichiers"
#: core/templates/core/base.jinja:85 #: core/templates/core/base.jinja:86
msgid "Sponsors" msgid "Sponsors"
msgstr "Partenaires" msgstr "Partenaires"
#: core/templates/core/base.jinja:86 #: core/templates/core/base.jinja:87
msgid "Help" msgid "Help"
msgstr "Aide" msgstr "Aide"
#: core/templates/core/base.jinja:119 #: core/templates/core/base.jinja:120
msgid "Contacts" msgid "Contacts"
msgstr "Contacts" msgstr "Contacts"
#: core/templates/core/base.jinja:120 #: core/templates/core/base.jinja:121
msgid "Legal notices" msgid "Legal notices"
msgstr "Mentions légales" msgstr "Mentions légales"
#: core/templates/core/base.jinja:121 #: core/templates/core/base.jinja:122
msgid "Intellectual property" msgid "Intellectual property"
msgstr "Propriété intellectuelle" msgstr "Propriété intellectuelle"
#: core/templates/core/base.jinja:122 #: core/templates/core/base.jinja:123
msgid "Help & Documentation" msgid "Help & Documentation"
msgstr "Aide & Documentation" msgstr "Aide & Documentation"
#: core/templates/core/base.jinja:123 #: core/templates/core/base.jinja:124
msgid "R&D" msgid "R&D"
msgstr "R&D" msgstr "R&D"
#: core/templates/core/base.jinja:125 #: core/templates/core/base.jinja:126
msgid "Site made by good people" msgid "Site made by good people"
msgstr "Site réalisé par des gens bons" msgstr "Site réalisé par des gens bons"
@ -1475,45 +1480,51 @@ msgstr "Propriétés"
msgid "Owner: " msgid "Owner: "
msgstr "Propriétaire : " msgstr "Propriétaire : "
#: core/templates/core/file_detail.jinja:26 #: core/templates/core/file_detail.jinja:26 sas/templates/sas/album.jinja:25
msgid "Clear clipboard" msgid "Clear clipboard"
msgstr "Vider le presse-papier" msgstr "Vider le presse-papier"
#: core/templates/core/file_detail.jinja:27 #: core/templates/core/file_detail.jinja:27 sas/templates/sas/album.jinja:26
msgid "Cut" msgid "Cut"
msgstr "Couper" msgstr "Couper"
#: core/templates/core/file_detail.jinja:28 #: core/templates/core/file_detail.jinja:28 sas/templates/sas/album.jinja:27
msgid "Paste" msgid "Paste"
msgstr "Coller" msgstr "Coller"
#: core/templates/core/file_detail.jinja:44 #: core/templates/core/file_detail.jinja:31 sas/templates/sas/album.jinja:30
#, fuzzy
#| msgid "Clear clipboard"
msgid "Clipboard: "
msgstr "Vider le presse-papier"
#: core/templates/core/file_detail.jinja:53
msgid "Real name: " msgid "Real name: "
msgstr "Nom réel : " msgstr "Nom réel : "
#: core/templates/core/file_detail.jinja:45 #: core/templates/core/file_detail.jinja:54
#: core/templates/core/file_moderation.jinja:21 #: core/templates/core/file_moderation.jinja:21
#: sas/templates/sas/moderation.jinja:25 sas/templates/sas/picture.jinja:79 #: sas/templates/sas/moderation.jinja:25 sas/templates/sas/picture.jinja:79
msgid "Date: " msgid "Date: "
msgstr "Date : " msgstr "Date : "
#: core/templates/core/file_detail.jinja:47 #: core/templates/core/file_detail.jinja:56
msgid "Type: " msgid "Type: "
msgstr "Type : " msgstr "Type : "
#: core/templates/core/file_detail.jinja:48 #: core/templates/core/file_detail.jinja:57
msgid "Size: " msgid "Size: "
msgstr "Taille : " msgstr "Taille : "
#: core/templates/core/file_detail.jinja:48 #: core/templates/core/file_detail.jinja:57
msgid "bytes" msgid "bytes"
msgstr "octets" msgstr "octets"
#: core/templates/core/file_detail.jinja:50 #: core/templates/core/file_detail.jinja:59
msgid "Download" msgid "Download"
msgstr "Télécharger" msgstr "Télécharger"
#: core/templates/core/file_detail.jinja:56 #: core/templates/core/file_detail.jinja:65
#: core/templates/core/file_moderation.jinja:23 #: core/templates/core/file_moderation.jinja:23
#: sas/templates/sas/moderation.jinja:32 sas/templates/sas/picture.jinja:109 #: sas/templates/sas/moderation.jinja:32 sas/templates/sas/picture.jinja:109
msgid "Moderate" msgid "Moderate"
@ -2911,13 +2922,13 @@ msgstr "Utilisateur qui sera supprimé"
msgid "picture" msgid "picture"
msgstr "photo" msgstr "photo"
#: sas/templates/sas/album.jinja:26 sas/templates/sas/album.jinja.py:28 #: sas/templates/sas/album.jinja:50 sas/templates/sas/album.jinja.py:52
#: sas/templates/sas/album.jinja:30 sas/templates/sas/main.jinja:17 #: sas/templates/sas/album.jinja:54 sas/templates/sas/main.jinja:17
#: sas/templates/sas/main.jinja.py:19 sas/templates/sas/main.jinja:21 #: sas/templates/sas/main.jinja.py:19 sas/templates/sas/main.jinja:21
msgid "preview" msgid "preview"
msgstr "miniature" msgstr "miniature"
#: sas/templates/sas/album.jinja:52 #: sas/templates/sas/album.jinja:86
msgid "Upload" msgid "Upload"
msgstr "Envoyer" msgstr "Envoyer"