/
default.haml
25 lines (25 loc) · 1.36 KB
/
default.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%html
%head
%title= "\"#{@item[:title]}\""
/ %script{:type=>"text/javascript", :src=>"/jquery-1.4.1.min.js"}
/ %script{:type=>"text/javascript", :src=>"/jquery.easing-1.3.js"}
/ %script{:type=>"text/javascript", :src=>"/jquery.accordion.js"}
%link{:rel=>"stylesheet", :type=>"text/css", :href=>"/assets/styles/style.css"}
/ = "<script type=\"text/javascript\">$().ready(function(){$('#accordion').accordion({alwaysOpen: false,autoheight: false, header:'a.header'});});</script>"
%body
%div#all
%div#nav<
- parents = get_parents(@item, @items)
- content_children = @item.children.reject{|i|i.binary?}
- do_collection(parents, 'parent', 'first', 'last') do |i, context, first, last|
%div{:class=>"#{context}#{first==true ? ' first' : ''}"}
%a{:href=>"#{i.identifier}"}<>= "#{i[:title]}"
%div{:class=>"current#{parents.size == 0 ? ' first' : ''}#{content_children.size==0 ? ' last' : ''}"}= @item[:title]
- do_collection(content_children, 'child', 'first', 'last') do |i, context, first, last|
%div{:class=>"#{context}#{last==true ? ' last' : ''}"}
%a{:href=>"#{i.reps[0].path}"}<>= "#{i[:title]}"
%div#main
%h2.page= @item[:page_title] || " "
%div.chapter= yield
%div#footer= "last modified: #{@item.mtime.strftime('%Y-%m-%d')}"