Source

better-scm / template.wml

Full commit
# #use wml::des::navbar
#include '../lib/bk-note.wml'

<:{
use MyNavData;
use HTML::Widgets::NavMenu;
use CGI qw();
use MyNavLinks;

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' => "berlios",
    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
        ));

use vars qw($nav_links_renderer);

$nav_links_renderer = MyNavLinks->new(
        'nav_links' => $nav_links,
        'root' => "$(ROOT)",
        );
}:>

# The Definition of the page itself
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE
    html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<title>{#SUBJECT_LOC#}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Author" content="Shlomi Fish" />
<meta name="Keywords" content="Better SCM, SCM, version control, source control, revision control, source configuration management, CVS, Subversion, BitKeeper, open source, Shlomi Fish{#MORE_KEYWORDS#}" />
<link rel="stylesheet" href="$(ROOT)/style.css" type="text/css" media="screen, projection" title="Normal" />
<link rel="stylesheet" href="$(ROOT)/print.css" type="text/css" media="print" />
<:{
my @keys = (sort { $a cmp $b } keys(%$nav_links));
foreach my $key (@keys)
{
    my $url = CGI::escapeHTML($nav_links->{$key});
    print "<link rel=\"$key\" href=\"$url\" />\n"
}
}:>
</head>
<body>

<p style="display:none;">
<a href="#main">Go to main content</a>
</p>

<div class="leading_path">
<:{ 
    print $leading_path_string;
}:>
</div>
<div class="navbar">
<p style="display:none;">
<a href="#nav_menu">Go to the navigation menu</a>
</p>

<a href="$(ROOT)/" title="Home"><img 
    src="$(ROOT)/images/better-scm-logo.png"
    alt="Better SCM" class="bless" /></a>
<:{
   print $nav_links_renderer->get_total_html('with_accesskey' => 1);
}:>
<div id="nav_menu">
<:{ print join("\n", @$nav_html); }:>
</div>
<define-tag validhtml>
<p>
<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=70"><img 
   style="margin-top:1em;" class="bless" alt="Get Firefox!" 
   title="Get Firefox! A safer, faster, better web-browser." 
   src="$(ROOT)/images/get-firefox.png" /></a>
</p>
<p>
<a href="http://validator.w3.org/check/referer" title="Valid XHTML 1.0!"><img 
    class="highlight bless"
    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 bless"
    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" class="bless" 
width="100" height="50" /></a>
</p>
</define-tag>

<validhtml />
<:{
   print $nav_links_renderer->get_total_html('with_accesskey' => 0);
}:>
</div>

<div class="main" id="main">
<h1>{#SUBJECT_LOC#}</h1>
{#BODY#}

</div>

<div class="footer">
<hr />
<p class="webmaster">
Webmaster: <a href="http://www.shlomifish.org/">Shlomi Fish</a> (<a href="mailto:shlomif@iglu.org.il">shlomif@iglu.org.il</a>)
</p>

<div class="righty">
<p>
<!-- Creative Commons License -->
<a rel="license" href="http://creativecommons.org/licenses/by/2.0/"><img 
alt="Creative Commons License"
src="$(ROOT)/images/somerights20.png" /></a><br />
This work is licensed under a <a rel="license" 
href="http://creativecommons.org/licenses/by/2.0/">Creative Commons 
License</a>.
<!-- /Creative Commons License -->
</p>

<!--

<rdf:RDF xmlns="http://web.resource.org/cc/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
   <dc:title>Better SCM Site Contents</dc:title>
   <dc:date>2004</dc:date>
   <dc:description>A Version Control Systems Information and Advocacy carrying site</dc:description>
   <dc:creator><Agent>
      <dc:title>Shlomi Fish</dc:title>
   </Agent></dc:creator>
   <dc:rights><Agent>
      <dc:title>Shlomi Fish</dc:title>
   </Agent></dc:rights>
   <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
   <license rdf:resource="http://creativecommons.org/licenses/by/2.0/" />
</Work>

<License rdf:about="http://creativecommons.org/licenses/by/2.0/">
   <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
   <permits rdf:resource="http://web.resource.org/cc/Distribution" />
   <requires rdf:resource="http://web.resource.org/cc/Notice" />
   <requires rdf:resource="http://web.resource.org/cc/Attribution" />
   <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
</License>

</rdf:RDF>

-->
</div>
</div>

</body>
</html>

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

<define-tag more_keywords>
{#MORE_KEYWORDS#:, %0:##}
</define-tag>

#   per default we are in body
{#BODY#: