diff --git a/frontend/templates/base-questionnaire.html b/frontend/templates/base-questionnaire.html index d2bac2d6..c597d0e7 100644 --- a/frontend/templates/base-questionnaire.html +++ b/frontend/templates/base-questionnaire.html @@ -2,7 +2,8 @@ {% load landings %} {% block title %}{{ block.super }}Questionnaire{% endblock title %} {% block search_box %} - +{% render_with_landing '' %} + {% endblock %} {% block signin %} {% endblock %} diff --git a/questionnaire/fixtures/sampleSurvey.json b/questionnaire/fixtures/sampleSurvey.json index 8935140b..b45f2d9b 100644 --- a/questionnaire/fixtures/sampleSurvey.json +++ b/questionnaire/fixtures/sampleSurvey.json @@ -44,7 +44,7 @@ "parse_html": true, "questionnaire": 3, "sortid": 1, - "text_en": "

Introduction

\r\n

\r\nWelcome, reader of {{ landing_object.title }}! And thanks for visiting Unglue.it to help us out with this \u2026\r\n

\r\n

\r\nAs Open Access publishers, {{ landing_object.last_campaign.publisher }} are truly committed to making academic research broadly accessible - so we want to understand how people like you are actually accessing and using our Open Access titles. \r\n

\r\n

\r\nWe have a bunch of questions for you (well - only 9 actually) about how you found this book and what you\u2019re going to do with it. Please tell us the things you think are interesting or relevant. We really want to know!\r\n

\r\n

\r\n[Privacy policy: There are no marketing traps, we\u2019re not going to surreptitiously drop cookies on you to carry around for us, or swamp you with emails afterwards, or tell our \u201cfriends\u201d about you - we\u2019re just going to store your answers to create a database of usage examples that can be used to understand what Open Access publishing enables." + "text_en": "

Introduction

\r\n

\r\nWelcome, reader of {{ landing_object.title }}! And thanks for visiting Unglue.it to help us out with this \u2026\r\n

\r\n

\r\nAs Open Access publishers, {{ landing_object.claim.all.0.rights_holder }} are truly committed to making academic research broadly accessible - so we want to understand how people like you are actually accessing and using our Open Access titles. \r\n

\r\n

\r\nWe have a bunch of questions for you (well - only 9 actually) about how you found this book and what you\u2019re going to do with it. Please tell us the things you think are interesting or relevant. We really want to know!\r\n

\r\n

\r\n[Privacy policy: There are no marketing traps, we\u2019re not going to surreptitiously drop cookies on you to carry around for us, or swamp you with emails afterwards, or tell our \u201cfriends\u201d about you - we\u2019re just going to store your answers to create a database of usage examples that can be used to understand what Open Access publishing enables." }, "model": "questionnaire.questionset", "pk": 5 @@ -68,7 +68,7 @@ "parse_html": true, "questionnaire": 3, "sortid": 3, - "text_en": "

We would really like to be able to follow up with some of the respondents to this questionnaire to ask them a few more questions - particularly if you\u2019ve told us something really interesting in a comment (for example). [There will also be a little reward (a free book no less!) for those of you we do contact in this way.]

\r\n\r\n

Thanks so much for your time and efforts answering these questions for us - we love you for it!

\r\n\r\n

We hope you enjoy {{ landing_object.title }}.

\r\n\r\n

{{ landing_object.last_campaign.publisher }} and Unglue.it

\r\n" + "text_en": "

We would really like to be able to follow up with some of the respondents to this questionnaire to ask them a few more questions - particularly if you\u2019ve told us something really interesting in a comment (for example). [There will also be a little reward (a free book no less!) for those of you we do contact in this way.]

\r\n\r\n

Thanks so much for your time and efforts answering these questions for us - we love you for it!

\r\n\r\n

We hope you enjoy {{ landing_object.title }}.

\r\n\r\n

{{ landing_object.claim.all.0.rights_holder }} and Unglue.it

\r\n" }, "model": "questionnaire.questionset", "pk": 7 diff --git a/questionnaire/templates/questionnaire/complete.en.html b/questionnaire/templates/questionnaire/complete.en.html index 2136f039..2d3578da 100644 --- a/questionnaire/templates/questionnaire/complete.en.html +++ b/questionnaire/templates/questionnaire/complete.en.html @@ -3,5 +3,5 @@

Thanks for completing the survey!

-

{{ landing_object.last_campaign.publisher }}

+

{{ landing_object.claim.all.0.rights_holder }}

{% endblock %} diff --git a/questionnaire/templatetags/landings.py b/questionnaire/templatetags/landings.py index d4a55b8e..85fa8a0e 100644 --- a/questionnaire/templatetags/landings.py +++ b/questionnaire/templatetags/landings.py @@ -4,9 +4,12 @@ register = django.template.Library() @register.simple_tag(takes_context=True) def render_with_landing(context, text): - block_context = Context({'landing_object' : context['runinfo'].landing.content_object}) + if not context.has_key('landing_object') and context.has_key('runinfo'): + context['landing_object'] = context['runinfo'].landing.content_object if text: template = Template(text) - return template.render(block_context) + return template.render(context) + else: - return '' \ No newline at end of file + return '' +