mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-31 14:28:49 +01:00
Merge branch '2.3_branch'
This brings the master branch up to date with the 2.3 release branch
This commit is contained in:
commit
f393afb69f
27 changed files with 111 additions and 84 deletions
|
|
@ -13,9 +13,6 @@ var TracksForm = {
|
|||
}
|
||||
toggleLink.parent().toggleClass('hide_form');
|
||||
},
|
||||
set_project_name: function (name) {
|
||||
$('input#todo_project_name').val(name);
|
||||
},
|
||||
set_project_name_for_multi_add: function (name) {
|
||||
$('#multi_todo_project_name').val(name);
|
||||
},
|
||||
|
|
@ -30,9 +27,8 @@ var TracksForm = {
|
|||
$('input[name=default_context_name]').val(name);
|
||||
},
|
||||
set_project_name_and_default_project_name: function (name) {
|
||||
TracksForm.set_project_name('');
|
||||
$('input#todo_project_name').val(name);
|
||||
$('#default_project_name_id').val(name);
|
||||
$('#project_name').html(name);
|
||||
},
|
||||
set_tag_list_and_default_tag_list: function (name) {
|
||||
$('input#tag_list').val(name);
|
||||
|
|
@ -658,7 +654,7 @@ var ContextListPage = {
|
|||
$.post(relative_to_root('contexts/'+context_id), {
|
||||
'context[name]': value,
|
||||
'_method': 'put'
|
||||
}, highlight);
|
||||
}, highlight, 'script');
|
||||
return value;
|
||||
},
|
||||
setup_behavior: function() {
|
||||
|
|
|
|||
|
|
@ -655,9 +655,6 @@ class TodosController < ApplicationController
|
|||
|
||||
# Set defaults for new_action
|
||||
@initial_tags = @tag_name
|
||||
unless @not_done_todos.empty?
|
||||
@context = current_user.contexts.find(@not_done_todos.first.context_id)
|
||||
end
|
||||
|
||||
# Set count badge to number of items with this tag
|
||||
@not_done_todos.empty? ? @count = 0 : @count = @not_done_todos.size
|
||||
|
|
|
|||
|
|
@ -417,18 +417,6 @@ module TodosHelper
|
|||
return html
|
||||
end
|
||||
|
||||
def reset_tab_index
|
||||
$tracks_tab_index = 0
|
||||
end
|
||||
|
||||
def next_tab_index
|
||||
# make sure it exists if reset was not called. Set to 20 to avoid clashes with existing form in sidebar
|
||||
$tracks_tab_index ||= 20
|
||||
|
||||
$tracks_tab_index = $tracks_tab_index + 1
|
||||
return $tracks_tab_index
|
||||
end
|
||||
|
||||
def feed_content_for_todo(todo)
|
||||
item_notes = todo.notes ? todo.rendered_notes : ''
|
||||
due = todo.due ? content_tag(:div, t('todos.feeds.due', :date => format_date(todo.due))) : ''
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ class Project < ActiveRecord::Base
|
|||
scope :with_name_or_description, lambda { |body| where("name LIKE ? OR description LIKE ?", body, body) }
|
||||
scope :with_namepart, lambda { |body| where("name LIKE ?", body + '%') }
|
||||
|
||||
before_create :set_last_reviewed_now
|
||||
|
||||
validates_presence_of :name
|
||||
validates_length_of :name, :maximum => 255
|
||||
validates_uniqueness_of :name, :scope => "user_id"
|
||||
|
|
@ -47,6 +49,10 @@ class Project < ActiveRecord::Base
|
|||
NullProject.new
|
||||
end
|
||||
|
||||
def set_last_reviewed_now
|
||||
self.last_reviewed = Time.now
|
||||
end
|
||||
|
||||
def hide_todos
|
||||
todos.each do |t|
|
||||
unless t.completed? || t.deferred?
|
||||
|
|
|
|||
|
|
@ -10,17 +10,17 @@
|
|||
<div id="edit_error_status"><%= get_list_of_error_messages_for(context) %></div>
|
||||
|
||||
<label for="context_name"><%= t 'contexts.context_name' %></label><br/>
|
||||
<%= text_field('context', 'name', :class => 'context-name', :tabindex => next_tab_index) %><br/>
|
||||
<%= text_field('context', 'name', :class => 'context-name') %><br/>
|
||||
|
||||
<label for="context_hide"><%= t 'contexts.context_state' %> </label><br/>
|
||||
<% ['active', 'hidden', 'closed'].each do | state | %>
|
||||
<%= radio_button(:context, 'state', state, {:tabindex => next_tab_index}) %> <%= state.titlecase %>
|
||||
<%= radio_button(:context, 'state', state) %> <%= state.titlecase %>
|
||||
<% end %>
|
||||
</br></br>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="<%= dom_id(context, 'submit') %>" tabindex="<%=next_tab_index%>">
|
||||
<button type="submit" class="positive" id="<%= dom_id(context, 'submit') %>">
|
||||
<%=image_tag("accept.png", :alt => "") %>
|
||||
<%= t 'common.update' %>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
<%- reset_tab_index %>
|
||||
<div id="context_new_container">
|
||||
|
||||
<div id="toggle_context_link" class="hide_form">
|
||||
|
|
@ -19,10 +18,10 @@
|
|||
</div>
|
||||
|
||||
<label for="context_name"><%= t 'contexts.context_name' %></label><br />
|
||||
<%= text_field( "context", "name", :tabindex => next_tab_index ) %><br />
|
||||
<%= text_field( "context", "name" ) %><br />
|
||||
|
||||
<label for="context_hide"><%= t 'contexts.context_hide' %></label>
|
||||
<%= check_box( "context_state", "hide", {:tabindex => next_tab_index} ) %><br />
|
||||
<%= check_box( "context_state", "hide" ) %><br />
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ var <%=object_name%> = {
|
|||
<% else -%>
|
||||
<%=object_name%>.replace_context_form_with_updated_context();
|
||||
<% end -%>
|
||||
TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@context.name)%>");
|
||||
},
|
||||
remove_and_re_add_context: function() {
|
||||
$('#<%=dom_id(@context, 'container')%>').slideUp(500, function() {
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ form_for(note, :html => {
|
|||
<div id="error_status"><%= get_list_of_error_messages_for(note) %></div>
|
||||
|
||||
<%= f.hidden_field( "project_id" ) %>
|
||||
<%= f.text_area( "body", "cols" => 70, "rows" => 15, "tabindex" => 1 ) %>
|
||||
<%= f.text_area( "body", "cols" => 70, "rows" => 15) %>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="<%= dom_id(note, 'submit') %>" tabindex="15">
|
||||
<button type="submit" class="positive" id="<%= dom_id(note, 'submit') %>">
|
||||
<%=image_tag("accept.png", :alt => "") %>
|
||||
<%= submit_text %>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
<%- reset_tab_index %>
|
||||
<div id="project_new_project_container">
|
||||
|
||||
<div id="toggle_project_link" class="hide_form">
|
||||
|
|
@ -10,19 +9,19 @@
|
|||
<div id="error_status"><%= get_list_of_error_messages_for(@new_project) %></div>
|
||||
|
||||
<label for="project_name"><%= Project.human_attribute_name(:name) %>:</label><br />
|
||||
<%= text_field 'project', 'name', "tabindex" => next_tab_index %><br />
|
||||
<%= text_field 'project', 'name' %><br />
|
||||
|
||||
<label for="project_description"><%= Project.human_attribute_name(:description) %> (<%= t('common.optional') %>):</label><br />
|
||||
<%= text_area 'project', 'description', "cols" => 30, "rows" => 4, "tabindex" => next_tab_index %><br />
|
||||
<%= text_area 'project', 'description', "cols" => 30, "rows" => 4 %><br />
|
||||
|
||||
<% unless @contexts.empty? -%>
|
||||
<label for="default_context_name"><%= Project.human_attribute_name(:default_context_name) %> (<%= t('common.optional') %>):</label><br />
|
||||
<%= text_field_tag("project[default_context_name]", @new_project.default_context.name, :tabindex => next_tab_index) %>
|
||||
<%= text_field_tag("project[default_context_name]", @new_project.default_context.name) %>
|
||||
<br />
|
||||
<% end -%>
|
||||
|
||||
<label for="default_tags"><%= Project.human_attribute_name(:default_tags) %> (<%= t('common.optional') %>):</label><br />
|
||||
<%= text_field_tag("project[default_tags]", @new_project.default_tags, :tabindex => next_tab_index) %>
|
||||
<%= text_field_tag("project[default_tags]", @new_project.default_tags) %>
|
||||
|
||||
<br/>
|
||||
|
||||
|
|
@ -34,7 +33,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<input id="go_to_project" type="checkbox" tabindex="<%= next_tab_index%>" name="go_to_project"/><label for="go_to_project"><%= t('projects.to_new_project_page') %></label><br />
|
||||
<input id="go_to_project" type="checkbox" name="go_to_project"/><label for="go_to_project"><%= t('projects.to_new_project_page') %></label><br />
|
||||
|
||||
<% end -%>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,28 +11,28 @@ project = project_form
|
|||
<%= source_view_tag( @source_view ) -%>
|
||||
|
||||
<label for="project_name">Name:</label><br/>
|
||||
<%= text_field :project, 'name', :class => 'project-name', :tabindex => next_tab_index %><br/>
|
||||
<%= text_field :project, 'name', :class => 'project-name' %><br/>
|
||||
|
||||
<label for="project_description">Description (optional):</label><br/>
|
||||
<%= text_area :project, 'description', "cols" => 30, "rows" => 4, :class => 'project-description', :tabindex => next_tab_index %><br/>
|
||||
<%= text_area :project, 'description', "cols" => 30, "rows" => 4, :class => 'project-description' %><br/>
|
||||
|
||||
<label for="project_done">Project status:</label><br/>
|
||||
<% ['active', 'hidden', 'completed'].each do | state | %>
|
||||
<%= radio_button(:project, 'state', state, {:tabindex => next_tab_index}) %> <%= state.titlecase %>
|
||||
<%= radio_button(:project, 'state', state) %> <%= state.titlecase %>
|
||||
<% end %><br/>
|
||||
|
||||
<label for="project[default_context_name]">Default Context</label><br/>
|
||||
<%= text_field_tag("project[default_context_name]", project.default_context.name, {:tabindex=>next_tab_index,:size=> 25}) %>
|
||||
<%= text_field_tag("project[default_context_name]", project.default_context.name, {:size=> 25}) %>
|
||||
<br/>
|
||||
|
||||
<label for="project[default_tags]">Default Tags</label><br/>
|
||||
<%= text_field_tag("project[default_tags]", project.default_tags, {:tabindex=>next_tab_index,:size=> 25}) %>
|
||||
<%= text_field_tag("project[default_tags]", project.default_tags, {:size=> 25}) %>
|
||||
<br/>
|
||||
|
||||
<input type="hidden" name="wants_render" value="true" />
|
||||
<div class="submit_box">
|
||||
<div class="widgets" id="<%= dom_id(project, 'widgets') %>">
|
||||
<button type="submit" class="positive" id="<%= dom_id(project, 'submit') %>" tabindex="<%=next_tab_index%>">
|
||||
<button type="submit" class="positive" id="<%= dom_id(project, 'submit') %>">
|
||||
<%=image_tag("accept.png", :alt => "") %>
|
||||
Update
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ var <%=object_name%> = {
|
|||
update_project_page: function() {
|
||||
<%=object_name%>.remove_project_edit_form();
|
||||
<%=object_name%>.update_and_show_project_settings();
|
||||
TracksForm.set_project_name("<%= escape_javascript(@project.name)%>");
|
||||
TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name)%>");
|
||||
$("h2 span#project_name").html("<%= escape_javascript(@project.name)%>");
|
||||
<% if @project.default_context %>
|
||||
TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@project.default_context.name)%>");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<% if @saved -%>
|
||||
TracksPages.page_inform('<%=t('projects.status_project_name_changed')%>');
|
||||
TracksForm.set_project_name("<%= escape_javascript(@project.name)%>");
|
||||
TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name)%>");
|
||||
<% end %>
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
@initial_project_name = @project.name unless @project.nil?
|
||||
@initial_tags ||= @default_tags
|
||||
@initial_tags ||= @project.default_tags unless @project.nil?
|
||||
reset_tab_index
|
||||
-%>
|
||||
<div id="todo_new_action_container">
|
||||
|
||||
|
|
|
|||
|
|
@ -15,27 +15,27 @@
|
|||
<%= content_tag(:input, "", :type=>"hidden", :name=>"_tag_name", :value=>"#{@tag_name}") if @tag_name -%>
|
||||
|
||||
<label for="<%= dom_id(@todo, 'description') %>"><%= t('common.description') %></label>
|
||||
<%= t.text_field( "description", "size" => 30, "tabindex" => next_tab_index, "maxlength" => 100) %>
|
||||
<%= t.text_field( "description", "size" => 30, "maxlength" => 100) %>
|
||||
|
||||
<label for="<%= dom_id(@todo, 'notes') %>"><%= t('common.notes') %></label>
|
||||
<%= t.text_area( "notes", "cols" => 29, "rows" => 4, "tabindex" => next_tab_index) %>
|
||||
<%= t.text_area( "notes", "cols" => 29, "rows" => 4) %>
|
||||
|
||||
<div class="project_input">
|
||||
<label for="<%= dom_id(@todo, 'project_name') %>"><%= t('common.project') %></label>
|
||||
<input id="<%= dom_id(@todo, 'project_name') %>" name="project_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%= @todo.project.nil? ? '' : h(@todo.project.name) %>" />
|
||||
<input id="<%= dom_id(@todo, 'project_name') %>" name="project_name" autocomplete="off" size="30" type="text" value="<%= @todo.project.nil? ? 'None' : h(@todo.project.name) %>" />
|
||||
</div>
|
||||
|
||||
<div class="context_input">
|
||||
<label for="<%= dom_id(@todo, 'context_name') %>"><%= t('common.context') %></label>
|
||||
<input id="<%= dom_id(@todo, 'context_name') %>" name="context_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%= h @todo.context.name %>" />
|
||||
<input id="<%= dom_id(@todo, 'context_name') %>" name="context_name" autocomplete="off" size="30" type="text" value="<%= h @todo.context.name %>" />
|
||||
</div>
|
||||
|
||||
<label class="tag_list_label" for="<%= dom_id(@todo, 'tag_list') %>"><%= t('todos.tags') %></label>
|
||||
<%= text_field_tag 'tag_list', tag_list_text, :id => dom_id(@todo, 'tag_list'), :size => 30, :tabindex => next_tab_index %>
|
||||
<%= text_field_tag 'tag_list', tag_list_text, :id => dom_id(@todo, 'tag_list'), :size => 30 %>
|
||||
|
||||
<div class="due_input">
|
||||
<label for="<%= dom_id(@todo, 'due_label') %>"><%= Todo.human_attribute_name('due') %></label>
|
||||
<%= date_field_tag("todo[due]", dom_id(@todo, 'due'), format_date(@todo.due), "tabindex" => next_tab_index) %>
|
||||
<%= date_field_tag("todo[due]", dom_id(@todo, 'due'), format_date(@todo.due)) %>
|
||||
<a href="#" id="<%= dom_id(@todo, 'due_x') %>" class="date_clear" title="<%= t('todos.clear_due_date') %>">
|
||||
<%= image_tag("blank.png", :alt => t('todos.clear_due_date'), :class => "delete_item") %>
|
||||
</a>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
<div class="show_from_input">
|
||||
<label for="<%= dom_id(@todo, 'show_from') %>"><%= t('todos.show_from') %></label>
|
||||
<%= date_field_tag("todo[show_from]", dom_id(@todo, 'show_from'), format_date(@todo.show_from), "tabindex" => next_tab_index) %>
|
||||
<%= date_field_tag("todo[show_from]", dom_id(@todo, 'show_from'), format_date(@todo.show_from)) %>
|
||||
<a href="#" id="<%= dom_id(@todo, 'show_from_x') %>" class="date_clear" title="<%= t('todos.clear_show_from_date') %>">
|
||||
<%= image_tag("blank.png", :alt => t('todos.clear_show_from_date'), :class => "delete_item") %>
|
||||
</a>
|
||||
|
|
@ -56,14 +56,14 @@
|
|||
</ul>
|
||||
</div>
|
||||
<label id="label_for_predecessor_input" for="predecessor_input" style="display:none"><%= t('todos.add_another_dependency')%></label>
|
||||
<%= text_field_tag "predecessor_input", nil, :size => 30, :tabindex => next_tab_index %>
|
||||
<%= text_field_tag "predecessor_input", nil, :size => 30 %>
|
||||
<%= hidden_field_tag "predecessor_list", @todo.predecessors.map{|t| t.id.to_s}.join(', ') %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="<%= dom_id(@todo, 'submit') %>" tabindex="<%= next_tab_index %>">
|
||||
<button type="submit" class="positive" id="<%= dom_id(@todo, 'submit') %>">
|
||||
<%=image_tag("accept.png", :alt => "") %>
|
||||
<%= t('common.update') %>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -4,34 +4,34 @@
|
|||
<%= get_list_of_error_messages_for(@todo) if @todo %>
|
||||
</span>
|
||||
<h2><label for="todo_description"><%= t('common.description') %></label></h2>
|
||||
<%= text_field( "todo", "description", "tabindex" => 1, "maxlength" => 100, "size" => 50) %>
|
||||
<%= text_field( "todo", "description", "maxlength" => 100, "size" => 50) %>
|
||||
<h2><label for="tag_list"><%= t('todos.tags') %></label></h2>
|
||||
<%= text_field_tag "tag_list", @tag_list_text, :size => 50, :tabindex => 2 %>
|
||||
<%= text_field_tag "tag_list", @tag_list_text, :size => 50 %>
|
||||
<h2><label for="todo_context_id"><%= t('common.context') %></label></h2>
|
||||
<%= unless @mobile_from_context
|
||||
collection_select( "todo", "context_id", @contexts, "id", "name", {}, {"tabindex" => 3} )
|
||||
collection_select( "todo", "context_id", @contexts, "id", "name", {} )
|
||||
else
|
||||
select_tag("todo[context_id]", options_from_collection_for_select(
|
||||
@contexts, "id", "name", @mobile_from_context.id),
|
||||
{"id" => :todo_context_id, :tabindex => 3} )
|
||||
{"id" => :todo_context_id} )
|
||||
end %>
|
||||
<h2><label for="todo_project_id"><%= t('common.project') %></label></h2>
|
||||
<%= unless @mobile_from_project
|
||||
collection_select( "todo", "project_id", @projects, "id", "name",
|
||||
{:include_blank => t('todos.no_project')}, {"tabindex" => 4} )
|
||||
{:include_blank => t('todos.no_project')} )
|
||||
else
|
||||
# manually add blank option since :include_blank does not work
|
||||
# with options_from_collection_for_select
|
||||
empty_option = content_tag(:option, "", :value => "")
|
||||
select_tag("todo[project_id]", empty_option+options_from_collection_for_select(
|
||||
@projects, "id", "name", @mobile_from_project.id),
|
||||
{"id" => :todo_project_id, :tabindex => 4} )
|
||||
{"id" => :todo_project_id} )
|
||||
end %>
|
||||
<h2><label for="todo_notes"><%= t('common.notes') %></label></h2>
|
||||
<%= text_area( "todo", "notes", "cols" => 40, "rows" => 3, "tabindex" => 5) %>
|
||||
<%= text_area( "todo", "notes", "cols" => 40, "rows" => 3) %>
|
||||
<h2><label for="todo_due"><%= t('todos.due') %></label></h2>
|
||||
<%= date_select("todo", "due", {:order => [:day, :month, :year],
|
||||
:start_year => Date.current.year, :include_blank => '--'}, :tabindex => 6) %>
|
||||
:start_year => Date.current.year, :include_blank => '--'}) %>
|
||||
<h2><label for="todo_show_from"><%= t('todos.show_from') %></label></h2>
|
||||
<%= date_select("todo", "show_from", {:order => [:day, :month, :year],
|
||||
:start_year => Date.current.year, :include_blank => true}, :tabindex => 7) %>
|
||||
:start_year => Date.current.year, :include_blank => true}) %>
|
||||
|
|
|
|||
|
|
@ -16,27 +16,27 @@
|
|||
</div>
|
||||
|
||||
<label for="todo_notes"><%= t('shared.multiple_next_actions') %></label>
|
||||
<%= text_area_tag( "todo[multiple_todos]", "", :cols => 29, :rows => 6, :tabindex => next_tab_index) %>
|
||||
<%= text_area_tag( "todo[multiple_todos]", "", :cols => 29, :rows => 6 ) %>
|
||||
|
||||
<label for="todo_project_name"><%= t('shared.project_for_all_actions') %></label>
|
||||
<input id="multi_todo_project_name" name="project_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%=h @initial_project_name %>" />
|
||||
<input id="multi_todo_project_name" name="project_name" autocomplete="off" size="30" type="text" value="<%=h @initial_project_name %>" />
|
||||
<div class="page_name_auto_complete" id="project_list" style="display:none"></div>
|
||||
|
||||
<label for="todo_context_name"><%= t('shared.context_for_all_actions') %></label>
|
||||
<input id="multi_todo_context_name" name="context_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%=h @initial_context_name %>" />
|
||||
<input id="multi_todo_context_name" name="context_name" autocomplete="off" size="30" type="text" value="<%=h @initial_context_name %>" />
|
||||
<div class="page_name_auto_complete" id="context_list" style="display:none"></div>
|
||||
|
||||
<label for="tag_list"><%= t('shared.tags_for_all_actions') %></label>
|
||||
<%= hidden_field_tag "initial_tag_list", @initial_tags%>
|
||||
<%= text_field_tag "multi_tag_list", @initial_tags, :name=>:tag_list, :size => 30, :tabindex => next_tab_index %>
|
||||
<%= text_field_tag "multi_tag_list", @initial_tags, :name=>:tag_list, :size => 30 %>
|
||||
<%= content_tag("div", "", :id => "tag_list_auto_complete", :class => "auto_complete") %>
|
||||
|
||||
<%= check_box_tag('todos_sequential', 'true', false, {:tabindex => next_tab_index}) %>
|
||||
<%= check_box_tag('todos_sequential', 'true', false) %>
|
||||
<label for="todos_sequential"><%= t('shared.make_actions_dependent') %></label>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="todo_multi_new_action_submit" tabindex="<%= next_tab_index%>">
|
||||
<button type="submit" class="positive" id="todo_multi_new_action_submit">
|
||||
<%= image_tag("accept.png", :alt => "") %><%= t('shared.add_actions') %>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,31 +12,31 @@
|
|||
|
||||
<label for="todo_description" style="float:left"><%= Todo.human_attribute_name('description') %></label>
|
||||
<a href="#" id="new_todo_starred_link" class="undecorated_link" ><%= image_tag("blank.png", :title =>t('todos.star_action'), :class => "todo_star", :style=> "float: right")%></a>
|
||||
<%= t.text_field("description", "size" => 30, "tabindex" => next_tab_index, "maxlength" => 100, "autocomplete" => "off", :autofocus => 1) %>
|
||||
<%= t.text_field("description", "size" => 30, "maxlength" => 100, "autocomplete" => "off", :autofocus => 1) %>
|
||||
|
||||
<label for="todo_notes"><%= Todo.human_attribute_name('notes') %></label>
|
||||
<%= t.text_area("notes", "cols" => 29, "rows" => 6, "tabindex" => next_tab_index) %>
|
||||
<%= t.text_area("notes", "cols" => 29, "rows" => 6) %>
|
||||
|
||||
<label for="todo_project_name"><%= Todo.human_attribute_name('project') %></label>
|
||||
<input id="todo_project_name" name="project_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%= h(@initial_project_name) %>" />
|
||||
<input id="todo_project_name" name="project_name" autocomplete="off" size="30" type="text" value="<%= h(@initial_project_name) %>" />
|
||||
<div class="page_name_auto_complete" id="project_list" style="display:none"></div>
|
||||
|
||||
<label for="todo_context_name"><%= Todo.human_attribute_name('context') %></label>
|
||||
<input id="todo_context_name" name="context_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%= h(@initial_context_name) %>" />
|
||||
<input id="todo_context_name" name="context_name" autocomplete="off" size="30" type="text" value="<%= h(@initial_context_name) %>" />
|
||||
|
||||
<label for="tag_list"><%= Todo.human_attribute_name('tags') + ' (' + t('shared.separate_tags_with_commas') + ')' %></label>
|
||||
<%= hidden_field_tag "initial_tag_list", @initial_tags%>
|
||||
<%= text_field_tag "tag_list", @initial_tags, :size => 30, :tabindex => next_tab_index %>
|
||||
<%= text_field_tag "tag_list", @initial_tags, :size => 30 %>
|
||||
<%= content_tag("div", "", :id => "tag_list_auto_complete", :class => "auto_complete") %>
|
||||
|
||||
<div class="due_input">
|
||||
<label for="todo_due"><%= Todo.human_attribute_name('due') %></label>
|
||||
<%= t.text_field("due", "size" => 12, "class" => "Date", "tabindex" => next_tab_index, "autocomplete" => "off") %>
|
||||
<%= t.text_field("due", "size" => 12, "class" => "Date", "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<div class="show_from_input">
|
||||
<label for="todo_show_from"><%= Todo.human_attribute_name('show_from') %></label>
|
||||
<%= t.text_field("show_from", "size" => 12, "class" => "Date", "tabindex" => next_tab_index, "autocomplete" => "off") %>
|
||||
<%= t.text_field("show_from", "size" => 12, "class" => "Date", "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<div class="depends_on">
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<label id="label_for_predecessor_input" for="predecessor_input" style="display:none"><%= t('todos.add_another_dependency')%></label>
|
||||
<%= text_field_tag "predecessor_input", nil, :size => 30, :tabindex => next_tab_index %>
|
||||
<%= text_field_tag "predecessor_input", nil, :size => 30 %>
|
||||
<%= hidden_field_tag "predecessor_list", ""%>
|
||||
</div>
|
||||
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="todo_new_action_submit" tabindex="<%= next_tab_index%>">
|
||||
<button type="submit" class="positive" id="todo_new_action_submit">
|
||||
<%= image_tag("accept.png", :alt => "") + t('shared.add_action') %>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
$('#todo-form-new-action').clearForm();
|
||||
$('#todo-form-new-action').clearDeps();
|
||||
TracksForm.set_context_name('<%=escape_javascript @initial_context_name%>');
|
||||
TracksForm.set_project_name('<%=escape_javascript @initial_project_name%>');
|
||||
TracksForm.set_project_name_and_default_project_name('<%=escape_javascript @initial_project_name%>');
|
||||
TracksForm.set_tag_list_and_default_tag_list('<%=escape_javascript @initial_tags%>');
|
||||
$('#todo-form-new-action input:text:first').focus();
|
||||
$('#new_todo_starred_link .todo_star').removeClass('starred');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<%= form_tag todo_path(@todo, :format => 'm'), :name => 'mobileEdit', :method => :put do %>
|
||||
<%= render :partial => 'edit_form', :locals => { :parent_container_type => "show_mobile" } %>
|
||||
<p><input type="submit" value="<%= t('common.update') %>" tabindex="6" accesskey="#" class="btn"/></p>
|
||||
<p><input type="submit" value="<%= t('common.update') %>" accesskey="#" class="btn"/></p>
|
||||
<% end -%>
|
||||
<%= link_to t('common.cancel'), @return_path %>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<%= form_tag todos_path(:format => 'm'), :method => :post do %>
|
||||
<%= render :partial => 'edit_form' %>
|
||||
<p class="text-right"><input type="submit" class="btn" value="<%= t('common.create') %>" tabindex="12" accesskey="#" /></p>
|
||||
<p class="text-right"><input type="submit" class="btn" value="<%= t('common.create') %>" accesskey="#" /></p>
|
||||
<% end -%>
|
||||
<%= link_to t('common.back'), @return_path %>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,21 @@ Feature: Edit a context
|
|||
Then I should see that a context named "Errands" is not present
|
||||
And I should see that a context named "OutAndAbout" is present
|
||||
|
||||
# Ticket #1796
|
||||
@javascript
|
||||
Scenario: I can change the name of the context and it should update the new todo form
|
||||
When I go to the context page for "@pc"
|
||||
And I edit the context name in place to be "OutAndAbout"
|
||||
Then the context field of the new todo form should contain "OutAndAbout"
|
||||
|
||||
# Ticket #1789
|
||||
@javascript
|
||||
Scenario: I can change the name of the context and it should still allow me to add new actions
|
||||
When I go to the context page for "@pc"
|
||||
And I edit the context name in place to be "OutAndAbout"
|
||||
And I submit a new action with description "a new next action"
|
||||
Then I should see the todo "a new next action"
|
||||
|
||||
@javascript
|
||||
Scenario: Editing the context of a todo will remove the todo
|
||||
When I go to the the context page for "@pc"
|
||||
|
|
@ -102,4 +117,4 @@ Feature: Edit a context
|
|||
When I go to the "test" context
|
||||
And I mark "deferred todo 1" as complete
|
||||
Then I should see empty message for todos of context
|
||||
And I should see empty message for deferred todos of context
|
||||
And I should see empty message for deferred todos of context
|
||||
|
|
|
|||
|
|
@ -58,6 +58,16 @@ Feature: Edit a project
|
|||
Then the project title should be "cherries"
|
||||
And the project field of the new todo form should contain "cherries"
|
||||
|
||||
# Ticket #1789
|
||||
@javascript
|
||||
Scenario: I can change the name of the project and it should still allow me to add new actions
|
||||
Given I have a project "bananas"
|
||||
When I go to the "bananas" project
|
||||
And I edit the project name to "cherries"
|
||||
And I edit the default context to "@pc"
|
||||
And I submit a new action with description "a new next action"
|
||||
Then I should see the todo "a new next action"
|
||||
|
||||
@javascript
|
||||
Scenario: I can change the default context of the project and it should update the new todo form
|
||||
Given I have a project "bananas" with 1 todos
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ When /^I edit the context name in place to be "([^\"]*)"$/ do |new_context_name|
|
|||
page.find("span#context_name").click
|
||||
fill_in "value", :with => new_context_name
|
||||
click_button "Ok"
|
||||
wait_for_ajax
|
||||
end
|
||||
|
||||
Then /^I should see the context name is "([^\"]*)"$/ do |context_name|
|
||||
|
|
|
|||
|
|
@ -123,13 +123,13 @@ end
|
|||
Then /^the project "([^"]*)" should have (\d+) actions listed$/ do |project_name, count|
|
||||
project = @current_user.projects.where(:name => project_name).first
|
||||
expect(project).to_not be_nil
|
||||
xpath = "//div[@id='list-active-projects-container']//div[@id='project_#{project.id}']//span[@class='needsreview']"
|
||||
xpath = "//div[@id='list-active-projects-container']//div[@id='project_#{project.id}']"
|
||||
expect(page.find(:xpath, xpath).text).to eq("#{project.name} (#{count} actions)")
|
||||
end
|
||||
|
||||
Then /^the project "([^"]*)" should have (\d+) deferred actions listed$/ do |project_name, deferred|
|
||||
project = @current_user.projects.where(:name => project_name).first
|
||||
expect(project).to_not be_nil
|
||||
xpath = "//div[@id='list-active-projects-container']//div[@id='project_#{project.id}']//span[@class='needsreview']"
|
||||
xpath = "//div[@id='list-active-projects-container']//div[@id='project_#{project.id}']"
|
||||
expect(page.find(:xpath, xpath).text).to eq("#{project.name} (#{deferred} deferred actions)")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ Then /^the project field of the new todo form should contain "([^"]*)"$/ do |pro
|
|||
expect(page.find(:xpath, xpath).value).to eq(project_name)
|
||||
end
|
||||
|
||||
Then /^the context field of the new todo form should contain "([^"]*)"$/ do |context_name|
|
||||
xpath= "//form[@id='todo-form-new-action']/input[@id='todo_context_name']"
|
||||
expect(page.find(:xpath, xpath).value).to eq(context_name)
|
||||
end
|
||||
|
||||
Then /^the default context of the new todo form should be "([^"]*)"$/ do |context_name|
|
||||
xpath= "//form[@id='todo-form-new-action']/input[@id='todo_context_name']"
|
||||
expect(context_name).to eq(page.find(:xpath, xpath).value)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@ class ProjectFromTodoTest < ActiveSupport::TestCase
|
|||
assert_equal "a, b", project.default_tags
|
||||
end
|
||||
|
||||
def test_project_is_marked_as_reviewed
|
||||
todo = todos(:upgrade_rails)
|
||||
project = ProjectFromTodo.new(todo).create
|
||||
refute project.needs_review?(users(:admin_user))
|
||||
end
|
||||
|
||||
def test_invalid_project_from_invalid_todo
|
||||
todo = todos(:upgrade_rails)
|
||||
todo.description = ""
|
||||
|
|
|
|||
|
|
@ -89,7 +89,12 @@ class ProjectTest < ActiveSupport::TestCase
|
|||
|
||||
def test_review_completedprojects
|
||||
@timemachine.complete!
|
||||
assert !@timemachine.needs_review?(users(:admin_user))
|
||||
refute @timemachine.needs_review?(users(:admin_user))
|
||||
end
|
||||
|
||||
def test_new_project_is_reviewed
|
||||
project = users(:admin_user).projects.create!(:name => "test1")
|
||||
refute project.needs_review?(users(:admin_user))
|
||||
end
|
||||
|
||||
def test_complete_project
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue