aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-12-26 23:33:21 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-12-28 11:03:29 +0000
commit75c44fd770ffa1890159b516c7b0cc59669dea7e (patch)
treece5ba766a6bfd4f4c396658ab000f01326eb4a25 /layerindex
parent5ce6448a1207d2797b3079323033d513e106dfdf (diff)
downloadopenembedded-core-contrib-75c44fd770ffa1890159b516c7b0cc59669dea7e.tar.gz
Use Django sites framework to specify website title
This allows specifying the site title in the database, instead of hardcoding it in the template. Just change it to something other than "example.com" to apply your own title. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex')
-rw-r--r--layerindex/context_processors.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/layerindex/context_processors.py b/layerindex/context_processors.py
index ba0664d205..e2852ee2e9 100644
--- a/layerindex/context_processors.py
+++ b/layerindex/context_processors.py
@@ -5,10 +5,17 @@
# Licensed under the MIT license, see COPYING.MIT for details
from layerindex.models import Branch, LayerItem
+from django.contrib.sites.models import Site
def layerindex_context(request):
+ site = Site.objects.get_current()
+ if site and site.name and site.name != 'example.com':
+ site_name = site.name
+ else:
+ site_name = 'OpenEmbedded metadata index'
return {
'all_branches': Branch.objects.exclude(name='oe-classic').order_by('sort_priority'),
'unpublished_count': LayerItem.objects.filter(status='N').count(),
- 'oe_classic': Branch.objects.filter(name='oe-classic')
+ 'oe_classic': Branch.objects.filter(name='oe-classic'),
+ 'site_name': site_name
} \ No newline at end of file