# HG changeset patch # User Sverre Rabbelier # Date 1235933828 0 # Node ID a06d60fcb23db23e2a70a52d46eb6e922e10e6f8 # Parent 0ffb9a3dfbdf9de40b976b0db1397731553139da Added a site-wide notice The notice is displayed below the 'login' bar, andonly if it is set in Site Settings. Patch by: Sverre Rabbelier diff -r 0ffb9a3dfbdf -r a06d60fcb23d app/soc/models/site.py --- a/app/soc/models/site.py Sun Mar 01 15:33:52 2009 +0000 +++ b/app/soc/models/site.py Sun Mar 01 18:57:08 2009 +0000 @@ -42,6 +42,10 @@ verbose_name=ugettext('Site Name')) site_name.help_text = ugettext('The official name of the Site') + #: A notice that should be displayed site-wide + site_notice = db.StringProperty(verbose_name=ugettext('Site Notice')) + site_notice.help_text = ugettext('A notice that will be displayed site-wide') + #: Valid Google Analytics tracking number, if entered every page #: is going to have Google Analytics JS initialization code in #: the footer with the given tracking number. diff -r 0ffb9a3dfbdf -r a06d60fcb23d app/soc/templates/soc/base.html --- a/app/soc/templates/soc/base.html Sun Mar 01 15:33:52 2009 +0000 +++ b/app/soc/templates/soc/base.html Sun Mar 01 18:57:08 2009 +0000 @@ -109,6 +109,22 @@ {% endblock %} +
+ {% if site_notice %} + + + +
+
+
+
{{ site_notice }}
+
+
+
+
+ {% endif %} +
+
diff -r 0ffb9a3dfbdf -r a06d60fcb23d app/soc/views/helper/responses.py --- a/app/soc/views/helper/responses.py Sun Mar 01 15:33:52 2009 +0000 +++ b/app/soc/views/helper/responses.py Sun Mar 01 18:57:08 2009 +0000 @@ -136,6 +136,7 @@ context['ga_tracking_num'] = settings.ga_tracking_num context['gmaps_api_key'] = settings.gmaps_api_key context['site_name'] = settings.site_name + context['site_notice'] = settings.site_notice context['tos_link'] = redirects.getToSRedirect(settings) return context