Skip to content

Commit

Permalink
see release notes 0.2.14
Browse files Browse the repository at this point in the history
  • Loading branch information
noctivityinc committed May 5, 2010
1 parent 1784185 commit 7d82605
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 43 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.textile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
h1. Todopia Release Notes

h3. 0.2.14
* #! tag now highlights the todo
* shift-enter saves a new/edited todo

h3. 0.2.13 (hotfix)
* Reenabled plain text email. Appears to be an odd Gmail spam issue
* Added link in daily summary to shutting off daily summary :)
Expand Down
11 changes: 8 additions & 3 deletions app/controllers/public/todos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ def create
end

def edit
@todo.tag_list.push(@todo.due_date.strftime('%m/%d/%Y')) if @todo.due_date
@todo.tag_list.push("starts #{@todo.starts_at.strftime('%m/%d/%Y')}") if @todo.starts_at
@todo.tag_string = @todo.tag_list
setup_tags
respond_to do |format|
format.js { render :partial => 'form' }
format.html { render :action => 'edit' }
Expand Down Expand Up @@ -98,6 +96,13 @@ def load_todos
@todos = @user.todos.not_complete
@completed = @user.todos.complete
end

def setup_tags
@todo.tag_list.push(@todo.due_date.strftime('%m/%d/%Y')) if @todo.due_date
@todo.tag_list.push("starts #{@todo.starts_at.strftime('%m/%d/%Y')}") if @todo.starts_at
@todo.tag_list.push('#!') if @todo.highlight
@todo.tag_string = @todo.tag_list
end

def render_list(status=200)
puts "XHR: #{request.xhr?}"
Expand Down
1 change: 1 addition & 0 deletions app/helpers/public/todos_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def tag_rel_url(todo, tag)
def todo_css(todo)
(css ||= []) << 'waiting' if todo.waiting_since
(css ||= []) << 'blink' if todo.due_date && todo.due_date <= Date.today && !todo.waiting_since
(css ||= []) << 'highlight' if todo.highlight
css.join(' ') if css
end

Expand Down
19 changes: 13 additions & 6 deletions app/models/todo.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# == Schema Information
# Schema version: 20100502203721
# Schema version: 20100505003817
#
# Table name: todos
#
Expand All @@ -15,6 +15,7 @@
# waiting_since :datetime
# starts_at :datetime
# reminder_sent_at :datetime
# highlight :boolean
#

class Todo < ActiveRecord::Base
Expand Down Expand Up @@ -97,33 +98,39 @@ def check_completed

def filter_plugins
new_list = self.tag_string.split(',').map do |tag|
if %w{!}.include? tag[0]
tag.strip!
if %w{!}.include?(tag[0])
tag[1..-1]
else
tag if !Chronic.parse(tag)
end
end.join(',')
end.compact
new_list = new_list - ['#!'] # => filter out keywords that cause action which should not be tags
new_list.join(',')
end

def pre_tag_plugins
return unless self.tag_string

self.starts_at = self.due_date = nil
self.starts_at = self.due_date = self.highlight = nil

self.tag_string.split(',').each { |tag|
tag.strip!
if !tag.scan(/^(start|begin)s?(\s[at|on])?\s(.*)\b/).empty?
self.starts_at = Chronic.parse(tag)
elsif Chronic.parse(tag)
self.due_date = Chronic.parse(tag)
elsif tag.starts_with? '#'
tag[1] == '!' ? (self.highlight = true) : (self.priority = tag[1..-1])
end
self.priority = tag[1..-1] if tag.starts_with? '#'
}

self.starts_at = self.due_date if self.starts_at && self.due_date && self.due_date < self.starts_at # => prevents setting a due date before the event starts
end

def post_tag_plugins
return unless self.tag_string
self.tag_string.downcase.split(',').each {|tag| self.user.tag_groups.create(:tag => tag[1..-1]) if tag.starts_with? '!' }
self.tag_string.downcase.split(',').each {|tag| tag.strip!; self.user.tag_groups.create(:tag => tag[1..-1]) if tag.starts_with? '!' }
end


Expand Down
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# == Schema Information
# Schema version: 20100503113238
# Schema version: 20100505003817
#
# Table name: users
#
Expand All @@ -21,7 +21,7 @@
# created_at :datetime
# updated_at :datetime
# invite_id :integer
# email_daily_summary :boolean
# email_daily_summary :boolean default(TRUE)
# daily_summary_sent_at :datetime
# email_summary_only_when_todos_due :boolean
#
Expand Down
3 changes: 3 additions & 0 deletions app/stylesheets/partials/_todos.sass
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@

