home page is restored, so is context view

This commit is contained in:
Reinier Balt 2012-04-12 17:30:05 +02:00
parent 4605b17d3c
commit e964769553
130 changed files with 89 additions and 152 deletions

20
Gemfile
View file

@ -57,20 +57,16 @@ gem 'bcrypt-ruby', '~> 3.0.0'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
# group :development do
# if RUBY_VERSION.to_f >= 1.9
# gem "ruby-debug19"
# gem "mongrel", "1.2.0.pre2"
# else
group :development do
if RUBY_VERSION.to_f >= 1.9
# gem "ruby-debug19", :require => 'ruby-debug'
gem "mongrel", "1.2.0.pre2"
else
# gem "ruby-debug"
# gem "mongrel"
# end
# gem "yard"
# end
end
gem "yard"
end
#
# group :test do
# gem "test-unit", "1.2.3"

View file

@ -41,9 +41,11 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.3.1)
daemons (1.0.10)
erubis (2.7.0)
execjs (1.3.0)
multi_json (~> 1.0)
gem_plugin (0.2.3)
highline (1.5.2)
hike (1.2.1)
htmlentities (4.3.1)
@ -58,6 +60,9 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.18)
mongrel (1.2.0.pre2)
daemons (~> 1.0.10)
gem_plugin (~> 0.2.3)
multi_json (1.2.0)
mysql2 (0.3.11)
nokogiri (1.4.7)
@ -115,6 +120,7 @@ GEM
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
will_paginate (3.0.3)
yard (0.7.5)
PLATFORMS
ruby
@ -129,6 +135,7 @@ DEPENDENCIES
htmlentities (~> 4.3.0)
jquery-rails
mail
mongrel (= 1.2.0.pre2)
mysql2
rails (= 3.2.3)
rails_autolink
@ -139,3 +146,4 @@ DEPENDENCIES
swf_fu
uglifier (>= 1.0.3)
will_paginate
yard

View file

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 596 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 156 B

After

Width:  |  Height:  |  Size: 156 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 587 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 109 B

After

Width:  |  Height:  |  Size: 109 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 496 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 425 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 501 B

After

Width:  |  Height:  |  Size: 501 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 441 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 905 B

After

Width:  |  Height:  |  Size: 905 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 216 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 764 B

After

Width:  |  Height:  |  Size: 764 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 192 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 618 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 69 B

After

Width:  |  Height:  |  Size: 69 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 337 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 271 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 161 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 410 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 598 B

After

Width:  |  Height:  |  Size: 598 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 475 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 814 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 642 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 84 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 935 B

After

Width:  |  Height:  |  Size: 935 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 328 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 515 B

Before After
Before After

View file

@ -12,4 +12,6 @@
//
//= require jquery
//= require jquery_ujs
//= require ../../../vendor/assets/javascripts/jquery-ui-1.8.17.custom.min
//= require_tree ../../../vendor/assets/javascripts
//= require_tree .

View file

@ -9,5 +9,7 @@
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
* require_tree .
*= require tracks
*= require_tree ../../../vendor/assets/stylesheets
*/

View file

