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 26 27 28 29 30 31 32 33 34
|
# titile_list.rb $Revision: 1.21 $
#
# title_list: ɽƤΥȥꥹȤɽ
# ѥ(å̤):
# rev: սɽ(false)
#
# : ȥꥹȤˤϡ쥤Ȥפʤ
# ʤޤإåեåtableȤäꡢCSSɬ
# פǤ礦
#
# Copyright (c) 2005 TADA Tadashi <sho@spc.gr.jp>
# You can distribute this file under the GPL2.
#
def title_list( rev = false )
result = %Q|<ul class="title-list">\n|
keys = @diaries.keys.sort
keys = keys.reverse if rev
keys.each do |date|
next unless @diaries[date].visible?
result << %Q[<li><a href="#{h( @index )}#{h anchor( date )}">#{h( @diaries[date].date.strftime( @date_format ) )}</a>\n\t<ul class="title-list-item">\n]
if !@plugin_files.grep(/\/category.rb$/).empty? and @diaries[date].categorizable?
@diaries[date].each_section do |section|
result << %Q[\t<li>#{section.stripped_subtitle_to_html}</li>\n] if section.stripped_subtitle
end
else
@diaries[date].each_section do |section|
result << %Q[<li>#{section.subtitle_to_html}</li>\n] if section.subtitle
end
end
result << "\t</ul>\n</li>\n"
end
apply_plugin( result << "</ul>\n" )
end
|