mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-29 21:38:49 +01:00
fix #860. The calendar view does not have a form in the right column for a new todo. The js for updating todos expects this form to update the autocompleter in case a new project or context is created with the update of the todo
fixed with a hack
This commit is contained in:
parent
1dca4747f3
commit
a4de0e62af
3 changed files with 20 additions and 10 deletions
|
|
@ -448,7 +448,10 @@ class TodosController < ApplicationController
|
|||
def calendar
|
||||
@source_view = params['_source_view'] || 'calendar'
|
||||
@page_title = "TRACKS::Calendar"
|
||||
|
||||
|
||||
@projects = current_user.projects.find(:all)
|
||||
@default_project_context_name_map = build_default_project_context_name_map(@projects).to_json
|
||||
|
||||
due_today_date = Time.zone.now
|
||||
due_this_week_date = Time.zone.now.end_of_week
|
||||
due_next_week_date = due_this_week_date + 7.days
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div id="display_box">
|
||||
|
||||
|
||||
<div class="container">
|
||||
<h2>Due today</h2>
|
||||
<div id="empty_due_today" <%= "style=\"display:none\"" unless @due_today.empty? %>>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<%= render :partial => "todos/todo", :collection => @due_today %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<h2>Due in rest of this week</h2>
|
||||
<div id="empty_due_this_week" <%= "style=\"display:none\"" unless @due_this_week.empty? %>>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
<%= render :partial => "todos/todo", :collection => @due_this_week %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<h2>Due next week</h2>
|
||||
<div id="empty_due_next_week" <%= "style=\"display:none\"" unless @due_next_week.empty? %>>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
<%= render :partial => "todos/todo", :collection => @due_next_week %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<h2>Due in rest of <%= Time.zone.now.strftime("%B") %> </h2>
|
||||
<div id="empty_due_this_month" <%= "style=\"display:none\"" unless @due_this_month.empty? %>>
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
<%= render :partial => "todos/todo", :collection => @due_this_month %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<h2>Due in <%= (Time.zone.now+1.month).strftime("%B") %> and later</h2>
|
||||
<div id="empty_due_after_this_month" <%= "style=\"display:none\"" unless @due_after_this_month.empty? %>>
|
||||
|
|
@ -49,9 +49,14 @@
|
|||
<%= render :partial => "todos/todo", :collection => @due_after_this_month %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- End of display_box -->
|
||||
<div class="input_box" id="input_box">
|
||||
<% # hack for #860 Need to refactor this and use another dom element to bind projectDefauiltContextsMap to -%>
|
||||
<input type="hidden" id="todo_context_name" value="hidden">
|
||||
<script type="text/javascript">
|
||||
$('todo_context_name').projectDefaultContextsMap = eval('(' + <%= @default_project_context_name_map %> + ')');
|
||||
</script>
|
||||
<!--
|
||||
<input class="hide_tickler" id="hide_tickler" type="checkbox" tabindex="5" name="hide_tickler" checked="true"/>
|
||||
<label for="hide_tickler"> Show actions in tickler</label>
|
||||
|
|
|
|||
|
|
@ -6,9 +6,11 @@ if @saved
|
|||
status_message = 'Added new context / ' + status_message if @new_context_created
|
||||
page.notify :notice, status_message, 5.0
|
||||
|
||||
# update auto completer arrays for context and project
|
||||
page << "contextAutoCompleter.options.array = #{context_names_for_autocomplete}; contextAutoCompleter.changed = true" if @new_context_created
|
||||
page << "projectAutoCompleter.options.array = #{project_names_for_autocomplete}; projectAutoCompleter.changed = true" if @new_project_created
|
||||
# update auto completer arrays for edit form in right column, only for pages with that form
|
||||
unless source_view_is_one_of(:calendar)
|
||||
page << "contextAutoCompleter.options.array = #{context_names_for_autocomplete}; contextAutoCompleter.changed = true" if @new_context_created
|
||||
page << "projectAutoCompleter.options.array = #{project_names_for_autocomplete}; projectAutoCompleter.changed = true" if @new_project_created
|
||||
end
|
||||
|
||||
if source_view_is_one_of(:todo, :context, :tag)
|
||||
if @context_changed || @todo.deferred?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue