From a446bd38e5c8715c7b987f2f3906db8f5be2c0c6 Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Mon, 28 May 2012 19:58:12 +0400 Subject: [PATCH 1/2] [refs #442] Filter mass builds by platform. Order them by created_at --- app/controllers/platforms/platforms_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/platforms/platforms_controller.rb b/app/controllers/platforms/platforms_controller.rb index d9eebe61f..e2073276f 100644 --- a/app/controllers/platforms/platforms_controller.rb +++ b/app/controllers/platforms/platforms_controller.rb @@ -17,14 +17,14 @@ class Platforms::PlatformsController < Platforms::BaseController if mass_build.save redirect_to(mass_builds_platform_path(@platform), :notice => t("flash.platform.build_all_success")) else - @mass_builds = MassBuild.paginate(:page => params[:page], :per_page => 20) + @mass_builds = MassBuild.by_platform(@platform).order('created_at DESC').paginate(:page => params[:page], :per_page => 20) flash[:warning] = mass_build.errors.full_messages.join('. ') flash[:error] = t("flash.platform.build_all_error") end end def mass_builds - @mass_builds = MassBuild.paginate(:page => params[:page], :per_page => 20) + @mass_builds = MassBuild.by_platform(@platform).order('created_at DESC').paginate(:page => params[:page], :per_page => 20) render :action => :build_all end From 5e9f348074d8fe8756acd68e6f0ebf78d4e38e5b Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Mon, 28 May 2012 23:18:50 +0400 Subject: [PATCH 2/2] [ref #442] Add id column --- app/views/platforms/platforms/build_all.html.haml | 2 ++ config/locales/models/mass_build.en.yml | 1 + config/locales/models/mass_build.ru.yml | 1 + 3 files changed, 4 insertions(+) diff --git a/app/views/platforms/platforms/build_all.html.haml b/app/views/platforms/platforms/build_all.html.haml index afdeea268..7e6f2b86c 100644 --- a/app/views/platforms/platforms/build_all.html.haml +++ b/app/views/platforms/platforms/build_all.html.haml @@ -28,6 +28,7 @@ %table.tablesorter.unbordered %thead %tr + %th.lpadding16= t('activerecord.attributes.mass_build.id') %th.lpadding16= t('activerecord.attributes.mass_build.name') %th.lpadding16= t('activerecord.attributes.mass_build.arch_names') %th.lpadding16= t('activerecord.attributes.mass_build.user') @@ -35,6 +36,7 @@ %th.lpadding16= t('activerecord.attributes.mass_build.created_at') - @mass_builds.each do |mass_build| %tr + %td= mass_build.id %td= link_to mass_build.name, build_lists_path(:filter => {:mass_build_id => mass_build.id}) %td= mass_build.arch_names %td= link_to mass_build.user.fullname, mass_build.user diff --git a/config/locales/models/mass_build.en.yml b/config/locales/models/mass_build.en.yml index e160bf2ec..9d60859d1 100644 --- a/config/locales/models/mass_build.en.yml +++ b/config/locales/models/mass_build.en.yml @@ -7,6 +7,7 @@ en: mass_build: Mass Build attributes: mass_build: + id: Id name: Name created_at: Created updated_at: Updated diff --git a/config/locales/models/mass_build.ru.yml b/config/locales/models/mass_build.ru.yml index 15b231c96..2954a4101 100644 --- a/config/locales/models/mass_build.ru.yml +++ b/config/locales/models/mass_build.ru.yml @@ -7,6 +7,7 @@ ru: mass_build: Массовая Сборка attributes: mass_build: + id: Id name: Название created_at: Создан updated_at: Обновлен