@ -106,35 +106,35 @@ h3 {
/* Rules for the icon links */
img.edit_item {background-image: url(../images/edit_off.png); background-repeat: no-repeat; border: none;}
a:hover img.edit_item {background-image: url(../images/edit_on.png); background-color: transparent; background-repeat: no-repeat; border: none;}
img.edit_item {background-image: url(/assets/edit_off.png); background-repeat: no-repeat; border: none;}
a:hover img.edit_item {background-image: url(/assets/edit_on.png); background-color: transparent; background-repeat: no-repeat; border: none;}
img.delete_item {background-image: url(../images/delete_off.png); background-repeat: no-repeat; border: none;}
a:hover img.delete_item {background-image: url(../images/delete_on.png);background-color: transparent;background-repeat: no-repeat; border: none;}
img.delete_item {background-image: url(/assets/delete_off.png); background-repeat: no-repeat; border: none;}
a:hover img.delete_item {background-image: url(/assets/delete_on.png);background-color: transparent;background-repeat: no-repeat; border: none;}
a.undecorated_link {background-color:transparent;color:transparent;}
img.todo_star {background-image: url(../images/staricons.png); background-repeat: no-repeat; border:none; background-position: -32px 0px;}
img.todo_star {background-image: url(/assets/staricons.png); background-repeat: no-repeat; border:none; background-position: -32px 0px;}
img.todo_star.starred{ background-position: 0px 0px; }
a:hover img.todo_star { background-position: -48px 0px;}
a:hover img.todo_star.starred { background-position: -16px 0px; }
a.to_top {background: transparent url(../images/top_off.png) no-repeat;}
a.to_top:hover {background: transparent url(../images/top_on.png) no-repeat;}
a.to_top {background: transparent url(/assets/top_off.png) no-repeat;}
a.to_top:hover {background: transparent url(/assets/top_on.png) no-repeat;}
a.up {background: transparent url(../images/up_off.png) no-repeat;}
a.up:hover {background: transparent url(../images/up_on.png) no-repeat;}
a.up {background: transparent url(/assets/up_off.png) no-repeat;}
a.up:hover {background: transparent url(/assets/up_on.png) no-repeat;}
a.down {background: transparent url(../images/down_off.png) no-repeat;}
a.down:hover {background: transparent url(../images/down_on.png) no-repeat;}
a.down {background: transparent url(/assets/down_off.png) no-repeat;}
a.down:hover {background: transparent url(/assets/down_on.png) no-repeat;}
a.to_bottom {background: transparent url(../images/bottom_off.png) no-repeat;}
a.to_bottom:hover {background: transparent url(../images/bottom_on.png) no-repeat;}
a.to_bottom {background: transparent url(/assets/bottom_off.png) no-repeat;}
a.to_bottom:hover {background: transparent url(/assets/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: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, a.link_to_notes {background-image: url(/assets/notes_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_notes:hover, a.link_to_notes:hover {background-image: url(/assets/notes_on.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_successors:hover, a.link_to_successors:hover {background-image: url(../images/successor_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_successors, a.link_to_successors {background-image: url(/assets/successor_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_successors:hover, a.link_to_successors:hover {background-image: url(/assets/successor_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
/* Structural divs */
@ -255,7 +255,7 @@ a.show_successors:hover, a.link_to_successors:hover {background-image: url(../im
#develop-notify-bar {
line-height:0.5;
background-image: url(/images/construction.gif);
background-image: url(/assets/construction.gif);
background-repeat: repeat-x;
}
@ -384,8 +384,8 @@ ul.predecessor_list li {
}
/* deleting dependency from new form of a todo */
img.icon_delete_dep {width: 10px; background-image: url(../images/icon_delete.png); background-repeat: no-repeat; background-position: -9px 0; border: none; color:black;}
a:hover img.icon_delete_dep {width: 10px; background-image: url(../images/icon_delete.png); background-repeat: no-repeat; background-position: 0 0; border: none; color:black; background-color: black;}
img.icon_delete_dep {width: 10px; background-image: url(/assets/icon_delete.png); background-repeat: no-repeat; background-position: -9px 0; border: none; color:black;}
a:hover img.icon_delete_dep {width: 10px; background-image: url(/assets/icon_delete.png); background-repeat: no-repeat; background-position: 0 0; border: none; color:black; background-color: black;}
a.icon_delete_dep:hover {width: 10px; background-color: black;}
/* deleting dependency from edit form of a todo */
@ -1161,7 +1161,7 @@ ul#prefs {list-style-type: disc; margin-left: 15px;}
}
input.open_id {
background: url(../images/open-id-login-bg.gif) no-repeat;
background: url(/assets/open-id-login-bg.gif) no-repeat;
background-color: #fff;
background-position: 0 50%;
color: #000;
@ -1428,5 +1428,5 @@ div.auto_complete ul strong.highlight {
}
.ui-autocomplete-loading {
background: white url('/images/ui-anim_basic_16x16.gif') right center no-repeat;
background: white url('/assets/ui-anim_basic_16x16.gif') right center no-repeat;
}

View file

@ -95,10 +95,10 @@ class ApplicationController < ActionController::Base
if count == 0 && deferred_count > 0
word = deferred_count == 1 ? string.singularize : string.pluralize
word = "deferred&nbsp;" + word
deferred_count.to_s + "&nbsp;" + word
return (deferred_count.to_s + "&nbsp;" + word).html_safe
else
word = count == 1 ? string.singularize : string.pluralize
count.to_s + "&nbsp;" + word
return (count.to_s + "&nbsp;" + word).html_safe
end
end

View file

@ -263,7 +263,7 @@ class ContextsController < ApplicationController
end
def set_context_from_params
@context = current_user.contexts.find_by_params(params)
@context = current_user.contexts.find(params[:id])
rescue
@context = nil
end
@ -276,11 +276,8 @@ class ContextsController < ApplicationController
def init_todos
set_context_from_params
unless @context.nil?
@context.todos.send :with_scope, :find => { :include => Todo::DEFAULT_INCLUDES } do
@done = @context.done_todos
end
@max_completed = current_user.prefs.show_number_completed
@done = @context.todos.completed.all(:limit => @max_completed)
# @not_done_todos = @context.not_done_todos TODO: Temporarily doing this
# search manually until I can work out a way to do the same thing using

View file

@ -192,18 +192,17 @@ module ApplicationHelper
end
def sidebar_html_for_titled_list (list, title)
return content_tag(:h3, title+" (#{list.length})") +
content_tag(:ul, sidebar_html_for_list(list))
return content_tag(:h3, title+" (#{list.length})") + content_tag(:ul, sidebar_html_for_list(list))
end
def sidebar_html_for_list(list)
if list.empty?
return content_tag(:li, t('sidebar.list_empty'))
return content_tag(:li, t('sidebar.list_empty')).html_safe
else
return list.inject("") do |html, item|
link = (item.class == "Project") ? link_to_project( item ) : link_to_context(item)
html << content_tag(:li, link + " (" + count_undone_todos_phrase(item)+")")
end
end.html_safe
end
end

View file

@ -64,7 +64,7 @@ module TodosHelper
def collapsed_notes_image(todo)
link = link_to(image_tag( 'blank.png', :width=>'16', :height=>'16', :border=>'0' ), "#", {:class => 'show_notes', :title => 'Show notes'})
notes = content_tag(:div, {:class => "todo_notes", :id => dom_id(todo, 'notes'), :style => "display:none"}) { todo.rendered_notes }
notes = content_tag(:div, {:class => "todo_notes", :id => dom_id(todo, 'notes'), :style => "display:none"}) { todo.rendered_notes.html_safe }
return link+notes
end
@ -133,7 +133,7 @@ module TodosHelper
end
def tag_list(todo=@todo, mobile=false)
content_tag(:span, :class => 'tags') { todo.tags.all_except_starred.collect{|tag| tag_span(tag, mobile)}.join('') }
content_tag(:span, :class => 'tags') { todo.tags.all_except_starred.collect{|tag| tag_span(tag, mobile)}.join('').html_safe }
end
def tag_list_mobile(todo=@todo)
@ -166,7 +166,7 @@ module TodosHelper
str << item_link_to_project( todo )
end
end
return str
return str.html_safe
end
# Uses the 'staleness_starts' value from settings.yml (in days) to colour the

View file

@ -1,5 +1,5 @@
<% @not_done = @not_done_todos.select {|t| t.context_id == context.id } %>
<div id="c<%= context.id %>" class="container context" <%= "style=\"display:none\"" if collapsible && @not_done.empty? %>>
<div id="c<%= context.id %>" class="container context" style="display:<%= (collapsible && @not_done.empty?) ? "none" : "block" %>">
<h2>
<% if collapsible -%>
<a href="#" class="container_toggle" id="toggle_c<%= context.id %>"><%= image_tag("collapse.png") %></a>

View file

@ -1,12 +1,12 @@
<div id="display_box">
<%= render :partial => "contexts/context", :object => @context, :locals => { :collapsible => false } %>
<%= render :partial => @context, :locals => { :collapsible => false } %>
<%= render :partial => "todos/deferred", :object => @deferred, :locals => { :collapsible => false, :append_descriptor => t('contexts.todos_append'), :parent_container_type => 'context', :pending => @pending } %>
<% unless @max_completed==0 -%>
<%= render :partial => "todos/completed", :object => @done, :locals => { :suppress_context => true, :collapsible => false, :append_descriptor => t('contexts.last_completed_in_context', :number=>prefs.show_number_completed) } %>
<% end -%>
</div><!-- [end:display_box] -->
</div>
<div id="input_box">
<%= render :partial => "shared/add_new_item_form" %>
<%= render :file => "sidebar/sidebar.html.erb" %>
</div><!-- End of input box -->
</div>

View file

@ -2,24 +2,16 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%#= stylesheet_link_tag 'standard','superfish','niftyCorners', 'jquery-ui-1.8.17.custom', :cache => 'tracks-cached' %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= stylesheet_link_tag "print", :media => "print" %>
<%#= javascript_include_tag 'jquery-1.7.1.min', 'jquery-ui-1.8.17.custom.min',
'jquery.truncator','jquery.jeditable.mini', 'jquery.cookie', 'jquery.blockUI',
'jquery.form',
:cache => 'jquery-cached' %>
<%#= javascript_tag_for_i18n_datepicker %>
<%#= javascript_include_tag 'hoverIntent','superfish','application',
'accesskey-hints','niftycube','swfobject',
:cache => 'tracks-cached' %>
<% #= javascript_include_tag('jquery.simulate.drag-sortable') if ENV['RAILS_ENV']=='cucumber' -%>
<%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>
<%= javascript_tag "var TAG_NAME = '#{@tag_name}';" if @tag_name %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
<script type="text/javascript">
var SOURCE_VIEW = '<%=@source_view%>';
var defaultContexts = <%= default_contexts_for_autocomplete rescue '{}' %>;
var defaultTags = <%= default_tags_for_autocomplete rescue '{}' %>;
var AUTH_TOKEN = '<%= protect_against_forgery? ? form_authenticity_token.inspect : "" %>'
var TAG_NAME = '<%= @tag_name ? @tag_name : "" %>'
var defaultContexts = <%= default_contexts_for_autocomplete.html_safe rescue '{}' %>;
var defaultTags = <%= default_tags_for_autocomplete.html_safe rescue '{}' %>;
var dateFormat = '<%= date_format_for_date_picker %>';
var weekStart = '<%= current_user.prefs.week_starts %>';
function relative_to_root(path) { return '<%= root_url %>'+path; };
@ -41,7 +33,7 @@
<body class="<%= controller.controller_name %>">
<div id="topbar">
<%= NOTIFY_BAR %>
<%= NOTIFY_BAR.html_safe %>
<div id="date">
<h1>

View file

@ -1,7 +1,14 @@
<%
todo = edit_form
form_for(todo, :html=> { :name=>'todo', :id => dom_id(@todo, 'form'), :class => 'inline-form edit_todo_form' }) do |t|%>
<div id="edit_error_status"><%= error_messages_for("todo", :object_name => 'action') %></div>
<% todo = edit_form -%>
<%= form_for(todo, :html=> { :name=>'todo', :id => dom_id(@todo, 'form'), :class => 'inline-form edit_todo_form' }) do |t|%>
<div id="edit_error_status">
<% if todo.errors.any? -%>
<ul>
<% todo.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
<% end -%>
</div>
<%= t.hidden_field( "id" ) -%>
<%= source_view_tag( @source_view ) -%>

View file

@ -1,7 +1,7 @@
<%- todo = new_multi_todo_form -%>
<div id="todo_multi_add" style="display:none">
<% form_for(todo, :html=> { :id=>'todo-form-multi-new-action', :name=>'todo', :class => 'inline-form' }) do |t| %>
<%= form_for(todo, :html=> { :id=>'todo-form-multi-new-action', :name=>'todo', :class => 'inline-form' }) do |t| %>
<input id="default_project_name_id" name="default_project_name" type="hidden" value="<%=h @initial_project_name-%>" />
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%=h @initial_context_name-%>" />

View file

@ -1,7 +1,7 @@
<%- todo = new_todo_form -%>
<div id="todo_new_action">
<% form_for(todo, :html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form new_todo_form' }) do |t|%>
<%= form_for(todo, :html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form new_todo_form' }) do |t|%>
<input id="default_project_name_id" name="default_project_name" type="hidden" value="<%= h(@initial_project_name)-%>" />
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%= h(@initial_context_name)-%>" />
<input type="hidden" id="new_todo_starred" name="new_todo_starred" value="false" />

View file

@ -1,5 +1,5 @@
<div id="display_box">
<div id="no_todos_in_view" class="container context" <%= "style=\"display:none\"" unless @not_done_todos.empty? %> >
<div id="no_todos_in_view" class="container context" style="display:<%= @not_done_todos.empty? ? "block" : "none" %>">
<h2><%= t('todos.no_actions_found_title')%></h2>
<div class="message"><p><%= t('todos.no_actions_found') %></p></div>
</div>

View file

@ -110,7 +110,14 @@ function html_for_new_context() {
}
function html_for_error_messages() {
return "<%= escape_javascript(error_messages_for('todo')) %>";
<%
error_messages = ""
if @todo.errors.any?
list_of_messages = @todo.errors.full_messages.inject("") { |all, msg| all += context_tag(:li, msg) }
error_messages = content_tag(:ul, list_of_messages)
end
-%>
return "<%= escape_javascript(error_messages) %>";
}
function update_predecessors(next_steps) {

View file

@ -1,69 +0,0 @@
/*
* AccessKey Hints
*
* Checks all HTML elements on this page that can have an accesskey attribute
* (<a>, <area>, <button>, <input>, <label>, <legend> and <textarea>)
* and creates or appends the title attribute to include platform-specific
* hint in the title, i.e. "Alt+S" (Win)
* or "Ctrl+S)" (Mac). If a title exists, a space plus the hint wrapped in
* parentheses is appended. The only exception is if the title already contains
* 'accesskey', 'Alt+' or 'Ctrl+' (case-insensitive) in which case this script
* will leave it alone.
*
* Use the following markup to include the library:
* <script type="text/javascript" src="access-key-hints.js"></script>
*/
var accessKeyHintsAdder = {
run : function() {
var elemTypes = new Array('a','area','button','input','label','legend','textarea');
for(var i = 0; i < elemTypes.length; i++)
{
accessKeyHintsAdder.addHint(document.getElementsByTagName(elemTypes[i]));
}
},
addHint : function(elems) {
var elem;
var i = 0;
processElements:
while(elem = elems.item(i++))
{
var accessKey = elem.getAttributeNode("accesskey");
if (!accessKey || !accessKey.value)
continue processElements;
var title = elem.getAttributeNode("title");
if (title && title.value)
{
var overrides = new Array('accesskey','alt+','ctrl+');
for (var j=0; j < overrides.length; j++)
{
if (title.value.toLowerCase().indexOf(overrides[j]) != -1)
continue processElements;
}
elem.setAttribute("title", title.value + ' (' + this.getHintText(accessKey.value) + ')');
}
else
{
elem.setAttribute("title", this.getHintText(accessKey.value));
}
}
},
getHintText : function(accessKey) {
return this.getModifier() + '+' + accessKey.toUpperCase();
},
getModifier : function() {
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('mac') == -1)
return 'Alt';
else
return 'Ctrl';
}
}
$(accessKeyHintsAdder.run);

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more