Skip to content

Commit

Permalink
💻 Show the reason why you can see adventures (#6134)
Browse files Browse the repository at this point in the history
You can see adventures of teachers that you share classes with: both  if you are the second teacher, and if they are the second teacher.

This is surprising at first, so this adds an icon that indicates why you can see a given adventure.

<img width="844" alt="image" src="https://github.com/user-attachments/assets/01ddcd93-f8c8-4101-9177-6fcce0c33dcc" />


**How to test**

Log in as a user that shares a class with another teacher. Observe that you can see their adventures.

Closes #6133.
  • Loading branch information
rix0rrr authored Jan 27, 2025
1 parent 66d3b18 commit 8d1af6d
Show file tree
Hide file tree
Showing 66 changed files with 233 additions and 20 deletions.
3 changes: 3 additions & 0 deletions messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion templates/htmx-adventures-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<tr class="{% if loop.index is divisibleby 2 %}bg-gray-200{% else %}bg-white{% endif %}">
<td class="text-center py-2"><a href="for-teachers/customize-adventure/{{adventure.id}}" class="no-underline" data-cy="edit_link_{{adventure.name|e}}">{{adventure.name|e}}</a></td>
<td class="text-center py-2 owner_username_cell">{{adventure.author or adventure.creator}}</td>
<td class="text-center py-2 username_cell">{{adventure.creator}}</td>
<td class="text-center py-2 username_cell">{{adventure.creator}} {% if adventure.why == 'shared_class' %}<i class="fa-solid fa-user-group text-gray-500 text-sm ml-4" title="{{ adventure.why_class }}"></i>{% endif %}</td>
<td class="text-center py-2">
{% if adventure.levels %}
{% for level in adventure.levels %}
Expand Down
3 changes: 3 additions & 0 deletions translations/ar/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,9 @@ msgstr "أدخل إسم المعلم لدعوته"
msgid "second_teacher_warning"
msgstr "كل معلم بهذا الصف يمكنه تعديل الخصائص جميعها."

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/bg/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/bn/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/ca/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,9 @@ msgstr "Introdueix un nom d'usuari de professor per convidar-lo."
msgid "second_teacher_warning"
msgstr "Tots els professors d'aquesta classe poden personalitzar-la."

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr "Veure certificat de {username}!"

Expand Down
3 changes: 3 additions & 0 deletions translations/cs/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/cy/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/da/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr "Zertifikat für {username} ansehen!"

Expand Down
3 changes: 3 additions & 0 deletions translations/el/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,9 @@ msgstr "Enter a teacher username to invite them."
msgid "second_teacher_warning"
msgstr "All teachers in this class can customize it."

msgid "see_adventure_shared_class"
msgstr "You can see this adventure because you share class {class_name} with {creator}"

msgid "see_certificate"
msgstr "See {username} certificate!"

Expand Down
3 changes: 3 additions & 0 deletions translations/eo/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr "Vidi la atestilon de {username}!"

Expand Down
3 changes: 3 additions & 0 deletions translations/es/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,9 @@ msgstr "Introduce el nombre del usuario de un profesor para invitarle."
msgid "second_teacher_warning"
msgstr "Todos los profesores de esta clase pueden personalizarlo."

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr "¡Ve el certificado de {username}!"

Expand Down
3 changes: 3 additions & 0 deletions translations/et/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/fa/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/fi/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/fr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr "Voir le certificat de {username} !"

Expand Down
3 changes: 3 additions & 0 deletions translations/fr_CA/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/fy/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/ga/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions translations/he/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/hi/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/hr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/hu/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/ia/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/iba/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/id/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,9 @@ msgstr "Masukkan nama pengguna guru untuk mengundang mereka."
msgid "second_teacher_warning"
msgstr "Semua guru di kelas ini dapat menyesuaikannya."

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr "Lihat sertifikat {username}!"

Expand Down
3 changes: 3 additions & 0 deletions translations/it/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/ja/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/kab/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr "Wali aselkin {username}!"

Expand Down
3 changes: 3 additions & 0 deletions translations/kmr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/ko/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr "{username} 인증서 참조!"
Expand Down
3 changes: 3 additions & 0 deletions translations/mi/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/ml/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

msgid "see_certificate"
msgstr ""

Expand Down
3 changes: 3 additions & 0 deletions translations/ms/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/nb_NO/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/ne/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions translations/nl/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,9 @@ msgstr "Geef een naam van een leraar/lerares om uit te nodigen."
msgid "second_teacher_warning"
msgstr "Alle leraren/leraressen in deze klas kunnen het aanpassen."

msgid "see_adventure_shared_class"
msgstr "Je ziet dit avontuur omdat je in klas {class_name} zit met {creator}"

msgid "see_certificate"
msgstr "Zie {username} certificaat!"

Expand Down
3 changes: 3 additions & 0 deletions translations/pa_PK/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,9 @@ msgstr ""
msgid "second_teacher_warning"
msgstr ""

msgid "see_adventure_shared_class"
msgstr ""

#, fuzzy
msgid "see_certificate"
msgstr ""
Expand Down
Loading

0 comments on commit 8d1af6d

Please sign in to comment.