a
color: #666

&.highlight
background: yellow

.col
padding-right: 5px
Expand Down
3 changes: 3 additions & 0 deletions app/views/public/todos/_docs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
.sc
%b #1, #2, #3, etc
sets a priority, 1 being highest
.sc
%b #!
highlights the todo
.sc
%b "starts DATE EXPRESSION"
schedules the todo for later
Expand Down
9 changes: 9 additions & 0 deletions db/migrate/20100505003817_add_highlight_to_todos.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddHighlightToTodos < ActiveRecord::Migration
def self.up
add_column :todos, :highlight, :boolean
end

def self.down
remove_column :todos, :highlight
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20100503113238) do
ActiveRecord::Schema.define(:version => 20100505003817) do

create_table "histories", :force => true do |t|
t.integer "todo_id"
Expand Down Expand Up @@ -83,6 +83,7 @@
t.datetime "waiting_since"
t.datetime "starts_at"
t.datetime "reminder_sent_at"
t.boolean "highlight"
end

create_table "users", :force => true do |t|
Expand Down
2 changes: 2 additions & 0 deletions public/javascripts/controllers/public/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ function bind_keyboard() {
$(document).bind('keydown', 'f', function(){ $('body').data('position',0); $('.todo_checkbox:first').focus(); return false; });
$(document).bind('keydown', 'ctrl+n', function(){ new_todo(); return false; });
$(document).bind('keydown', 'ctrl+s', function(){ $('#new_todo').submit(); return false; });
$(document).bind('keydown', 'shift+return', function(){ $('#new').find('form').submit(); return false; });
$('body:not(#new)').bind('keydown', 'c', function(){ new_todo(); return false; });
}

Expand All @@ -225,6 +226,7 @@ function bind_add_edit_keyboard() {
$('input:not(.todo_checkbox)').bind('keydown', 'ctrl+n', function(){ new_todo(); return false; });
$('input:not(.todo_checkbox)').bind('keydown', 'ctrl+s', function(){ $('#new_todo').submit(); return false; });
$('input').bind('keydown','esc', function(){ toggle_todo_form(); return false; })
$('input').bind('keydown', 'shift+return', function(){ $('#new').find('form').submit(); return false; });
}

