summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorDavid Dahl <dahl@mcs.anl.gov>2006-10-31 21:58:21 +0000
committerDavid Dahl <dahl@mcs.anl.gov>2006-10-31 21:58:21 +0000
commit5b2b4bc317d6a533ee19758132863a0fcf5ce245 (patch)
tree719f572f517e4517b325264d77f68d56d2ef9131 /src/lib
parente8ee28690e839cf962f70103a28dc54f9f16c365 (diff)
downloadbcfg2-5b2b4bc317d6a533ee19758132863a0fcf5ce245.tar.gz
bcfg2-5b2b4bc317d6a533ee19758132863a0fcf5ce245.tar.bz2
bcfg2-5b2b4bc317d6a533ee19758132863a0fcf5ce245.zip
slight tweaks to logout login and index
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2463 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Hostbase/hostbase/views.py6
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/index.html14
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/logout.html13
-rw-r--r--src/lib/Server/Hostbase/settings.py1
-rw-r--r--src/lib/Server/Hostbase/urls.py3
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'),