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/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index d8fe0a51..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) @@ -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/layouts/standard.html.erb b/app/views/layouts/standard.html.erb index 11ebb9d8..223efb41 100644 --- a/app/views/layouts/standard.html.erb +++ b/app/views/layouts/standard.html.erb @@ -30,6 +30,7 @@ var defaultTags = <%= default_tags_for_autocomplete %>; var tagNames = <%= tag_names_for_autocomplete %>; var dateFormat = '<%= date_format_for_date_picker %>'; + var weekStart = '<%= current_user.prefs.week_starts %>'; <% end -%> <% if @prefs.refresh != 0 -%> setup_auto_refresh(<%= @prefs["refresh"].to_i*60000 %>); diff --git a/app/views/recurring_todos/_recurring_todo_form.erb b/app/views/recurring_todos/_recurring_todo_form.erb index ef724f33..4b3dc734 100644 --- a/app/views/recurring_todos/_recurring_todo_form.erb +++ b/app/views/recurring_todos/_recurring_todo_form.erb @@ -2,8 +2,7 @@ <% form_remote_tag( :url => recurring_todos_path, :method => :post, :html=> { :id=>'recurring-todo-form-new-action', :name=>'recurring_todo', :class => 'inline-form' }, - :before => "$('#recurring_todo_new_action_submit').block({message: null})", - :complete => "$('#recurring_todo_new_action_submit').unblock();$('#recurring-todo-form-new-action').clearForm();") do + :before => "$('#recurring_todo_new_action_submit').block({message: null})") do -%>
<%= error_messages_for("item", :object_name => 'action') %>
@@ -18,7 +17,7 @@ - + <%= text_field_tag "tag_list", nil, :size => 30, :tabindex => 5 -%> diff --git a/app/views/recurring_todos/create.js.rjs b/app/views/recurring_todos/create.js.rjs index 790e2fc9..4ef13703 100644 --- a/app/views/recurring_todos/create.js.rjs +++ b/app/views/recurring_todos/create.js.rjs @@ -4,8 +4,7 @@ page.replace_html 'new_status', "#{error_messages_for('recurring_todo')}" page.notify :notice, @message, 5.0 if @recurring_saved # reset form - page << "TracksForm.hide_all_recurring(); $('#recurring_daily').show();" - page << "$('#recurring_todo_new_action_submit').unblock();$('#recurring-todo-form-new-action').clearForm();" + page['new-recurring-todo'].replace_html :partial => 'recurring_todo_form' # hide overlayed edit form page << "TracksForm.toggle_overlay();" # insert new recurring todo diff --git a/app/views/todos/_todo.html.erb b/app/views/todos/_todo.html.erb index 579ea766..4e325c8b 100644 --- a/app/views/todos/_todo.html.erb +++ b/app/views/todos/_todo.html.erb @@ -11,12 +11,12 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
<%= remote_star_icon %> <%= remote_toggle_checkbox unless source_view_is :deferred %> + <% unless suppress_edit_button %> + <%= remote_edit_button %> + <% end %>