scratch/layouts/default.html

170 lines
6 KiB
HTML
Raw Normal View History

2009-10-09 12:27:31 +00:00
-----
-----
<%
2009-10-12 09:22:31 +00:00
# -- init variables --
class LocalConf
2010-01-19 15:23:37 +00:00
attr_accessor :blog, :article, :languages, :language, :indent
2009-10-12 15:36:17 +00:00
def to_s
instance_variables.map{ |x|
if instance_variable_get(x).class == Array
%{#{x.intern}= [#{instance_variable_get(x).join(', ')}]}
else
%{#{x.intern}= #{instance_variable_get(x)}}
end
}
end
2009-10-09 12:27:31 +00:00
end
2009-10-12 09:22:31 +00:00
conf=LocalConf.new
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
2010-01-19 15:23:37 +00:00
conf.language=language
2009-10-12 09:22:31 +00:00
# the current item is an article
2010-01-19 15:23:37 +00:00
article=( ( not @item[:kind].nil? ) && @item[:kind] == 'article' )
2009-10-12 09:22:31 +00:00
conf.article=article
2010-01-19 15:23:37 +00:00
2009-10-12 09:22:31 +00:00
# the current item is a blog entry page
2010-01-19 15:23:37 +00:00
blog=( ( not @item[:kind].nil? ) && @item[:kind] == 'blog' )
2009-10-12 09:22:31 +00:00
conf.blog=blog
2010-01-19 15:23:37 +00:00
2009-10-12 09:22:31 +00:00
# all supported languages
languages=@config[:languages]
conf.languages=languages
2009-10-12 15:36:17 +00:00
self.instance_variable_set(:@conf, conf)
2009-10-12 09:22:31 +00:00
2010-01-20 16:00:39 +00:00
# puts '--- conf ---'
# puts conf.to_s
2009-10-12 09:22:31 +00:00
2009-10-12 15:36:17 +00:00
%><?xml version="1.0" encoding="utf-8"?>
2009-10-09 12:27:31 +00:00
<!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" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" type="image/x-icon" href="/Scratch/img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/twilight.css" />
2010-01-20 15:20:44 +00:00
<link rel="stylesheet" type="text/css" href="/Scratch/assets/css/layout.css" />
2010-01-01 21:07:55 +00:00
<link rel="stylesheet" type="text/css" href="/Scratch/css/shadows.css" />
2010-01-20 15:20:44 +00:00
<link rel="stylesheet" type="text/css" href="/Scratch/assets/css/gen.css" />
<% if article %>
<link rel="stylesheet" type="text/css" href="/Scratch/css/idc.css" />
<% end %>
2010-01-19 15:23:37 +00:00
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/yannespositocom<%= language %>">
2010-02-19 10:26:31 +00:00
<link rel="stylesheet" type="text/css" href="/Scratch/css/js.css" /> <%
languages.each do |lang|
item_for_lang=item_of_language(lang)
if not item_for_lang.nil? %>
<link rel="alternate" lang="<%= lang %>" xml:lang="<%= lang %>" title="<%= item_for_lang[:title] %>" type="text/html" hreflang="<%= lang %>" href="<%= item_for_lang.reps[0].path %>" /> <%
end
end %>
2009-10-09 12:27:31 +00:00
<script type="text/javascript" src="/Scratch/js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="/Scratch/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Scratch/js/index.js"></script>
<noscript>
2010-01-19 15:23:37 +00:00
<link rel="stylesheet" type="text/css" href="/Scratch/css/nojs.css" />
2009-10-09 12:27:31 +00:00
</noscript>
2010-01-19 15:23:37 +00:00
<title><%= @item[:title] %></title>
</head>
<body lang="<%= language %>">
<script type="text/javascript">
document.write('<div id="blackpage"><p><%= tradOf(:loading) %></p><img src="/Scratch/img/loading.gif" alt="loading logo"/></div>');
</script>
2010-01-20 15:20:44 +00:00
<div id="content">
<div id="entete">
<div id="rss">
<span>
<a href="http://feeds.feedburner.com/yannespositocom<%= language %>">
<%= tradOf(:subscribe) %>
<img src="/Scratch/img/menu/rss-128.png" alt="rss" height="32"/>
</a>
<sup>
<a href="/Scratch/multi/rss"><%= tradOf(:whatsthis) %></a>
</sup>
</span>
</div>
<div id="choix">
2010-01-20 16:00:39 +00:00
<%= tradOf(:langue) %>
2010-01-20 15:20:44 +00:00
<div id="choixlang">
<ul>
<% languages.each do |l| %>
<li><%= l %></li>
<% end %>
</ul>
</div>
</div>
<div id="liens">
2010-02-19 10:26:31 +00:00
<%= generateMenu %>
2010-01-19 15:23:37 +00:00
</div>
2010-01-01 21:07:55 +00:00
</div>
<div id="titre">
<h1>
2010-01-19 15:23:37 +00:00
<%= @item[:title] %>
2010-01-01 21:07:55 +00:00
</h1>
2010-01-19 15:23:37 +00:00
<% unless @item[:subtitle].nil? %>
2009-10-09 12:27:31 +00:00
<h2>
2010-01-19 15:23:37 +00:00
<%= @item[:subtitle] %>
2009-10-09 12:27:31 +00:00
</h2>
<% end %>
</div>
<div class="flush"></div>
2009-10-12 15:36:17 +00:00
<% if @item[:content_for_summary] %>
2010-01-01 21:07:55 +00:00
<div class="corps summary">
2009-10-12 15:36:17 +00:00
<% @item[:content_for_summary] %>
</div>
<% end %>
2010-02-19 10:26:31 +00:00
<%= generateSubMenu %>
2009-10-09 12:27:31 +00:00
<div class="flush"></div>
<div id="afterheader">
<div class="corps">
2009-10-09 14:32:50 +00:00
<%= yield %>
2009-10-09 12:27:31 +00:00
</div>
2010-01-19 15:23:37 +00:00
<% if article %>
<% if depthOf(@item) == 3 %>
<div class="navigation">
2010-02-19 10:26:31 +00:00
<%= puts "previousFor(@item)" %>
<%= puts "nextFor(@item)" %>
2010-01-19 15:23:37 +00:00
</div>
<div class="flush"></div>
<% end %>
2009-10-09 12:27:31 +00:00
2010-01-19 15:23:37 +00:00
<div class="corps" id="comment">
<h2><%= tradOf(:comment) %></h2>
2010-03-12 12:11:05 +00:00
<%= generateIntenseDebateThread %>
2010-01-19 15:23:37 +00:00
</div>
2009-10-09 12:27:31 +00:00
<% end %>
<div id="bottom">
<div>
2010-01-20 15:20:44 +00:00
<%= tradOf(:entirely_done_with) %>
2009-10-09 12:27:31 +00:00
<a href="http://www.vim.org">Vim</a>
2010-01-20 15:20:44 +00:00
<%= tradOf(:and) %>
2009-10-09 12:27:31 +00:00
<a href="http://nanoc.stoneship.org">nanoc</a>
</div>
<div>
2010-01-20 16:00:39 +00:00
<a href="/Scratch/<%=language%>/validation/">Validation</a>
2009-10-09 12:27:31 +00:00
<a href="http://validator.w3.org/check?uri=referer"> [xhtml] </a>
.
<a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"> [css] </a>
.
2010-01-20 16:00:39 +00:00
<a href="http://validator.w3.org/feed/check.cgi?url=http%3A//yannesposito.com/Scratch/<%=language%>/blog/feed/feed.xml">[rss]</a>
2009-10-09 12:27:31 +00:00
</div>
2010-01-01 21:07:55 +00:00
<div>
2010-01-20 15:20:44 +00:00
<%=tradOf(:copyright) %>
2010-01-01 21:07:55 +00:00
</div>
2009-10-09 12:27:31 +00:00
<div id="lastmod">
2010-01-20 15:20:44 +00:00
<%=tradOf(:last_modified)%>: <%= @item.mtime.strftime(@config[:dateFormat][language.intern]) %>
2009-10-09 12:27:31 +00:00
</div>
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>