diff --git a/src/onegov/org/locale/de_CH/LC_MESSAGES/onegov.org.po b/src/onegov/org/locale/de_CH/LC_MESSAGES/onegov.org.po index f1848d82ba..1ff2415121 100644 --- a/src/onegov/org/locale/de_CH/LC_MESSAGES/onegov.org.po +++ b/src/onegov/org/locale/de_CH/LC_MESSAGES/onegov.org.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2025-07-16 13:05+0200\n" +"POT-Creation-Date: 2025-07-17 14:55+0200\n" "PO-Revision-Date: 2022-03-15 10:21+0100\n" "Last-Translator: Marc Sommerhalder \n" "Language-Team: German\n" @@ -1179,8 +1179,8 @@ msgstr "Nach Beschreibung" msgid "By last change" msgstr "Nach Zeitpunkt der letzten Änderung" -msgid "Portrait" -msgstr "Portrait" +msgid "Agenda Items" +msgstr "Traktanden" msgid "Used in the overview and the e-mail subject" msgstr "Wird in der Übersicht und als E-Mail Subjekt verwendet" @@ -3429,6 +3429,9 @@ msgstr "Letztes Jahr" msgid "Older" msgstr "Älter" +msgid "Meeting" +msgstr "Sitzung" + msgid "Do you really want to delete this note?" msgstr "Möchten Sie diese Notiz wirklich löschen?" @@ -3655,8 +3658,8 @@ msgstr "Reservationen absagen" msgid "Reject all with message" msgstr "Alle absagen mit Kommentar" -#. #. Used in sentence: "${event} published." +#. msgid "Event" msgstr "Veranstaltung" @@ -7262,6 +7265,9 @@ msgstr "Der Benutzer wurde erfolgreich erstellt" msgid "Please enter your e-mail address in order to continue" msgstr "Bitte geben Sie ihre E-Mail Adresse ein um fortzufahren" +#~ msgid "Portrait" +#~ msgstr "Portrait" + #~ msgid "Please note that this page has subpages which will also be deleted!" #~ msgstr "" #~ "Bitte beachten Sie dass die Unterthemen dieses Themas ebenfalls gelöscht " diff --git a/src/onegov/org/locale/fr_CH/LC_MESSAGES/onegov.org.po b/src/onegov/org/locale/fr_CH/LC_MESSAGES/onegov.org.po index 3b59e4fea7..fa7364c6c8 100644 --- a/src/onegov/org/locale/fr_CH/LC_MESSAGES/onegov.org.po +++ b/src/onegov/org/locale/fr_CH/LC_MESSAGES/onegov.org.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2025-07-16 13:05+0200\n" +"POT-Creation-Date: 2025-07-17 14:55+0200\n" "PO-Revision-Date: 2022-03-15 10:50+0100\n" "Last-Translator: Marc Sommerhalder \n" "Language-Team: French\n" @@ -1178,8 +1178,8 @@ msgstr "Par légende" msgid "By last change" msgstr "Par date de dernière modification" -msgid "Portrait" -msgstr "Portrait" +msgid "Agenda Items" +msgstr "Éléments d'agenda" msgid "Used in the overview and the e-mail subject" msgstr "Utilisé dans l'aperçu et le sujet de l'e-mail" @@ -3435,6 +3435,9 @@ msgstr "L'an dernier" msgid "Older" msgstr "Plus âgés" +msgid "Meeting" +msgstr "Réunion" + msgid "Do you really want to delete this note?" msgstr "Voulez-vous vraiment supprimer cette note ?" @@ -3661,8 +3664,8 @@ msgstr "Refuser les réservations" msgid "Reject all with message" msgstr "Tout refuser avec message" -#. #. Used in sentence: "${event} published." +#. msgid "Event" msgstr "Événement" @@ -4054,8 +4057,8 @@ msgid "" "filled-out form." msgstr "" "Veuillez vérifier vos données et appuyez sur « Compléter » pour finaliser le " -"processus. S'il y a quelque chose que vous souhaitez modifier, cliquez sur " -"« Modifier » pour retourner sur le formulaire complété." +"processus. S'il y a quelque chose que vous souhaitez modifier, cliquez sur « " +"Modifier » pour retourner sur le formulaire complété." msgid "" "The image shown in the list view is a square. To have your image shown fully " @@ -7274,6 +7277,9 @@ msgstr "L'utilisateur a bien été créé" msgid "Please enter your e-mail address in order to continue" msgstr "Veuillez saisir votre adresse e-mail pour continuer" +#~ msgid "Portrait" +#~ msgstr "Portrait" + #~ msgid "Please note that this page has subpages which will also be deleted!" #~ msgstr "" #~ "Veuillez noter que cette page contient des sous-pages qui seront " diff --git a/src/onegov/org/locale/it_CH/LC_MESSAGES/onegov.org.po b/src/onegov/org/locale/it_CH/LC_MESSAGES/onegov.org.po index 97b67ff755..badcdda5e8 100644 --- a/src/onegov/org/locale/it_CH/LC_MESSAGES/onegov.org.po +++ b/src/onegov/org/locale/it_CH/LC_MESSAGES/onegov.org.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-07-16 13:05+0200\n" +"POT-Creation-Date: 2025-07-17 14:55+0200\n" "PO-Revision-Date: 2022-03-15 10:52+0100\n" "Last-Translator: \n" "Language-Team: \n" @@ -1182,8 +1182,8 @@ msgstr "Per didascalia" msgid "By last change" msgstr "Per data dell'ultima modifica" -msgid "Portrait" -msgstr "Ritratto" +msgid "Agenda Items" +msgstr "Elementi dell'agenda" msgid "Used in the overview and the e-mail subject" msgstr "Utilizzato nella panoramica e nell'oggetto dell'e-mail" @@ -3436,6 +3436,9 @@ msgstr "Lo scorso anno" msgid "Older" msgstr "Più vecchia" +msgid "Meeting" +msgstr "Riunione" + msgid "Do you really want to delete this note?" msgstr "Vuoi davvero eliminare questa nota?" @@ -3662,8 +3665,8 @@ msgstr "Rifiuta le prenotazioni" msgid "Reject all with message" msgstr "Rifiuta tutto con messaggio" -#. #. Used in sentence: "${event} published." +#. msgid "Event" msgstr "Evento" @@ -7252,6 +7255,9 @@ msgstr "Utente creato correttamente" msgid "Please enter your e-mail address in order to continue" msgstr "Inserisci il tuo indirizzo e-mail per continuare" +#~ msgid "Portrait" +#~ msgstr "Ritratto" + #~ msgid "Please note that this page has subpages which will also be deleted!" #~ msgstr "" #~ "Nota che questa pagina contiene delle sottopagine che verranno anch'esse " diff --git a/src/onegov/org/models/meeting.py b/src/onegov/org/models/meeting.py index d5643928db..14bf84b445 100644 --- a/src/onegov/org/models/meeting.py +++ b/src/onegov/org/models/meeting.py @@ -3,6 +3,10 @@ import uuid from functools import cached_property +from sqlalchemy import exists, func +from sqlalchemy.ext.hybrid import hybrid_property +from sedate import utcnow + from onegov.core.collection import GenericCollection from onegov.core.orm import Base from onegov.core.orm.mixins import ContentMixin @@ -15,14 +19,17 @@ from sqlalchemy import Column, Text, ForeignKey from sqlalchemy.orm import RelationshipProperty, relationship -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Self if TYPE_CHECKING: import uuid from datetime import datetime from markupsafe import Markup + + from sqlalchemy.orm import Query + from sqlalchemy.orm import Session + from onegov.org.models import PoliticalBusiness from onegov.org.models import MeetingItem - from sqlalchemy.orm import Query class Meeting( @@ -107,12 +114,28 @@ def title_text(self) -> str: order_by='desc(MeetingItem.number)' ) + @hybrid_property + def past(self): + return self.start_datetime < utcnow() if self.start_datetime else False + + @past.expression # type:ignore[no-redef] + def past(cls): + return exists.where(cls.start_datetime < func.now()) + def __repr__(self) -> str: return f'' class MeetingCollection(GenericCollection[Meeting]): + def __init__( + self, + session: Session, + past: bool | None = None + ) -> None: + super().__init__(session) + self.past = past + @cached_property def title(self) -> str: return _('Meeting') @@ -123,4 +146,17 @@ def model_class(self) -> type[Meeting]: def query(self) -> Query[Meeting]: query = super().query() - return query.order_by(self.model_class.start_datetime.desc()) + + Meeting = self.model_class # noqa: N806 + if self.past is not None: + if self.past: + query = query.filter(Meeting.start_datetime < utcnow()) + query = query.order_by(Meeting.start_datetime.desc()) + else: + query = query.filter(Meeting.start_datetime >= utcnow()) + query = query.order_by(Meeting.start_datetime.asc()) + + return query + + def for_filter(self, past: bool | None = None) -> Self: + return self.__class__(self.session, past=past) diff --git a/src/onegov/org/path.py b/src/onegov/org/path.py index a662c21a7b..19029db42a 100644 --- a/src/onegov/org/path.py +++ b/src/onegov/org/path.py @@ -1282,11 +1282,13 @@ def get_commission( @OrgApp.path( model=MeetingCollection, path='/meetings', + converters={'past': bool} ) def get_meetings( app: OrgApp, + past: bool = True # show past meetings by default ) -> MeetingCollection: - return MeetingCollection(app.session()) + return MeetingCollection(app.session(), past) @OrgApp.path( diff --git a/src/onegov/town6/locale/de_CH/LC_MESSAGES/onegov.town6.po b/src/onegov/town6/locale/de_CH/LC_MESSAGES/onegov.town6.po index 082fe49ca0..19dd16d3e1 100644 --- a/src/onegov/town6/locale/de_CH/LC_MESSAGES/onegov.town6.po +++ b/src/onegov/town6/locale/de_CH/LC_MESSAGES/onegov.town6.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: OneGov Cloud 1.0\n" -"POT-Creation-Date: 2025-07-16 13:06+0200\n" +"POT-Creation-Date: 2025-07-17 14:55+0200\n" "PO-Revision-Date: 2021-03-03 16:24+0100\n" "Last-Translator: Lukas Burkhard \n" "Language-Team: German\n" @@ -295,6 +295,18 @@ msgstr "Ratsinformationssystem" msgid "Meeting" msgstr "Sitzung" +msgid "Edit" +msgstr "Bearbeiten" + +msgid "Do you really want to delete this meeting?" +msgstr "Diese Sitzung wirklich löschen?" + +msgid "This cannot be undone." +msgstr "Dies kann nicht rückgängig gemacht werden." + +msgid "Delete meeting" +msgstr "Sitzung löschen" + msgid "Parliamentarians" msgstr "Parlamentarierinnen und Parlamentarier" @@ -304,15 +316,9 @@ msgstr "Parlamentarier:in" msgid "Role (as a group member)" msgstr "Rolle (als Fraktionsmitglied)" -msgid "Edit" -msgstr "Bearbeiten" - msgid "Do you really want to delete this parliamentarian?" msgstr "Möchten Sie diese:n Parlamentarier:in wirklich löschen?" -msgid "This cannot be undone." -msgstr "Dies kann nicht rückgängig gemacht werden." - msgid "Delete parliamentarian" msgstr "Parlamentarier:in löschen" @@ -2478,14 +2484,38 @@ msgstr "Neue Kommission" msgid "Your changes were saved" msgstr "Ihre Änderungen wurden gespeichert" +msgid "The commission has been deleted." +msgstr "Die Kommission wurde gelöscht." + msgid "Sort" msgstr "Sortieren" +msgid "Past Meetings" +msgstr "Vergangene" + +msgid "Upcoming Meetings" +msgstr "Zukünftige" + +msgid "Added a new meeting" +msgstr "Neue Sitzung hinzugefügt" + +msgid "New meeting" +msgstr "Neue Sitzung" + +msgid "Edit meeting" +msgstr "Sitzung bearbeiten" + +msgid "The meeting has been deleted." +msgstr "Die Sitzung wurde gelöscht." + msgid "Added a new parliamentarian" msgstr "Parlamentarier:in hinzugefügt" msgid "New parliamentarian" -msgstr "Neue:r Parlamentarier:in" +msgstr "Neue/r Parlamentarier/in" + +msgid "The parliamentarian has been deleted." +msgstr "Der Parlamentarier/in wurde gelöscht." msgid "Added a new role" msgstr "Neue Rolle hinzugefügt" @@ -2493,12 +2523,18 @@ msgstr "Neue Rolle hinzugefügt" msgid "New role" msgstr "Neue Rolle" +msgid "The parliamentarian role has been deleted." +msgstr "Die Rolle des Parlamentariers wurde gelöscht." + msgid "Added a new parliamentary group" msgstr "Fraktion hinzugefügt" msgid "New parliamentary group" msgstr "Neue Fraktion" +msgid "The parliamentary group has been deleted." +msgstr "Die Fraktion wurde gelöscht." + msgid "Added a new political business" msgstr "Politisches Geschäft hinzugefügt" @@ -2713,12 +2749,6 @@ msgstr "Neue Notiz" #~ msgid "End must be after start" #~ msgstr "Ende muss nach dem Start liegen" -#~ msgid "Do you really want to delete this meeting?" -#~ msgstr "Diese Sitzung wirklich löschen?" - -#~ msgid "Delete meeting" -#~ msgstr "Sitzung löschen" - #~ msgid "Do you really want to remove this parliamentarian?" #~ msgstr "Diese:n Parlamentarier:in wirklich entfernen?" diff --git a/src/onegov/town6/locale/fr_CH/LC_MESSAGES/onegov.town6.po b/src/onegov/town6/locale/fr_CH/LC_MESSAGES/onegov.town6.po index 76cd2ccf27..258059aea7 100644 --- a/src/onegov/town6/locale/fr_CH/LC_MESSAGES/onegov.town6.po +++ b/src/onegov/town6/locale/fr_CH/LC_MESSAGES/onegov.town6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: OneGov Cloud 1.0\n" -"POT-Creation-Date: 2025-07-16 13:06+0200\n" +"POT-Creation-Date: 2025-07-17 14:55+0200\n" "PO-Revision-Date: 2021-03-03 14:04+0100\n" "Last-Translator: Lukas Burkhard \n" "Language-Team: French\n" @@ -295,6 +295,18 @@ msgstr "Paramètres RIS" msgid "Meeting" msgstr "Réunion" +msgid "Edit" +msgstr "Modifier" + +msgid "Do you really want to delete this meeting?" +msgstr "Voulez-vous vraiment supprimer cette réunion?" + +msgid "This cannot be undone." +msgstr "Cela ne peut être effectué." + +msgid "Delete meeting" +msgstr "Supprimer la réunion" + msgid "Parliamentarians" msgstr "Parlementaires" @@ -304,15 +316,9 @@ msgstr "Parlementaire" msgid "Role (as a group member)" msgstr "Rôle (en tant que membre d'un groupe)" -msgid "Edit" -msgstr "Modifier" - msgid "Do you really want to delete this parliamentarian?" msgstr "Voulez-vous vraiment supprimer ce parlementaire ?" -msgid "This cannot be undone." -msgstr "Cela ne peut être effectué." - msgid "Delete parliamentarian" msgstr "Supprimer le parlementaire" @@ -589,8 +595,8 @@ msgid "" "filled-out form." msgstr "" "Veuillez vérifier vos données et appuyez sur « Compléter » pour finaliser le " -"processus. S'il y a quelque chose que vous souhaitez modifier, cliquez sur " -"« Modifier » pour retourner sur le formulaire complété." +"processus. S'il y a quelque chose que vous souhaitez modifier, cliquez sur « " +"Modifier » pour retourner sur le formulaire complété." msgid "" "The image shown in the list view is a square. To have your image shown fully " @@ -2483,27 +2489,57 @@ msgstr "Nouvelle commission" msgid "Your changes were saved" msgstr "Vos modifications ont été enregistrées" +msgid "The commission has been deleted." +msgstr "La commission a été supprimée." + msgid "Sort" msgstr "Trier" +msgid "Past Meetings" +msgstr "Passées" + +msgid "Upcoming Meetings" +msgstr "A venir" + +msgid "Added a new meeting" +msgstr "Ajout d'une nouvelle réunion" + +msgid "New meeting" +msgstr "Nouvelle réunion" + +msgid "Edit meeting" +msgstr "Éditer la réunion" + +msgid "The meeting has been deleted." +msgstr "La réunion a été supprimée." + msgid "Added a new parliamentarian" msgstr "Ajout d'un nouveau parlementaire" msgid "New parliamentarian" msgstr "Nouveau parlementaire" +msgid "The parliamentarian has been deleted." +msgstr "Le parlementaire a été supprimé." + msgid "Added a new role" msgstr "Ajout d'un nouveau rôle" msgid "New role" msgstr "Nouveau rôle" +msgid "The parliamentarian role has been deleted." +msgstr "Le rôle du parlementaire a été supprimé." + msgid "Added a new parliamentary group" msgstr "Ajout d'un nouveau groupe parlementaire" msgid "New parliamentary group" msgstr "Nouveau groupe parlementaire" +msgid "The parliamentary group has been deleted." +msgstr "Le groupe parlementaire a été supprimé." + msgid "Added a new political business" msgstr "Ajout d' un nouveau business politique" diff --git a/src/onegov/town6/locale/it_CH/LC_MESSAGES/onegov.town6.po b/src/onegov/town6/locale/it_CH/LC_MESSAGES/onegov.town6.po index 787938077f..6d66761d45 100644 --- a/src/onegov/town6/locale/it_CH/LC_MESSAGES/onegov.town6.po +++ b/src/onegov/town6/locale/it_CH/LC_MESSAGES/onegov.town6.po @@ -1,7 +1,7 @@ # This file was generated from translations.town6.xlsx msgid "" msgstr "" -"POT-Creation-Date: 2025-07-16 13:06+0200\n" +"POT-Creation-Date: 2025-07-17 14:55+0200\n" "PO-Revision-Date: 2021-09-27 16:02+0200\n" "Language: it_CH\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -291,6 +291,18 @@ msgstr "Impostazioni RIS" msgid "Meeting" msgstr "Riunione" +msgid "Edit" +msgstr "Modifica" + +msgid "Do you really want to delete this meeting?" +msgstr "Vuoi davvero cancellare questa riunione?" + +msgid "This cannot be undone." +msgstr "L'operazione non può essere annullata." + +msgid "Delete meeting" +msgstr "Elimina riunione" + msgid "Parliamentarians" msgstr "Parlamentari" @@ -300,15 +312,9 @@ msgstr "Parlamentare" msgid "Role (as a group member)" msgstr "Ruolo (come membro di un gruppo)" -msgid "Edit" -msgstr "Modifica" - msgid "Do you really want to delete this parliamentarian?" msgstr "Vuole davvero cancellare questo parlamentare?" -msgid "This cannot be undone." -msgstr "L'operazione non può essere annullata." - msgid "Delete parliamentarian" msgstr "Elimina parlamentare" @@ -2478,27 +2484,57 @@ msgstr "Nuova commissione" msgid "Your changes were saved" msgstr "Le modifiche sono state salvate" +msgid "The commission has been deleted." +msgstr "La commissione è stata eliminata." + msgid "Sort" msgstr "Ordinare" +msgid "Past Meetings" +msgstr "Passate" + +msgid "Upcoming Meetings" +msgstr "Prossime" + +msgid "Added a new meeting" +msgstr "Aggiunta di una nuova riunione" + +msgid "New meeting" +msgstr "Nuova riunione" + +msgid "Edit meeting" +msgstr "Modifica riunione" + +msgid "The meeting has been deleted." +msgstr "La riunione è stata eliminata." + msgid "Added a new parliamentarian" msgstr "Aggiunto un nuovo parlamentare" msgid "New parliamentarian" msgstr "Nuovo parlamentare" +msgid "The parliamentarian has been deleted." +msgstr "Il parlamentare è stato eliminato." + msgid "Added a new role" msgstr "Aggiunto un nuovo ruolo" msgid "New role" msgstr "Nuovo ruolo" +msgid "The parliamentarian role has been deleted." +msgstr "Il ruolo del parlamentare è stato eliminato." + msgid "Added a new parliamentary group" msgstr "Aggiunto un nuovo gruppo parlamentare" msgid "New parliamentary group" msgstr "Nuovo gruppo parlamentare" +msgid "The parliamentary group has been deleted." +msgstr "Il gruppo parlamentare è stato eliminato." + msgid "Added a new political business" msgstr "Aggiunta di una nuova attività politica" diff --git a/src/onegov/town6/templates/meetings.pt b/src/onegov/town6/templates/meetings.pt index 521f68971a..c038027d0d 100644 --- a/src/onegov/town6/templates/meetings.pt +++ b/src/onegov/town6/templates/meetings.pt @@ -4,11 +4,10 @@