以下の箇所を修正。
656c656 < if ["month", "quearter", "half", "year", "all"].index(@cgi.params["category.period"][0]) --- > if ["month", "quarter", "half", "year", "all"].index(@cgi.params["category.period"][0])
html_category.rb に対応させる。
110c110,111 < url = "#{@conf.index}?year=#{Time.now.year};month=#{(Time.now.month - 1) / 3 + 1}Q;category=#{CGI.escape(key)}" --- > alias_name = info.alias_name(key) > url = "#{CGI.escape(alias_name)}.html"
レイアウトを変えるために以下のように変更。
def calendar result = %Q[<form method="get" action="#{@index}">\n] result << %Q[<h5>#{@options['dropdown_calendar.label'] || @dropdown_calendar_label}</h5>\n] result << %Q[<div class="calendar">\n] result << %Q[<select name="date">\n] @years.keys.sort.reverse_each do |year| @years[year.to_s].sort.reverse_each do |month| result << %Q[<option value="#{year}#{month}">#{year}年#{month}月</option>\n] end end result << "</select>\n" result << %Q[<input type="submit" value="選択">\n] result << "</div>\n</form>" end
ナビゲーションバーを以下のように変更する。
20a21,23 > def navi_prev_diary(date); "前の日記:#{date.strftime(@date_format)}"; end > def navi_next_diary(date); "次の日記:#{date.strftime(@date_format)}"; end > 31d33 < result << %Q[<span class="adminmenu"><a href="#{@index_page}">#{navi_index}</a></span>\n] unless @index_page.empty? 57c59 < result << %Q[<span class="adminmenu"><a href="#{@index}#{anchor prev_day}"><#{navi_prev_diary(navi_user_format(prev_day))}</a></span>\n] --- > result << %Q[<span class="adminmenu"><a href="#{@index}#{anchor prev_day}">← #{navi_prev_diary(navi_user_format(prev_day))}</a></span>\n] 60c62 < result << %Q[<span class="adminmenu"><a href="#{@index}#{anchor next_day}">#{navi_next_diary(navi_user_format(next_day))}></a></span>\n] --- > result << %Q[<span class="adminmenu"><a href="#{@index}#{anchor next_day}">#{navi_next_diary(navi_user_format(next_day))} →</a></span>\n] 63c65 < result << %Q[<span class="adminmenu"><a href="#{@index}">#{navi_latest}</a></span>\n] unless @mode == 'latest' --- > result << %Q[<span class="adminmenu"><a href="#{@index}">#{navi_latest}</a></span>\n]
カテゴリ指定のページの場合にインデックスを作るか否かを、 その表示期間に応じて制御可能にする。
*** search_control.rb.orig 2003-10-13 23:55:24.000000000 +0900 --- search_control.rb 2006-04-25 09:06:29.000000000 +0900 *************** *** 35,40 **** --- 35,44 ---- 'month' => ['f'], 'nyear' => ['f'], 'category' => ['f'], + 'category_month' => ['f'], + 'category_quarter' => ['f'], + 'category_half' => ['f'], + 'category_year' => ['f'], } # to be used for @options and in the HTML form *************** *** 109,114 **** --- 113,130 ---- key = "#{Search_control_prefix}.#{@mode}" elsif /^category/ =~ @mode then key = "#{Search_control_prefix}.category" + if @cgi.params['year'][0] + month = @cgi.params['month'][0] + if /[12]H/ === month.to_s + key << "_half" + elsif /[1-4]Q/ === month.to_s + key << "_quarter" + elsif (1..12).include?(month.to_i) + key << "_month" + else + key << "_year" + end + end else key = nil end
ja/search_control.rb も以下のように変更。
55c55,59 < [ '長年', 'nyear' ], [ 'カテゴリー', 'category' ] --- > [ '長年', 'nyear' ], [ 'カテゴリー (全期間)', 'category' ], > [ 'カテゴリー (月)', 'category_month' ], > [ 'カテゴリー (四半期)', 'category_quarter' ], > [ 'カテゴリー (半期)', 'category_half' ], > [ 'カテゴリー (年)', 'category_year' ]