fill home page with zones (a unique "Global Settings" zone at the moment)

This commit is contained in:
Frédéric Péters 2014-03-24 20:09:30 +01:00
parent 7458cd4126
commit ef83708db9
3 changed files with 29 additions and 2 deletions

View File

@ -17,6 +17,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: views.py:21
msgid "Global Settings"
msgstr "Paramétrage global"
#: templates/hobo/home.html:6
msgid "Welcome"
msgstr "Bienvenue"

View File

@ -8,7 +8,10 @@
{% block content %}
<p>
</p>
<ul class="apps">
{% for zone in zones %}
<li id="{{zone.zone_id}}"><a href="{{zone.href}}">{{zone.title}}</a></li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -1,5 +1,25 @@
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateView
class Zone:
title = None
zone_id = None
href = None
def __init__(self, title, zone_id, href):
self.title = title
self.zone_id = zone_id
self.href = href
class Home(TemplateView):
template_name = 'hobo/home.html'
def get_context_data(self, **kwargs):
context = super(Home, self).get_context_data(**kwargs)
context['zones'] = [
Zone(_('Global Settings'), 'settings', 'settings/'),
]
return context
home = Home.as_view()