mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-16 14:15:28 +01:00
Quite a few changes in this revision:
1. The contexts and projects lists are now drag and droppable. In other words, if you visit [tracks_url]/projects or [tracks_url]/contexts, you can grab the 'DRAG' handle with the mouse and drag and drop the projects or contexts into your preferred order. At the same time, this re-orders the 'position' column appropriately, so that changes in order will be reflected on other pages. '''NB''': At the moment, deleting projects and contexts is a bit buggy. The item doesn't disappear, but if you refresh the page it will update appropriately. Also, if you add a new item, you can't drag it until you refresh. I'll try to fix these things. Fixes #115. 2. Fixed typo of 'tomorrow' due date label. Fixes #131 3. I updated the syntax for some of the visual effects to use the new {{{visual_effect(:fade, 'element')}}} syntax. Also removed the javascript files effects2 and prototype-ex, which aren't used now. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@148 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
86b8753c17
commit
5ce97df3f4
16 changed files with 78 additions and 519 deletions
|
|
@ -72,36 +72,15 @@ class ContextController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# Methods for changing the sort order of the contexts in the list
|
||||
# Methods for changing the sort order of the projects in the list
|
||||
#
|
||||
def move_up
|
||||
check_user_set_context
|
||||
@context.move_higher
|
||||
@context.save
|
||||
redirect_to(:controller => "context", :action => "list")
|
||||
def order
|
||||
@params["list-contexts"].each_with_index do |id, position|
|
||||
Context.update(id, :position => position + 1)
|
||||
end
|
||||
render_text ""
|
||||
end
|
||||
|
||||
def move_down
|
||||
check_user_set_context
|
||||
@context.move_lower
|
||||
@context.save
|
||||
redirect_to(:controller => "context", :action => "list")
|
||||
end
|
||||
|
||||
def move_top
|
||||
check_user_set_context
|
||||
@context.move_to_top
|
||||
@context.save
|
||||
redirect_to(:controller => "context", :action => "list")
|
||||
end
|
||||
|
||||
def move_bottom
|
||||
check_user_set_context
|
||||
@context.move_to_bottom
|
||||
@context.save
|
||||
redirect_to(:controller => "context", :action => "list" )
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
|
||||
def check_user_set_context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue