diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Hostbase/hostbase/views.py | 6 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/hostbase/webtemplates/index.html | 14 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/hostbase/webtemplates/logout.html | 13 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/settings.py | 1 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/urls.py | 3 |
5 files changed, 35 insertions, 2 deletions
diff --git a/src/lib/Server/Hostbase/hostbase/views.py b/src/lib/Server/Hostbase/hostbase/views.py index b88083c94..748a84471 100644 --- a/src/lib/Server/Hostbase/hostbase/views.py +++ b/src/lib/Server/Hostbase/hostbase/views.py @@ -7,6 +7,7 @@ __revision__ = "$Revision: $" from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.decorators import login_required +from django.contrib.auth import logout from Hostbase.hostbase.models import * from datetime import date @@ -53,6 +54,11 @@ dispatch = {'mac_addr':'i.mac_addr LIKE \'%%%%%s%%%%\'', ## t.failures = False ## return HttpResponse(str(t)) +def index(request): + """rediredct to /hostbase/""" + return render_to_response('index.html', + {}) + def search(request): """Search for hosts in the database If more than one field is entered, logical AND is used diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/index.html b/src/lib/Server/Hostbase/hostbase/webtemplates/index.html new file mode 100644 index 000000000..e9cb18821 --- /dev/null +++ b/src/lib/Server/Hostbase/hostbase/webtemplates/index.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block pagebanner %} + <div class="header"> + <h2>Welcome to Hostbase!</h2> + <p>Hostbase is a web based management tools for Bcfg2 Hosts</p> + </div> + <br/> +{% endblock %} +{% block sidebar %} +<a href="/login/" class="sidebar">Login to Hostbase</a> +{% endblock %} +{% block content %} +{% endblock %} + diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/logout.html b/src/lib/Server/Hostbase/hostbase/webtemplates/logout.html new file mode 100644 index 000000000..91dae7e6d --- /dev/null +++ b/src/lib/Server/Hostbase/hostbase/webtemplates/logout.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% block pagebanner %} + <div class="header"> + <h2>You are logged out of Hostbase!</h2> + </div> + <br/> +{% endblock %} +{% block sidebar %} +<a href="/login/" class="sidebar">Login to Hostbase</a> +{% endblock %} +{% block content %} +{% endblock %} + diff --git a/src/lib/Server/Hostbase/settings.py b/src/lib/Server/Hostbase/settings.py index bdde3619a..41c557f0d 100644 --- a/src/lib/Server/Hostbase/settings.py +++ b/src/lib/Server/Hostbase/settings.py @@ -101,5 +101,6 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.sites', 'Hostbase.hostbase', + ) diff --git a/src/lib/Server/Hostbase/urls.py b/src/lib/Server/Hostbase/urls.py index 5c57f38bd..dd3d34eaf 100644 --- a/src/lib/Server/Hostbase/urls.py +++ b/src/lib/Server/Hostbase/urls.py @@ -1,12 +1,11 @@ import os from django.conf.urls.defaults import * -os.environ['bcfg_media_root'] = "/homes/raffenet/under_contruction/djangobase/bcfg2/src/lib/Server/Hostbase/media" - urlpatterns = patterns('Hostbase.hostbase.views', (r'^admin/', include('django.contrib.admin.urls')), (r'^hostbase/$', 'search'), + (r'^$','index' ), (r'^hostbase/(?P<host_id>\d+)/$', 'look'), (r'^hostbase/(?P<host_id>\d+)/edit', 'edit'), (r'^hostbase/(?P<host_id>\d+)/remove', 'remove'), |