From f0928badc81743beeda261d06f12a16dd560dcc8 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 22 Jan 2013 19:28:59 +0400 Subject: [PATCH] #836: update build_lists UI, API --- app/views/api/v1/build_lists/show.json.jbuilder | 6 ++++++ .../platforms/product_build_lists/_results.html.haml | 10 ++++++---- app/views/platforms/product_build_lists/show.html.haml | 2 +- app/views/projects/build_lists/show.html.haml | 2 +- config/locales/models/build_list.en.yml | 2 ++ config/locales/models/build_list.ru.yml | 2 ++ config/locales/models/product_build_list.en.yml | 1 + config/locales/models/product_build_list.ru.yml | 1 + 8 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app/views/api/v1/build_lists/show.json.jbuilder b/app/views/api/v1/build_lists/show.json.jbuilder index 327674067..1f07e603a 100644 --- a/app/views/api/v1/build_lists/show.json.jbuilder +++ b/app/views/api/v1/build_lists/show.json.jbuilder @@ -58,5 +58,11 @@ json.build_list do |json| json_mass_build.(@build_list.mass_build, :id, :name) end if @build_list.mass_build + json.logs (@build_list.results || []) do |json_logs, result| + json_logs.file_name result['file_name'] + json_logs.size result['size'] + json_logs.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{result['sha1']}" + end if @build_list.new_core? + json.url api_v1_build_list_path(@build_list, :format => :json) end diff --git a/app/views/platforms/product_build_lists/_results.html.haml b/app/views/platforms/product_build_lists/_results.html.haml index 94129618c..ab9aed523 100644 --- a/app/views/platforms/product_build_lists/_results.html.haml +++ b/app/views/platforms/product_build_lists/_results.html.haml @@ -1,6 +1,8 @@ -%h3= t("layout.product_build_lists.results") -- unless pbl.results.present? - %h4.nomargin= t("layout.product_build_lists.no_results") +- header = subject.is_a?(BuildList) ? 'logs' : 'results' +- prefix = 'layout.' << subject.class.name.underscore << 's.' +%h3= t("#{prefix}#{header}") +- unless subject.results.present? + %h4.nomargin= t("#{prefix}no_#{header}") - else %table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"} %thead @@ -9,7 +11,7 @@ %th= t("activerecord.attributes.product_build_list/results.sha1") %th= t("activerecord.attributes.product_build_list/results.size") %tbody - - pbl.results.each do |item| + - subject.results.each do |item| %tr - sha1 = item['sha1'] - filename = item['file_name'] diff --git a/app/views/platforms/product_build_lists/show.html.haml b/app/views/platforms/product_build_lists/show.html.haml index ce0efcdc9..6af23ac72 100644 --- a/app/views/platforms/product_build_lists/show.html.haml +++ b/app/views/platforms/product_build_lists/show.html.haml @@ -35,7 +35,7 @@ - if pbl.build_started? || pbl.build_canceling? = render 'shared/log', { :build_started => true, :get_log_path => log_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) } -= render 'results', :pbl => pbl += render 'results', :subject => pbl :javascript $(function(){ diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index 6c6858ada..68485db1e 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -178,7 +178,7 @@ - if @build_list.new_core? .hr - = render 'platforms/product_build_lists/results', :pbl => @build_list + = render 'platforms/product_build_lists/results', :subject => @build_list :javascript $('article .all').addClass('bigpadding'); diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 43128a667..0579798ed 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -46,6 +46,8 @@ en: layout: build_lists: + logs: Logs + no_logs: No logs filter_header: Filter current: Curent created_at_start: "Build to start on:" diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index 3b9489aaa..9560f121b 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -45,6 +45,8 @@ ru: layout: build_lists: + logs: Логи + no_logs: Нет логов filter_header: Фильтр current: Текущие created_at_start: "Время постановки на сборку с:" diff --git a/config/locales/models/product_build_list.en.yml b/config/locales/models/product_build_list.en.yml index e554e1d57..53201b395 100644 --- a/config/locales/models/product_build_list.en.yml +++ b/config/locales/models/product_build_list.en.yml @@ -3,6 +3,7 @@ en: product_build_lists: logs: Logs (last 100 lines) results: Results + no_results: No results work_env: Work environment iso_builder_folder: folder with contents of the GIT project results_folder: all files from this folder will be uploaded into the file-store diff --git a/config/locales/models/product_build_list.ru.yml b/config/locales/models/product_build_list.ru.yml index d593aa3f4..f762a2527 100644 --- a/config/locales/models/product_build_list.ru.yml +++ b/config/locales/models/product_build_list.ru.yml @@ -3,6 +3,7 @@ ru: product_build_lists: logs: Логи (последнии 100 строк) results: Результаты + no_results: Нет результатов work_env: Рабочее пространство iso_builder_folder: папка с содержимым GIT проекта results_folder: все файлы из этой папки будут загружены на file-store