mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-19 00:30:12 +01:00
Merge branch 'master' into railsupdate
This commit is contained in:
commit
6d11ebd1b0
3 changed files with 23 additions and 8 deletions
|
|
@ -536,13 +536,17 @@ class TodosController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_parent_resource_scope(&block)
|
def with_parent_resource_scope(&block)
|
||||||
|
@feed_title = "Actions "
|
||||||
if (params[:context_id])
|
if (params[:context_id])
|
||||||
@context = current_user.contexts.find_by_params(params)
|
@context = current_user.contexts.find_by_params(params)
|
||||||
|
@feed_title = @feed_title + "in context '#{@context.name}'"
|
||||||
Todo.send :with_scope, :find => {:conditions => ['todos.context_id = ?', @context.id]} do
|
Todo.send :with_scope, :find => {:conditions => ['todos.context_id = ?', @context.id]} do
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
elsif (params[:project_id])
|
elsif (params[:project_id])
|
||||||
@project = current_user.projects.find_by_params(params)
|
@project = current_user.projects.find_by_params(params)
|
||||||
|
@feed_title = @feed_title + "in project '#{@project.name}'"
|
||||||
|
@project_feed = true
|
||||||
Todo.send :with_scope, :find => {:conditions => ['todos.project_id = ?', @project.id]} do
|
Todo.send :with_scope, :find => {:conditions => ['todos.project_id = ?', @project.id]} do
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
|
@ -718,7 +722,7 @@ class TodosController < ApplicationController
|
||||||
render_rss_feed_for @todos, :feed => todo_feed_options,
|
render_rss_feed_for @todos, :feed => todo_feed_options,
|
||||||
:item => {
|
:item => {
|
||||||
:title => :description,
|
:title => :description,
|
||||||
:link => lambda { |t| context_url(t.context) },
|
:link => lambda { |t| @project_feed.nil? ? context_url(t.context) : project_url(t.project) },
|
||||||
:guid => lambda { |t| todo_url(t) },
|
:guid => lambda { |t| todo_url(t) },
|
||||||
:description => todo_feed_content
|
:description => todo_feed_content
|
||||||
}
|
}
|
||||||
|
|
@ -726,7 +730,9 @@ class TodosController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def todo_feed_options
|
def todo_feed_options
|
||||||
Todo.feed_options(current_user)
|
options = Todo.feed_options(current_user)
|
||||||
|
options[:title] = @feed_title
|
||||||
|
return options
|
||||||
end
|
end
|
||||||
|
|
||||||
def todo_feed_content
|
def todo_feed_content
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ module RecurringTodosHelper
|
||||||
def recurrence_time_span(rt)
|
def recurrence_time_span(rt)
|
||||||
case rt.ends_on
|
case rt.ends_on
|
||||||
when "no_end_date"
|
when "no_end_date"
|
||||||
return ""
|
return rt.start_from.nil? ? "" : "from " + format_date(rt.start_from)
|
||||||
when "ends_on_number_of_times"
|
when "ends_on_number_of_times"
|
||||||
return "for "+rt.number_of_occurences.to_s + " times"
|
return "for "+rt.number_of_occurences.to_s + " times"
|
||||||
when "ends_on_end_date"
|
when "ends_on_end_date"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,16 @@
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<span class="todo.descr"><%= sanitize(recurring_todo.description) %></span> <%= recurring_todo_tag_list %>
|
<span class="todo.descr"><%= sanitize(recurring_todo.description) %></span> <%= recurring_todo_tag_list %>
|
||||||
<span class='recurrence_pattern'>
|
<span class='recurrence_pattern'>
|
||||||
[<%=recurrence_target(recurring_todo)%> <%= recurring_todo.recurrence_pattern %> <%= recurrence_time_span(recurring_todo) %>]
|
<%
|
||||||
|
rt = recurrence_target(recurring_todo)
|
||||||
|
rp = recurring_todo.recurrence_pattern
|
||||||
|
# only add space if recurrence_pattern has content
|
||||||
|
rp = " " + rp if !rp.nil?
|
||||||
|
rts = recurrence_time_span(recurring_todo)
|
||||||
|
# only add space if recurrence_time_span has content
|
||||||
|
rts = " " + rts if !(rts == "")
|
||||||
|
%>
|
||||||
|
[<%=rt%><%=rp%><%=rts%>]
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue