Class: Writecast::Index_view

Inherits:
Base_view
  • Object
show all
Defined in:
lib/writecast/views/index.rb

Instance Method Summary collapse

Methods inherited from Base_view

#content, #render_body_top_inner, #render_footer, #render_head, #render_menu, #render_post_summary

Instance Method Details

#render_breadcrumbObject



8
9
10
# File 'lib/writecast/views/index.rb', line 8

def render_breadcrumb
    p SEPARATOR
end

#render_content_innerObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/writecast/views/index.rb', line 12

def render_content_inner
    div :id => 'sidebar' do
        div :id => 'tags' do
            p do
                text "tag cloud ("
                a 'view list', :href => '/tags'
                text ")"
            end
            p do
                @tags_hash.each do |tag_set,posts|
                    tag,escaped_tag = tag_set
                    size = 200*(posts.size.to_f/@num_posts)
                    span :style => "font-size: #{50 + size}%;" do
                        a tag, :href => "/tags/#{escaped_tag}"
                        text ' '
                    end
                end
            end
        end
        div :id => 'archive' do
            p 'post archive'
            ul do
                @years.each do |year|
                    li do
                        a year, :href => "/#{year}"
                    end
                end
            end
        end
    end
    div :id => 'recent_posts' do
        ul do
            @recent_posts.each do |post|
                render_post_summary(post) # defined in base
            end
        end
    end
end


4
5
6
# File 'lib/writecast/views/index.rb', line 4

def render_feed_link
    link :rel => 'alternate', :type => 'application/rss+xml', :href=> '/feed.atom'
end