Commits

Guilherme Gondim committed e99ed26

Add context variable SITE_COPYRIGHT

  • Participants
  • Parent commits 941e3c5

Comments (0)

Files changed (2)

File etc/project-template/settings.py

 
 SITE_NAME = 'Planeta'
 SITE_DESCRIPTION = 'Planeta is a RSS/Atom feeds aggregator'
+SITE_COPYRIGHT = '© Copyright 2013 {}.'.format(SITE_NAME)
 
 PROJECT_ROOT = abspath(dirname(__file__))
 

File planeta/context_processors.py

 from datetime import date
 from django.conf import settings
 from django.db.models import Min
+from django.utils.timezone import now
 
 from agregador.models import Entry
 
 
 
 def meta(*args, **kwargs):
-    name = getattr(settings, 'SITE_NAME', 'Planeta')
-    description = getattr(settings, 'SITE_DESCRIPTION', 'Planeta is a RSS/Atom feeds aggregator')
-    return dict(SITE_NAME=name, SITE_DESCRIPTION=description)
+    year = now().year
+    name = 'Planeta'
+    description = 'Planeta is a RSS/Atom feeds aggregator'
+    copyright = '© Copyright {} {}.'.format(year, name)
+    return {
+        'SITE_NAME': getattr(settings, 'SITE_NAME', name),
+        'SITE_DESCRIPTION': getattr(settings, 'SITE_DESCRIPTION', description),
+        'SITE_COPYRIGHT': getattr(settings, 'SITE_COPYRIGHT', copyright),
+    }