mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-27 12:28:48 +01:00
Move the calendar to its own controller
This commit is contained in:
parent
70fc1848c2
commit
d1ff0daf6f
6 changed files with 97 additions and 26 deletions
21
app/controllers/calendar_controller.rb
Normal file
21
app/controllers/calendar_controller.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
class CalendarController < ApplicationController
|
||||
def show
|
||||
@source_view = 'calendar'
|
||||
@page_title = t('todos.calendar_page_title')
|
||||
|
||||
@calendar = Todos::Calendar.new(current_user)
|
||||
@projects = @calendar.projects
|
||||
@count = current_user.todos.not_completed.are_due.count
|
||||
@due_all = current_user.todos.not_completed.are_due.reorder("due")
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.ics {
|
||||
render :action => 'calendar', :layout => false, :content_type => Mime::ICS
|
||||
}
|
||||
format.xml {
|
||||
render :xml => @due_all.to_xml( *to_xml_params )
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue