mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 07:40:12 +01:00
Bug #300: Displays pending state and successor information
Pending state is displayed in the date_span. Successor information is displayed in the tooltip of a successor icon placed after the action description. Conflicts: app/helpers/todos_helper.rb public/javascripts/application.js
This commit is contained in:
parent
2bf48a15cb
commit
6d97bca57f
7 changed files with 16 additions and 10 deletions
|
|
@ -83,12 +83,14 @@ module TodosHelper
|
||||||
|
|
||||||
def remote_toggle_checkbox
|
def remote_toggle_checkbox
|
||||||
check_box_tag('item_id', toggle_check_todo_path(@todo), @todo.completed?, :class => 'item-checkbox',
|
check_box_tag('item_id', toggle_check_todo_path(@todo), @todo.completed?, :class => 'item-checkbox',
|
||||||
:disabled => @todo.pending?)
|
:title => @todo.pending? ? 'Blocked by ' + @todo.uncompleted_predecessors.map(&:description).join(', ') : "", :readonly => @todo.pending?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def date_span
|
def date_span
|
||||||
if @todo.completed?
|
if @todo.completed?
|
||||||
"<span class=\"grey\">#{format_date( @todo.completed_at )}</span>"
|
"<span class=\"grey\">#{format_date( @todo.completed_at )}</span>"
|
||||||
|
elsif @todo.pending?
|
||||||
|
"<a title='Depends on: #{@todo.predecessors.map(&:description).join(', ')}'><span class=\"orange\">Pending</span></a> "
|
||||||
elsif @todo.deferred?
|
elsif @todo.deferred?
|
||||||
show_date( @todo.show_from )
|
show_date( @todo.show_from )
|
||||||
else
|
else
|
||||||
|
|
@ -96,6 +98,15 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def successors_span
|
||||||
|
unless @todo.successors.empty?
|
||||||
|
successors_count = @todo.successors.length
|
||||||
|
title = "Has #{pluralize(successors_count, 'pending action')}: #{@todo.successors.map(&:description).join(', ')}"
|
||||||
|
link_to(image_tag( 'blank.png', :width=>'10', :height=>'16', :border=>'0' ),
|
||||||
|
'#', {:class => 'show_successors', :title => title})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def tag_list_text
|
def tag_list_text
|
||||||
@todo.tags.collect{|t| t.name}.join(', ')
|
@todo.tags.collect{|t| t.name}.join(', ')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,12 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||||
<div class="description<%= staleness_class( todo ) %>">
|
<div class="description<%= staleness_class( todo ) %>">
|
||||||
<%= date_span -%>
|
<%= date_span -%>
|
||||||
<span class="todo.descr"><%= h sanitize(todo.description) %></span>
|
<span class="todo.descr"><%= h sanitize(todo.description) %></span>
|
||||||
|
<%= successors_span %>
|
||||||
<%= image_tag_for_recurring_todo(todo) if @todo.from_recurring_todo? %>
|
<%= image_tag_for_recurring_todo(todo) if @todo.from_recurring_todo? %>
|
||||||
<%= tag_list %>
|
<%= tag_list %>
|
||||||
<%= deferred_due_date %>
|
<%= deferred_due_date %>
|
||||||
<%= project_and_context_links( parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
|
<%= project_and_context_links( parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
|
||||||
<%= render(:partial => "todos/toggle_notes", :locals => { :item => todo }) if todo.notes? %>
|
<%= render(:partial => "todos/toggle_notes", :locals => { :item => todo }) if todo.notes? %>
|
||||||
<%= render(:partial => "todos/toggle_dependencies", :locals => { :item => todo }) if todo.uncompleted_predecessors.empty? or !todo.successors.empty? %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">
|
<div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<%= link_to(image_tag( 'blank.png', :width=>'16', :height=>'16', :border=>'0' ), "#", {:class => 'show_dependencies', :title => 'Show dependencies'}) %>
|
|
||||||
|
|
||||||
<div class="todo_dependencies" id="<%= dom_id(item, 'dependencies') %>" style="display:none">
|
|
||||||
<p>Links</p>
|
|
||||||
</div>
|
|
||||||
BIN
public/images/successor_off.png
Normal file
BIN
public/images/successor_off.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
public/images/successor_on.png
Normal file
BIN
public/images/successor_on.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
|
|
@ -247,7 +247,7 @@ $(document).ready(function() {
|
||||||
$(this).next().toggle("fast"); return false;
|
$(this).next().toggle("fast"); return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".show_dependencies").live('click', function () {
|
$(".show_successors").live('click', function () {
|
||||||
$(this).next().toggle("fast"); return false;
|
$(this).next().toggle("fast"); return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,8 @@ a.to_bottom:hover {background: transparent url(/images/bottom_on.png) no-repeat;
|
||||||
a.show_notes, a.link_to_notes {background-image: url(/images/notes_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
a.show_notes, a.link_to_notes {background-image: url(/images/notes_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
||||||
a.show_notes:hover, a.link_to_notes:hover {background-image: url(/images/notes_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
a.show_notes:hover, a.link_to_notes:hover {background-image: url(/images/notes_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
||||||
|
|
||||||
a.show_dependencies, a.link_to_dependencies {background-image: url(/images/notes_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
a.show_successors, a.link_to_successors {background-image: url(/images/successor_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
||||||
a.show_dependencies:hover, a.link_to_dependencies:hover {background-image: url(/images/notes_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
a.show_successors:hover, a.link_to_successors:hover {background-image: url(/images/successor_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
|
||||||
|
|
||||||
/* Structural divs */
|
/* Structural divs */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue