# HG changeset patch # User Pawel Solyga # Date 1224692510 0 # Node ID f3525c1288eda30c0a84f59374dcb12209d6218c # Parent 44223e50e1fc1dc8263db5e65d93d41a477f4981 Add Google Analytics support to Site Settings. The reason I created additional SettingsValidationForm is because you cannot inherit from Form that has already defined Meta class, so it's sort of workaround for that. I didn't want to have same validation functions in both Form classes. Patch by: Pawel Solyga Review by: to-be-reviewed diff -r 44223e50e1fc -r f3525c1288ed app/soc/logic/site/map.py --- a/app/soc/logic/site/map.py Wed Oct 22 06:20:02 2008 +0000 +++ b/app/soc/logic/site/map.py Wed Oct 22 16:21:50 2008 +0000 @@ -108,7 +108,7 @@ site_settings_edit = page.Page( page.Url( r'^site/settings/edit$', - 'soc.views.settings.edit', + 'soc.views.site.settings.edit', kwargs={ 'path': models.site_settings.logic.DEF_SITE_SETTINGS_PATH, 'logic': models.site_settings.logic, diff -r 44223e50e1fc -r f3525c1288ed app/soc/models/site_settings.py --- a/app/soc/models/site_settings.py Wed Oct 22 06:20:02 2008 +0000 +++ b/app/soc/models/site_settings.py Wed Oct 22 16:21:50 2008 +0000 @@ -21,12 +21,22 @@ ] +from google.appengine.ext import db + +from django.utils.translation import ugettext_lazy + import soc.models.home_settings class SiteSettings(soc.models.home_settings.HomeSettings): """Model of a SiteSettings, which stores per site configuration.""" - # there is currently no site-specific configuration that is different from - # other /home page configuration (but this will change...) - pass + #: 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. + ga_tracking_no = db.StringProperty(verbose_name=ugettext_lazy('Google Analytics')) + ga_tracking_no.help_text = ugettext_lazy( + 'Valid Google Analytics tracking number. If the number is ' + 'entered every page is going to have Google Analytics ' + 'initialization code in footer.') + diff -r 44223e50e1fc -r f3525c1288ed app/soc/templates/soc/base.html --- a/app/soc/templates/soc/base.html Wed Oct 22 06:20:02 2008 +0000 +++ b/app/soc/templates/soc/base.html Wed Oct 22 16:21:50 2008 +0000 @@ -146,9 +146,10 @@

{% endblock %} - -