Merge branch 'defer_buttons' of git://github.com/epall/tracks into master

This commit is contained in:
Eric Allen 2008-09-21 11:59:35 -07:00
commit 383328fab6
8 changed files with 29 additions and 2 deletions

View file

@ -384,7 +384,21 @@ class TodosController < ApplicationController
end
end
private
def defer
@source_view = params['_source_view'] || 'todo'
numdays = params['days'].to_i
@todo = Todo.find(params[:id])
@todo.show_from = (@todo.show_from || @todo.user.date) + numdays.days
@saved = @todo.save
respond_to do |format|
format.html { redirect_to :back }
format.js {render :action => 'update'}
end
end
private
def get_todo_from_params
@todo = current_user.todos.find(params['id'])

View file

@ -280,4 +280,8 @@ module TodosHelper
image_tag("blank.png", :title =>"Star action", :class => class_str)
end
def defer_link(days)
link_to_remote image_tag("defer_#{days}.png"), :url => {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => days, :_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}
end
end

View file

@ -11,6 +11,7 @@
<%= remote_star_icon %>
<%= remote_toggle_checkbox unless source_view_is :deferred %>
<div class="description<%= staleness_class( todo ) %>">
<% unless @todo.completed? %><span class="defer-container"><%= defer_link(1) %> <%= defer_link(7) %></span><% end %>
<%= date_span -%>
<span class="todo.descr"><%= h sanitize(todo.description) %></span>
<%= link_to(image_tag("recurring16x16.png"), {:controller => "recurring_todos", :action => "index"}, :class => "recurring_icon") if @todo.from_recurring_todo? %>

BIN
public/images/defer_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
public/images/defer_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -1200,4 +1200,10 @@ body.integrations textarea {
padding:3px;
width:80%;
background-color:#ddd;
}
}
.defer-container {
float:right;
}
.defer-container a:hover {
background-color: inherit;
}

View file

@ -220,6 +220,8 @@ body.integrations h2 {margin-top:40px; padding-top:20px; margin-bottom:10px; bor
body.integrations p, body.integrations li {font-size:1.0em}
body.integrations li {list-style-type: disc; list-style-position: inside; margin-left:30px}
body.integrations textarea {margin:10px; padding:3px; width:80%; background-color:#ddd}
.defer-container {float:right}
.defer-container a:hover {background-color: inherit}
div.calendar {position: relative}
.calendar, .calendar table {border: 1px solid #556; font-size: 11px; color: #000; cursor: default; background: #eef; z-index: 110; font-family: tahoma,verdana,sans-serif}
.calendar .button {text-align: center; padding: 2px}