diff --git a/app/assets/javascripts/tracks.js b/app/assets/javascripts/tracks.js index 9d32e0f4..077da5c4 100644 --- a/app/assets/javascripts/tracks.js +++ b/app/assets/javascripts/tracks.js @@ -434,7 +434,7 @@ var TodoItems = { return confirm(i18n['contexts.new_context_pre'] + givenContextName + i18n['contexts.new_context_post']); }, generate_predecessor: function(todo_id, todo_spec) { - var img = ""; + var img = ""; var anchor = "" + img + ""; var li = "
  • "+ anchor +" "+ todo_spec + "
  • "; return li; @@ -728,7 +728,8 @@ var ProjectListPage = { }; $.post(relative_to_root('projects/update/'+project_id), { 'project[name]': value, - 'update_project_name': 'true' + 'update_project_name': 'true', + '_method': 'put' }, highlight, 'script'); return(value); }, @@ -843,8 +844,9 @@ var ContextListPage = { var highlight = function(){ $('div.context span#context_name').effect('highlight', {}, 500); }; - $.post(relative_to_root('contexts/update/'+context_id), { - 'context[name]': value + $.post(relative_to_root('contexts/'+context_id), { + 'context[name]': value, + '_method': 'put' }, highlight); return value; }, diff --git a/app/assets/stylesheets/mobile.css b/app/assets/stylesheets/mobile.css index b43cdbf9..cf05eea6 100644 --- a/app/assets/stylesheets/mobile.css +++ b/app/assets/stylesheets/mobile.css @@ -23,7 +23,7 @@ a:hover { color: #FFFFFF; } -div.footer a { +div.footer a { text-decoration: underline; color: #999999; } @@ -58,12 +58,12 @@ h2 a:hover { } h4.alert { - border: 1px solid #666666; + border: 1px solid #666666; text-align: center; } h4.warning { - border: 1px solid #ED2E38; + border: 1px solid #ED2E38; background-color: #F6979C; color: #000; } @@ -72,7 +72,7 @@ h4.error { background:#c00; } h4.notice { - border: 1px solid #007E00; + border: 1px solid #007E00; background-color: #c2ffc2; color: #007E00; } @@ -91,7 +91,7 @@ span.r { } span.prj, span.ctx{ - font-size: small; + font-size: small; } #ctx, #pjr { @@ -102,7 +102,7 @@ span.prj, span.ctx{ padding: 0.1em 0; } -/* Draw attention to some text +/* Draw attention to some text Same format as traffic lights */ .red { color: #fff; @@ -259,20 +259,20 @@ input#todo_description, input#todo_tag_list, textarea#todo_notes, select#todo_pr } .prev a { - background: url(images/previous.png) left center no-repeat; + background: url(assets/previous.png) left center no-repeat; padding-left: 20px; } .prev a:hover { - background: #cc3334 url(images/previous.png) left center no-repeat; + background: #cc3334 url(assets/previous.png) left center no-repeat; } .next a { text-align:right; - background: url(images/next.png) right center no-repeat; + background: url(assets/next.png) right center no-repeat; padding-right: 20px; } .next a:hover { - background: #cc3334 url(images/next.png) right center no-repeat; + background: #cc3334 url(assets/next.png) right center no-repeat; } diff --git a/app/assets/stylesheets/scaffold.css b/app/assets/stylesheets/scaffold.css index 060a372a..1abda09f 100644 --- a/app/assets/stylesheets/scaffold.css +++ b/app/assets/stylesheets/scaffold.css @@ -71,23 +71,23 @@ h4.alert { } h4.warning { - border: 1px solid #ED2E38; + border: 1px solid #ED2E38; background-color: #F6979C; color: #000000; } h4.error { - color:#fff; + color:#fff; background:#c00; } h4.notice { - border: 1px solid #007E00; + border: 1px solid #007E00; background-color: #c2ffc2; color: #007E00; } /*#notice { padding: 2px; - border: 1px solid #007E00; + border: 1px solid #007E00; background-color: #c2ffc2; color: #007E00; margin-bottom: 15px; @@ -147,8 +147,8 @@ input.login_text { width:200px; } input.open_id { - background: url(../images/open-id-login-bg.gif) no-repeat; - background-color: #fff; + background: url(/assets/open-id-login-bg.gif) no-repeat; + background-color: #fff; background-position: 0 50%; color: #000; padding-left: 18px; diff --git a/app/assets/stylesheets/tracks.css b/app/assets/stylesheets/tracks.css index 4274702b..e2c4a38b 100644 --- a/app/assets/stylesheets/tracks.css +++ b/app/assets/stylesheets/tracks.css @@ -1313,7 +1313,7 @@ button.positive, .widgets a.positive{ } .blockUI.blockOverlay { - background-image:url('../images/waiting.gif'); + background-image:url('/assets/waiting.gif'); background-repeat:no-repeat; background-position:center center; background-color:white; @@ -1321,21 +1321,21 @@ button.positive, .widgets a.positive{ } .bigWaiting { - background-image:url('../images/bigWaiting.gif'); + background-image:url('/assets/bigWaiting.gif'); background-repeat:no-repeat; background-position:center 20%; background-color:white; } .blackWaiting { - background-image:url('../images/blackWaiting.gif'); + background-image:url('/assets/blackWaiting.gif'); background-repeat:no-repeat; background-position:center center; background-color:black; } .bigBlackWaiting { - background-image:url('../images/bigBlackWaiting.gif'); + background-image:url('/assets/bigBlackWaiting.gif'); background-repeat:no-repeat; background-position:center center; background-color:black; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 71620089..43207dc1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -189,6 +189,10 @@ class ApplicationController < ActionController::Base super # handle xml http auth via our own login code end end + + def sanitize(arg) + ActionController::Base.helpers.sanitize(arg) + end protected diff --git a/app/controllers/integrations_controller.rb b/app/controllers/integrations_controller.rb index 36e5e052..002b3d34 100644 --- a/app/controllers/integrations_controller.rb +++ b/app/controllers/integrations_controller.rb @@ -28,7 +28,7 @@ class IntegrationsController < ApplicationController def search_plugin # TODO: ASSET PATH!! - @icon_data = [File.open(Rails.root + '/public/images/done.png').read]. + @icon_data = [File.open(Rails.root + '/app/assets/images/done.png').read]. pack('m').gsub(/\n/, '') render :layout => false diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index b6619915..b2f576af 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -386,7 +386,7 @@ class TodosController < ApplicationController @source_view = params['_source_view'] || 'todo' @predecessor = current_user.todos.find_by_id(params['predecessor']) @predecessors = @predecessor.predecessors - @todo = current_user.todos.find_by_id(params['successor']).includes(Todo::DEFAULT_INCLUDES) + @todo = current_user.todos.includes(Todo::DEFAULT_INCLUDES).find_by_id(params['successor']) @original_state = @todo.state unless @predecessor.completed? @todo.add_predecessor(@predecessor) @@ -757,7 +757,7 @@ class TodosController < ApplicationController # Set defaults for new_action @initial_tags = @tag_name unless @not_done_todos.empty? - @context = current_user.contexts.find_by_id(@not_done_todos[0].context_id) + @context = current_user.contexts.find(@not_done_todos.first.context_id) end # Set count badge to number of items with this tag diff --git a/app/models/todo.rb b/app/models/todo.rb index 47bc1060..1c946f4f 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -43,13 +43,13 @@ class Todo < ActiveRecord::Base # other scopes scope :are_due, :conditions => ['NOT (todos.due IS NULL)'] - scope :with_tag, lambda { |tag_id| {:joins => :taggings, :conditions => ["taggings.tag_id = ? ", tag_id] } } - scope :with_tags, lambda { |tag_ids| {:conditions => ["EXISTS(SELECT * from taggings t WHERE t.tag_id IN (?) AND t.taggable_id=todos.id AND t.taggable_type='Todo')", tag_ids] } } - scope :of_user, lambda { |user_id| {:conditions => ["todos.user_id = ? ", user_id] } } - scope :completed_after, lambda { |date| {:conditions => ["todos.completed_at > ?", date] } } - scope :completed_before, lambda { |date| {:conditions => ["todos.completed_at < ?", date] } } - scope :created_after, lambda { |date| {:conditions => ["todos.created_at > ?", date] } } - scope :created_before, lambda { |date| {:conditions => ["todos.created_at < ?", date] } } + scope :with_tag, lambda { |tag_id| joins("INNER JOIN taggings ON todos.id = taggings.taggable_id").where("taggings.tag_id = ? ", tag_id) } + scope :with_tags, lambda { |tag_ids| where("EXISTS(SELECT * from taggings t WHERE t.tag_id IN (?) AND t.taggable_id=todos.id AND t.taggable_type='Todo')", tag_ids) } + # scope :of_user, lambda { |user_id| {:conditions => ["todos.user_id = ? ", user_id] } } + # scope :completed_after, lambda { |date| {:conditions => ["todos.completed_at > ?", date] } } + # scope :completed_before, lambda { |date| {:conditions => ["todos.completed_at < ?", date] } } + # scope :created_after, lambda { |date| {:conditions => ["todos.created_at > ?", date] } } + # scope :created_before, lambda { |date| {:conditions => ["todos.created_at < ?", date] } } STARRED_TAG_NAME = "starred" DEFAULT_INCLUDES = [ :project, :context, :tags, :taggings, :pending_successors, :uncompleted_predecessors, :recurring_todo ] diff --git a/app/views/integrations/google_gadget.erb b/app/views/integrations/google_gadget.erb index 45ca5554..ff113f54 100644 --- a/app/views/integrations/google_gadget.erb +++ b/app/views/integrations/google_gadget.erb @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/views/todos/_hidden.rhtml b/app/views/todos/_hidden.html.erb similarity index 100% rename from app/views/todos/_hidden.rhtml rename to app/views/todos/_hidden.html.erb diff --git a/app/views/todos/tag.html.erb b/app/views/todos/tag.html.erb index 64506aa1..78268366 100644 --- a/app/views/todos/tag.html.erb +++ b/app/views/todos/tag.html.erb @@ -1,5 +1,5 @@
    -
    > +
    >

    <%= t('todos.no_actions_found_title')%>

    <%= t('todos.no_actions_with', :tag_name=>@tag_name) %>

    @@ -29,5 +29,5 @@
    <%= render :partial => "shared/add_new_item_form" %> - <%= render :file => "sidebar/sidebar.html.erb" %> + <%= render :file => "sidebar/sidebar" %>
    diff --git a/test/views/context_helper_test.rb b/backup.rails2.3/test_views/views/context_helper_test.rb similarity index 100% rename from test/views/context_helper_test.rb rename to backup.rails2.3/test_views/views/context_helper_test.rb diff --git a/test/views/todos_helper_test.rb b/backup.rails2.3/test_views/views/todos_helper_test.rb similarity index 100% rename from test/views/todos_helper_test.rb rename to backup.rails2.3/test_views/views/todos_helper_test.rb diff --git a/config/cucumber.yml b/config/cucumber.yml index 19b288df..645eff4e 100644 --- a/config/cucumber.yml +++ b/config/cucumber.yml @@ -4,5 +4,5 @@ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'pr std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" %> default: <%= std_opts %> features -wip: --tags @wip:3 --wip features +wip: --tags @wip:10 --wip features rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/config/routes.rb b/config/routes.rb index a12fb3cb..af591143 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -112,9 +112,12 @@ Tracksapp::Application.routes.draw do post 'check_deferred' post 'filter_to_context' post 'filter_to_project' + post 'add_predecessor' end end match 'todos/tag/:name' => 'todos#tag', :as => :tag + match 'todos/done/tag/:name' => "todos#done_tag", :as => :done_tag + match 'todos/all_done/tag/:name' => "todos#all_done_tag", :as => :all_done_tag resources :recurring_todos do member do diff --git a/vendor/assets/stylesheets/superfish.css b/vendor/assets/stylesheets/superfish.css index a5c2fa5d..ad99e40f 100644 --- a/vendor/assets/stylesheets/superfish.css +++ b/vendor/assets/stylesheets/superfish.css @@ -161,7 +161,7 @@ ul.sf-menu li li li.sfHover ul { height: 10px; text-indent: -999em; overflow: hidden; - background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ + background: url('/assets/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ } a > .sf-sub-indicator { /* give all except IE6 the correct values */ top: .8em; @@ -190,7 +190,7 @@ li.sfHover > a > .sf-sub-indicator { /*** shadows for all but IE6 ***/ .sf-shadow ul { - background: url('../images/shadow.png') no-repeat bottom right; + background: url('/assets/shadow.png') no-repeat bottom right; padding: 0 8px 9px 0; -moz-border-radius-bottomleft: 17px; -moz-border-radius-topright: 17px;