summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorKen Raffenetti <raffenet@mcs.anl.gov>2006-09-11 16:55:45 +0000
committerKen Raffenetti <raffenet@mcs.anl.gov>2006-09-11 16:55:45 +0000
commit3f1134a665925748b13dc3832e1cfd5722b9c9e8 (patch)
tree4c6d4dfd8490bf9b631deb8c9fbd4a85144c5a29 /src/lib
parent499b088328c0b6ac57154840001a3d7da03a1638 (diff)
downloadbcfg2-3f1134a665925748b13dc3832e1cfd5722b9c9e8.tar.gz
bcfg2-3f1134a665925748b13dc3832e1cfd5722b9c9e8.tar.bz2
bcfg2-3f1134a665925748b13dc3832e1cfd5722b9c9e8.zip
modifying web templates
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2239 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Hostbase/hostbase/views.py9
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/base.html35
-rw-r--r--src/lib/Server/Hostbase/hostbase/webtemplates/search.html154
-rw-r--r--src/lib/Server/Hostbase/settings.py1
4 files changed, 64 insertions, 135 deletions
diff --git a/src/lib/Server/Hostbase/hostbase/views.py b/src/lib/Server/Hostbase/hostbase/views.py
index c3b850442..76eed63c0 100644
--- a/src/lib/Server/Hostbase/hostbase/views.py
+++ b/src/lib/Server/Hostbase/hostbase/views.py
@@ -93,11 +93,10 @@ def search(request):
return render_to_response('%s/results.html' % templatedir, {'hosts': results})
else:
- temp = Template(open('%s/search.html' % templatedir).read())
- temp.TYPE_CHOICES = Interface.TYPE_CHOICES
- temp.DNS_CHOICES = Name.DNS_CHOICES
- temp.yesno = [(1, 'yes'), (0, 'no')]
- return HttpResponse(str(temp))
+ return render_to_response('%s/search.html' % templatedir,
+ {'TYPE_CHOICES': Interface.TYPE_CHOICES,
+ 'DNS_CHOICES': Name.DNS_CHOICES,
+ 'yesno': [(1, 'yes'), (0, 'no')]})
def look(request, host_id):
"""Displays general host information"""
diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/base.html b/src/lib/Server/Hostbase/hostbase/webtemplates/base.html
new file mode 100644
index 000000000..04c519717
--- /dev/null
+++ b/src/lib/Server/Hostbase/hostbase/webtemplates/base.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>{% block title %}BCFG2 - Hostbase{% endblock %}</title>
+ <link rel="stylesheet" type="text/css" href="http://hostbase.mcs.anl.gov:8080/site_media/boxypastel.css" />
+ <link rel="stylesheet" type="text/css" href="http://hostbase.mcs.anl.gov:8080/site_media/base.css" />
+ <script type="text/javascript" src="http://hostbase.mcs.anl.gov/site_media/main.js">
+ </script>
+ {% block extra_header_info %}{% endblock %}
+</head>
+
+<body>
+ <div id="header">
+ <div id="branding">
+ <h1>BCFG2</h1>
+ </div>
+ <div id="user-tools">...Change is Coming...</div>
+ </div>
+ <div id="sidebar">
+ {% block sidebar %}
+ <ul class="sidebar">
+ </ul>
+ {% endblock %}
+ </div>
+
+ <div id="content-main">
+ <div id="container">
+ {% block pagebanner %}{% endblock %}
+ {% block content %}{% endblock %}
+
+ </div>
+ </div>
+</body>
+</html>
diff --git a/src/lib/Server/Hostbase/hostbase/webtemplates/search.html b/src/lib/Server/Hostbase/hostbase/webtemplates/search.html
index 29a684b1a..f8053e229 100644
--- a/src/lib/Server/Hostbase/hostbase/webtemplates/search.html
+++ b/src/lib/Server/Hostbase/hostbase/webtemplates/search.html
@@ -1,91 +1,15 @@
-<!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" -->
- <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>
-</td>
- </tr>
- <tr valign="top">
- <td nowrap><table width="100%" border="0" cellpadding="5" cellspacing="0">
- <tr>
- <td><!-- InstanceBeginEditable name="mainFeature" -->
-<h2>Welcome to the hostbase database!</h2>
+{% extends "base.html" %}
+
+{% block pagebanner %}
+ <div class="header">
+ <h1>Welcome to Hostbase!</h1>
+ </div>
+ <br/>
+{% endblock %}
+{% block content %}
Find hosts using one or more of the searchable fields below.<br>
-#*...or go to <a href="hostinfo">this</a>
- page to enter hostinfo-like queries<br><br>*#
+<!-- ...or go to <a href="hostinfo">this</a>
+ page to enter hostinfo-like queries<br><br> -->
<form name="input" action="?sub=true" method="post">
<table border="0" width="100%">
<colgroup>
@@ -108,15 +32,15 @@ Find hosts using one or more of the searchable fields below.<br>
<td> <input name="printq" type="text" ></td></tr>
<tr> <td> <b>dhcp</b></td>
<td>
- #for $choice in $yesno
- <input type="radio" name="dhcp" value="$choice[0]" >$choice[1]
- #end for
+ {% for choice in yesno %}
+ <input type="radio" name="dhcp" value="{{ choice.0 }}" >{{ choice.1 }}
+ {% endfor %}
</td></tr>
<tr> <td> <b>outbound_smtp</b></td>
<td>
- #for $choice in $yesno
- <input type="radio" name="outbound_smtp" value="$choice[0]" >$choice[1]
- #end for
+ {% for choice in yesno %}
+ <input type="radio" name="outbound_smtp" value="{{ choice.0 }}" >{{ choice.1 }}
+ {% endfor %}
</td></tr>
<tr> <td> <b>primary_user</b></td>
<td> <input name="primary_user" type="text" size="32" ></td></tr>
@@ -127,9 +51,9 @@ Find hosts using one or more of the searchable fields below.<br>
<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" value="$choice[0]" >$choice[1]
- #end for
+ {% for choice in TYPE_CHOICES %}
+ <input type="radio" name="hdwr_type" value="{{ choice.0 }}" >{{ choice.1 }}
+ {% endfor %}
</td></tr>
<tr> <td> <b>mac_addr</b></td>
<td> <input name="mac_addr" type="text"></td></tr>
@@ -138,9 +62,9 @@ Find hosts using one or more of the searchable fields below.<br>
<tr> <td> <b>name</b></td>
<td> <input name="name" type="text"></td></tr>
<tr> <td><b>dns_view</b></td><td>
- #for $choice in $DNS_CHOICES
- <input type="radio" name="dns_view" value="$choice[0]" >$choice[1]
- #end for
+ {% for choice in DNS_CHOICES %}
+ <input type="radio" name="dns_view" value="{{ choice.0 }}" >{{ choice.1 }}
+ {% endfor %}
</td></tr>
<tr> <td> <b>cname</b></td>
<td> <input name="cname" type="text"></td></tr>
@@ -150,34 +74,4 @@ Find hosts using one or more of the searchable fields below.<br>
<p>
<input type="submit" value="Search">
</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 %} \ No newline at end of file
diff --git a/src/lib/Server/Hostbase/settings.py b/src/lib/Server/Hostbase/settings.py
index 330c99f3b..604195622 100644
--- a/src/lib/Server/Hostbase/settings.py
+++ b/src/lib/Server/Hostbase/settings.py
@@ -62,6 +62,7 @@ ROOT_URLCONF = 'Hostbase.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates".
# Always use forward slashes, even on Windows.
+ '/disks/bcfg2/Hostbase/hostbase/webtemplates'
)
INSTALLED_APPS = (