mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Added Luke's patch to fix the expand/collapse icons, which were formerly not working after an Ajax action had been performed without a refresh. This works properly now. Fixes #230.
I also modified the context pages slightly so that it only shows the last n completed actions in that project, where n is the number of completed actions user preference (no_completed). I'll do the same for projects. It prevents the context and project individual pages getting unmanageably long when you've been using it for a while. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@214 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
9723645dcd
commit
654bec2239
8 changed files with 12 additions and 11 deletions
|
|
@ -25,7 +25,8 @@ class Context < ActiveRecord::Base
|
||||||
def find_done_todos
|
def find_done_todos
|
||||||
todos = Todo.find :all, :conditions => ["todos.context_id = #{id} AND todos.done = ?", true],
|
todos = Todo.find :all, :conditions => ["todos.context_id = #{id} AND todos.done = ?", true],
|
||||||
:include => [:context, :project],
|
:include => [:context, :project],
|
||||||
:order => "due IS NULL, due ASC, created_at ASC"
|
:order => "due IS NULL, due ASC, created_at ASC",
|
||||||
|
:limit => @user.preferences["no_completed"]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a count of next actions in the given context
|
# Returns a count of next actions in the given context
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<%= link_to( sanitize("#{context.name}"), { :controller => "context", :action => "show", :name => urlize(context.name) }, { :title => "Go to the #{context.name} context page" } ) %>
|
<%= link_to( sanitize("#{context.name}"), { :controller => "context", :action => "show", :name => urlize(context.name) }, { :title => "Go to the #{context.name} context page" } ) %>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="items toggle_target">
|
<div id="c<%= context.id %>items" class="items toggle_target">
|
||||||
<div id="empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
|
<div id="empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
|
||||||
<div class="message"><p>Currently there are no uncompleted actions in this context</p></div>
|
<div class="message"><p>Currently there are no uncompleted actions in this context</p></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render :partial => "context/context", :locals => { :context => @context, :collapsible => false } %>
|
<%= render :partial => "context/context", :locals => { :context => @context, :collapsible => false } %>
|
||||||
<%= render :partial => "todo/completed", :locals => { :done => @done, :collapsible => false, :append_descriptor => "in this context" } %>
|
<%= render :partial => "todo/completed", :locals => { :done => @done, :collapsible => false, :append_descriptor => "in this context (last #{@user.preferences["no_completed"]})" } %>
|
||||||
|
|
||||||
</div><!-- [end:display_box] -->
|
</div><!-- [end:display_box] -->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ if @saved
|
||||||
page.replace_html "status", content_tag("div", "Added new next action", "class" => "confirmation")
|
page.replace_html "status", content_tag("div", "Added new next action", "class" => "confirmation")
|
||||||
page.visual_effect :appear, 'status', :duration => 0.5
|
page.visual_effect :appear, 'status', :duration => 0.5
|
||||||
page.replace_html "badge_count", @up_count
|
page.replace_html "badge_count", @up_count
|
||||||
page.visual_effect :highlight, "item-#{@item.id}-container", :duration => 3
|
|
||||||
page.send :record, "Form.reset('todo-form-new-action');Form.focusFirstElement('todo-form-new-action')"
|
page.send :record, "Form.reset('todo-form-new-action');Form.focusFirstElement('todo-form-new-action')"
|
||||||
page.insert_html :bottom, "c#{@item.context_id}", :partial => 'todo/item'
|
page.insert_html :bottom, "c#{@item.context_id}items", :partial => 'todo/item'
|
||||||
|
page.visual_effect :highlight, "item-#{@item.id}-container", :duration => 3
|
||||||
else
|
else
|
||||||
page.hide "status"
|
page.hide "status"
|
||||||
page.replace_html "status", content_tag("div", content_tag("h2", "#{pluralize(@item.errors.count, "error")} prohibited this record from being saved") + content_tag("p", "There were problems with the following fields:") + content_tag("ul", @item.errors.each_full { |msg| content_tag("li", msg) }), "id" => "ErrorExplanation", "class" => "ErrorExplanation")
|
page.replace_html "status", content_tag("div", content_tag("h2", "#{pluralize(@item.errors.count, "error")} prohibited this record from being saved") + content_tag("p", "There were problems with the following fields:") + content_tag("ul", @item.errors.each_full { |msg| content_tag("li", msg) }), "id" => "ErrorExplanation", "class" => "ErrorExplanation")
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>Completed in the last 31 days</h2>
|
<h2>Completed in the last 28 days</h2>
|
||||||
<table class="next_actions" cellspacing="5" cellpadding="0" border="0">
|
<table class="next_actions" cellspacing="5" cellpadding="0" border="0">
|
||||||
<%= render :partial => "done", :collection => @done_this_month %>
|
<%= render :partial => "done", :collection => @done_this_month %>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
if @saved
|
if @saved
|
||||||
page["item-#{@item.id}-container"].remove
|
page["item-#{@item.id}-container"].remove
|
||||||
# For some reason, the code below works on the project and context pages, but
|
|
||||||
# not on the todo/list page when the item being deleted has just been added
|
|
||||||
# page.visual_effect :fade, "item-#{@item.id}-container", :duration => 0.4
|
|
||||||
page['badge_count'].replace_html @down_count
|
page['badge_count'].replace_html @down_count
|
||||||
else
|
else
|
||||||
page.replace_html "status", content_tag("div", content_tag("h2", "#{pluralize(@item.errors.count, "error")} prohibited this record from being saved") + content_tag("p", "There were problems with the following fields:") + content_tag("ul", @item.errors.each_full { |msg| content_tag("li", msg) }), "id" => "ErrorExplanation", "class" => "ErrorExplanation")
|
page["status"].replace_html content_tag("div", content_tag("h2", "#{pluralize(@item.errors.count, "error")} prohibited this record from being saved") + content_tag("p", "There were problems with the following fields:") + content_tag("ul", @item.errors.each_full { |msg| content_tag("li", msg) }), "id" => "ErrorExplanation", "class" => "ErrorExplanation")
|
||||||
end
|
end
|
||||||
|
|
@ -1 +1 @@
|
||||||
page.replace_html "status", "An error occurred on the server."
|
page["status"].replace_html "An error occurred on the server."
|
||||||
|
|
@ -279,6 +279,9 @@ a.footer_link:hover {color: #fff; background-color: #cc3334 !important;}
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#status .confirmation {
|
||||||
|
width: 220px;
|
||||||
|
}
|
||||||
#warning, .warning {
|
#warning, .warning {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
border: 1px solid #ED2E38;
|
border: 1px solid #ED2E38;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue