diff options
Diffstat (limited to 'src/lib/Server/Hostbase/hostbase')
-rw-r--r-- | src/lib/Server/Hostbase/hostbase/views.py | 11 | ||||
-rw-r--r-- | src/lib/Server/Hostbase/hostbase/webtemplates/dnsedit.html | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/Server/Hostbase/hostbase/views.py b/src/lib/Server/Hostbase/hostbase/views.py index 146963af5..f26c4b891 100644 --- a/src/lib/Server/Hostbase/hostbase/views.py +++ b/src/lib/Server/Hostbase/hostbase/views.py @@ -13,8 +13,6 @@ from django.db import connection from django.shortcuts import render_to_response import re -templatedir = '/usr/lib/python2.4/site-packages/Hostbase/hostbase/webtemplates' - attribs = ['hostname', 'whatami', 'netgroup', 'security_class', 'support', 'csi', 'printq', 'primary_user', 'administrator', 'location', 'comments', 'status'] @@ -295,7 +293,7 @@ def edit(request, host_id): host.save() return HttpResponseRedirect('/hostbase/%s/' % host.id) else: - t = Template(open('%s/errors.html' % templatedir).read()) + t = Template(open('errors.html').read()) t.failures = validate(request, False, host_id) return HttpResponse(str(t)) # examine the check boxes for any changes @@ -448,7 +446,8 @@ def dnsedit(request, host_id): 'cnames': cnames, 'mxs': mxs, 'request': request, - 'interfaces': interfaces}) + 'interfaces': interfaces, + 'DNS_CHOICES': Name.DNS_CHOICES}) def new(request): """Function for creating a new host in hostbase @@ -466,7 +465,7 @@ def new(request): host.status = 'active' host.save() else: - return render_to_response('%s/errors.html' % templatedir, + return render_to_response('errors.html', {'failures': validate(request, True)}) if request.POST['mac_addr_new']: new_inter = Interface(host=host, @@ -588,7 +587,7 @@ def new(request): host.save() return HttpResponseRedirect('/hostbase/%s/' % host.id) else: - return render_to_response('%s/new.html' % templatedir, + return render_to_response('new.html', {'TYPE_CHOICES': Interface.TYPE_CHOICES, 'NETGROUP_CHOICES': Host.NETGROUP_CHOICES, 'CLASS_CHOICES': Host.CLASS_CHOICES, diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/dnsedit.html b/src/lib/Server/Hostbase/hostbase/webtemplates/dnsedit.html index 01caba4ad..b437e4a11 100644 --- a/src/lib/Server/Hostbase/hostbase/webtemplates/dnsedit.html +++ b/src/lib/Server/Hostbase/hostbase/webtemplates/dnsedit.html @@ -39,7 +39,7 @@ <tr> <td><b>name(dns)</b></td> <td> <input name="name{{ name.id }}" type="text" value="{{ name.name }}"> <select name="dns_view{{ name.id }}"> - {% for choice in name.DNS_CHOICES %} + {% for choice in DNS_CHOICES %} {% ifequal name.dns_view choice.0 %} <option value="{{ choice.0 }}">{{ choice.1 }} {% else %} @@ -74,7 +74,7 @@ <tr> <td> <b>name</b></td> <td> <input name="{{ ip.0.ip_addr }}name" type="text"> <select name="{{ ip.0.ip_addr }}dns_view"> - {% for choice in name.DNS_CHOICES %} + {% for choice in DNS_CHOICES %} <option value="{{ choice.0 }}">{{ choice.1 }} {% endfor %} </select></td></tr> |