Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONE] Fix : favorite js #848

Merged
merged 3 commits into from
May 16, 2023

Conversation

AymericJak
Copy link
Collaborator

  • Fix bug in chapter page : Cannot read properties of null (reading 'addEventListener')
  • Remove favorite form in mange section
    image

@AymericJak AymericJak added the bug Something isn't working label May 16, 2023
@AymericJak AymericJak self-assigned this May 16, 2023

// Favorites

const favoriteButtonManage = document.querySelector("#card-managevideo #fav-button");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je ne comprend pas. pourquoi retirer le bouton en js ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le link_video.html relie à la fois la carte mais aussi la section sur la page video :
image
image

Donc je passe par le JS pour retirer uniquement le bouton si il est présent dans la section 'Gérer la vidéo'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok en regardant un peu merci de retirer ce code JS. Voici une alternative :
fichier video_edit.html L.166 {% include "videos/link_video.html" with video=form.instance hide_favorite_link=True %}
fichier link_video.html L.6 {% if USE_FAVORITES and not hide_favorite_link %}
Merci de tester et de me dire si c'est ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vous pouvez rajouter hide_favorite_link=True à tous les appels que vous souhaitez

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

un peu mieux {% if USE_FAVORITES and not hide_favorite_link is True %}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En modifiant ces 2 lignes :

  • {% include "videos/link_video.html" with video=form.instance hide_favorite_link=True %}
  • {% if USE_FAVORITES and not hide_favorite_link is True %}

Le bouton apparait toujours pour les pages de complétion, cut...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non c'est bon, je sais !

Copy link
Contributor

@ptitloup ptitloup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merci de remplacer le JS par une variable d'affichage

Copy link
Contributor

@ptitloup ptitloup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok pour moi

@ptitloup ptitloup merged commit 599b304 into EsupPortail:develop May 16, 2023
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants