diff --git a/.gitignore b/.gitignore index 34fd4e71..b2629579 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ config/database.yml config/environment.rb log -tmp \ No newline at end of file +tmp +db/data.yml \ No newline at end of file diff --git a/README b/README index 7ed8b4a5..3e6d8f9d 100644 --- a/README +++ b/README @@ -1,7 +1,6 @@ # Tracks: a GTD(TM) web application, built with Ruby on Rails * Project homepage: http://www.rousette.org.uk/projects/ -* Development page: http://tracks.lighthouseapp.com/projects/11609-tracks/overview * GitHub: http://github.com/bsag/tracks/ * Trac (for bug reports and feature requests): http://dev.rousette.org.uk/report/6 * Wiki (community contributed information): http://www.rousette.org.uk/projects/wiki/ @@ -9,10 +8,12 @@ * Mailing list: http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss * Original developer: bsag (http://www.rousette.org.uk/) * Contributors: http://dev.rousette.org.uk/wiki/Tracks/Contributing/Contributors -* Version: 1.5 -* Copyright: (cc) 2004-2006 rousette.org.uk. +* Version: 1.6 +* Copyright: (cc) 2004-2008 rousette.org.uk. * License: GNU GPL +**An important note for version 1.6: OpenID support is broken in this release. The fix isn't trivial because of changes to the `ruby-openid` gem, so we wanted to get this version out now and fix OpenID for the next release. If you depend on OpenID integration, we recommend waiting until the next release.** + All the documentation for Tracks can be found within the /doc directory. It contains a manual in HTML (manual.html) or PDF format (manual.pdf), and this includes full instructions for both new installations and upgrades from older installations of Tracks. The instructions might appear long and intimidatingly complex, but that is mostly because of the number of different platforms supported, and the different configurations which can be used (e.g. running Tracks on your local computer or on a remote server). If you choose the appropriate section for your situation (installation vs. upgrade), and use the easiest (recommended) method, you should find the instructions easy to follow. If you encounter problems, try searching the wiki, forum or mailing list (URLs above), and ask a question if you cannot find a solution to your problem. For those upgrading, change notes are available in /doc/CHANGELOG. If you are thinking about contributing towards the development of Tracks, please read /doc/README_DEVELOPERS for general information, or /doc/tracks_api_wrapper.rb for information on Tracks' API. diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index c44f592e..c28490ca 100755 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -481,8 +481,10 @@ class StatsController < ApplicationController @chart_name = "actions_visible_running_time_data" @page_title = "Actions selected from week " + @further = false if params['id'] == 'avrt_end' @page_title += week_from.to_s + " and further" + @further = true else @page_title += week_from.to_s + " - " + week_to.to_s + "" end @@ -512,8 +514,10 @@ class StatsController < ApplicationController @chart_name = "actions_running_time_data" @page_title = "Actions selected from week " + @further = false if params['id'] == 'art_end' @page_title += week_from.to_s + " and further" + @further = true else @page_title += week_from.to_s + " - " + week_to.to_s + "" end diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index a334e189..27f9d23d 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -154,6 +154,7 @@ class TodosController < ApplicationController end def update + @source_view = params['_source_view'] || 'todo' init_data_for_sidebar unless mobile? @todo.tag_with(params[:tag_list], current_user) if params[:tag_list] @original_item_context_id = @todo.context_id @@ -461,7 +462,11 @@ class TodosController < ApplicationController @todos = Todo.find(:all, :conditions => ['todos.user_id = ?', current_user.id], :include => [ :project, :context, :tags ]) # Exclude hidden projects from the home page - @not_done_todos = Todo.find(:all, :conditions => ['todos.user_id = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', current_user.id, false, 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => [ :project, :context, :tags ]) + @not_done_todos = Todo.find(:all, + :conditions => ['todos.user_id = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', + current_user.id, false, 'active'], + :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", + :include => [ :project, :context, :tags ]) end end @@ -475,8 +480,8 @@ class TodosController < ApplicationController # Exclude hidden projects from the home page @not_done_todos = Todo.find(:all, - :conditions => ['todos.user_id = ? AND todos.state = ? AND contexts.hide = ?', - current_user.id, 'active', false], + :conditions => ['todos.user_id = ? AND todos.state = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', + current_user.id, 'active', false, 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => [ :project, :context ]) end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9d750597..bd5fe39e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -116,7 +116,7 @@ class UsersController < ApplicationController # DELETE /users/somelogin # DELETE /users/somelogin.xml def destroy - @deleted_user = User.find_by_id(params[:id]) + @deleted_user = User.find_by_login(params[:id]) @saved = @deleted_user.destroy @total_users = User.find(:all).size diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 869f82e1..c543bbb0 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -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 = '' + image_tag("blank.png") + " " 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 \ No newline at end of file diff --git a/app/views/contexts/_context.rhtml b/app/views/contexts/_context.rhtml index 59809d23..7fb2e942 100644 --- a/app/views/contexts/_context.rhtml +++ b/app/views/contexts/_context.rhtml @@ -4,18 +4,21 @@ <% if collapsible -%> <%= image_tag("collapse.png") %> <% apply_behavior '.container_toggle:click', :prevent_default => true do |page| - page << "containerElem = this.up('.container') - toggleTarget = containerElem.down('.toggle_target') - if (Element.visible(toggleTarget)) - { - todoItems.collapseNextActionListing(this, toggleTarget); - todoItems.contextCollapseCookieManager.setCookie(todoItems.buildCookieName(containerElem), true) - } - else - { - todoItems.expandNextActionListing(this, toggleTarget); - todoItems.contextCollapseCookieManager.clearCookie(todoItems.buildCookieName(containerElem)) - } + page << " /* only handle the click if a previous click had finished its animation */ + if (todoItems.lastEffect == null || todoItems.lastEffect.state=='finished') { + containerElem = this.up('.container') + toggleTarget = containerElem.down('.toggle_target') + if (Element.visible(toggleTarget)) + { + todoItems.collapseNextActionListing(this, toggleTarget); + todoItems.contextCollapseCookieManager.setCookie(todoItems.buildCookieName(containerElem), true) + } + else + { + todoItems.expandNextActionListing(this, toggleTarget); + todoItems.contextCollapseCookieManager.clearCookie(todoItems.buildCookieName(containerElem)) + } + } " end %> @@ -31,6 +34,14 @@
You can choose between the following formats:
diff --git a/app/views/feedlist/mobile_index.rhtml b/app/views/feedlist/mobile_index.rhtml index a8511e75..b8c64398 100644 --- a/app/views/feedlist/mobile_index.rhtml +++ b/app/views/feedlist/mobile_index.rhtml @@ -1,50 +1,32 @@