diff --git a/.gitignore b/.gitignore index 1daf5e90..d62f537c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ public/stylesheets/cache tmp vendor/plugins/query_trace/ rerun.txt +public/javascripts/jquery-all.js +public/javascripts/tracks.js +public/stylesheets/all.css diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fb4ee359..56dc69f6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -276,8 +276,6 @@ class ApplicationController < ActionController::Base def set_time_zone Time.zone = current_user.prefs.time_zone if logged_in? - locale = params[:locale] || 'en-US' - I18n.locale = locale end def set_zindex_counter diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 9e8a5597..329b38e5 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -27,13 +27,29 @@ class NotesController < ApplicationController def create note = current_user.notes.build - note.attributes = params["new_note"] - - if note.save - render :partial => 'notes_summary', :object => note - else - render :text => '' - end + note.attributes = params["note"] + + saved = note.save + + respond_to do |format| + format.js do + if note.save + render :partial => 'notes_summary', :object => note + else + render :text => '' + end + end + format.xml do + if saved + head :created, :location => note_url(note), :text => "new note with id #{note.id}" + else + render_failure note.errors.full_messages.join(', ') + end + end + format.html do + render :text => 'unexpected request for html rendering' + end + end end def destroy diff --git a/app/controllers/preferences_controller.rb b/app/controllers/preferences_controller.rb index 5e5f9640..89935666 100644 --- a/app/controllers/preferences_controller.rb +++ b/app/controllers/preferences_controller.rb @@ -7,7 +7,6 @@ class PreferencesController < ApplicationController def edit @page_title = "TRACKS::Edit Preferences" - render :object => prefs end def update @@ -20,4 +19,4 @@ class PreferencesController < ApplicationController end end -end \ No newline at end of file +end diff --git a/app/controllers/recurring_todos_controller.rb b/app/controllers/recurring_todos_controller.rb index be659b3a..2bfcdc3b 100644 --- a/app/controllers/recurring_todos_controller.rb +++ b/app/controllers/recurring_todos_controller.rb @@ -2,7 +2,7 @@ class RecurringTodosController < ApplicationController helper :todos, :recurring_todos - append_before_filter :init, :only => [:index, :new, :edit] + append_before_filter :init, :only => [:index, :new, :edit, :create] append_before_filter :get_recurring_todo_from_param, :only => [:destroy, :toggle_check, :toggle_star, :edit, :update] def index @@ -243,7 +243,7 @@ class RecurringTodosController < ApplicationController private - def init + def init @days_of_week = [ ['Sunday',0], ['Monday',1], ['Tuesday', 2], ['Wednesday',3], ['Thursday',4], ['Friday',5], ['Saturday',6]] @months_of_year = [ ['January',1], ['Februari',2], ['March', 3], ['April',4], ['May',5], ['June',6], diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index fc928a03..67b983f2 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -6,9 +6,9 @@ class TodosController < ApplicationController prepend_before_filter :login_or_feed_token_required, :only => [:index, :calendar] append_before_filter :init, :except => [ :destroy, :completed, :completed_archive, :check_deferred, :toggle_check, :toggle_star, - :edit, :update, :create, :calendar, :auto_complete_for_tag, :auto_complete_for_predecessor, :remove_predecessor, :add_predecessor] + :edit, :update, :create, :calendar, :auto_complete_for_predecessor, :remove_predecessor, :add_predecessor] append_before_filter :get_todo_from_params, :only => [ :edit, :toggle_check, :toggle_star, :show, :update, :destroy, :remove_predecessor] - protect_from_forgery :except => [:auto_complete_for_tag, :auto_complete_for_predecessor] + protect_from_forgery :except => [:auto_complete_for_predecessor] def index current_user.deferred_todos.find_and_activate_ready @@ -77,7 +77,7 @@ class TodosController < ApplicationController @todo.tags.reload end - unless (@aved == false) + unless (@saved == false) unless @todo.uncompleted_predecessors.empty? || @todo.state == 'project_hidden' @todo.state = 'pending' end @@ -140,8 +140,8 @@ class TodosController < ApplicationController def add_predecessor @source_view = params['_source_view'] || 'todo' - @predecessor = Todo.find(params['predecessor']) - @todo = Todo.find(params['successor']) + @predecessor = current_user.todos.find(params['predecessor']) + @todo = current_user.todos.find(params['successor']) @original_state = @todo.state # Add predecessor @todo.add_predecessor(@predecessor) @@ -154,7 +154,7 @@ class TodosController < ApplicationController def remove_predecessor @source_view = params['_source_view'] || 'todo' - @predecessor = Todo.find(params['predecessor']) + @predecessor = current_user.todos.find(params['predecessor']) @successor = @todo @removed = @successor.remove_predecessor(@predecessor) respond_to do |format| @@ -590,14 +590,6 @@ class TodosController < ApplicationController } end end - - def auto_complete_for_tag - @items = Tag.find(:all, - :conditions => [ "name LIKE ?", '%' + params['tag_list'] + '%' ], - :order => "name ASC", - :limit => 10) - render :inline => "<%= auto_complete_result(@items, :name) %>" - end def auto_complete_for_predecessor unless params['id'].nil? @@ -640,8 +632,8 @@ class TodosController < ApplicationController end def convert_to_project - @todo = Todo.find(params[:id]) - @project = Project.new(:name => @todo.description, :description => @todo.notes, + @todo = current_user.todos.find(params[:id]) + @project = current_user.projects.new(:name => @todo.description, :description => @todo.notes, :default_context => @todo.context) @todo.destroy @project.save! diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 1230efa3..8eafc567 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -24,14 +24,12 @@ module TodosHelper :class => "icon star_item", :title => "star the action '#{@todo.description}'") end - def remote_edit_menu_item(parameters, todo) - return link_to_remote( - image_tag("edit_off.png", :mouseover => "edit_on.png", :alt => "Edit", :align => "absmiddle", :id => 'edit_icon_todo_'+todo.id.to_s)+" Edit", - :url => {:controller => 'todos', :action => 'edit', :id => todo.id}, - :method => 'get', - :with => "'#{parameters}'", - :before => todo_start_waiting_js(todo), - :complete => todo_stop_waiting_js(todo)) + def remote_edit_button + link_to( + image_tag("blank.png", :alt => "Edit", :align => "absmiddle", :id => 'edit_icon_todo_'+@todo.id.to_s, :class => 'edit_item'), + {:controller => 'todos', :action => 'edit', :id => @todo.id}, + :class => "icon edit_item", + :title => "Edit the action '#{@todo.description}'") end def remote_delete_menu_item(parameters, todo) @@ -70,7 +68,7 @@ module TodosHelper :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")} url[:_tag_name] = @tag_name if @source_view == 'tag' - return link_to("Promote to project", url) + return link_to(image_tag("to_project_off.png", :align => "absmiddle")+" Make project", url) end def todo_start_waiting_js(todo) @@ -121,8 +119,10 @@ module TodosHelper def grip_span unless @todo.completed? image_tag('grip.png', :width => '7', :height => '16', :border => '0', - :title => 'Drag onto another action to make it depend on that action', - :class => 'grip') + :title => 'Drag onto another action to make it depend on that action', + :class => 'grip') + + image_tag('blank.png', :width => 16, :height => 16, :border => 0, + :title => "Drop an action to make it depend on this action", :class => 'successor_target') end end diff --git a/app/views/contexts/_context_listing.rhtml b/app/views/contexts/_context_listing.rhtml index 3be6d091..f8c80b48 100644 --- a/app/views/contexts/_context_listing.rhtml +++ b/app/views/contexts/_context_listing.rhtml @@ -26,7 +26,8 @@ :with => "'_source_view=#{@source_view}'", :before => "$('#{dom_id(context)}').block({message:null});", :complete => "$('#{dom_id(context)}').unblock();", - :confirm => "Are you sure that you want to delete the context '#{context.name}'?" + :confirm => "Are you sure that you want to delete the context '#{context.name}'?", + :html => { :id => dom_id(context, 'delete') } ) %> <%= link_to_remote( image_tag( "blank.png", :title => "Edit context", :class=>"edit_item"), diff --git a/app/views/contexts/_text_context.rhtml b/app/views/contexts/_text_context.rhtml index 6a4a3a22..84e57a25 100644 --- a/app/views/contexts/_text_context.rhtml +++ b/app/views/contexts/_text_context.rhtml @@ -1,7 +1,7 @@ <% context = text_context -todos_in_context = todos.select { |t| t.context_id == context.id } +todos_in_context = not_done_todos.select { |t| t.context_id == context.id } if todos_in_context.length > 0 -%> <%= context.name.upcase %>: <%= render :partial => "todos/text_todo", :collection => todos_in_context -%> -<% end -%> \ No newline at end of file +<% end -%> diff --git a/app/views/contexts/update_context_name.js.rjs b/app/views/contexts/update_context_name.js.rjs index acee3308..9dd1d2e9 100644 --- a/app/views/contexts/update_context_name.js.rjs +++ b/app/views/contexts/update_context_name.js.rjs @@ -1,5 +1,3 @@ -page['context_name_in_place_editor'].replace_html @context.name - page['default_context_name_id'].value = @context.name page['todo_context_name'].value = @context.name diff --git a/app/views/feedlist/index.html.erb b/app/views/feedlist/index.html.erb index bb417c7e..9853d2a2 100644 --- a/app/views/feedlist/index.html.erb +++ b/app/views/feedlist/index.html.erb @@ -73,12 +73,6 @@ <%= options_from_collection_for_select(@active_contexts, "id", "name", @active_contexts.first.id) unless @active_projects.empty?-%> <%= options_from_collection_for_select(@hidden_contexts, "id", "name") -%> - <%= observe_field "feed-contexts", :update => "feeds-for-context", - :with => 'context_id', - :url => { :controller => "feedlist", :action => "get_feeds_for_context" }, - :before => "$('feeds-for-context').startWaiting()", - :complete => "$('feeds-for-context').stopWaiting()" - -%>
  • Step 2 - Select the feed for this context
    @@ -101,12 +95,6 @@ <%= options_from_collection_for_select(@hidden_projects, "id", "name") -%> <%= options_from_collection_for_select(@completed_projects, "id", "name") -%> - <%= observe_field "feed-projects", :update => "feeds-for-project", - :with => 'project_id', - :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
    diff --git a/app/views/integrations/index.html.erb b/app/views/integrations/index.html.erb index d99f0066..51398c24 100644 --- a/app/views/integrations/index.html.erb +++ b/app/views/integrations/index.html.erb @@ -27,12 +27,6 @@ <% if has_contexts -%>
    1. Choose the context you want to add actions to: - <%= observe_field "applescript1-contexts", :update => "applescript1", - :with => 'context_id', - :url => { :controller => "integrations", :action => "get_applescript1" }, - :before => "$('applescript1').startWaiting()", - :complete => "$('applescript1').stopWaiting()" - %>
    2. Copy the Applescript below to the clipboard.
      @@ -52,12 +46,6 @@ <% if has_contexts -%>
      1. Choose the context you want to add actions to: - <%= observe_field "applescript2-contexts", :update => "applescript2", - :with => 'context_id', - :url => { :controller => "integrations", :action => "get_applescript2" }, - :before => "$('applescript2').startWaiting()", - :complete => "$('applescript2').stopWaiting()" - %>
      2. Copy the Applescript below to the clipboard.
        @@ -79,12 +67,6 @@ <% if has_contexts -%>
        1. Choose the context you want to add actions to: - <%= observe_field "quicksilver-contexts", :update => "quicksilver", - :with => 'context_id', - :url => { :controller => "integrations", :action => "get_quicksilver_applescript" }, - :before => "$('quicksilver').startWaiting()", - :complete => "$('quicksilver').stopWaiting()" - %>
        2. Copy the Applescript below to the clipboard.
          diff --git a/app/views/layouts/standard.html.erb b/app/views/layouts/standard.html.erb index f551e886..f5713db2 100644 --- a/app/views/layouts/standard.html.erb +++ b/app/views/layouts/standard.html.erb @@ -2,37 +2,27 @@ - <% if @prefs.refresh != 0 -%> - ;url=<%= request.request_uri %>"> - <% end -%> - <% bundle :name => "tracks_css" do %> - <%= stylesheet_link_tag *%w[ standard superfish niftyCorners jquery-ui jquery.autocomplete] %> - <% end %> + <%= stylesheet_link_tag 'standard','superfish','niftyCorners','jquery-ui', + 'jquery.autocomplete', :cache => true %> <%= stylesheet_link_tag "print", :media => "print" %> - <% bundle :name => "jquery" do %> - <%= javascript_include_tag 'jquery' %> - <%= javascript_include_tag 'jquery-ui' %> - <%= javascript_include_tag 'jquery.cookie' %> - <%= javascript_include_tag 'jquery.blockUI' %> - <%= javascript_include_tag 'jquery.jeditable' %> - <%= javascript_include_tag 'jquery.autocomplete' %> - <% end %> - <% bundle :name => "tracks_js" do %> - <%= javascript_include_tag *%w[ - hoverIntent superfish application - accesskey-hints niftycube flashobject ] %> - <% end %> + <%= javascript_include_tag 'jquery','jquery-ui','jquery.cookie', + 'jquery.blockUI','jquery.jeditable','jquery.autocomplete', :cache => 'jquery-all' %> + <%= javascript_include_tag 'hoverIntent','superfish','application', + 'accesskey-hints','niftycube','flashobject', :cache => 'tracks' %> <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> <%= javascript_tag "var SOURCE_VIEW = '#{@source_view}';" %> <%= javascript_tag "var TAG_NAME = '#{@tag_name}';" if @tag_name %> diff --git a/app/views/notes/_notes.rhtml b/app/views/notes/_notes.rhtml index 4ae528e0..2e5fef2e 100644 --- a/app/views/notes/_notes.rhtml +++ b/app/views/notes/_notes.rhtml @@ -6,17 +6,12 @@
    <% note = nil -%> + diff --git a/app/views/projects/_project.rhtml b/app/views/projects/_project.rhtml index cce7436c..943bb4bb 100644 --- a/app/views/projects/_project.rhtml +++ b/app/views/projects/_project.rhtml @@ -1,5 +1,9 @@
    -

    <% if collapsible %><%= image_tag("collapse.png") %><% end %><%= project.name -%>

    +

    + <% if collapsible -%> + <%= image_tag("collapse.png") %> + <% end -%> + <%= project.name -%>

    "> <%= render :partial => "projects/project_settings", :locals => { :project => project, :collapsible => collapsible } %>
    diff --git a/app/views/projects/_project_settings.rhtml b/app/views/projects/_project_settings.rhtml index 1c3747e0..5bea674d 100644 --- a/app/views/projects/_project_settings.rhtml +++ b/app/views/projects/_project_settings.rhtml @@ -20,11 +20,12 @@ :method => 'get', :with => "'_source_view=#{@source_view}'", :before => "$('#{dom_id(project)}').block({message: null});", - :complete => "$('#{dom_id(project)}').unblock();enable_rich_interaction();" + :complete => "$('#{dom_id(project)}').unblock();enable_rich_interaction();", + :html => {:id => "link_edit_#{dom_id(project)}"} ) %>
    <% unless project.description.blank? -%> -
    <%= sanitize(project.description) %>
    +
    <%= format_note(project.description) %>
    <% end -%>