add hobo.environment app to configure global settings and services

This commit is contained in:
Frédéric Péters 2014-03-24 21:19:41 +01:00
parent 490120a007
commit 3c744deed8
11 changed files with 37 additions and 2 deletions

View File

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,9 @@
{% extends "hobo/base.html" %}
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Environment Settings' %}</h2>
{% endblock %}
{% block content %}
{% endblock %}

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

7
hobo/environment/urls.py Normal file
View File

@ -0,0 +1,7 @@
from django.conf.urls import patterns, url
from .views import *
urlpatterns = patterns('',
url(r'^$', HomeView.as_view(), name='environment-home'),
)

View File

@ -0,0 +1,8 @@
from django.views.generic.base import TemplateView
class HomeView(TemplateView):
template_name = 'environment/home.html'
def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)
return context

View File

@ -18,7 +18,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: views.py:21
msgid "Global Settings"
msgid "Environment Settings"
msgstr "Paramétrage global"
#: templates/hobo/home.html:6

View File

@ -37,6 +37,7 @@ INSTALLED_APPS = (
'django.contrib.messages',
'django.contrib.staticfiles',
'gadjo',
'hobo.environment',
)
MIDDLEWARE_CLASSES = (

View File

@ -5,6 +5,7 @@ admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'hobo.views.home', name='home'),
url(r'^environment/', include('hobo.environment.urls')),
url(r'^admin/', include(admin.site.urls)),
)

View File

@ -18,7 +18,7 @@ class Home(TemplateView):
def get_context_data(self, **kwargs):
context = super(Home, self).get_context_data(**kwargs)
context['zones'] = [
Zone(_('Global Settings'), 'settings', 'settings/'),
Zone(_('Environment Settings'), 'settings', 'environment/'),
]
return context