mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-22 07:04:09 +01:00
Merge branch 'svn-tracking'
Up to r881 of svn repository * svn-tracking: (22 commits) Added .gitconfig Added yaml_db plugin: http://opensource.heroku.com/ applied patch from Eric from #732 fixes #730 restores ability to delete user from user management page fixes #724 where editing todos truncates the project name of the todo when the project name contains quotes (") Applied patch from Eric Pallen whcih automatically converts url's to links. Thanks Eric! explain that yaml cannot yet be used for backup as importing is not implemented yet. from mailinglist. hopefully fixes #727.Changes the check on running animation to finished animation regenerate compressed js and cleanup whitespace turns out that getElementsByClassName is removed from prototype and it therfore falls back to the function of the browser which has different semantics. Found here http://www.prototypejs.org/api/utility/getElementsByClassName forgot to create a new compressed js from the previous js changes in the stats page you can downdrill to see the active todos in a certain week from the running time charts. This patch adds the option to see all active todos from the selected week and older. fix #727. Adds a check to prevent expand/collapse while a previous expand/collaps is still animating fixed small problem where updating a todo from mobile resulted in an error becase source_view was nil fixes #726. Thanks Eric Pallen for the fix. The mobile view showed active todos from completed projects while the home page does not. merges changes from tracks1.6 to trunk prepares trunk for 1.6 release fixes #713. Adds behavior for edit/star/delete/check buttons of todo even if there is no todo to show. This makes sure that the behaviors are present when you add a new todo through AJAX. fixes #718. The link included the number of actions which resulted from last commit removed some more whitespace to reduce the download of the mobile view. ...
This commit is contained in:
commit
c1109b3fb3
49 changed files with 1871 additions and 1343 deletions
|
|
@ -22,55 +22,71 @@ module TodosHelper
|
|||
:prevent_default => true
|
||||
end
|
||||
|
||||
def remote_delete_icon
|
||||
def set_behavior_for_delete_icon
|
||||
parameters = "_source_view=#{@source_view}"
|
||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||
str = link_to( image_tag_for_delete,
|
||||
todo_path(@todo), :id => "delete_icon_"+@todo.id.to_s,
|
||||
:class => "icon delete_icon", :title => "delete the action '#{@todo.description}'")
|
||||
apply_behavior '.item-container a.delete_icon:click', :prevent_default => true do |page|
|
||||
page.confirming "'Are you sure that you want to ' + this.title + '?'" do
|
||||
page << "itemContainer = this.up('.item-container'); itemContainer.startWaiting();"
|
||||
page << remote_to_href(:method => 'delete', :with => "'#{parameters}'", :complete => "itemContainer.stopWaiting();")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def remote_delete_icon
|
||||
str = link_to( image_tag_for_delete,
|
||||
todo_path(@todo), :id => "delete_icon_"+@todo.id.to_s,
|
||||
:class => "icon delete_icon", :title => "delete the action '#{@todo.description}'")
|
||||
set_behavior_for_delete_icon
|
||||
str
|
||||
end
|
||||
|
||||
def set_behavior_for_star_icon
|
||||
apply_behavior '.item-container a.star_item:click',
|
||||
remote_to_href(:method => 'put', :with => "{ _source_view : '#{@source_view}' }"),
|
||||
:prevent_default => true
|
||||
end
|
||||
|
||||
def remote_star_icon
|
||||
str = link_to( image_tag_for_star(@todo),
|
||||
toggle_star_todo_path(@todo),
|
||||
:class => "icon star_item", :title => "star the action '#{@todo.description}'")
|
||||
apply_behavior '.item-container a.star_item:click',
|
||||
remote_to_href(:method => 'put', :with => "{ _source_view : '#{@source_view}' }"),
|
||||
:prevent_default => true
|
||||
set_behavior_for_star_icon
|
||||
str
|
||||
end
|
||||
|
||||
def remote_edit_icon
|
||||
def set_behavior_for_edit_icon
|
||||
parameters = "_source_view=#{@source_view}"
|
||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||
apply_behavior '.item-container a.edit_icon:click', :prevent_default => true do |page|
|
||||
page << "Effect.Pulsate(this);"
|
||||
page << remote_to_href(:method => 'get', :with => "'#{parameters}'")
|
||||
end
|
||||
end
|
||||
|
||||
def remote_edit_icon
|
||||
if !@todo.completed?
|
||||
str = link_to( image_tag_for_edit,
|
||||
edit_todo_path(@todo),
|
||||
:class => "icon edit_icon")
|
||||
apply_behavior '.item-container a.edit_icon:click', :prevent_default => true do |page|
|
||||
page << "Effect.Pulsate(this);"
|
||||
page << remote_to_href(:method => 'get', :with => "'#{parameters}'")
|
||||
end
|
||||
set_behavior_for_edit_icon
|
||||
else
|
||||
str = '<a class="icon">' + image_tag("blank.png") + "</a> "
|
||||
end
|
||||
str
|
||||
end
|
||||
|
||||
def remote_toggle_checkbox
|
||||
str = check_box_tag('item_id', toggle_check_todo_path(@todo), @todo.completed?, :class => 'item-checkbox')
|
||||
def set_behavior_for_toggle_checkbox
|
||||
parameters = "_source_view=#{@source_view}"
|
||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||
apply_behavior '.item-container input.item-checkbox:click',
|
||||
remote_function(:url => javascript_variable('this.value'), :method => 'put',
|
||||
:with => "'#{parameters}'")
|
||||
:with => "'#{parameters}'")
|
||||
end
|
||||
|
||||
def remote_toggle_checkbox
|
||||
str = check_box_tag('item_id', toggle_check_todo_path(@todo), @todo.completed?, :class => 'item-checkbox')
|
||||
set_behavior_for_toggle_checkbox
|
||||
str
|
||||
end
|
||||
|
||||
|
|
@ -120,10 +136,10 @@ module TodosHelper
|
|||
str += @todo.project.name unless should_suppress_project
|
||||
str = "(#{str})" unless str.blank?
|
||||
else
|
||||
if (['project', 'tag', 'stats', 'search'].include?(parent_container_type))
|
||||
if (['project', 'tag', 'stats', 'search'].include?(parent_container_type))
|
||||
str << item_link_to_context( @todo )
|
||||
end
|
||||
if (['context', 'tickler', 'tag', 'stats', 'search'].include?(parent_container_type)) && @todo.project_id
|
||||
if (['context', 'tickler', 'tag', 'stats', 'search'].include?(parent_container_type)) && @todo.project_id
|
||||
str << item_link_to_project( @todo )
|
||||
end
|
||||
end
|
||||
|
|
@ -265,4 +281,4 @@ module TodosHelper
|
|||
image_tag("blank.png", :title =>"Star action", :class => class_str)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue