summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raffenetti <raffenet@mcs.anl.gov>2006-09-13 19:13:08 +0000
committerKen Raffenetti <raffenet@mcs.anl.gov>2006-09-13 19:13:08 +0000
commit5d4849dc21d7aae7e861033ab5aa3bdeb17847c1 (patch)
tree4b4ae31b1e39caf36a8fce2ae7c21dad6ff41822 /src
parent38df760dd986caa7e786f0f9efb6bc16bd107c15 (diff)
downloadbcfg2-5d4849dc21d7aae7e861033ab5aa3bdeb17847c1.tar.gz
bcfg2-5d4849dc21d7aae7e861033ab5aa3bdeb17847c1.tar.bz2
bcfg2-5d4849dc21d7aae7e861033ab5aa3bdeb17847c1.zip
more web layout changes
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2248 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Hostbase/hostbase/views.py109
-rw-r--r--src/lib/Server/Hostbase/hostbase/views.pycbin19040 -> 0 bytes
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/dns.html167
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/errors.html141
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/host.html11
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/new.html163
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/results.html5
7 files changed, 160 insertions, 436 deletions
diff --git a/src/lib/Server/Hostbase/hostbase/views.py b/src/lib/Server/Hostbase/hostbase/views.py
index d2321e364..48e924ddc 100644
--- a/src/lib/Server/Hostbase/hostbase/views.py
+++ b/src/lib/Server/Hostbase/hostbase/views.py
@@ -103,18 +103,61 @@ def look(request, host_id):
host = Host.objects.get(id=host_id)
interfaces = []
for interface in host.interface_set.all():
- interfaces.append((interface, interface.ip_set.all()))
- comments = [line for line in host.comments.split("\n")]
+ interfaces.append([interface, interface.ip_set.all()])
return render_to_response('%s/host.html' % templatedir,
{'host': host,
- 'interfaces': interfaces,
- 'comments': comments})
+ 'interfaces': interfaces})
def dns(request, host_id):
- temp = Template(open('%s/dns.html' % templatedir).read())
- hostdata = gethostdata(host_id, True)
- temp = fill(temp, hostdata, True)
- return HttpResponse(str(temp))
+ host = Host.objects.get(id=host_id)
+ ips = []
+ info = []
+ cnames = []
+ mxs = []
+ for interface in host.interface_set.all():
+ ips.extend(interface.ip_set.all())
+ for ip in ips:
+ info.append([ip, ip.name_set.all()])
+ for name in ip.name_set.all():
+ cnames.extend(name.cname_set.all())
+ mxs.append((name.id, name.mxs.all()))
+ return render_to_response('%s/dns.html' % templatedir,
+ {'host': host,
+ 'info': info,
+ 'cnames': cnames,
+ 'mxs': mxs})
+
+def gethostdata(host_id, dnsdata=False):
+ """Grabs the necessary data about a host
+ Replaces a lot of repeated code"""
+ hostdata = {}
+ hostdata['ips'] = {}
+ hostdata['names'] = {}
+ hostdata['cnames'] = {}
+ hostdata['mxs'] = {}
+ hostdata['host'] = Host.objects.get(id=host_id)
+ hostdata['interfaces'] = hostdata['host'].interface_set.all()
+ for interface in hostdata['interfaces']:
+ hostdata['ips'][interface.id] = interface.ip_set.all()
+ if dnsdata:
+ for ip in hostdata['ips'][interface.id]:
+ hostdata['names'][ip.id] = ip.name_set.all()
+ for name in hostdata['names'][ip.id]:
+ hostdata['cnames'][name.id] = name.cname_set.all()
+ hostdata['mxs'][name.id] = name.mxs.all()
+ return hostdata
+
+def fill(template, hostdata, dnsdata=False):
+ """Fills a generic template
+ Replaces a lot of repeated code"""
+ if dnsdata:
+ template.names = hostdata['names']
+ template.cnames = hostdata['cnames']
+ template.mxs = hostdata['mxs']
+ template.host = hostdata['host']
+ template.interfaces = hostdata['interfaces']
+ template.ips = hostdata['ips']
+ return template
def edit(request, host_id):
"""Edit general host information
@@ -385,39 +428,6 @@ def dnsedit(request, host_id):
temp = fill(temp, hostdata, True)
temp.request = request
return HttpResponse(str(temp))
-
-def gethostdata(host_id, dnsdata=False):
- """Grabs the necessary data about a host
- Replaces a lot of repeated code"""
- hostdata = {}
- hostdata['ips'] = {}
- hostdata['names'] = {}
- hostdata['cnames'] = {}
- hostdata['mxs'] = {}
- hostdata['host'] = Host.objects.get(id=host_id)
- hostdata['interfaces'] = hostdata['host'].interface_set.all()
- for interface in hostdata['interfaces']:
- hostdata['ips'][interface.id] = interface.ip_set.all()
- if dnsdata:
- for ip in hostdata['ips'][interface.id]:
- hostdata['names'][ip.id] = ip.name_set.all()
- for name in hostdata['names'][ip.id]:
- hostdata['cnames'][name.id] = name.cname_set.all()
- hostdata['mxs'][name.id] = name.mxs.all()
- return hostdata
-
-def fill(template, hostdata, dnsdata=False):
- """Fills a generic template
- Replaces a lot of repeated code"""
- if dnsdata:
- template.names = hostdata['names']
- template.cnames = hostdata['cnames']
- template.mxs = hostdata['mxs']
- template.host = hostdata['host']
- template.interfaces = hostdata['interfaces']
- template.ips = hostdata['ips']
- return template
-
def new(request):
"""Function for creating a new host in hostbase
@@ -435,9 +445,8 @@ def new(request):
host.status = 'active'
host.save()
else:
- temp = Template(open('%s/errors.html' % templatedir).read())
- temp.failures = validate(request, True)
- return HttpResponse(str(temp))
+ return render_to_response('%s/errors.html' % templatedir,
+ {'failures': validate(request, True)})
if request.POST['mac_addr_new']:
new_inter = Interface(host=host,
mac_addr=request.POST['mac_addr_new'],
@@ -558,13 +567,11 @@ def new(request):
host.save()
return HttpResponseRedirect('/hostbase/%s/' % host.id)
else:
- temp = Template(open('%s/new.html' % templatedir).read())
- temp.TYPE_CHOICES = Interface.TYPE_CHOICES
- temp.NETGROUP_CHOICES = Host.NETGROUP_CHOICES
- temp.CLASS_CHOICES = Host.CLASS_CHOICES
- temp.SUPPORT_CHOICES = Host.SUPPORT_CHOICES
- temp.failures = False
- return HttpResponse(str(temp))
+ return render_to_response('%s/new.html' % templatedir,
+ {'TYPE_CHOICES': Interface.TYPE_CHOICES,
+ 'NETGROUP_CHOICES': Host.NETGROUP_CHOICES,
+ 'CLASS_CHOICES': Host.CLASS_CHOICES,
+ 'SUPPORT_CHOICES': Host.SUPPORT_CHOICES})
def validate(request, new=False, host_id=None):
"""Function for checking form data"""
diff --git a/src/lib/Server/Hostbase/hostbase/views.pyc b/src/lib/Server/Hostbase/hostbase/views.pyc
deleted file mode 100644
index 24619902c..000000000
--- a/src/lib/Server/Hostbase/hostbase/views.pyc
+++ /dev/null
Binary files differ
diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/dns.html b/src/lib/Server/Hostbase/hostbase/webtemplates/dns.html
index a937fb833..79db89e5a 100644
--- a/src/lib/Server/Hostbase/hostbase/webtemplates/dns.html
+++ b/src/lib/Server/Hostbase/hostbase/webtemplates/dns.html
@@ -1,133 +1,42 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><!-- InstanceBegin template="/Templates/publicFull.dwt" codeOutsideHTMLIsLocked="false" -->
-<head>
-<link href="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/stylesheets/argonne.css" rel="stylesheet" type="text/css">
-<link href="http://www.anl.gov/favicon.ico" rel="SHORTCUT ICON">
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/anlmain.js" type="text/JavaScript"></script>
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/stm31.js" type="text/JavaScript"></script>
-<!-- InstanceBeginEditable name="head" -->
-<!-- Insert page specific head elements in this region, including custom javascript -->
-<!-- TemplateBeginEditable name="head" -->
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/main.js" type="text/JavaScript"></script>
-<!-- TemplateEndEditable --><!-- InstanceEndEditable -->
-<!-- InstanceBeginEditable name="title" -->
-<title></title>
-<!-- InstanceEndEditable -->
-<!-- InstanceBeginEditable name="metadata" -->
-<meta name="description" content="">
-<meta name="keywords" content="">
-<meta name="classification" content="">
-<meta name="author" content="Argonne National Laboratory">
-<meta name="expires" content="">
-<!-- InstanceEndEditable -->
-<!-- InstanceParam name="Contact URL" type="URL" value="../about/contacts.html" --><!-- InstanceParam name="Sitemap URL" type="URL" value="../Division/sitemap.html" --><!-- InstanceParam name="Search URL" type="URL" value="../About/search.html" --><!-- InstanceParam name="enableOptionalSponsorLogos" type="boolean" value="true" --><!-- InstanceParam name="enableNavBarTabs" type="boolean" value="true" --><!-- InstanceParam name="enableNavBarSearch" type="boolean" value="false" --><!-- InstanceParam name="enableOptionalSitemapFooter" type="boolean" value="false" --><!-- InstanceParam name="enableOptionalSearchFooter" type="boolean" value="false" -->
-</head>
-<body>
-<table width="100%" border="0" cellpadding="0" cellspacing="3">
- <tr>
- <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr class="headerBkgd" valign="middle">
- <td width="10"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" height="10" width="10" border="0" alt=""></td>
- <td width="300" align="left"><a href="http://www.anl.gov"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/argonne_header_logo.jpg" alt="Argonne National Laboratory" width="227" height="100" border="0"></a></td>
- <td><span class="sectionTitle"><!-- InstanceBeginEditable name="divisionProgramIdentity" --><img src="http://www-unix.mcs.anl.gov/hostbaseweb/images/mcs_logo_white_minus_logo_small.png" width="92" height="31"><br>
- <a href="http://www.mcs.anl.gov">Mathematics
- and Computer Science </a><!-- InstanceEndEditable --></span></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
-
- <tr> <!-- InstanceBeginRepeat name="localNavigation" --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --> <a href="http://www.mcs.anl.gov">About
- Us</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --><a href="http://www-fp.mcs.anl.gov/division/research/">Research</a><!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --> <a href="../research/index.html"></a><a href="http://www-fp.mcs.anl.gov/division/resources/">Facilities</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --><a href="http://www-fp.mcs.anl.gov/division/people/">Staff</a><!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/software/">Software</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/collaboration">Collaborations </a>
- <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/information/">Information</a>
- <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
-
- <td class="navGlobalBkgd" width="50%"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="1" height="30" border="0" alt=""></td>
- </tr> </table>
- <!-- #EndLibraryItem --></td>
- </tr>
- <tr>
- <td class="greyBkgdLight"><span class="breadcrumbs"><a href="http://www.mcs.anl.gov/">MCS
- Home</a> &gt; <!-- InstanceBeginEditable name="topLevelBreadcrumbs" -->
- <script language="JavaScript">breadCrumbs("www-unix.mcs.anl.gov/new",">","","breadcrumbs","None","None","0");</script>
- <!-- InstanceEndEditable --></span></td>
- </tr>
- <tr valign="top">
- <td nowrap><table width="100%" border="0" cellpadding="5" cellspacing="0">
- <tr>
- <td><!-- InstanceBeginEditable name="mainFeature" -->
-<b>DNS Information for host "$host.hostname"</b>
+{% extends "base.html" %}
- #for $interface in $interfaces
- #for $ip in $ips[$interface.id]
- <ul><li> <b>ip_addr:</b> $ip.ip_addr</li>
- #for $name in $names[$ip.id]
- <ul> <li><b>name:</b> $name.name</li> <ul>
- #for $cname in $cnames[$name.id]
- <li> <b>cname:</b> $cname.cname</li>
- #end for
- #for $mx in $mxs[$name.id]
- <li> <b>mx:</b> $mx.priority $mx.mx</li>
- #end for
+{% block pagebanner %}
+ <div class="header">
+ <h2>dns info for {{ host.hostname }}</h2>
+ </div>
+ <br/>
+{% endblock %}
+
+{% block sidebar %}
+<a href="/hostbase/" class="sidebar">new search</a>
+<ul class="sidebar">
+ <li><a href="/hostbase/{{ host.id }}/" class="sidebar">host info</a></li>
+ <li><a href="/hostbase/{{ host.id }}/edit/" class="sidebar">edit host info</a></li>
+ <li><a href="edit/" class="sidebar">edit dns info</a></li>
+</ul>
+{% endblock %}
+
+{% block content %}
+
+ {% for ip in info %}
+ <ul><li> <b>ip_addr:</b> {{ ip.0.ip_addr }}</li>
+ {% for name in ip.1 %}
+ <ul> <li><b>name:</b> {{ name.name }}</li> <ul>
+ {% for cname in cnames %}
+ {% ifequal cname.name_id name.id %}
+ <li> <b>cname:</b> {{ cname.cname }}</li>
+ {% endifequal %}
+ {% endfor %}
+ {% for mx in mxs %}
+ {% ifequal mx.0 name.id %}
+ {% for record in mx.1 %}
+ <li> <b>mx:</b> {{ record.priority }} {{ record.mx }}</li>
+ {% endfor %}
+ {% endifequal %}
+ {% endfor %}
</ul></ul>
- #end for
+ {% endfor %}
</ul>
- #end for
- #end for
- <!-- InstanceEndEditable --></td>
- </tr>
- </table></td>
- </tr>
- <tr valign="top">
- <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td colspan="2" align="left"><hr size="1"></td>
- </tr>
- <tr valign="top">
- <td colspan="2" align="center"><table border="0" cellspacing="0" cellpadding="5">
- <tr>
- <td><a href="http://www.doe.gov/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_doe.gif" alt="U.S. Department of Energy" width="153" height="35" border="0"></a></td>
- <td><a href="http://www.uchicago.edu/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_uofc.gif" alt="The University of Chicago" width="125" height="34" border="0"></a></td>
-
- <td><!-- InstanceBeginEditable name="sponsorLogos" --><!-- #BeginLibraryItem "/Library/logoOfficeOfScience.lbi" --><a href="http://www.sc.doe.gov/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_doe_science.gif" alt="Office of Science - Department of Energy" width="143" height="31" border="0"></a><!-- #EndLibraryItem --><!-- InstanceEndEditable --></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td colspan="2" align="center"> <table cellspacing="0" cellpadding="2" border="0">
- <tr>
- <td class="footerText"><a href="http://www.anl.gov/notice.html">Privacy &amp; Security Notice</a>&nbsp;|&nbsp;<a href="http://www.anl.gov/Administration/contactus.html">Contact Us</a></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
-</table>
-</body>
-<!-- InstanceEnd --></html>
+ {% endfor %}
+{% endblock %}
diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/errors.html b/src/lib/Server/Hostbase/hostbase/webtemplates/errors.html
index 83f5cd014..47d32ede4 100644
--- a/src/lib/Server/Hostbase/hostbase/webtemplates/errors.html
+++ b/src/lib/Server/Hostbase/hostbase/webtemplates/errors.html
@@ -1,126 +1,27 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><!-- InstanceBegin template="/Templates/publicFull.dwt" codeOutsideHTMLIsLocked="false" -->
-<head>
-<link href="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/stylesheets/argonne.css" rel="stylesheet" type="text/css">
-<link href="http://www.anl.gov/favicon.ico" rel="SHORTCUT ICON">
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/anlmain.js" type="text/JavaScript"></script>
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/stm31.js" type="text/JavaScript"></script>
-<!-- InstanceBeginEditable name="head" -->
-<!-- Insert page specific head elements in this region, including custom javascript -->
-<!-- TemplateBeginEditable name="head" -->
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/main.js" type="text/JavaScript"></script>
-<!-- TemplateEndEditable --><!-- InstanceEndEditable -->
-<!-- InstanceBeginEditable name="title" -->
-<title></title>
-<!-- InstanceEndEditable -->
-<!-- InstanceBeginEditable name="metadata" -->
-<meta name="description" content="">
-<meta name="keywords" content="">
-<meta name="classification" content="">
-<meta name="author" content="Argonne National Laboratory">
-<meta name="expires" content="">
-<!-- InstanceEndEditable -->
-<!-- InstanceParam name="Contact URL" type="URL" value="../about/contacts.html" --><!-- InstanceParam name="Sitemap URL" type="URL" value="../Division/sitemap.html" --><!-- InstanceParam name="Search URL" type="URL" value="../About/search.html" --><!-- InstanceParam name="enableOptionalSponsorLogos" type="boolean" value="true" --><!-- InstanceParam name="enableNavBarTabs" type="boolean" value="true" --><!-- InstanceParam name="enableNavBarSearch" type="boolean" value="false" --><!-- InstanceParam name="enableOptionalSitemapFooter" type="boolean" value="false" --><!-- InstanceParam name="enableOptionalSearchFooter" type="boolean" value="false" -->
-</head>
-<body>
-<table width="100%" border="0" cellpadding="0" cellspacing="3">
- <tr>
- <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr class="headerBkgd" valign="middle">
- <td width="10"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" height="10" width="10" border="0" alt=""></td>
- <td width="300" align="left"><a href="http://www.anl.gov"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/argonne_header_logo.jpg" alt="Argonne National Laboratory" width="227" height="100" border="0"></a></td>
- <td><span class="sectionTitle"><!-- InstanceBeginEditable name="divisionProgramIdentity" --><img src="http://www-unix.mcs.anl.gov/hostbaseweb/images/mcs_logo_white_minus_logo_small.png" width="92" height="31"><br>
- <a href="http://www.mcs.anl.gov">Mathematics
- and Computer Science </a><!-- InstanceEndEditable --></span></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
-
- <tr> <!-- InstanceBeginRepeat name="localNavigation" --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --> <a href="http://www.mcs.anl.gov">About
- Us</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --><a href="http://www-fp.mcs.anl.gov/division/research/">Research</a><!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --> <a href="../research/index.html"></a><a href="http://www-fp.mcs.anl.gov/division/resources/">Facilities</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --><a href="http://www-fp.mcs.anl.gov/division/people/">Staff</a><!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/software/">Software</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/collaboration">Collaborations </a>
- <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/information/">Information</a>
- <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
-
- <td class="navGlobalBkgd" width="50%"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="1" height="30" border="0" alt=""></td>
- </tr> </table>
- <!-- #EndLibraryItem --></td>
- </tr>
- <tr>
- <td class="greyBkgdLight"><span class="breadcrumbs"><a href="http://www.mcs.anl.gov/">MCS
- Home</a> &gt; <!-- InstanceBeginEditable name="topLevelBreadcrumbs" -->
- <script language="JavaScript">breadCrumbs("www-unix.mcs.anl.gov/new",">","index.html","breadcrumbs","None","None","0");</script>
- <!-- InstanceEndEditable --></span></td>
- </tr>
- <tr valign="top">
- <td nowrap><table width="100%" border="0" cellpadding="5" cellspacing="0">
- <tr>
- <td><!-- InstanceBeginEditable name="mainFeature" -->
-#if $failures
+{% extends "base.html" %}
+
+{% block pagebanner %}
+ <div class="header">
+ <h2>Search Results</h2>
+ </div>
+ <br/>
+{% endblock %}
+
+{% block sidebar %}
+<a href="/hostbase/" class="sidebar">new search</a>
+{% endblock %}
+
+{% block content %}
+
+{% if failures %}
There were errors in the following fields<br><br>
-#for $failure in $failures
+{% for failure in failures %}
-<font color="#FF0000">$failure</font><br>
+<font color="#FF0000">{{ failure }}</font><br>
-#end for
-#end if
+{% endfor %}
+{% endif %}
<br>
Press the back button on your browser and edit those field(s)
- <!-- InstanceEndEditable --></td>
- </tr>
- </table></td>
- </tr>
- <tr valign="top">
- <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td colspan="2" align="left"><hr size="1"></td>
- </tr>
- <tr valign="top">
- <td colspan="2" align="center"><table border="0" cellspacing="0" cellpadding="5">
- <tr>
- <td><a href="http://www.doe.gov/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_doe.gif" alt="U.S. Department of Energy" width="153" height="35" border="0"></a></td>
- <td><a href="http://www.uchicago.edu/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_uofc.gif" alt="The University of Chicago" width="125" height="34" border="0"></a></td>
-
- <td><!-- InstanceBeginEditable name="sponsorLogos" --><!-- #BeginLibraryItem "/Library/logoOfficeOfScience.lbi" --><a href="http://www.sc.doe.gov/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_doe_science.gif" alt="Office of Science - Department of Energy" width="143" height="31" border="0"></a><!-- #EndLibraryItem --><!-- InstanceEndEditable --></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td colspan="2" align="center"> <table cellspacing="0" cellpadding="2" border="0">
- <tr>
- <td class="footerText"><a href="http://www.anl.gov/notice.html">Privacy &amp; Security Notice</a>&nbsp;|&nbsp;<a href="http://www.anl.gov/Administration/contactus.html">Contact Us</a></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
-</table>
-</body>
-<!-- InstanceEnd --></html>
-
+{% endblock %} \ No newline at end of file
diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/host.html b/src/lib/Server/Hostbase/hostbase/webtemplates/host.html
index 1a89ea6c1..f66c935f2 100644
--- a/src/lib/Server/Hostbase/hostbase/webtemplates/host.html
+++ b/src/lib/Server/Hostbase/hostbase/webtemplates/host.html
@@ -8,10 +8,11 @@
{% endblock %}
{% block sidebar %}
+<a href="/hostbase/" class="sidebar">new search</a>
<ul class="sidebar">
- <li><a href="dns/" class="sidebar">Detailed DNS Info</a></li>
- <li><a href="edit/" class="sidebar">Edit Host Entry</a></li>
- <li><a href="dns/edit/" class="sidebar">Edit Detailed DNS Info</a></li>
+ <li><a href="dns/" class="sidebar">detailed dns info</a></li>
+ <li><a href="edit/" class="sidebar">edit host info</a></li>
+ <li><a href="dns/edit/" class="sidebar">edit dns info</a></li>
</ul>
{% endblock %}
@@ -69,9 +70,7 @@
{% endfor %}
<tr> <td valign="top"> <b>comments</b></td>
<td>
- {% for line in comments %}
- {{ line }}<br>
- {% endfor %}
+ {{ host.comments|linebreaksbr }}<br>
</td></tr>
</table>
diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/new.html b/src/lib/Server/Hostbase/hostbase/webtemplates/new.html
index bb00e57b0..7ed664368 100644
--- a/src/lib/Server/Hostbase/hostbase/webtemplates/new.html
+++ b/src/lib/Server/Hostbase/hostbase/webtemplates/new.html
@@ -1,87 +1,19 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><!-- InstanceBegin template="/Templates/publicFull.dwt" codeOutsideHTMLIsLocked="false" -->
-<head>
-<link href="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/stylesheets/argonne.css" rel="stylesheet" type="text/css">
-<link href="http://www.anl.gov/favicon.ico" rel="SHORTCUT ICON">
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/anlmain.js" type="text/JavaScript"></script>
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/stm31.js" type="text/JavaScript"></script>
-<!-- InstanceBeginEditable name="head" -->
-<!-- Insert page specific head elements in this region, including custom javascript -->
-<!-- TemplateBeginEditable name="head" -->
-<script language="JavaScript" src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/javascript/main.js" type="text/JavaScript"></script>
-<!-- TemplateEndEditable --><!-- InstanceEndEditable -->
-<!-- InstanceBeginEditable name="title" -->
-<title></title>
-<!-- InstanceEndEditable -->
-<!-- InstanceBeginEditable name="metadata" -->
-<meta name="description" content="">
-<meta name="keywords" content="">
-<meta name="classification" content="">
-<meta name="author" content="Argonne National Laboratory">
-<meta name="expires" content="">
-<!-- InstanceEndEditable -->
-<!-- InstanceParam name="Contact URL" type="URL" value="../about/contacts.html" --><!-- InstanceParam name="Sitemap URL" type="URL" value="../Division/sitemap.html" --><!-- InstanceParam name="Search URL" type="URL" value="../About/search.html" --><!-- InstanceParam name="enableOptionalSponsorLogos" type="boolean" value="true" --><!-- InstanceParam name="enableNavBarTabs" type="boolean" value="true" --><!-- InstanceParam name="enableNavBarSearch" type="boolean" value="false" --><!-- InstanceParam name="enableOptionalSitemapFooter" type="boolean" value="false" --><!-- InstanceParam name="enableOptionalSearchFooter" type="boolean" value="false" -->
-</head>
-<body>
-<table width="100%" border="0" cellpadding="0" cellspacing="3">
- <tr>
- <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr class="headerBkgd" valign="middle">
- <td width="10"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" height="10" width="10" border="0" alt=""></td>
- <td width="300" align="left"><a href="http://www.anl.gov"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/argonne_header_logo.jpg" alt="Argonne National Laboratory" width="227" height="100" border="0"></a></td>
- <td><span class="sectionTitle"><!-- InstanceBeginEditable name="divisionProgramIdentity" --><img src="http://www-unix.mcs.anl.gov/hostbaseweb/images/mcs_logo_white_minus_logo_small.png" width="92" height="31"><br>
- <a href="http://www.mcs.anl.gov">Mathematics
- and Computer Science </a><!-- InstanceEndEditable --></span></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
-
- <tr> <!-- InstanceBeginRepeat name="localNavigation" --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --> <a href="http://www.mcs.anl.gov">About
- Us</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --><a href="http://www-fp.mcs.anl.gov/division/research/">Research</a><!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --> <a href="../research/index.html"></a><a href="http://www-fp.mcs.anl.gov/division/resources/">Facilities</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" --><a href="http://www-fp.mcs.anl.gov/division/people/">Staff</a><!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/software/">Software</a> <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/collaboration">Collaborations </a>
- <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
- <td nowrap class="navGlobalBkgd"><span class="navGlobal"><!-- InstanceBeginEditable name="localNavigationItem" -->
- <a href="http://www-fp.mcs.anl.gov/division/information/">Information</a>
- <!-- InstanceEndEditable --></span></td>
- <td width="3" nowrap><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="3" height="1" border="0" alt=""></td>
- <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
-
- <td class="navGlobalBkgd" width="50%"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/spacer.gif" width="1" height="30" border="0" alt=""></td>
- </tr> </table>
- <!-- #EndLibraryItem --></td>
- </tr>
- <tr>
- <td class="greyBkgdLight"><span class="breadcrumbs"><a href="http://www.mcs.anl.gov/">MCS
- Home</a> &gt; <!-- InstanceBeginEditable name="topLevelBreadcrumbs" -->
- <script language="JavaScript">breadCrumbs("www-unix.mcs.anl.gov/new",">","","breadcrumbs","None","None","0");</script>
- <!-- InstanceEndEditable --></span></td>
- </tr>
- <tr valign="top">
- <td nowrap><table width="100%" border="0" cellpadding="5" cellspacing="0">
- <tr>
- <td><!-- InstanceBeginEditable name="mainFeature" -->
-<b> Enter new host information </b>
+{% extends "base.html" %}
+
+{% block pagebanner %}
+ <div class="header">
+ <h2>new host information</h2>
+ </div>
+ <br/>
+{% endblock %}
+
+{% block sidebar %}
+<ul class="sidebar">
+ <li><a href="/hostbase/" class="sidebar">search</a></li>
+</ul>
+{% endblock %}
+
+{% block content %}
<form name="hostdata" action="?sub=true" method="post">
<input type="hidden" name="host">
@@ -96,24 +28,24 @@
<tr> <td> <b>netgroup</b></td>
<td>
<select name="netgroup">
- #for $choice in $NETGROUP_CHOICES
- <option value="$choice[0]">$choice[1]
- #end for
+ {% for choice in NETGROUP_CHOICES %}
+ <option value="{{ choice.0 }}">{{ choice.1 }}
+ {% endfor %}
</select>
</td></tr>
<tr> <td> <b>class</b></td>
<td>
<select name="security_class">
- #for $choice in $CLASS_CHOICES
- <option value="$choice[0]">$choice[1]
- #end for
+ {% for choice in CLASS_CHOICES %}
+ <option value="{{ choice.0 }}">{{ choice.1 }}
+ {% endfor %}
</select></td></tr>
<tr> <td> <b>support</b></td>
<td>
<select name="support">
- #for $choice in $SUPPORT_CHOICES
- <option value="$choice[0]">$choice[1]
- #end for
+ {% for choice in SUPPORT_CHOICES %}
+ <option value="{{ choice.0 }}">{{ choice.1 }}
+ {% endfor %}
</select></td></tr>
<tr> <td> <b>csi</b></td>
<td> <input name="csi" type="text" ></td></tr>
@@ -134,18 +66,18 @@
<tr> <td> <b>expiration_date</b></td>
<td> <input name="expiration_date" type="text" size="10" >YYYY-MM-DD</td></tr>
<tr> <td><br><b>Interface</b></td><td><br>
- #for $choice in $TYPE_CHOICES
- <input type="radio" name="hdwr_type_new" value="$choice[0]" >$choice[1]
- #end for
+ {% for choice in TYPE_CHOICES %}
+ <input type="radio" name="hdwr_type_new" value="{{ choice.0 }}" >{{ choice.1 }}
+ {% endfor %}
</td></tr>
<tr> <td> <b>mac_addr</b></td>
<td> <input name="mac_addr_new" type="text"></td></tr>
<tr> <td> <b>ip_addr</b></td>
<td> <input name="ip_addr_new" type="text"></td></tr>
<tr> <td><br><b>Interface</b></td><td><br>
- #for $choice in $TYPE_CHOICES
- <input type="radio" name="hdwr_type_new2" value="choice[0]" >$choice[1]
- #end for
+ {% for choice in TYPE_CHOICES %}
+ <input type="radio" name="hdwr_type_new2" value="{{ choice.0 }}" >{{ choice.1 }}
+ {% endfor %}
</td></tr>
<tr> <td> <b>mac_addr</b></td>
<td> <input name="mac_addr_new2" type="text"></td></tr>
@@ -157,35 +89,6 @@
<br>
<p><input type="submit" value="Submit">
</form>
- <!-- InstanceEndEditable --></td>
- </tr>
- </table></td>
- </tr>
- <tr valign="top">
- <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td colspan="2" align="left"><hr size="1"></td>
- </tr>
- <tr valign="top">
- <td colspan="2" align="center"><table border="0" cellspacing="0" cellpadding="5">
- <tr>
- <td><a href="http://www.doe.gov/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_doe.gif" alt="U.S. Department of Energy" width="153" height="35" border="0"></a></td>
- <td><a href="http://www.uchicago.edu/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_uofc.gif" alt="The University of Chicago" width="125" height="34" border="0"></a></td>
-
- <td><!-- InstanceBeginEditable name="sponsorLogos" --><!-- #BeginLibraryItem "/Library/logoOfficeOfScience.lbi" --><a href="http://www.sc.doe.gov/"><img src="http://www-unix.mcs.anl.gov/hostbaseweb/anl_templates/images/logos/footer_doe_science.gif" alt="Office of Science - Department of Energy" width="143" height="31" border="0"></a><!-- #EndLibraryItem --><!-- InstanceEndEditable --></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td colspan="2" align="center"> <table cellspacing="0" cellpadding="2" border="0">
- <tr>
- <td class="footerText"><a href="http://www.anl.gov/notice.html">Privacy &amp; Security Notice</a>&nbsp;|&nbsp;<a href="http://www.anl.gov/Administration/contactus.html">Contact Us</a></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
-</table>
-</body>
-<!-- InstanceEnd --></html>
+
+{% endblock %}
diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/results.html b/src/lib/Server/Hostbase/hostbase/webtemplates/results.html
index 4413e0527..3db1a8c9b 100644
--- a/src/lib/Server/Hostbase/hostbase/webtemplates/results.html
+++ b/src/lib/Server/Hostbase/hostbase/webtemplates/results.html
@@ -6,6 +6,11 @@
</div>
<br/>
{% endblock %}
+
+{% block sidebar %}
+<a href="/hostbase/" class="sidebar">new search</a>
+{% endblock %}
+
{% block content %}
{% if hosts %}