wezm.net/layouts/articles.html

65 lines
1.9 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<%= render '_head' %>
2010-06-16 10:23:22 +00:00
<script src="/js/jquery.quicksand.min.js" type="text/javascript" charset="utf-8"></script>
2010-03-03 20:44:34 +00:00
<script type="text/javascript" charset="utf-8">
2010-06-16 10:23:22 +00:00
jQuery(function() {
2010-06-30 07:56:37 +00:00
function search_handler(e) {
2010-06-16 10:23:22 +00:00
var input = $(this);
2010-06-30 07:56:37 +00:00
var value = input.val();
// var q = (value + String.fromCharCode(e.which)).toLowerCase();
var q = value.toLowerCase();
2010-06-16 10:23:22 +00:00
2010-06-30 07:56:37 +00:00
$('#articles li').filter(function(i) {
2010-06-16 10:23:22 +00:00
var article = $(this);
2010-06-30 07:56:37 +00:00
return article.text().toLowerCase().indexOf(q) < 0;
}).animate({height: 0, opacity: 0}, {queue: false, duration: 500});
}
$('#search').show();
$('#search input').keypress(search_handler).change(search_handler).focus();
2010-03-03 20:44:34 +00:00
});
</script>
</head>
<body class="articles">
<%= render '_header' %>
<div id="content">
<h1>Archives</h1>
2010-01-30 06:09:05 +00:00
<%
menu = [
['All', sorted_articles.size],
['Technical', technical_articles.size],
['Personal', personal_articles.size],
]
%>
2010-06-30 07:56:37 +00:00
<nav class="inline menu">
<% menu.each do |menu_item|
label, count = menu_item
path = (label != "All" ? '/' + label.downcase : '') + "/articles/"
2010-04-01 07:24:05 +00:00
feed = 'http://feeds.feedburner.com/wezm'
feed += "-#{label.downcase}" if label != "All"
2010-02-03 10:53:58 +00:00
active = (@item.identifier.sub(%r{page/$}, '') == path)
%>
2010-03-30 21:03:04 +00:00
<li>
2010-06-16 10:23:22 +00:00
<a href="<%= feed %>"><img class="feed-icon" src="/images/black-feed-icon.png" width="12" height="12" alt="Black Feed Icon" /></a>
2010-03-30 21:03:04 +00:00
<a href="<%= path %>"<%= %Q{class="active"} if active %>><%= label %></a> (<%= count %>)
</li>
<% end %>
2010-02-02 10:08:33 +00:00
<li id="search">
<fieldset>
<label for="query">Search</label>
2010-06-30 07:56:37 +00:00
<input type="search" name="q" id="query" value="" />
2010-02-02 10:08:33 +00:00
</fieldset>
</li>
2010-06-30 07:56:37 +00:00
</nav>
2010-01-30 06:09:05 +00:00
2010-06-16 10:23:22 +00:00
<ul id="articles" class="articles">
<%= yield %>
</ul>
2010-01-30 06:09:05 +00:00
</div>
<%= render '_footer' %>
</body>
</html>