Small fixes

This commit is contained in:
aignatov-bio 2020-07-23 11:35:22 +02:00
parent 6ceb4abfb5
commit 04a6a2a250
3 changed files with 3 additions and 8 deletions

View file

@ -6,7 +6,6 @@ class MyModulesController < ApplicationController
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
include ApplicationHelper include ApplicationHelper
include MyModulesHelper
before_action :load_vars before_action :load_vars
before_action :load_projects_tree, only: %i(protocols results activities archive) before_action :load_projects_tree, only: %i(protocols results activities archive)
@ -246,7 +245,8 @@ class MyModulesController < ApplicationController
.experiment .experiment
.project .project
.team) .team)
@results = ordered_result_of(@my_module, params[:page]) @results = @my_module.results.where(archived: false).page(params[:page])
.per(Constants::RESULTS_PER_PAGE_LIMIT).order(created_at: :desc)
end end
def archive def archive

View file

@ -33,11 +33,6 @@ module MyModulesHelper
my_module.samples.count my_module.samples.count
end end
def ordered_result_of(my_module, page)
page ||= 1
my_module.results.where(archived: false).page(page).per(Constants::RESULTS_SEARCH_LIMIT).order(created_at: :desc)
end
def get_task_alert_color(my_module) def get_task_alert_color(my_module)
alert = '' alert = ''
if !my_module.completed? if !my_module.completed?

View file

@ -65,7 +65,7 @@ class Constants
# Max characters for repository name in Atwho modal # Max characters for repository name in Atwho modal
ATWHO_REP_NAME_LIMIT = 16 ATWHO_REP_NAME_LIMIT = 16
# Results limited query/display elements for pages # Results limited query/display elements for pages
RESULTS_SEARCH_LIMIT = 10 RESULTS_PER_PAGE_LIMIT = 10
#============================================================================= #=============================================================================
# File and data memory size # File and data memory size