diff --git a/app/controllers/kuroko2/dashboard_controller.rb b/app/controllers/kuroko2/dashboard_controller.rb index c735dccc..306189b9 100644 --- a/app/controllers/kuroko2/dashboard_controller.rb +++ b/app/controllers/kuroko2/dashboard_controller.rb @@ -1,6 +1,6 @@ class Kuroko2::DashboardController < Kuroko2::ApplicationController def index - @definitions = current_user.job_definitions + @definitions = current_user.job_definitions.includes(:tags, :job_instances, :job_schedules) @input_tags = params[:tag] || [] if @input_tags.present? diff --git a/app/controllers/kuroko2/job_definitions_controller.rb b/app/controllers/kuroko2/job_definitions_controller.rb index 18bce4a5..0732fe24 100644 --- a/app/controllers/kuroko2/job_definitions_controller.rb +++ b/app/controllers/kuroko2/job_definitions_controller.rb @@ -2,7 +2,7 @@ class Kuroko2::JobDefinitionsController < Kuroko2::ApplicationController before_action :set_definition, only: [:show, :edit, :update, :destroy] def index - rel = Kuroko2::JobDefinition + rel = Kuroko2::JobDefinition.joins(:admins).includes(:tags, :job_instances, :job_schedules, :admins) query = query_params[:q] if query.present? diff --git a/app/views/kuroko2/job_definitions/_list.html.slim b/app/views/kuroko2/job_definitions/_list.html.slim index 67c672f7..8517ffa4 100644 --- a/app/views/kuroko2/job_definitions/_list.html.slim +++ b/app/views/kuroko2/job_definitions/_list.html.slim @@ -21,7 +21,7 @@ td= labeled_status(definition.job_instances.take) td - definition.tags.each do |tag| - =link_to tag.name, root_path('tag': [tag.name]), class: 'label label-default spacer-right-3' + =link_to tag.name, { 'tag': [tag.name] }, class: 'label label-default spacer-right-3' = first_line(definition.description) td = link_to definition, class: 'btn btn-sm btn-default' do