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

Le superadmin peut paramétrer l’illustration d’une question numératie #1618

Conversation

Marionvel
Copy link

No description provided.

@Marionvel Marionvel force-pushed the EVA-170-le-superadmin-peut-parametrer-lillustration-dune-question-numeratie branch from c7b938f to a446911 Compare August 12, 2024 14:34
@@ -8,6 +8,9 @@ active_admin_form_for [:admin, resource] do |f|
f.input :metacompetence
f.input :type_qcm
f.input :description
f.input :illustration, as: :file,
input_html: { accept: 'image/png,image/jpg,image/jpeg' },
Copy link
Contributor

Choose a reason for hiding this comment

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

Tu n'accepte pas le webp ici, c'est normal ?
Tu duplique d'ailleurs du texte du model Question.

J'aurais tendance dans le model Question à faire :

class Question < ApplicationRecord
  ...

  ILLUSTRATION_CONTENT_TYPES = ['image/png', 'image/jpeg', 'image/webp']
  validates :illustration,
            blob: { content_type: ILLUSTRATION_CONTENT_TYPES }
Suggested change
input_html: { accept: 'image/png,image/jpg,image/jpeg' },
input_html: { accept: Question::ILLUSTRATION_CONTENT_TYPES.join(',') },

@cprodhomme cprodhomme merged commit 785a396 into betagouv:develop Aug 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants