Changeset 451


Ignore:
Timestamp:
07/28/10 16:46:21 (14 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Move Javascript from the header into its own file
Convert index page (master block summary) to template
Convert header to template, use template header in main.cgi
and search.cgi - going to leave admin.cgi out for now
Update HTML in header, index, footer to HTML 4.01 strict
See #3.

Location:
branches/htmlform
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/main.cgi

    r450 r451  
    5555$ENV{HTML_TEMPLATE_ROOT} = '/home/kdeugau/dev/ipdb/trunk/templates';
    5656
    57 # Headerize!  Make sure we replace the $$EXTRA0$$ bit as needed.
    58 printHeader('', ($IPDBacl{$authuser} =~ /a/ ?
    59         '<td align=right><a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a>' : ''
    60         ));
     57my $header = HTML::Template->new(filename => "header.tmpl");
     58$header->param(version => $IPDB::VERSION);
     59$header->param(addperm => $IPDBacl{$authuser} =~ /a/);
     60print "Content-type: text/html\n\n", $header->output;
    6161
    6262# Set up the CGI object...
  • branches/htmlform/cgi-bin/search.cgi

    r449 r451  
    7474}
    7575
    76 # Headerize!  Make sure we replace the $$EXTRA0$$ bit as needed.
    77 printHeader('', ($IPDBacl{$authuser} =~ /a/ ?
    78         '<td align=right><a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a></td>' : ''
    79         ));
     76my $header = HTML::Template->new(filename => "header.tmpl");
     77$header->param(version => $IPDB::VERSION);
     78$header->param(addperm => $IPDBacl{$authuser} =~ /a/);
     79print "Content-type: text/html\n\n", $header->output;
    8080
    8181if ($webvar{stype} eq 'q') {
  • branches/htmlform/ipdb.css

    r450 r451  
     1/* Default/global defs for specific tags */
     2fieldset {
     3        border: none;
     4        padding: 0px;
     5        margin: 0px;
     6}
     7
    18/* Specific divs */
     9#bodyheader {
     10        margin-left: 4px;
     11        position: relative;
     12}
     13#homelink {
     14        font-size: 13px;
     15        font-weight: bold;
     16        position: absolute;
     17        right: 10px;
     18        bottom: 2px;
     19        text-align: right;
     20}
     21#subheader {
     22        background-color: #D0E0E0;
     23        font-size: 90%;
     24        padding: 3px;
     25        border-top: thin solid #000000;
     26        /* apparently this is required to keep "contained" position: absolute divs from escaping.  O_o */
     27        position: relative;
     28}
     29#csearch {
     30        float: right;
     31        padding: 3px;
     32}
     33#newlink {
     34        position: absolute;
     35        right: 10px;
     36        top: 6px;
     37        text-align: right;
     38}
     39#main {
     40        padding: 10px;
     41        border-top: thin solid #000000;
     42/*        text-align: center;*/
     43        padding-top: 20px;
     44        position: relative;
     45}
     46#utils {
     47        font-size: 13px;
     48        font-weight: bold;
     49        position: absolute;
     50        right: 10px;
     51        top: 2px;
     52        text-align: right;
     53}
    254#adminlink {
    355        position: absolute;
     
    2779a:hover         { color:#dd00dd; }      /* mouse over link */
    2880a:active        { color:#cc0000; }      /* selected link */
     81
     82table.centre {
     83        margin-left: auto;
     84        margin-right: auto;
     85}
    2986
    3087/* Defs for bulk-data rows */
     
    81138}
    82139
     140/* Generic classes */
    83141.indent {
    84142        margin-left: 5%;
  • branches/htmlform/templates/footer.tmpl

    r450 r451  
    11<br>
    22<!-- Done with the main div opened in the header template -->
    3 <TMPL_IF NAME=adminlink><div id=adminlink><a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div></TMPL_IF>
     3<TMPL_IF NAME=adminlink><div id="adminlink"><a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div></TMPL_IF>
    44</div>
    55
    6 <div id=footer>
    7 <div id=contact>DeepNet <a href="http://projects.deepnet.cx/trac/ipdb" target="_blank">IP Database</a> |
    8  Copyright 2004-2010 <a href="mailto:kdeugau@deepnet.cx">Kris Deugau</a><br />
     6<div id="footer">
     7<div id="contact">DeepNet <a href="http://projects.deepnet.cx/trac/ipdb">IP Database</a> |
     8 Copyright 2004-2010 <a href="mailto:kdeugau@deepnet.cx">Kris Deugau</a><br>
    99Written for standards-based browsers (eg <a href="http://www.mozilla.org">Mozilla</a>)
    1010</div>
  • branches/htmlform/templates/index.tmpl

    r450 r451  
    11<br>
    2 <center><table width="98%" cellspacing="0" class="center"><tr class=heading>
     2<div class="center">
     3<table class="centre" width="98%" cellspacing="0">
     4<tr class="heading">
    35<td>Master netblock</td>
    46<td>Routed netblocks</td>
    57<td>Allocated netblocks</td>
    6 <td>Free netblocks</td><td>Largest free block</td>
     8<td>Free netblocks</td>
     9<td>Largest free block</td>
    710</tr>
    811<TMPL_LOOP NAME=masterlist>
    912<tr class="<TMPL_VAR name=rowclass>">
    10 <td><a href="/ip/cgi-bin/main.cgi?action=showmaster&block=<TMPL_VAR NAME=master>"><TMPL_VAR NAME=master></a></td>
     13<td><a href="/ip/cgi-bin/main.cgi?action=showmaster&amp;block=<TMPL_VAR NAME=master>"><TMPL_VAR NAME=master></a></td>
    1114<td><TMPL_VAR NAME=routed></td>
    1215<td><TMPL_VAR NAME=allocated></td>
     
    2124<br><br>
    2225Note:  Free blocks noted here include both routed and unrouted blocks.
    23 </center>
     26</div>
    2427
Note: See TracChangeset for help on using the changeset viewer.