From 01a011ee062568ac5707da11f721bcb227c93fab Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Sat, 17 Jan 2009 14:43:06 +0100 Subject: [PATCH 01/17] improve last path. Thanks Vitaliel! --- app/controllers/stats_controller.rb | 2 +- test/functional/stats_controller_test.rb | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 2a7009e4..3847c47a 100755 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -652,7 +652,7 @@ class StatsController < ApplicationController "AND tags.id = taggings.tag_id " + "AND taggings.taggable_id = todos.id ", current_user.id]) tags_ids_s = tag_ids.map(&:id).sort.join(",") - return {} if tags_ids_s.blank? # return empty array for .size to work + return {} if tags_ids_s.blank? # return empty hash for .size to work return Tag.find(:all, :conditions => "id in (" + tags_ids_s + ")") end diff --git a/test/functional/stats_controller_test.rb b/test/functional/stats_controller_test.rb index 41e0048f..11f409a0 100755 --- a/test/functional/stats_controller_test.rb +++ b/test/functional/stats_controller_test.rb @@ -99,10 +99,7 @@ class StatsControllerTest < Test::Unit::TestCase assert_response :success # clear taggings table and render again - taggings = Tagging.find(:all) - taggings.each do |t| - t.delete - end + Tagging.delete_all get :index assert_response :success From 496741c9728206c85ca50a817740b7349a46f932 Mon Sep 17 00:00:00 2001 From: Vitalie Lazu Date: Sat, 17 Jan 2009 17:40:37 +0800 Subject: [PATCH 02/17] Fixed sidebar rendering, was not working on some pages after rails 2.2 upgrade Signed-off-by: Reinier Balt --- app/views/contexts/show.html.erb | 4 ++-- app/views/feedlist/index.html.erb | 14 +++++++------- app/views/projects/show.html.erb | 6 +++--- app/views/todos/list_deferred.html.erb | 8 ++++---- app/views/todos/tag.html.erb | 16 ++++++++-------- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/views/contexts/show.html.erb b/app/views/contexts/show.html.erb index a22e4728..41268330 100644 --- a/app/views/contexts/show.html.erb +++ b/app/views/contexts/show.html.erb @@ -8,5 +8,5 @@
<%= render :partial => "shared/add_new_item_form" %> - <%= render :template => "sidebar/sidebar" %> -
\ No newline at end of file + <%= render :file => "sidebar/sidebar.html.erb" %> + diff --git a/app/views/feedlist/index.html.erb b/app/views/feedlist/index.html.erb index 5c855e16..74a45880 100644 --- a/app/views/feedlist/index.html.erb +++ b/app/views/feedlist/index.html.erb @@ -57,18 +57,18 @@
  • <%= rss_formatted_link({:controller => 'todos', :action => 'index', :tag => 'starred'}) %> <%= text_formatted_link({:controller => 'todos', :action => 'index', :tag => 'starred'}) %> - All starred, active actions + All starred, active actions
  • <%= text_formatted_link({:controller => 'projects', :action => 'index', :projects_and_actions => true}) %> - Active projects with their actions + Active projects with their actions
  • Feeds for incomplete actions in a specific context:

    <% if @active_contexts.empty? && @hidden_contexts.empty? -%>
    • There need to be at least one context before you can request a feed
    <% else -%>
      -
    • Step 1 - Choose the context you want a feed of: +
    • Step 1 - Choose the context you want a feed of: <%= options_from_collection_for_select(@active_projects, "id", "name", @active_projects.first.id) unless @active_projects.empty?-%> <%= options_from_collection_for_select(@hidden_projects, "id", "name") -%> @@ -106,7 +106,7 @@ :url => { :controller => "feedlist", :action => "get_feeds_for_project" }, :before => "$('feeds-for-project').startWaiting()", :complete => "$('feeds-for-project').stopWaiting()" - -%> + -%>
    • Step 2 - Select the feed for this project
      @@ -123,7 +123,7 @@
      - <%= render :template => "sidebar/sidebar" %> + <%= render :file => "sidebar/sidebar.html.erb" %>