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

DEMO_PAGE_INTRO_HTML not shown on oTree hub #106

Open
peterjc opened this issue Sep 24, 2021 · 5 comments
Open

DEMO_PAGE_INTRO_HTML not shown on oTree hub #106

peterjc opened this issue Sep 24, 2021 · 5 comments

Comments

@peterjc
Copy link

peterjc commented Sep 24, 2021

Steps to reproduce at time of writing:

  1. Goto https://www.otreehub.com/projects/mdt-intr-exp-met/
  2. Text includes the line "To edit your app's description, go to settings.py and edit DEMO_PAGE_INTRO_HTML."
  3. Click "Browse source code"
  4. Click "settings.py"
  5. Notice that DEMO_PAGE_INTRO_HTML is set:
...
DEMO_PAGE_INTRO_HTML = 'Risk attitude lottery game based on Holt and Laury (2002), followed by an interactive multi-player game about volunteering. <a href="https://github.com/peterjc/MDT-INTR-EXP-MET">Source code on GitHub</a>.'

The text is shown correctly on the demo page:

  1. Goto https://mdt-intr-exp-met.herokuapp.com/demo
  2. Notice following description in right hand side box "Risk attitude lottery game based on Holt and Laury (2002), followed by an interactive multi-player game about volunteering. Source code on GitHub." (with link)
@peterjc
Copy link
Author

peterjc commented Sep 24, 2021

Based on #107, were using DEMO_PAGE_INTRO_HTML with triple-quoted string broke, I suspect there is an ad hoc parser involved. This may not support all the Python string syntax?

@peterjc
Copy link
Author

peterjc commented Sep 24, 2021

All the working examples from a quick browse on oTree Hub use a triple-quoted multi-line string, like this:

DEMO_PAGE_INTRO_HTML = """
Experiment.
"""

@oTree-org
Copy link
Owner

Thank you for the report. Yes it's not 100% accurate but my goal is just to capture most of those strings.

@peterjc
Copy link
Author

peterjc commented Sep 25, 2021

So if I really want my example's description to show, just use a multi-line triple quoted string as a workaround?

peterjc added a commit to peterjc/MDT-INTR-EXP-MET that referenced this issue Dec 10, 2021
@peterjc
Copy link
Author

peterjc commented Dec 10, 2021

Confirming successful workaround using a triple-quoted multi-line string, however surprisingly even with an introduction string the message about how to change it is still shown.

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

No branches or pull requests

2 participants