mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Add team and task status for calendars scope
This commit is contained in:
parent
3d408ba7a1
commit
0675b137ad
1 changed files with 8 additions and 2 deletions
|
@ -6,13 +6,19 @@ module Dashboard
|
|||
date = DateTime.parse(params[:date])
|
||||
start_date = date.at_beginning_of_month.utc - 7.days
|
||||
end_date = date.at_end_of_month.utc + 14.days
|
||||
due_dates = current_user.my_modules.where('due_date > ? AND due_date < ?', start_date, end_date).pluck(:due_date)
|
||||
due_dates = current_user.my_modules.active.uncomplete
|
||||
.where('due_date > ? AND due_date < ?', start_date, end_date)
|
||||
.joins(:protocols).where('protocols.team_id = ?', current_team.id)
|
||||
.pluck(:due_date)
|
||||
render json: { events: due_dates.map { |i| { date: i } } }
|
||||
end
|
||||
|
||||
def day
|
||||
date = DateTime.parse(params[:date]).utc
|
||||
my_modules = current_user.my_modules.where('DATE(my_modules.due_date) = DATE(?)', date).my_modules_list_partial
|
||||
my_modules = current_user.my_modules.active.uncomplete
|
||||
.where('DATE(my_modules.due_date) = DATE(?)', date)
|
||||
.where('projects.team_id = ?', current_team.id)
|
||||
.my_modules_list_partial
|
||||
render json: {
|
||||
html: render_to_string(partial: 'shared/my_modules_list_partial.html.erb', locals: { task_groups: my_modules })
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue