get context, dependencies and admin scenarios running

This commit is contained in:
Reinier Balt 2012-05-01 15:45:58 +02:00
parent 7bce774daa
commit d7aebf03a0
16 changed files with 49 additions and 40 deletions

View file

@ -434,7 +434,7 @@ var TodoItems = {
return confirm(i18n['contexts.new_context_pre'] + givenContextName + i18n['contexts.new_context_post']); return confirm(i18n['contexts.new_context_pre'] + givenContextName + i18n['contexts.new_context_post']);
}, },
generate_predecessor: function(todo_id, todo_spec) { 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 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>"; var li = "<li style=\"display:none\" id=\"pred_"+todo_id+"\">"+ anchor +" "+ todo_spec + "</li>";
return li; return li;
@ -728,7 +728,8 @@ var ProjectListPage = {
}; };
$.post(relative_to_root('projects/update/'+project_id), { $.post(relative_to_root('projects/update/'+project_id), {
'project[name]': value, 'project[name]': value,
'update_project_name': 'true' 'update_project_name': 'true',
'_method': 'put'
}, highlight, 'script'); }, highlight, 'script');
return(value); return(value);
}, },
@ -843,8 +844,9 @@ var ContextListPage = {
var highlight = function(){ var highlight = function(){
$('div.context span#context_name').effect('highlight', {}, 500); $('div.context span#context_name').effect('highlight', {}, 500);
}; };
$.post(relative_to_root('contexts/update/'+context_id), { $.post(relative_to_root('contexts/'+context_id), {
'context[name]': value 'context[name]': value,
'_method': 'put'
}, highlight); }, highlight);
return value; return value;
}, },

View file

