shlomi-fish-homepage / template.wml

# #use wml::des::navbar
#include '../std/logo.wml'

<:{
use MyNavData;
use HTML::Widgets::NavMenu;

my $filename = "$(FILENAME)";
$filename =~ s!index\.html$!!;
$filename = "/$filename";

use vars qw($nav_bar);

$nav_bar = HTML::Widgets::NavMenu->new(
    'path_info' => $filename,
    'current_host' => "$(SERVER)",
    MyNavData::get_params(),
    'ul_classes' => [ "navbarmain", ("navbarnested") x 10 ],
    );

my $rendered_results = $nav_bar->render();

use vars qw($nav_links);

$nav_links = $rendered_results->{nav_links};

use vars qw($nav_html);

$nav_html = $rendered_results->{html};

my $leading_path = $rendered_results->{leading_path};

my $render_leading_path_component = sub {
    my $component = shift;
    my $title = $component->title();
    my $title_attr = defined($title) ? " title=\"$title\"" : "";
    return "<a href=\"" . CGI::escapeHTML($component->direct_url()) .
        "\"$title_attr>" .
        $component->label() . "</a>";
};

use vars qw($leading_path_string);

$leading_path_string =
    join(" &rarr; ",
        (map
        { $render_leading_path_component->($_) }
        @$leading_path
        ));

}:>


# Utility Functions.

<define-tag software_patents>1</define-tag>

<define-tag mynot><if "%0" "" "1" /></define-tag>

<define-tag printable_style>
<style type="text/css">
table.cv { width : 100% ; border : none ; }
table.cv td { vertical-align : top }
</style>
</define-tag>

# The Definition of the page itself
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>{#SUBJECT_LOC#}</title>
<link rel="StyleSheet" href="$(ROOT)/style.css" type="text/css" />
<link rel="shortcut icon" href="$(ROOT)/favicon.ico" type="image/x-icon" />
<:{
use CGI qw();

my @keys = (sort { $a cmp $b } keys(%$nav_links));
foreach my $key (@keys)
{
    my $url = $nav_links->{$key};
    print "<link rel=\"$key\" href=\"" . CGI::escapeHTML($url) . "\" />\n"
}
}:>
<if "$(PRINTABLE)" "<printable_style />" "" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<define-tag rellink whitespace="delete">
<preserve url />
<preserve host />
<preserve title />
<set-var %attributes />
<set-var host=<if "<get-var host />" "<get-var host />" "t2" /> />
<if <match "<get-var url />" "^http://" action="report" />
    "<get-var url />" 
    <ifeq "$(SERVER)" "<get-var host />"
        "$(ROOT)/<get-var url />"
        <ifeq "<get-var host />" "t2"
            "http://www.shlomifish.org/<get-var url />"
            "http://vipe.technion.ac.il/~shlomif/<get-var url />"
            />
    />
/>
<restore title />
<restore host />
<restore url /></define-tag>

<define-tag vipe:url>http://vipe.technion.ac.il/~shlomif/%0</define-tag>

<define-tag validhtml>
<p>
<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=70"><img 
   style="margin-top:1em; border:0;" alt="Get Firefox!" 
   title="Get Firefox! A safer, faster, better web-browser." 
   src="$(ROOT)/images/get-firefox.gif" /></a>
</p>
<p>
<a href="http://validator.w3.org/check/referer" title="Valid XHTML 1.0!"><img 
    class="highlight" style="border:0;" 
    src="$(ROOT)/images/valid-xhtml10.png" 
    alt="Valid XHTML 1.0!" height="31" width="88" 
    /></a>
</p>
<p>
 <a href="http://jigsaw.w3.org/css-validator/" title="Valid CSS!"><img 
    class="highlight" style="border:0;"
    src="$(ROOT)/images/valid-css.png" 
    alt="Valid CSS!" /></a>
</p>
<p>
<a href="http://thewml.org/" title="Website META Language"><img 
src="$(ROOT)/images/logo-wml.png" alt="Website Meta Language" style="border:0" 
width="100" height="50" /></a>
</p>
<p>
<a href="<rellink url="no-ie/" host="t2" />" title="Stop Using Internet Explorer!"><img src="$(ROOT)/images/noIE.png" 
class="highlight" style="border:0" 
alt="Stop Using Internet Explorer!" /><br />
Stop Using Internet Explorer!</a>
</p>
</define-tag>


<define-tag start_table>
<table summary="Layout Table: The first cell contains a navigation bar, the second the main page" border="0" width="99%">
<tr>
<td colspan="2" class="leading_path">
<:{ 
    print +($leading_path_string || 
        ("<a href=\"<rellink url="" host="t2" title="Home" />\" " . 
         "title=\"Shlomi Fish' Homepage\">Shlomi Fish</a>")
         );
}:>
</td>
</tr>
<tr>
<td valign="top" class="navbar" style="width:20%">

<if "<software_patents />" 
    "<div class="center"><a href="http://swpat.ffii.org/" 
     title="Stop Software Patents!"><img 
     src="$(ROOT)/images/noepatents_liberty.png" 
     alt="Stop Software Patents" class="highlight" 
     style="border:0;margin-bottom:0.5em;" /></a></div>"
    ""
    />
<:{ 
    my $nav_buttons_html = "";
    foreach my $button 
        (
            { 
                'dir' => "prev", 
                'button' => "left", 
                'title' => "Previous Page",
            },
            { 
                'dir' => "up", 
                'button' => "up", 
                'title' => "Up in the Site",
            },
            {
                'dir' => "next", 
                'button' => "right", 
                'title' => "Next Page",
            },
       )
   {
        my $dir = $button->{dir};
        my $key = substr($dir, 0, 1);
        my $key_uc = uc($key);
        $nav_buttons_html .= "<a href=\"" . CGI::escapeHTML($nav_links->{$button->{dir}}) . 
            "\" title=\"$button->{title} (Alt+$key_uc)\" accesskey=\"$key\"><img src=\"$(ROOT)/images/arrow-$button->{button}.png\" alt=\"$button->{title}\" style=\"border:0\" /></a>\n";
   }
   print "<div class=\"center\">\n$nav_buttons_html\n</div>";
}:>    
<:{ print join("\n", @$nav_html); }:>
<p>
<a href="<rellink host="t2" url="site-map/" />"><b>Site Map</b></a>
</p>

<validhtml />

</td>
<td valign="top" class="main">
</define-tag>

# </define-tag>
<if "<mynot "$(PRINTABLE)" />" "<start_table />" "" />

<h1>{#SUBJECT_LOC#}</h1>
{#BODY#}

<define-tag end_table>
</td>
</tr>
</table>
<hr />



<define-tag hosted:at:tech>
<div class="rightalign">
<a href="http://www.actcom.co.il/"><img src="images/actcom-50-2.gif" 
   alt="Hosted at Actcom" class="highlight" style="border : 0" 
   title="Hosted at Actcom" /></a>
</div>
</define-tag>

<define-tag backtomyhp>
<div>
<a href="<rellink url="" host="t2" />"><img src="$(ROOT)/images/bk2hp.png" class="highlight" style="border : 0" alt="Back to my Homepage" /></a>
</div>
</define-tag>
<p>
Written, designed and maintained by Shlomi Fish, <a href="mailto:shlomif@iglu.org.il">shlomif@iglu.org.il</a>
</p>

;;; If it is the t2 index than display the hosted:at:tech macro
;;; Else - display the back to my homepage image
<if <ifeq "$(FILENAME)" "index.html" 
        <ifeq "$(SERVER)" "t2" "t2" "" /> "" /> 
    <hosted:at:tech />
    <backtomyhp />
    />
</define-tag>

<if <mynot "$(PRINTABLE)" /> "<end_table />" "" />

</body>
</html>



<define-tag subject>
{#SUBJECT_LOC#:%0:##}
</define-tag>

<define-tag longblank>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</define-tag>

<define-tag email:link>
<a href="mailto:%0">%0</a>
</define-tag>

#   per default we are in body
{#BODY#:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.