Added a site-wide notice
authorSverre Rabbelier <srabbelier@gmail.com>
Sun, 01 Mar 2009 18:57:08 +0000
changeset 1579 a06d60fcb23d
parent 1578 0ffb9a3dfbdf
child 1580 947a0ee153a4
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
app/soc/models/site.py
app/soc/templates/soc/base.html
app/soc/views/helper/responses.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.
--- 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 %}
   </div>
 
+  <div id="notice">
+  {% if site_notice %}
+  <table align="center">
+      <tr>
+          <td>
+          <div class="notice">
+          <div class="rounded_ul"><div class="rounded_ur"><div class="rounded_ll"><div class="rounded_lr">
+          <div style="padding: 5px 10px;"><b>{{ site_notice }}</b></div>
+          </div></div></div></div>
+          </div>
+          <td>
+      </tr>
+  </table>
+  {% endif %}
+  </div>
+
   <div id="header">
    <div id="logo">
 	{% block logo %}
@@ -152,6 +168,7 @@
 	{% endif %}
 	</div>
 	{% endblock %}
+
   </div>
 
   <div id="side" dir="ltr">
--- 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