Skip to content

Commit

Permalink
[DONE] Feature add personal meeting room (#1073)
Browse files Browse the repository at this point in the history
* Manage fields for a personal meeting room

* Add and manage is_personal (personal meeting room) field

* Hide fields for personal meeting room and add management when voice bridge is modified in a bad format

* Can't delete a personal meeting room

* Manage personal meeting room and inform the user

* Modify tests to manage personal meeting room

* Create personal meeting room when list meetings, manage this feature, modify rights

* Translations added

* Translations modified (use of <strong> instead of <b> and French quotation marks with non-breaking spaces

* Translations modified (use of <strong> instead of <b> and French quotation marks with non-breaking spaces)

* use the d-none class rather than the inline style

* The meeting name is read-only for a personal meeting room.

* Add and use .meeting-card-personal class, like .meeting-card-inactive

* Hides an unnecessary message for additional owners

* Additional owners may not modify another user's personal meeting room

* Manage rights around personal meeting rooms and additional owners

* Field is_personnal isn't editable.

* Modification to take account of the fact that the is_personal field is no longer editable
  • Loading branch information
LoicBonavent authored Mar 14, 2024
1 parent d0d36fc commit b931a94
Show file tree
Hide file tree
Showing 13 changed files with 383 additions and 75 deletions.
113 changes: 95 additions & 18 deletions pod/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"POT-Creation-Date: 2024-03-12 12:01+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: Pod Team [email protected]\n"
Expand Down Expand Up @@ -5584,6 +5584,18 @@ msgstr "Pont vocal"
msgid "BBB Create Time"
msgstr "date de création dans BBB"

#: pod/meeting/models.py pod/meeting/views.py
msgid "Personal meeting room"
msgstr "Salle de réunion personnelle"

#: pod/meeting/models.py
msgid ""
"If this box is checked, this meeting corresponds to the user's personal "
"meeting room."
msgstr ""
"Si cette case est cochée, cette réunion correspond à la salle de réunion "
"personnelle de l’utilisateur."

#: pod/meeting/models.py
msgid ""
"The day of the start date of the meeting must be included in the recurrence "
Expand Down Expand Up @@ -5631,6 +5643,30 @@ msgstr ""
"L’accès à l’ajout d’une réunion a été limité. Si vous souhaitez ajouter des "
"réunions sur la plateforme, veuillez <a href=\"%(url)s\">nous contacter</a>."

#: pod/meeting/templates/meeting/add_or_edit.html
msgid ""
"Your personal meeting room is a room specific to your profile, which is "
"always available."
msgstr ""
"Votre salle de réunion personnelle est une salle spécifique à votre profil, "
"qui est toujours disponible."

#: pod/meeting/templates/meeting/add_or_edit.html
msgid "You can start it at any time, or schedule it for later use."
msgstr ""
"Vous pouvez la lancer à tout moment ou la programmer pour une utilisation "
"ultérieure."

#: pod/meeting/templates/meeting/add_or_edit.html
#: pod/meeting/templates/meeting/meeting_card.html
#, python-format
msgid ""
"This is “%(full_name)s”'s personal meeting room, a room specific to his "
"profile, which is always available."
msgstr ""
"Il s’agit de la salle de réunion personnelle de « %(full_name)s », une salle "
"spécifique à son profil, qui est toujours disponible."

#: pod/meeting/templates/meeting/delete.html
#, python-format
msgid "Delete the meeting <b>%(name)s</b>"
Expand Down Expand Up @@ -5768,6 +5804,14 @@ msgstr "Obtenir les enregistrements de la réunion"
msgid "Delete the meeting"
msgstr "Supprimer la réunion"

#: pod/meeting/templates/meeting/meeting_card.html
msgid ""
"This is your personal meeting room, a room specific to your profile, which "
"is always available."
msgstr ""
"Il s’agit de votre salle de réunion personnelle, une salle spécifique à "
"votre profil, qui est toujours disponible."

#: pod/meeting/templates/meeting/meeting_card.html
msgid "Access to this meeting is restricted"
msgstr "L’accès à cette réunion est restreint"
Expand Down Expand Up @@ -5890,6 +5934,10 @@ msgstr "Vous ne pouvez pas éditer cette réunion."
msgid "You cannot delete this meeting."
msgstr "Vous ne pouvez pas supprimer cette réunion."

#: pod/meeting/views.py
msgid "You cannot delete a personal meeting room."
msgstr "Vous ne pouvez pas supprimer une salle de réunion personnelle."

#: pod/meeting/views.py
msgid "The meeting has been deleted."
msgstr "La réunion a été supprimée."
Expand Down Expand Up @@ -5945,43 +5993,70 @@ msgid ""
msgstr ""
"\n"
" <p>Bonjour,\n"
" <p>%(owner)s vous invite à une réunion récurrente <b>"
"%(meeting_title)s</b>.</p>\n"
" <p>%(owner)s vous invite à une réunion récurrente <strong>"
"%(meeting_title)s</strong>.</p>\n"
" <p>Date de début : %(start_date_time)s </p>\n"
" <p>Récurrent jusqu’à la date : %(end_date)s </p>\n"
" <p>La réunion se tiendra tou(te)s les %(frequency)s %(recurrence)s </"
"p>\n"
" <p>Voici le lien pour rejoindre la réunion :\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : <b>"
"%(password)s</b> </p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : <strong>"
"%(password)s</strong> </p>\n"
" <p>Cordialement</p>\n"
" "

#: pod/meeting/views.py
#, python-format
msgid ""
"\n"
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting <b>%(meeting_title)s</b>."
"</p>\n"
" <p>Start date: %(start_date_time)s </p>\n"
" <p>End date: %(end_date)s </p>\n"
" <p>here the link to join the meeting:\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>You need this password to enter: <b>%(password)s</b> </p>\n"
" <p>Regards</p>\n"
" "
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting <strong>"
"%(meeting_title)s</strong>.</p>\n"
" <p>here the link to join the meeting:\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>You need this password to enter: <strong>%(password)s</"
"strong> </p>\n"
" <p>Regards</p>\n"
" "
msgstr ""
"\n"
" <p>Bonjour,\n"
" <p>%(owner)s vous invite à la réunion <strong>%(meeting_title)s</"
"strong>.</p>\n"
" <p>Voici le lien pour rejoindre la réunion :\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : <strong>"
"%(password)s</strong> </p>\n"
" <p>Cordialement</p>\n"
" "

#: pod/meeting/views.py
#, python-format
msgid ""
"\n"
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting <strong>"
"%(meeting_title)s</strong>.</p>\n"
" <p>Start date: %(start_date_time)s </p>\n"
" <p>End date: %(end_date)s </p>\n"
" <p>here the link to join the meeting:\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>You need this password to enter: <strong>%(password)s</"
"strong> </p>\n"
" <p>Regards</p>\n"
" "
msgstr ""
"\n"
" <p>Bonjour,\n"
" <p>%(owner)s vous invite à la réunion <b>%(meeting_title)s</b>.</p>\n"
" <p>%(owner)s vous invite à la réunion <strong>%(meeting_title)s</"
"strong>.</p>\n"
" <p>Date de début : %(start_date_time)s </p>\n"
" <p>Date de fin : %(end_date)s </p>\n"
" <p>Voici le lien pour rejoindre la réunion :\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : <b>"
"%(password)s</b> </p>\n"
" <p>Vous avez besoin de ce mot de passe pour entrer : <strong>"
"%(password)s</strong> </p>\n"
" <p>Cordialement</p>\n"
" "

Expand Down Expand Up @@ -7884,12 +7959,14 @@ msgstr[0] "%(counter)s thème trouvé dans cette chaine"
msgstr[1] "%(counter)s thèmes trouvés dans cette chaine"

#: pod/video/templates/channel/channel.html
#, python-format
msgid "%(counter)s video for this channel"
msgid_plural "%(counter)s videos for this channel"
msgstr[0] "%(counter)s vidéo trouvée dans cette chaine"
msgstr[1] "%(counter)s vidéos trouvées dans cette chaine"

#: pod/video/templates/channel/channel.html
#, python-format
msgid "%(counter)s subtheme found for this theme"
msgid_plural "%(counter)s subthemes found for this theme"
msgstr[0] "%(counter)s sous-thème trouvé dans ce thème"
Expand Down
2 changes: 1 addition & 1 deletion pod/locale/fr/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"POT-Creation-Date: 2024-03-12 12:01+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down
76 changes: 65 additions & 11 deletions pod/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"POT-Creation-Date: 2024-03-12 12:01+0100\n"
"PO-Revision-Date: 2023-06-08 14:37+0200\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -5291,6 +5291,16 @@ msgstr ""
msgid "BBB Create Time"
msgstr ""

#: pod/meeting/models.py pod/meeting/views.py
msgid "Personal meeting room"
msgstr ""

#: pod/meeting/models.py
msgid ""
"If this box is checked, this meeting corresponds to the user's personal "
"meeting room."
msgstr ""

#: pod/meeting/models.py
msgid ""
"The day of the start date of the meeting must be included in the recurrence "
Expand Down Expand Up @@ -5334,6 +5344,24 @@ msgid ""
"the platform, please <a href=\"%(url)s\">contact us</a>."
msgstr ""

#: pod/meeting/templates/meeting/add_or_edit.html
msgid ""
"Your personal meeting room is a room specific to your profile, which is "
"always available."
msgstr ""

#: pod/meeting/templates/meeting/add_or_edit.html
msgid "You can start it at any time, or schedule it for later use."
msgstr ""

#: pod/meeting/templates/meeting/add_or_edit.html
#: pod/meeting/templates/meeting/meeting_card.html
#, python-format
msgid ""
"This is “%(full_name)s”'s personal meeting room, a room specific to his "
"profile, which is always available."
msgstr ""

#: pod/meeting/templates/meeting/delete.html
#, python-format
msgid "Delete the meeting <b>%(name)s</b>"
Expand Down Expand Up @@ -5461,6 +5489,12 @@ msgstr ""
msgid "Delete the meeting"
msgstr ""

#: pod/meeting/templates/meeting/meeting_card.html
msgid ""
"This is your personal meeting room, a room specific to your profile, which "
"is always available."
msgstr ""

#: pod/meeting/templates/meeting/meeting_card.html
msgid "Access to this meeting is restricted"
msgstr ""
Expand Down Expand Up @@ -5577,6 +5611,10 @@ msgstr ""
msgid "You cannot delete this meeting."
msgstr ""

#: pod/meeting/views.py
msgid "You cannot delete a personal meeting room."
msgstr ""

#: pod/meeting/views.py
msgid "The meeting has been deleted."
msgstr ""
Expand Down Expand Up @@ -5635,16 +5673,32 @@ msgstr ""
#, python-format
msgid ""
"\n"
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting <b>%(meeting_title)s</b>."
"</p>\n"
" <p>Start date: %(start_date_time)s </p>\n"
" <p>End date: %(end_date)s </p>\n"
" <p>here the link to join the meeting:\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>You need this password to enter: <b>%(password)s</b> </p>\n"
" <p>Regards</p>\n"
" "
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting <strong>"
"%(meeting_title)s</strong>.</p>\n"
" <p>here the link to join the meeting:\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>You need this password to enter: <strong>%(password)s</"
"strong> </p>\n"
" <p>Regards</p>\n"
" "
msgstr ""

#: pod/meeting/views.py
#, python-format
msgid ""
"\n"
" <p>Hello,</p>\n"
" <p>%(owner)s invites you to the meeting <strong>"
"%(meeting_title)s</strong>.</p>\n"
" <p>Start date: %(start_date_time)s </p>\n"
" <p>End date: %(end_date)s </p>\n"
" <p>here the link to join the meeting:\n"
" <a href=\"%(join_link)s\">%(join_link)s</a></p>\n"
" <p>You need this password to enter: <strong>%(password)s</"
"strong> </p>\n"
" <p>Regards</p>\n"
" "
msgstr ""

#: pod/meeting/views.py
Expand Down
2 changes: 1 addition & 1 deletion pod/locale/nl/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-06 12:13+0100\n"
"POT-Creation-Date: 2024-03-12 12:01+0100\n"
"PO-Revision-Date: 2023-02-08 15:22+0100\n"
"Last-Translator: obado <[email protected]>\n"
"Language-Team: \n"
Expand Down
18 changes: 18 additions & 0 deletions pod/meeting/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,26 @@ def __init__(self, *args, **kwargs):
self.remove_field("start_at")
# set min frequency to 1
self.fields["frequency"].widget.attrs["min"] = 1
# Manage personal meeting room
self.manage_personal_meeting_room()

def manage_personal_meeting_room(self):
"""Manage fields for a personal meeting room."""
if self.instance.is_personal:
# Name is a readonly field in such a case
self.fields["name"].widget.attrs["readonly"] = True
# Hide time settings
hidden_fields = ("start", "start_time", "expected_duration", "is_personal")
for field in hidden_fields:
self.hide_field(field)

def hide_field(self, field):
"""Hide a field from the form."""
if self.fields.get(field):
self.fields[field].widget = forms.HiddenInput()

def remove_field(self, field):
"""Remove a field from the form."""
if self.fields.get(field):
del self.fields[field]

Expand Down
14 changes: 14 additions & 0 deletions pod/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,17 @@ class Meeting(models.Model):
editable=False,
)

# Personal meeting room
is_personal = models.BooleanField(
verbose_name=_("Personal meeting room"),
help_text=_(
"If this box is checked, "
"this meeting corresponds to the user's personal meeting room."
),
default=False,
editable=False,
)

# Time related Info
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
Expand Down Expand Up @@ -573,6 +584,9 @@ def get_occurrences(self, start, end=None):
@property
def is_active(self):
"""Compute meeting to know if it is past or not."""
# Specific case for the personal meeting room
if self.is_personal:
return True
start_datetime = self.start_at + self.expected_duration
if self.recurrence is None and start_datetime > timezone.now():
return True
Expand Down
4 changes: 4 additions & 0 deletions pod/meeting/static/css/meeting.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
border: 1px solid #f5a391;
}

.meeting-card-personal {
border: 1px solid #91a3f5;
}

.link-meeting {
right: 1rem;
border-radius: 0.375rem;
Expand Down
Loading

0 comments on commit b931a94

Please sign in to comment.