misc/plugin/category.rb in tdiary-4.2.0 vs misc/plugin/category.rb in tdiary-4.2.1

- old
+ new

@@ -167,11 +167,11 @@ if category.empty? category = ['ALL'] end options = '' - (['ALL'] + @categories.sort_by{|e| e.downcase}).each do |c| + (['ALL'] + @categories).each do |c| options << %Q|\t\t<option value="#{h c}"#{" selected" if category.include?(c)}>#{h c}</option>\n| end params = '' params << %Q[<input type="hidden" name="year" value="#{h info.year}">] if info.year @@ -578,22 +578,22 @@ # def category_edit_support_flatlist ret = '' ret << '<div class="field title">' ret << "#{@category_conf_label}:\n" - @categories.sort_by{|e| e.downcase}.each do |c| + @categories.each do |c| ret << %Q!| <span class="category-item">#{h c}</span>\n! end ret << "|\n</div>\n<br>\n" ret end def category_edit_support_dropdown ret = '' ret << '<div class="field title">' ret << %Q|#{@category_conf_label}: <select id="category-candidate" name="category-candidate">\n| - @categories.sort_by{|e| e.downcase}.each do |c| + @categories.each do |c| ret << %Q!<option>#{h c}</option>\n! end ret << "|\n</select>\n</div>\n<br>\n" ret end @@ -725,10 +725,10 @@ end category_icon_conf_html end end -@categories = @category_cache.restore_categories +@categories = @category_cache.restore_categories.sort_by{|e| e.downcase} if @mode == 'categoryview' info = Category::Info.new(@cgi, @years, @conf) @categorized = @category_cache.categorize(info.category, info.years) end