2019-12-18 09:49:57 -06:00
|
|
|
# typed: false
|
2013-04-30 20:09:46 -05:00
|
|
|
class CalendarController < ApplicationController
|
2018-09-22 12:55:27 -05:00
|
|
|
skip_before_action :login_required, :only => [:show]
|
|
|
|
prepend_before_action :login_or_feed_token_required, :only => [:show]
|
2013-04-30 20:19:27 -05:00
|
|
|
|
2013-04-30 20:09:46 -05:00
|
|
|
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
|
2014-04-21 12:09:32 -04:00
|
|
|
format.m {
|
|
|
|
cookies[:mobile_url]= {:value => request.fullpath, :secure => SITE_CONFIG['secure_cookies']}
|
|
|
|
}
|
2013-04-30 20:09:46 -05:00
|
|
|
format.ics {
|
2018-11-03 14:50:30 -05:00
|
|
|
render :action => 'show', :layout => false, :content_type => Mime[:ics]
|
2013-04-30 20:09:46 -05:00
|
|
|
}
|
|
|
|
format.xml {
|
2019-05-03 11:47:05 +03:00
|
|
|
render :xml => @due_all.to_xml( *[todo_xml_params[0].merge({:root => :todos})] )
|
2013-04-30 20:09:46 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|