scratch/layouts/latest.html
2012-03-30 18:15:43 +02:00

21 lines
895 B
HTML

-----
-----
<% language, languages, blog, article = setItemConf %>
<%
last_article = @items.select do |a|
a.reps[0].path =~ /\/#{language}\// && a[:kind] == 'article'
end.sort { |x,y| y[:created_at] <=> x[:created_at] }[0]
targetUrl = last_article.path
targetTitle = last_article[:title]
%>
<html>
<head>
<title>Redirect to the right page.</title>
<meta http-equiv="refresh" content="0;url=<%= targetUrl %>">
<style> body { font: sans-serif; color: #333333; font-size: 18px; position: absolute; text-align: center; font-weight: bold; top: 50%; left: 50%; width: 460px; height: 100px; margin-left: -230px; margin-top: -50px; line-height: 2em; } a,a:hover,a:visited,a:active { color: #C53; } </style>
</head>
<body>
<p>You should be redirected to</p>
<div><a href="<%= targetUrl %>"><%= targetTitle %></a></div>
</body>
</HTML>