function setup_tooltips(){
Expand Down
60 changes: 32 additions & 28 deletions public/stylesheets/compiled/public.css
Original file line number Diff line number Diff line change
Expand Up @@ -955,47 +955,51 @@
color: #666;
}
/* line 53, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo.highlight {
background: yellow;
}
/* line 56, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo .col {
padding-right: 5px;
display: inline;
float: left;
}
/* line 57, ../../../app/stylesheets/partials/_todos.sass */
/* line 60, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo .col img {
vertical-align: baseline;
}
/* line 60, ../../../app/stylesheets/partials/_todos.sass */
/* line 63, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane {
display: table;
float: left;
overflow: hidden;
min-width: 400px;
max-width: 650px;
}
/* line 68, ../../../app/stylesheets/partials/_todos.sass */
/* line 71, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane .col_select.selected {
background: transparent url(/images/icons/download.png) -41px -21px no-repeat;
}
/* line 71, ../../../app/stylesheets/partials/_todos.sass */
/* line 74, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane .col_cb {
width: 20px;
text-align: center;
}
/* line 75, ../../../app/stylesheets/partials/_todos.sass */
/* line 78, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane .col_cb input.vanish {
position: absolute;
left: -1000px;
}
/* line 79, ../../../app/stylesheets/partials/_todos.sass */
/* line 82, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane .col_label {
padding-right: 15px;
font-size: 1em;
}
/* line 84, ../../../app/stylesheets/partials/_todos.sass */
/* line 87, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane .col_tags .tags {
overflow: hidden;
}
/* line 86, ../../../app/stylesheets/partials/_todos.sass */
/* line 89, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane .col_tags .tags .tag {
display: inline;
float: left;
Expand All @@ -1006,98 +1010,98 @@
margin: 0em;
cursor: pointer;
}
/* line 95, ../../../app/stylesheets/partials/_todos.sass */
/* line 98, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #left_pane .col_tags .tags .tag.selected {
background: yellow;
}
/* line 98, ../../../app/stylesheets/partials/_todos.sass */
/* line 101, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #right_pane {
float: right;
overflow: hidden;
}
/* line 102, ../../../app/stylesheets/partials/_todos.sass */
/* line 105, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #right_pane .col_due {
width: 100px;
text-align: right;
}
/* line 106, ../../../app/stylesheets/partials/_todos.sass */
/* line 109, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #right_pane .col_scheduled {
width: 120px;
text-align: right;
}
/* line 110, ../../../app/stylesheets/partials/_todos.sass */
/* line 113, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #right_pane .due_date, #todo #index #not_complete .todo #right_pane .scheduled_date {
font-size: .90em;
color: #666;
}
/* line 114, ../../../app/stylesheets/partials/_todos.sass */
/* line 117, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .todo #right_pane .due_date.past_due, #todo #index #not_complete .todo #right_pane .scheduled_date.past_due {
color: red;
}
/* line 118, ../../../app/stylesheets/partials/_todos.sass */
/* line 121, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #not_complete .ui-state-highlight {
height: 1.5em;
line-height: 1.2em;
}
/* line 123, ../../../app/stylesheets/partials/_todos.sass */
/* line 126, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #completed h2 {
font-size: 1em;
margin: 1em 0em .25em 0em;
}
/* line 127, ../../../app/stylesheets/partials/_todos.sass */
/* line 130, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #completed h2 a {
color: black;
}
/* line 130, ../../../app/stylesheets/partials/_todos.sass */
/* line 133, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #completed .completed {
font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif;
font-style: italic;
font-size: 1.15em;
}
/* line 132, ../../../app/stylesheets/partials/_todos.sass */
/* line 135, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #completed .completed .completed_at, #todo #index #completed .completed .completed_by {
color: gray;
}
/* line 136, ../../../app/stylesheets/partials/_todos.sass */
/* line 139, ../../../app/stylesheets/partials/_todos.sass */
#todo #index #completed .completed .label a {
text-decoration: none;
color: black;
}
/* line 140, ../../../app/stylesheets/partials/_todos.sass */
/* line 143, ../../../app/stylesheets/partials/_todos.sass */
#todo #docs {
font-size: .90em;
color: #666;
text-align: center;
margin-top: 6em;
}
/* line 145, ../../../app/stylesheets/partials/_todos.sass */
/* line 148, ../../../app/stylesheets/partials/_todos.sass */
#todo #docs .sc {
display: inline;
padding-right: 1em;
}
/* line 149, ../../../app/stylesheets/partials/_todos.sass */
/* line 152, ../../../app/stylesheets/partials/_todos.sass */
#todo #docs .sc a {
color: #333;
}
/* line 152, ../../../app/stylesheets/partials/_todos.sass */
/* line 155, ../../../app/stylesheets/partials/_todos.sass */
#todo #docs .sc a[rel=toggle] {
color: blue;
}
/* line 155, ../../../app/stylesheets/partials/_todos.sass */
/* line 158, ../../../app/stylesheets/partials/_todos.sass */
#todo #docs #more_keyboard {
margin-top: .5em;
}
/* line 158, ../../../app/stylesheets/partials/_todos.sass */
/* line 161, ../../../app/stylesheets/partials/_todos.sass */
#todo .contextMenu {
margin: 1em;
float: left;
}
/* line 161, ../../../app/stylesheets/partials/_todos.sass */
/* line 164, ../../../app/stylesheets/partials/_todos.sass */
#todo .contextMenu ul {
padding: 0px;
margin: 1em 1em;
}
/* line 164, ../../../app/stylesheets/partials/_todos.sass */
/* line 167, ../../../app/stylesheets/partials/_todos.sass */
#todo .contextMenu li {
font-size: 11px;
width: 99%;
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/todos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# == Schema Information
# Schema version: 20100502203721
# Schema version: 20100505003817
#
# Table name: todos
#
Expand All @@ -15,6 +15,7 @@
# waiting_since :datetime
# starts_at :datetime
# reminder_sent_at :datetime
# highlight :boolean
#

one:
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/users.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# == Schema Information
# Schema version: 20100503113238
# Schema version: 20100505003817
#
# Table name: users
#
Expand All @@ -21,7 +21,7 @@
# created_at :datetime
# updated_at :datetime
# invite_id :integer
# email_daily_summary :boolean
# email_daily_summary :boolean default(TRUE)
# daily_summary_sent_at :datetime
# email_summary_only_when_todos_due :boolean
#
Expand Down

0 comments on commit 7d82605

Please sign in to comment.