@ -23,7 +23,7 @@ a:hover {
color: #FFFFFF; color: #FFFFFF;
} }
div.footer a { div.footer a {
text-decoration: underline; text-decoration: underline;
color: #999999; color: #999999;
} }
@ -58,12 +58,12 @@ h2 a:hover {
} }
h4.alert { h4.alert {
border: 1px solid #666666; border: 1px solid #666666;
text-align: center; text-align: center;
} }
h4.warning { h4.warning {
border: 1px solid #ED2E38; border: 1px solid #ED2E38;
background-color: #F6979C; background-color: #F6979C;
color: #000; color: #000;
} }
@ -72,7 +72,7 @@ h4.error {
background:#c00; background:#c00;
} }
h4.notice { h4.notice {
border: 1px solid #007E00; border: 1px solid #007E00;
background-color: #c2ffc2; background-color: #c2ffc2;
color: #007E00; color: #007E00;
} }
@ -91,7 +91,7 @@ span.r {
} }
span.prj, span.ctx{ span.prj, span.ctx{
font-size: small; font-size: small;
} }
#ctx, #pjr { #ctx, #pjr {
@ -102,7 +102,7 @@ span.prj, span.ctx{
padding: 0.1em 0; padding: 0.1em 0;
} }
/* Draw attention to some text /* Draw attention to some text
Same format as traffic lights */ Same format as traffic lights */
.red { .red {
color: #fff; color: #fff;
@ -259,20 +259,20 @@ input#todo_description, input#todo_tag_list, textarea#todo_notes, select#todo_pr
} }
.prev a { .prev a {
background: url(images/previous.png) left center no-repeat; background: url(assets/previous.png) left center no-repeat;
padding-left: 20px; padding-left: 20px;
} }
.prev a:hover { .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 { .next a {
text-align:right; text-align:right;
background: url(images/next.png) right center no-repeat; background: url(assets/next.png) right center no-repeat;
padding-right: 20px; padding-right: 20px;
} }
.next a:hover { .next a:hover {
background: #cc3334 url(images/next.png) right center no-repeat; background: #cc3334 url(assets/next.png) right center no-repeat;
} }

View file

@ -71,23 +71,23 @@ h4.alert {
} }
h4.warning { h4.warning {
border: 1px solid #ED2E38; border: 1px solid #ED2E38;
background-color: #F6979C; background-color: #F6979C;
color: #000000; color: #000000;
} }
h4.error { h4.error {
color:#fff; color:#fff;
background:#c00; background:#c00;
} }
h4.notice { h4.notice {
border: 1px solid #007E00; border: 1px solid #007E00;
background-color: #c2ffc2; background-color: #c2ffc2;
color: #007E00; color: #007E00;
} }
/*#notice { /*#notice {
padding: 2px; padding: 2px;
border: 1px solid #007E00; border: 1px solid #007E00;
background-color: #c2ffc2; background-color: #c2ffc2;
color: #007E00; color: #007E00;
margin-bottom: 15px; margin-bottom: 15px;
@ -147,8 +147,8 @@ input.login_text {
width:200px; width:200px;
} }
input.open_id { 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-color: #fff;
background-position: 0 50%; background-position: 0 50%;
color: #000; color: #000;
padding-left: 18px; padding-left: 18px;

View file

@ -1313,7 +1313,7 @@ button.positive, .widgets a.positive{
} }
.blockUI.blockOverlay { .blockUI.blockOverlay {
background-image:url('../images/waiting.gif'); background-image:url('/assets/waiting.gif');
background-repeat:no-repeat; background-repeat:no-repeat;
background-position:center center; background-position:center center;
background-color:white; background-color:white;
@ -1321,21 +1321,21 @@ button.positive, .widgets a.positive{
} }
.bigWaiting { .bigWaiting {
background-image:url('../images/bigWaiting.gif'); background-image:url('/assets/bigWaiting.gif');
background-repeat:no-repeat; background-repeat:no-repeat;
background-position:center 20%; background-position:center 20%;
background-color:white; background-color:white;
} }
.blackWaiting { .blackWaiting {
background-image:url('../images/blackWaiting.gif'); background-image:url('/assets/blackWaiting.gif');
background-repeat:no-repeat; background-repeat:no-repeat;
background-position:center center; background-position:center center;
background-color:black; background-color:black;
} }
.bigBlackWaiting { .bigBlackWaiting {
background-image:url('../images/bigBlackWaiting.gif'); background-image:url('/assets/bigBlackWaiting.gif');
background-repeat:no-repeat; background-repeat:no-repeat;
background-position:center center; background-position:center center;
background-color:black; background-color:black;

View file

@ -189,6 +189,10 @@ class ApplicationController < ActionController::Base
super # handle xml http auth via our own login code super # handle xml http auth via our own login code
end end
end end
def sanitize(arg)
ActionController::Base.helpers.sanitize(arg)
end
protected protected

View file

@ -28,7 +28,7 @@ class IntegrationsController < ApplicationController
def search_plugin def search_plugin
# TODO: ASSET PATH!! # 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/, '') pack('m').gsub(/\n/, '')
render :layout => false render :layout => false

View file

@ -386,7 +386,7 @@ class TodosController < ApplicationController
@source_view = params['_source_view'] || 'todo' @source_view = params['_source_view'] || 'todo'
@predecessor = current_user.todos.find_by_id(params['predecessor']) @predecessor = current_user.todos.find_by_id(params['predecessor'])
@predecessors = @predecessor.predecessors @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 @original_state = @todo.state
unless @predecessor.completed? unless @predecessor.completed?
@todo.add_predecessor(@predecessor) @todo.add_predecessor(@predecessor)
@ -757,7 +757,7 @@ class TodosController < ApplicationController
# Set defaults for new_action # Set defaults for new_action
@initial_tags = @tag_name @initial_tags = @tag_name
unless @not_done_todos.empty? 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 end
# Set count badge to number of items with this tag # Set count badge to number of items with this tag

View file

@ -43,13 +43,13 @@ class Todo < ActiveRecord::Base
# other scopes # other scopes
scope :are_due, :conditions => ['NOT (todos.due IS NULL)'] 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_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| {: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 :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 :of_user, lambda { |user_id| {:conditions => ["todos.user_id = ? ", user_id] } }
scope :completed_after, lambda { |date| {:conditions => ["todos.completed_at > ?", date] } } # scope :completed_after, lambda { |date| {:conditions => ["todos.completed_at > ?", date] } }
scope :completed_before, 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_after, lambda { |date| {:conditions => ["todos.created_at > ?", date] } }
scope :created_before, lambda { |date| {:conditions => ["todos.created_at < ?", date] } } # scope :created_before, lambda { |date| {:conditions => ["todos.created_at < ?", date] } }
STARRED_TAG_NAME = "starred" STARRED_TAG_NAME = "starred"
DEFAULT_INCLUDES = [ :project, :context, :tags, :taggings, :pending_successors, :uncompleted_predecessors, :recurring_todo ] DEFAULT_INCLUDES = [ :project, :context, :tags, :taggings, :pending_successors, :uncompleted_predecessors, :recurring_todo ]

View file

@ -1,5 +1,5 @@
<Module> <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> </ModulePrefs>
<Content type="url" href="<%= root_url %>mobile"/> <Content type="url" href="<%= root_url %>mobile"/>
</Module> </Module>

View file

@ -1,5 +1,5 @@
<div id="display_box"> <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> <h2><%= t('todos.no_actions_found_title')%></h2>
<div class="message"><p><%= t('todos.no_actions_with', :tag_name=>@tag_name) %></p></div> <div class="message"><p><%= t('todos.no_actions_with', :tag_name=>@tag_name) %></p></div>
</div> </div>
@ -29,5 +29,5 @@
<div id="input_box"> <div id="input_box">
<%= render :partial => "shared/add_new_item_form" %> <%= render :partial => "shared/add_new_item_form" %>
<%= render :file => "sidebar/sidebar.html.erb" %> <%= render :file => "sidebar/sidebar" %>
</div><!-- End of input box --> </div><!-- End of input box -->

View file

@ -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" std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%> %>
default: <%= std_opts %> features 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 rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip

View file

@ -112,9 +112,12 @@ Tracksapp::Application.routes.draw do
post 'check_deferred' post 'check_deferred'
post 'filter_to_context' post 'filter_to_context'
post 'filter_to_project' post 'filter_to_project'
post 'add_predecessor'
end end
end end
match 'todos/tag/:name' => 'todos#tag', :as => :tag 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 resources :recurring_todos do
member do member do

View file

@ -161,7 +161,7 @@ ul.sf-menu li li li.sfHover ul {
height: 10px; height: 10px;
text-indent: -999em; text-indent: -999em;
overflow: hidden; 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 */ a > .sf-sub-indicator { /* give all except IE6 the correct values */
top: .8em; top: .8em;
@ -190,7 +190,7 @@ li.sfHover > a > .sf-sub-indicator {
/*** shadows for all but IE6 ***/ /*** shadows for all but IE6 ***/
.sf-shadow ul { .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; padding: 0 8px 9px 0;
-moz-border-radius-bottomleft: 17px; -moz-border-radius-bottomleft: 17px;
-moz-border-radius-topright: 17px; -moz-border-radius-topright: 17px;