mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-25 10:16:11 +01:00
You can mark projects as completed (by editing the project on /projects). In the 'sidebar' active and completed projects are shown separately, but you can still view the completed project.
Fixes #5. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@91 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
ed5d72e9e1
commit
8a08515227
9 changed files with 87 additions and 20 deletions
|
|
@ -140,7 +140,7 @@ class ProjectController < ApplicationController
|
|||
item.toggle!('done')
|
||||
render_partial 'show_items', item
|
||||
end
|
||||
|
||||
|
||||
# Methods for changing the sort order of the projects in the list
|
||||
#
|
||||
def move_up
|
||||
|
|
|
|||
|
|
@ -76,6 +76,20 @@
|
|||
<li><%= link_to( other_context.name, { :controller => "context", :action => "show", :name => urlize(other_context.name) } ) + " (" + Todo.count( "project_id=#{other_context.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<h3>Active Projects:</h3>
|
||||
<ul>
|
||||
<% for active_project in Project.find(:all, :conditions => "done=0", :order => "position") %>
|
||||
<li><%= link_to( active_project.name, { :controller => "project", :action => "show", :name => urlize(active_project.name) } ) + " (" + Todo.count( "project_id=#{active_project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<h3>Completed Projects:</h3>
|
||||
<ul>
|
||||
<% for done_project in Project.find(:all, :conditions => "done=1", :order => "position") %>
|
||||
<li><%= link_to( done_project.name, { :controller => "project", :action => "show", :name => urlize(done_project.name) } ) + " (" + Todo.count( "project_id=#{active_project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div><!-- End of input box -->
|
||||
|
||||
<% if @flash["confirmation"] %><div class="confirmation"><%= @flash["confirmation"] %></div><% end %>
|
||||
|
|
|
|||
|
|
@ -8,5 +8,7 @@
|
|||
<div class="data">
|
||||
<label for="project_name">Name</label>
|
||||
<%= text_field 'project', 'name', :class => 'project-name' %>
|
||||
<label for="project_done">Project done?</label>
|
||||
<%= check_box 'project', 'done', :class => 'project-done' %>
|
||||
</div>
|
||||
<% @project = nil %>
|
||||
|
|
@ -17,7 +17,13 @@
|
|||
<%= link_to( "#{project.name}", :action => "show", :name => urlize(project.name) ) %><%= " (" + Todo.count( "project_id=#{project.id} AND done=0" ).to_s + " actions)" %>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<%= link_to_function(image_tag( "edit", :title => "Edit item", :width=>"10", :height=>"10", :border=>"0"), "Element.toggle('project-#{project.id}','project-#{project.id}-edit-form'); new Effect.Appear('project-#{project.id}-edit-form'); Form.focus_first('form-project-#{project.id}');" ) + " " +
|
||||
<% if project.done == 1 -%>
|
||||
<input type="checkbox" value="1" checked="checked" disabled="true" />
|
||||
<% else -%>
|
||||
<input type="checkbox" value="0" disabled="true" />
|
||||
<% end -%>
|
||||
|
||||
<%= link_to_function(image_tag( "edit", :title => "Edit item", :width=>"10", :height=>"10", :border=>"0"), "Element.toggle('project-#{project.id}','project-#{project.id}-edit-form'); new Effect.Appear('project-#{project.id}-edit-form'); Form.focus_first('form-project-#{project.id}');" ) + " " +
|
||||
link_to_remote( image_tag("delete", :title =>"Delete this project"),
|
||||
:update => "project-#{project.id}-container",
|
||||
:loading => "new Effect.Squish('project-#{project.id}-container')",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
:update => "completed",
|
||||
:position => "top",
|
||||
:loading => "Form.disable('checkbox-notdone-#{item.id}');",
|
||||
:complete => "new Effect.Squish('project-item-#{item.id}-container', true);"
|
||||
:complete => "new Effect.Squish('item-#{item.id}-container', true);"
|
||||
) %>
|
||||
|
||||
<div id="item-<%= item.id %>">
|
||||
|
|
|
|||
|
|
@ -4,13 +4,15 @@
|
|||
<h2><%= @project.name %></h2>
|
||||
|
||||
<div id="next_actions">
|
||||
<% if @not_done.empty? %>
|
||||
<% if @project.done == 1 -%>
|
||||
<p class="info">This project has been completed</p>
|
||||
<% elsif @not_done.empty? -%>
|
||||
<p>There are no next actions yet in this project</p>
|
||||
<% else %>
|
||||
<% for item in @not_done %>
|
||||
<% else -%>
|
||||
<% for item in @not_done -%>
|
||||
<%= render_partial "show_items", item %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
</div><!-- [end:next_actions] -->
|
||||
</div><!-- [end:contexts] -->
|
||||
|
||||
|
|
@ -64,8 +66,29 @@
|
|||
|
||||
<h3>Active Projects:</h3>
|
||||
<ul>
|
||||
<% for other_project in Project.find_all %>
|
||||
<li><%= link_to( other_project.name, { :controller => "project", :action => "show", :name => urlize(other_project.name) } ) + " (" + Todo.count( "project_id=#{other_project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% for active_project in Project.find(:all, :conditions => "done=0", :order => "position") %>
|
||||
<li><%= link_to( active_project.name, { :controller => "project", :action => "show", :name => urlize(active_project.name) } ) + " (" + Todo.count( "project_id=#{active_project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<h3>Completed Projects:</h3>
|
||||
<ul>
|
||||
<% for done_project in Project.find(:all, :conditions => "done=1", :order => "position") %>
|
||||
<li><%= link_to( done_project.name, { :controller => "project", :action => "show", :name => urlize(done_project.name) } ) + " (" + Todo.count( "project_id=#{active_project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<h3>Active Contexts:</h3>
|
||||
<ul>
|
||||
<% for other_context in Context.find(:all, :conditions => "hide=0", :order => "position ASC") %>
|
||||
<li><%= link_to( other_context.name, { :controller => "context", :action => "show", :name => urlize(other_context.name) } ) + " (" + Todo.count( "project_id=#{other_context.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<h3>Hidden Contexts:</h3>
|
||||
<ul>
|
||||
<% for other_context in Context.find(:all, :conditions => "hide=1", :order => "position ASC") %>
|
||||
<li><%= link_to( other_context.name, { :controller => "context", :action => "show", :name => urlize(other_context.name) } ) + " (" + Todo.count( "project_id=#{other_context.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div><!-- End of input box -->
|
||||
|
|
|
|||
|
|
@ -77,17 +77,31 @@
|
|||
|
||||
<h3>Active Projects:</h3>
|
||||
<ul>
|
||||
<% for project in @projects -%>
|
||||
<li><%= link_to( project.name, { :controller => "project", :action => "show", :name => urlize(project.name) } ) + " (" + Todo.count( "project_id=#{project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end -%>
|
||||
<% for active_project in Project.find(:all, :conditions => "done=0", :order => "position") %>
|
||||
<li><%= link_to( active_project.name, { :controller => "project", :action => "show", :name => urlize(active_project.name) } ) + " (" + Todo.count( "project_id=#{active_project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Completed Projects:</h3>
|
||||
<ul>
|
||||
<% for done_project in Project.find(:all, :conditions => "done=1", :order => "position") %>
|
||||
<li><%= link_to( done_project.name, { :controller => "project", :action => "show", :name => urlize(done_project.name) } ) + " (" + Todo.count( "project_id=#{active_project.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<h3>Active Contexts:</h3>
|
||||
<ul>
|
||||
<% for other_context in Context.find(:all, :conditions => "hide=0", :order => "position ASC") %>
|
||||
<li><%= link_to( other_context.name, { :controller => "context", :action => "show", :name => urlize(other_context.name) } ) + " (" + Todo.count( "project_id=#{other_context.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<h3>Hidden Contexts:</h3>
|
||||
<ul>
|
||||
<% for other_context in Context.find(:all, :conditions => "hide=1", :order => "position ASC") %>
|
||||
<li><%= link_to( other_context.name, { :controller => "context", :action => "show", :name => urlize(other_context.name) } ) + " (" + Todo.count( "context_id=#{other_context.id} AND done=0" ).to_s + " actions)" -%></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
<ul>
|
||||
<% for other_context in Context.find(:all, :conditions => "hide=1", :order => "position ASC") %>
|
||||
<li><%= link_to( other_context.name, { :controller => "context", :action => "show", :name => urlize(other_context.name) } ) + " (" + Todo.count( "project_id=#{other_context.id} AND done=0" ).to_s + " actions)" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div><!-- End of input box -->
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ Project wiki: <http://www.rousette.org.uk/projects/wiki/>
|
|||
2. Removed the section in config/environment.rb which requires Redcloth. This was causing errors because Rails now requires Redcloth itself. This means that you now need to have Redcloth installed as a gem (gem install redcloth) (thanks, Jim).
|
||||
3. Fixed SQLite dump format in db/tracks_1.0.2_sqlite.sql (thanks, Jim)
|
||||
4. The new item forms on all pages now use a mini calendar which pops up when you click the due date field. Calendar is the GPL one from dynarch.com <http://www.dynarch.com/projects/calendar/>
|
||||
5. Added some XMLHTTPRequest calls to speed up checking off an item as done. It grabs the checked item and appends it immediately to a 'holding' section (where you can uncheck it again if it was a mistake, or add a closing note). When you next refresh the page, it will be added to the 'Last 5 completed items' section.
|
||||
6. [Contributed by Lolindrath] Toggling of contexts in /todo/list to collapse or expand their display via a small '+' or '-' graphic. This is independent of the shown/hidden setting for contexts, and is ideal for just hiding things on the fly to focus your view.
|
||||
7. [Contributed by Jim Ray] Jim added a host of fixes and bits of cleaning up, including a position column for contexts and projects to allow custom sorting, and changes to the links for pages to make them more human-readable.
|
||||
8. I added a pop-up calendar to set the due date. This is entirely lifted from Michele's excellent tutorial on pxl8.com <http://www.pxl8.com/calendar_date_picker.html>. It works well, but I need to make sure it doesn't break in postgresql or sqlite.
|
||||
|
|
@ -32,6 +31,7 @@ Project wiki: <http://www.rousette.org.uk/projects/wiki/>
|
|||
marked darker yellow, and those created more than 28 days ago (staleness_starts * 3) are fluorescent
|
||||
yellow!
|
||||
17. Contexts and projects can now be sorted in any order you like. Arrow buttons on the /contexts and /projects pages let you move an item to the top, up, down or to the bottom. For contexts, this affects the order in which they sort on the home page.
|
||||
18. You can mark projects as completed (by editing the project on /projects). In the 'sidebar' active and completed projects are shown separately, but you can still view the completed project.
|
||||
|
||||
## Version 1.02
|
||||
|
||||
|
|
|
|||
|
|
@ -245,6 +245,14 @@ h2 a:hover {
|
|||
padding: 1px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: #fff;
|
||||
background: #CCC;
|
||||
border: 1px solid #999;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Backgrounds marking out 'staleness' of a task based on age of creation date
|
||||
The colour of the background gets progressively yellower with age */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue