# HG changeset patch # User Lennard de Rijk # Date 1246885126 -7200 # Node ID ba32a4f5716ba633b819087c2e0e9fcf042590c8 # Parent cba50e22ff6bcb5465b4c4bd2d5d26cbb531ea6d Added the possiblitity to add a description to the top of the Survey. Thie uses the content property which has been inherited from the Work model. diff -r cba50e22ff6b -r ba32a4f5716b app/soc/models/work.py --- a/app/soc/models/work.py Mon Jul 06 13:19:00 2009 +0200 +++ b/app/soc/models/work.py Mon Jul 06 14:58:46 2009 +0200 @@ -67,13 +67,13 @@ #: The content is only to be displayed to Persons in Roles eligible to #: view them (which may be anyone, for example, with the site front page). content = db.TextProperty(verbose_name=ugettext('Content')) - + #: date when the work was created created = db.DateTimeProperty(auto_now_add=True) - + #: date when the work was last modified modified = db.DateTimeProperty(auto_now=True) - + # indicating wich user last modified the work. Used in displaying Work modified_by = db.ReferenceProperty(reference_class=soc.models.user.User, required=True, diff -r cba50e22ff6b -r ba32a4f5716b app/soc/templates/soc/survey/public.html --- a/app/soc/templates/soc/survey/public.html Mon Jul 06 13:19:00 2009 +0200 +++ b/app/soc/templates/soc/survey/public.html Mon Jul 06 14:58:46 2009 +0200 @@ -37,6 +37,10 @@
This page gives a preview of how users will see the Survey. + + {{ entity.content|safe }} + +
diff -r cba50e22ff6b -r ba32a4f5716b app/soc/templates/soc/survey/take.html --- a/app/soc/templates/soc/survey/take.html Mon Jul 06 13:19:00 2009 +0200 +++ b/app/soc/templates/soc/survey/take.html Mon Jul 06 14:58:46 2009 +0200 @@ -33,6 +33,12 @@ {{ help_text }} + {% if entity.content %} + + {{ entity.content|safe }} + + {% endif %} + {% if form_action %} {% else %} diff -r cba50e22ff6b -r ba32a4f5716b app/soc/views/models/survey.py --- a/app/soc/views/models/survey.py Mon Jul 06 13:19:00 2009 +0200 +++ b/app/soc/views/models/survey.py Mon Jul 06 14:58:46 2009 +0200 @@ -154,10 +154,9 @@ }, ] - # survey_html: save form content if POST fails, so fields remain in UI new_params['create_extra_dynaproperties'] = { - #'survey_content': forms.fields.CharField(widget=surveys.EditSurvey(), - #required=False), + 'content': forms.fields.CharField(required=False, label='Description', + widget=widgets.FullTinyMCE(attrs={'rows': 25, 'cols': 100})), 'survey_html': forms.fields.CharField(widget=forms.HiddenInput, required=False), 'scope_path': forms.fields.CharField(widget=forms.HiddenInput, @@ -170,7 +169,7 @@ 'clean': cleaning.validate_document_acl(self, True), } - new_params['extra_dynaexclude'] = ['author', 'created', 'content', + new_params['extra_dynaexclude'] = ['author', 'created', 'home_for', 'modified_by', 'modified', 'take_survey', 'survey_content']