mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Fix markup
This commit is contained in:
parent
da4967b3d0
commit
9fa8818a5d
2 changed files with 11 additions and 11 deletions
|
@ -10,10 +10,10 @@ module Dashboard
|
|||
end_date = date.at_end_of_month.utc + 14.days
|
||||
due_dates = current_user.my_modules.active.uncomplete
|
||||
.joins(experiment: :project)
|
||||
.where(experiments: {archived: false})
|
||||
.where(projects: {archived: false})
|
||||
.where(experiments: { archived: false })
|
||||
.where(projects: { archived: false })
|
||||
.where('my_modules.due_date > ? AND my_modules.due_date < ?', start_date, end_date)
|
||||
.joins(:protocols).where('protocols.team_id = ?', current_team.id)
|
||||
.joins(:protocols).where(protocols: { team_id: current_team.id })
|
||||
.pluck(:due_date)
|
||||
render json: { events: due_dates.map { |i| { date: i } } }
|
||||
end
|
||||
|
@ -22,10 +22,10 @@ module Dashboard
|
|||
date = DateTime.parse(params[:date]).utc
|
||||
my_modules = current_user.my_modules.active.uncomplete
|
||||
.joins(experiment: :project)
|
||||
.where(experiments: {archived: false})
|
||||
.where(projects: {archived: false})
|
||||
.where(experiments: { archived: false })
|
||||
.where(projects: { archived: false })
|
||||
.where('DATE(my_modules.due_date) = DATE(?)', date)
|
||||
.where('projects.team_id = ?', current_team.id)
|
||||
.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 })
|
||||
|
|
|
@ -12,19 +12,19 @@ module Dashboard
|
|||
tasks = if @experiment
|
||||
@experiment.my_modules.active
|
||||
elsif @project
|
||||
MyModule.active.where('projects.id': @project.id)
|
||||
MyModule.active.where(projects: { id: @project.id })
|
||||
else
|
||||
MyModule.active.viewable_by_user(current_user, current_team)
|
||||
end
|
||||
|
||||
tasks = tasks.joins(experiment: :project)
|
||||
.where(experiments: {archived: false})
|
||||
.where(projects: {archived: false})
|
||||
.where(experiments: { archived: false })
|
||||
.where(projects: { archived: false })
|
||||
|
||||
if task_filters[:mode] == 'assigned'
|
||||
tasks = tasks.left_outer_joins(:user_my_modules).where('user_my_modules.user_id': current_user.id)
|
||||
tasks = tasks.left_outer_joins(:user_my_modules).where(user_my_modules: { user_id: current_user.id })
|
||||
end
|
||||
tasks = tasks.where('my_modules.state': task_filters[:view])
|
||||
tasks = tasks.where(my_modules: { state: task_filters[:view] })
|
||||
.search_by_name(current_user, current_team, task_filters[:query])
|
||||
|
||||
case task_filters[:sort]
|
||||
|
|
Loading…
Reference in a new issue