More tweaks to the archive pages

This commit is contained in:
Wesley Moore 2010-02-03 21:53:58 +11:00
parent 3c58d08cea
commit f1252cb2a4
8 changed files with 34 additions and 30 deletions

View file

@ -1 +1,3 @@
<ul class="aricles"></ul>
<ul class="articles">
<li>Loading&hellip;</li>
</ul>

View file

@ -1 +1,3 @@
<ul class="aricles"></ul>
<ul class="articles">
<li>Loading&hellip;</li>
</ul>

View file

@ -1 +1,3 @@
<ul class="aricles"></ul>
<ul class="articles">
<li>Loading&hellip;</li>
</ul>

View file

@ -7,6 +7,6 @@
</abbr>
<p>
<strong><a href="<%= @article.reps.first.path %>"><%= @article[:title] %></a></strong>
A one sentence summary of this post would go here this one is longer then the other one.
<%= @item[:summary] %>
</p>
</li>

View file

@ -3,6 +3,7 @@
<head>
<%= render 'head_common' %>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js" type="text/javascript"></script>
<script src="/js/common.js" type="text/javascript" charset="utf-8"></script>
<% if @item.identifier =~ %r{/page/$} %>
<script src="/js/jquery.ba-bbq.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/mojo.js" type="text/javascript" charset="utf-8"></script>
@ -10,17 +11,16 @@
<% else %>
<script type="text/javascript" charset="utf-8">
jQuery(function() {
// pagination and search require javascript, so reveal them with javascript
$('.pagination').show();
$('#search').show();
show_javascript_widgets();
webkit_search_tweak();
});
</script>
<% end %>
</head>
<body class="articles">
<%= render 'header' %>
<h1>Archives</h1>
<div id="content">
<h1>Archives</h1>
<%
menu = [
@ -33,8 +33,9 @@
<% menu.each do |menu_item|
label, count = menu_item
path = (label != "All" ? '/' + label.downcase : '') + "/articles/"
active = (@item.identifier.sub(%r{page/$}, '') == path)
%>
<li><a href="<%= path %>"<%= %Q{class="active"} if @item.identifier == path %>><%= label %></a> (<%= count %>)</li>
<li><a href="<%= path %>"<%= %Q{class="active"} if active %>><%= label %></a> (<%= count %>)</li>
<% end %>
<li id="search">
<fieldset>
@ -51,9 +52,9 @@
<div class="pagination">
<% pagepath = @item.identifier; pagepath += 'page/' if pagepath !~ %r{/page/$} %>
<a href="<%= pagepath %>" class="older">&laquo; Older</a>
<a href="<%= pagepath %>#2" class="newer">&laquo; Newer</a>
|
<a href="<%= pagepath %>#2" class="newer">Newer &raquo;</a>
<a href="<%= pagepath %>" class="older">Older &raquo;</a>
</div>
</div>
<%= render 'footer' %>

View file

@ -3,14 +3,14 @@ body {
font-size: 62.5%;
background: #fff;
color: #223;
/* padding: 2em;*/
}
p,li {
p,li,div {
font-size: 16px;
}
p,li {
line-height: 1.2;
}
p {
margin: 0 0 1em 0;
}
@ -109,21 +109,13 @@ pre {
}
ul#menu {
/* list-style: none;*/
float: right;
/* margin: 0;*/
padding-right: 0.25em;
}
ul#menu li {
/* display: inline;*/
font-size: inherit;
}
/*body.article h1 {
padding-left: 20px;
padding-right: 20px;
}*/
#content {
padding: 0 20px;
clear: both;
@ -143,7 +135,7 @@ body.articles #content {
}
#footer .copyright {
font-family: "Helvetica Neue", Helvetica, "Liberation Sans", "Bitstream Vera Sans", Tahoma, Geneva, Arial, sans-serif;
font-size: 1.4em;
font-size: 14px;
padding-top: 1em;
display: block;
font-weight: 200;

View file

@ -70,13 +70,8 @@
// Since the event is only triggered when the hash changes, we need to trigger
// the event now, to handle the hash the page may have loaded with.
$(window).trigger('hashchange');
$('.pagination').show();
$('#search').show();
if(navigator.userAgent.toLowerCase().indexOf('webkit') >= 0) {
// WebKit browser
$('#search input').css('paddingTop', 0);
}
show_javascript_widgets();
webkit_search_tweak();
});
};

10
output/js/common.js Normal file
View file

@ -0,0 +1,10 @@
function show_javascript_widgets() {
$('.pagination').show();
$('#search').show();
};
function webkit_search_tweak() {
if(navigator.userAgent.toLowerCase().indexOf('webkit') >= 0) {
$('#search input').css('paddingTop', 0);
}
};