Amsterdam-Music-Lab / MUSCLE

An application to easily set up and run online listening experiments for music research.
https://www.amsterdammusiclab.nl/
MIT License
4 stars 1 forks source link

Turn `base.feedback_info` into a model #1248

Open BeritJanssen opened 2 months ago

BeritJanssen commented 2 months ago

Right now, there is some information related to giving feedback to researchers, which is defined in the Python rules files, i.e., a standard feedback_info method on base.py, with overrides in some other rules files. There is also a contact_email, which is suboptimal as it requires to check email adresses into version control.

It would probably make more sense to define this information in the database, perhaps even configure here whether or not to show the floating feedback button.

As this is something which will need to be localized: if we go this way, we'll also need to add TranslatedContent models.

class FeedbackInfo(models.Model):
   experiment = models.ForeignKey(Experiment, ...)
   show_float_button = models.BooleanField(default=False)
   experimenter_email = models.CharField(blank=True)

class FeedbackInfoTranslatedContent(models.Model):
   feedback_info = models.ForeignKey(FeedbackInfo, ...)
   language = models.CharField
   header = models.CharField
   button_text = models.CharField
   contact_body = models.TextField # <- this can currently be HTML, so use `MarkdownPreviewTextInput` as form
   thank_you_message = models.CharField