Skip to content
Browse files

get context, dependencies and admin scenarios running

  • Loading branch information...
1 parent 7bce774 commit d7aebf03a0ba05ad8ba69596b3c85b6de248c583 @lrbalt lrbalt committed May 1, 2012
View
10 app/assets/javascripts/tracks.js
@@ -434,7 +434,7 @@ var TodoItems = {
return confirm(i18n['contexts.new_context_pre'] + givenContextName + i18n['contexts.new_context_post']);
},
generate_predecessor: function(todo_id, todo_spec) {
- var img = "<img id=\"delete_dep_"+todo_id+"\" class=\"icon_delete_dep\" src=\""+ relative_to_root('images/blank.png') + "\">";
+ var img = "<img id=\"delete_dep_"+todo_id+"\" class=\"icon_delete_dep\" src=\""+ relative_to_root('assets/blank.png') + "\">";
var anchor = "<a class=\"icon_delete_dep\" id=\""+todo_id+"\" href=\"#\">" + img + "</a>";
var li = "<li style=\"display:none\" id=\"pred_"+todo_id+"\">"+ anchor +" "+ todo_spec + "</li>";
return li;
@@ -728,7 +728,8 @@ var ProjectListPage = {
};
$.post(relative_to_root('projects/update/'+project_id), {
'project[name]': value,
- 'update_project_name': 'true'
+ 'update_project_name': 'true',
+ '_method': 'put'
}, highlight, 'script');
return(value);
},
@@ -843,8 +844,9 @@ var ContextListPage = {
var highlight = function(){
$('div.context span#context_name').effect('highlight', {}, 500);
};
- $.post(relative_to_root('contexts/update/'+context_id), {
- 'context[name]': value
+ $.post(relative_to_root('contexts/'+context_id), {
+ 'context[name]': value,
+ '_method': 'put'
}, highlight);
return value;
},
View
20 app/assets/stylesheets/mobile.css
@@ -23,7 +23,7 @@ a:hover {
color: #FFFFFF;
}
-div.footer a {
+div.footer a {
text-decoration: underline;
color: #999999;
}
@@ -58,12 +58,12 @@ h2 a:hover {
}
h4.alert {
- border: 1px solid #666666;
+ border: 1px solid #666666;
text-align: center;
}
h4.warning {
- border: 1px solid #ED2E38;
+ border: 1px solid #ED2E38;
background-color: #F6979C;
color: #000;
}
@@ -72,7 +72,7 @@ h4.error {
background:#c00;
}
h4.notice {
- border: 1px solid #007E00;
+ border: 1px solid #007E00;
background-color: #c2ffc2;
color: #007E00;
}
@@ -91,7 +91,7 @@ span.r {
}
span.prj, span.ctx{
- font-size: small;
+ font-size: small;
}
#ctx, #pjr {
@@ -102,7 +102,7 @@ span.prj, span.ctx{
padding: 0.1em 0;
}
-/* Draw attention to some text
+/* Draw attention to some text
Same format as traffic lights */
.red {
color: #fff;
@@ -259,20 +259,20 @@ input#todo_description, input#todo_tag_list, textarea#todo_notes, select#todo_pr
}
.prev a {
- background: url(images/previous.png) left center no-repeat;
+ background: url(assets/previous.png) left center no-repeat;
padding-left: 20px;
}
.prev a:hover {
- background: #cc3334 url(images/previous.png) left center no-repeat;
+ background: #cc3334 url(assets/previous.png) left center no-repeat;
}
.next a {
text-align:right;
- background: url(images/next.png) right center no-repeat;
+ background: url(assets/next.png) right center no-repeat;
padding-right: 20px;
}
.next a:hover {
- background: #cc3334 url(images/next.png) right center no-repeat;
+ background: #cc3334 url(assets/next.png) right center no-repeat;
}
View
12 app/assets/stylesheets/scaffold.css
@@ -71,23 +71,23 @@ h4.alert {
}
h4.warning {
- border: 1px solid #ED2E38;
+ border: 1px solid #ED2E38;
background-color: #F6979C;
color: #000000;
}
h4.error {
- color:#fff;
+ color:#fff;
background:#c00;
}
h4.notice {
- border: 1px solid #007E00;
+ border: 1px solid #007E00;
background-color: #c2ffc2;
color: #007E00;
}
/*#notice {
padding: 2px;
- border: 1px solid #007E00;
+ border: 1px solid #007E00;
background-color: #c2ffc2;
color: #007E00;
margin-bottom: 15px;
@@ -147,8 +147,8 @@ input.login_text {
width:200px;
}
input.open_id {
- background: url(../images/open-id-login-bg.gif) no-repeat;
- background-color: #fff;
+ background: url(/assets/open-id-login-bg.gif) no-repeat;
+ background-color: #fff;
background-position: 0 50%;
color: #000;
padding-left: 18px;
View
8 app/assets/stylesheets/tracks.css
@@ -1313,29 +1313,29 @@ button.positive, .widgets a.positive{
}
.blockUI.blockOverlay {
- background-image:url('../images/waiting.gif');
+ background-image:url('/assets/waiting.gif');
background-repeat:no-repeat;
background-position:center center;
background-color:white;
opacity: 1;
}
.bigWaiting {
- background-image:url('../images/bigWaiting.gif');
+ background-image:url('/assets/bigWaiting.gif');
background-repeat:no-repeat;
background-position:center 20%;
background-color:white;
}
.blackWaiting {
- background-image:url('../images/blackWaiting.gif');
+ background-image:url('/assets/blackWaiting.gif');
background-repeat:no-repeat;
background-position:center center;
background-color:black;
}
.bigBlackWaiting {
- background-image:url('../images/bigBlackWaiting.gif');
+ background-image:url('/assets/bigBlackWaiting.gif');
background-repeat:no-repeat;
background-position:center center;
background-color:black;
View
4 app/controllers/application_controller.rb
@@ -189,6 +189,10 @@ def handle_unverified_request
super # handle xml http auth via our own login code
end
end
+
+ def sanitize(arg)
+ ActionController::Base.helpers.sanitize(arg)
+ end
protected
View
2 app/controllers/integrations_controller.rb
@@ -28,7 +28,7 @@ def get_applescript2
def search_plugin
# TODO: ASSET PATH!!
- @icon_data = [File.open(Rails.root + '/public/images/done.png').read].
+ @icon_data = [File.open(Rails.root + '/app/assets/images/done.png').read].
pack('m').gsub(/\n/, '')
render :layout => false
View
4 app/controllers/todos_controller.rb
@@ -386,7 +386,7 @@ def add_predecessor
@source_view = params['_source_view'] || 'todo'
@predecessor = current_user.todos.find_by_id(params['predecessor'])
@predecessors = @predecessor.predecessors
- @todo = current_user.todos.find_by_id(params['successor']).includes(Todo::DEFAULT_INCLUDES)
+ @todo = current_user.todos.includes(Todo::DEFAULT_INCLUDES).find_by_id(params['successor'])
@original_state = @todo.state
unless @predecessor.completed?
@todo.add_predecessor(@predecessor)
@@ -757,7 +757,7 @@ def tag
# Set defaults for new_action
@initial_tags = @tag_name
unless @not_done_todos.empty?
- @context = current_user.contexts.find_by_id(@not_done_todos[0].context_id)
+ @context = current_user.contexts.find(@not_done_todos.first.context_id)
end
# Set count badge to number of items with this tag
View
14 app/models/todo.rb
@@ -43,13 +43,13 @@ class Todo < ActiveRecord::Base
# other scopes
scope :are_due, :conditions => ['NOT (todos.due IS NULL)']
- scope :with_tag, lambda { |tag_id| {:joins => :taggings, :conditions => ["taggings.tag_id = ? ", tag_id] } }
- scope :with_tags, lambda { |tag_ids| {:conditions => ["EXISTS(SELECT * from taggings t WHERE t.tag_id IN (?) AND t.taggable_id=todos.id AND t.taggable_type='Todo')", tag_ids] } }
- scope :of_user, lambda { |user_id| {:conditions => ["todos.user_id = ? ", user_id] } }
- scope :completed_after, lambda { |date| {:conditions => ["todos.completed_at > ?", date] } }
- scope :completed_before, lambda { |date| {:conditions => ["todos.completed_at < ?", date] } }
- scope :created_after, lambda { |date| {:conditions => ["todos.created_at > ?", date] } }
- scope :created_before, lambda { |date| {:conditions => ["todos.created_at < ?", date] } }
+ scope :with_tag, lambda { |tag_id| joins("INNER JOIN taggings ON todos.id = taggings.taggable_id").where("taggings.tag_id = ? ", tag_id) }
+ scope :with_tags, lambda { |tag_ids| where("EXISTS(SELECT * from taggings t WHERE t.tag_id IN (?) AND t.taggable_id=todos.id AND t.taggable_type='Todo')", tag_ids) }
+ # scope :of_user, lambda { |user_id| {:conditions => ["todos.user_id = ? ", user_id] } }
+ # scope :completed_after, lambda { |date| {:conditions => ["todos.completed_at > ?", date] } }
+ # scope :completed_before, lambda { |date| {:conditions => ["todos.completed_at < ?", date] } }
+ # scope :created_after, lambda { |date| {:conditions => ["todos.created_at > ?", date] } }
+ # scope :created_before, lambda { |date| {:conditions => ["todos.created_at < ?", date] } }
STARRED_TAG_NAME = "starred"
DEFAULT_INCLUDES = [ :project, :context, :tags, :taggings, :pending_successors, :uncompleted_predecessors, :recurring_todo ]
View
2 app/views/integrations/google_gadget.erb
@@ -1,5 +1,5 @@
<Module>
- <ModulePrefs title="Tracks" directory_title="Tracks" description="<%= t('integrations.gmail_description') %>" author="Tracks" author_email="butshesagirl@rousette.org.uk" author_affiliation="Tracks" author_location="UK" title_url="http://www.getontracks.org/" screenshot="http://www.getontracks.org/images/uploads/tracks_home_thumb.png" thumbnail="http://www.getontracks.org/images/uploads/tracks_tickler.png" category="communication" category2="tools" height="300">
+ <ModulePrefs title="Tracks" directory_title="Tracks" description="<%= t('integrations.gmail_description') %>" author="Tracks" author_email="butshesagirl@rousette.org.uk" author_affiliation="Tracks" author_location="UK" title_url="http://www.getontracks.org/" screenshot="http://getontracks.org/images/screens/tracks_home.png" thumbnail="http://getontracks.org/images/screens/tracks_home_thumb.png" category="communication" category2="tools" height="300">
</ModulePrefs>
<Content type="url" href="<%= root_url %>mobile"/>
</Module>
View
0 app/views/todos/_hidden.rhtml → app/views/todos/_hidden.html.erb
File renamed without changes.
View
4 app/views/todos/tag.html.erb
@@ -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:none\"".html_safe unless @not_done_todos.empty? %> >
<h2><%= t('todos.no_actions_found_title')%></h2>
<div class="message"><p><%= t('todos.no_actions_with', :tag_name=>@tag_name) %></p></div>
</div>
@@ -29,5 +29,5 @@
<div id="input_box">
<%= render :partial => "shared/add_new_item_form" %>
- <%= render :file => "sidebar/sidebar.html.erb" %>
+ <%= render :file => "sidebar/sidebar" %>
</div><!-- End of input box -->
View
0 test/views/context_helper_test.rb → ...3/test_views/views/context_helper_test.rb
File renamed without changes.
View
0 test/views/todos_helper_test.rb → ...2.3/test_views/views/todos_helper_test.rb
File renamed without changes.
View
2 config/cucumber.yml
@@ -4,5 +4,5 @@ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'pr
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
-wip: --tags @wip:3 --wip features
+wip: --tags @wip:10 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
View
3 config/routes.rb
@@ -112,9 +112,12 @@
post 'check_deferred'
post 'filter_to_context'
post 'filter_to_project'
+ post 'add_predecessor'
end
end
match 'todos/tag/:name' => 'todos#tag', :as => :tag
+ match 'todos/done/tag/:name' => "todos#done_tag", :as => :done_tag
+ match 'todos/all_done/tag/:name' => "todos#all_done_tag", :as => :all_done_tag
resources :recurring_todos do
member do
View
4 vendor/assets/stylesheets/superfish.css
@@ -161,7 +161,7 @@ ul.sf-menu li li li.sfHover ul {
height: 10px;
text-indent: -999em;
overflow: hidden;
- background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
+ background: url('/assets/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
}
a > .sf-sub-indicator { /* give all except IE6 the correct values */
top: .8em;
@@ -190,7 +190,7 @@ li.sfHover > a > .sf-sub-indicator {
/*** shadows for all but IE6 ***/
.sf-shadow ul {
- background: url('../images/shadow.png') no-repeat bottom right;
+ background: url('/assets/shadow.png') no-repeat bottom right;
padding: 0 8px 9px 0;
-moz-border-radius-bottomleft: 17px;
-moz-border-radius-topright: 17px;

0 comments on commit d7aebf0

Please sign in to comment.
Something went wrong with that request. Please try again.