From 4ad974b829ff3afe8d03bfdf83936664c595838f Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 29 May 2014 00:30:06 +0600 Subject: [PATCH] [#369] changed build list info to the table --- app/assets/stylesheets/custom_bootstrap.scss | 19 + app/views/projects/build_lists/show.html.haml | 356 +++++++++--------- 2 files changed, 197 insertions(+), 178 deletions(-) diff --git a/app/assets/stylesheets/custom_bootstrap.scss b/app/assets/stylesheets/custom_bootstrap.scss index 36df10e3d..2618fa707 100644 --- a/app/assets/stylesheets/custom_bootstrap.scss +++ b/app/assets/stylesheets/custom_bootstrap.scss @@ -99,8 +99,27 @@ table tbody { } .build-list { + .panel-heading { + .build-list-status { + padding: 5px 10px; + color: #000; + } + .build-list-time { + padding: 5px 10px; + } + .bg-nocolor { + background-color: #fff; + } + } + form .row [class^=col-] { padding-top: 5px; padding-bottom: 5px; } + + .table-borderless td, + .table-borderless th { + border: 0; + } } + diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index 8328a6e77..48ab2a062 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -1,217 +1,217 @@ -set_meta_tags title: [title_object(@build_list.project), t('activerecord.models.build_list')] .container.build-list{ 'ng-controller' => 'BuildListController', 'ng-cloak' => true } .row - .col-md-10.col-md-offset-1 - .panel.panel-info + .col-md-10.col-md-offset-1.col-sm-10 + .panel.panel-primary .panel-heading - .pull-left{class: '{{build_list.status_color}}'} {{build_list.human_status | i18n}} - .pull-right - %div{ 'am-time-ago' => 'build_list.updated_at', - title: "{{build_list.updated_at | amDateFormat:'ddd, LLL'}}" } + .build-list-status.pull-left{ 'ng-class' => '"bg-" + build_list.status_color' } + {{build_list.human_status | i18n}} + .pull-right.build-list-time{ 'am-time-ago' => 'build_list.updated_at', + title: "{{build_list.updated_at | amDateFormat:'ddd, LLL'}}" } .clearfix .panel-body - %h3.offset0.col-md-4.text-right= t 'layout.build_lists.main_data' + %h3.offset0= t 'layout.build_lists.main_data' .clearfix =form_for @build_list, url: publish_build_list_path(@build_list), html: { class: :form } do |f| - .row - .col-md-4.text-right= t 'activerecord.attributes.build_list.container_path' - .col-md-8{'ng-show' => "build_list.container_status == #{BuildList::BUILD_PUBLISHED}"} - - url = container_url - = link_to url, url - .clearfix - .col-md-8.col-md-offset-4{'ng-show' => "build_list.container_status == #{BuildList::BUILD_PUBLISH}"} - = t("layout.build_lists.creating") - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.id' - .col-md-8 - = @build_list.id - = hidden_field_tag :build_list_id, @build_list.id - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.user' - .col-md-8= link_to @build_list.user.try(:fullname), @build_list.user - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.publisher' - .col-md-8{'ng-show' => 'build_list.publisher'} - %a{'ng-href' => '{{build_list.publisher.path}}' } {{build_list.publisher.fullname}} - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.build_for_platform' - .col-md-8 - - if bfp = @build_list.build_for_platform - = link_to(bfp.name, bfp) - - else - = t 'layout.build_lists.platform_deleted' - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.save_to_repository' - .col-md-8 - = link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", [@build_list.save_to_platform, @build_list.save_to_repository] - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.include_testing_subrepository' - .col-md-8= t("layout.#{@build_list.include_testing_subrepository?}_") - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.include_repos' - .col-md-8= (@build_list.include_repos||[]).map{|r| Repository.where(id: r).first.try(:name)}.join(', ') - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.update_type' - .col-md-8 - = f.select :update_type, options_for_select(build_list_classified_update_types, - @build_list.update_type), {}, 'ng-model' => 'build_list.update_type', - 'ng-change' => 'updateTypeChanged()', 'ng-show' => 'build_list.can_publish' - %div{'ng-hide' => 'build_list.can_publish'}= @build_list.update_type - .ng-hide{ 'ng-show' => 'update_type_errors' } - .flash_notify - .alert{ 'ng-class' => "{ 'alert-error': update_type_errors }" } - {{ update_type_errors }} - .clearfix - - .col-md-4.text-right= t 'activerecord.attributes.build_list.auto_publish_status' - .col-md-8= t "layout.build_lists.auto_publish_status.#{@build_list.auto_publish_status}" - .clearfix - .col-md-4.text-right= t("activerecord.attributes.build_list.auto_create_container") - .col-md-8= t "layout.#{@build_list.auto_create_container?}_" - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.use_cached_chroot' - .col-md-8= t "layout.#{@build_list.use_cached_chroot?}_" - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.project_version' - .col-md-8= link_to @build_list.project_version, tree_path(@build_list.project, @build_list.project_version) - .clearfix - .col-md-4.text-right= t 'diff' - .col-md-8= build_list_version_link(@build_list, true) - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.arch' - .col-md-8= @build_list.arch.name - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.updated_at' - .col-md-8 {{build_list.updated_at_utc}} - .clearfix + %table.table.table-borderless + %tr + %td= t 'activerecord.attributes.build_list.container_path' + %td + %div{'ng-show' => "build_list.container_status == #{BuildList::BUILD_PUBLISHED}"} + - url = container_url + = link_to url, url + %div{'ng-show' => "build_list.container_status == #{BuildList::BUILD_PUBLISH}"} + = t 'layout.build_lists.creating' + %tr + %td= t 'activerecord.attributes.build_list.id' + %td + = @build_list.id + = hidden_field_tag :build_list_id, @build_list.id + %tr + %td= t 'activerecord.attributes.build_list.user' + %td= link_to @build_list.user.try(:fullname), @build_list.user + %tr + %td= t 'activerecord.attributes.build_list.publisher' + %td + %a{ 'ng-show' => 'build_list.publisher', + 'ng-href' => '{{build_list.publisher.path}}' } + {{build_list.publisher.fullname}} + %tr + %td= t 'activerecord.attributes.build_list.build_for_platform' + %td + - if bfp = @build_list.build_for_platform + = link_to(bfp.name, bfp) + - else + = t 'layout.build_lists.platform_deleted' + %tr + %td= t 'activerecord.attributes.build_list.save_to_repository' + %td + = link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", + [@build_list.save_to_platform, @build_list.save_to_repository] + %tr + %td= t 'activerecord.attributes.build_list.include_testing_subrepository' + %td= t "layout.#{@build_list.include_testing_subrepository?}_" + %tr + %td= t 'activerecord.attributes.build_list.include_repos' + %td= (@build_list.include_repos||[]).map{|r| Repository.where(id: r).first.try(:name)}.join(', ') + %tr + %td= t 'activerecord.attributes.build_list.update_type' + %td + = f.select :update_type, options_for_select(build_list_classified_update_types, + @build_list.update_type), {}, 'ng-model' => 'build_list.update_type', + 'ng-change' => 'updateTypeChanged()', 'ng-show' => 'build_list.can_publish' + %div{'ng-hide' => 'build_list.can_publish'}= @build_list.update_type + %tr + %td + .ng-hide{ 'ng-show' => 'update_type_errors' } + .flash_notify + .alert{ 'ng-class' => "{ 'alert-error': update_type_errors }" } + {{ update_type_errors }} + %tr + %td= t 'activerecord.attributes.build_list.auto_publish_status' + %td= t "layout.build_lists.auto_publish_status.#{@build_list.auto_publish_status}" + %tr + %td= t("activerecord.attributes.build_list.auto_create_container") + %td= t "layout.#{@build_list.auto_create_container?}_" + %tr + %td= t 'activerecord.attributes.build_list.use_cached_chroot' + %td= t "layout.#{@build_list.use_cached_chroot?}_" + %tr + %td= t 'activerecord.attributes.build_list.project_version' + %td= link_to @build_list.project_version, tree_path(@build_list.project, @build_list.project_version) + %tr + %td= t 'diff' + %td= build_list_version_link(@build_list, true) + %tr + %td= t 'activerecord.attributes.build_list.arch' + %td= @build_list.arch.name + %tr + %td= t 'activerecord.attributes.build_list.updated_at' + %td {{build_list.updated_at_utc}} - if @build_list.external_nodes.present? - .col-md-4.text-right= t 'activerecord.attributes.build_list.external_nodes' - .col-md-8= I18n.t "layout.build_lists.external_nodes.#{@build_list.external_nodes}" - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.builder' - .col-md-8{'ng-show' => 'build_list.builder'} - %a{'ng-href' => '{{build_list.builder.path}}' } {{build_list.builder.fullname}} - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.is_circle' - .col-md-8= t "layout.#{@build_list.is_circle?}_" - .clearfix - .col-md-4.text-right= t 'activerecord.attributes.build_list.new_core' - .col-md-8= t "layout.#{@build_list.new_core?}_" - .clearfix + %tr + %td= t 'activerecord.attributes.build_list.external_nodes' + %td= I18n.t "layout.build_lists.external_nodes.#{@build_list.external_nodes}" + %tr + %td= t 'activerecord.attributes.build_list.builder' + %td + %a{ 'ng-show' => 'build_list.builder', 'ng-href' => '{{build_list.builder.path}}' } + {{build_list.builder.fullname}} + %tr + %td= t 'activerecord.attributes.build_list.is_circle' + %td= t "layout.#{@build_list.is_circle?}_" + %tr + %td= t 'activerecord.attributes.build_list.new_core' + %td= t "layout.#{@build_list.new_core?}_" - if @build_list.extra_build_lists.present? || @build_list.extra_repositories.present? - .col-md-4.text-right= t 'activerecord.attributes.build_list.extra_repositories' - .col-md-8 - - Repository.where(id: @build_list.extra_repositories).each do |repo| - %p= link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] - - BuildList.where(id: @build_list.extra_build_lists).each do |bl| - %p= link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl - .clearfix - + %tr + %td= t 'activerecord.attributes.build_list.extra_repositories' + %td + - Repository.where(id: @build_list.extra_repositories).each do |repo| + %p= link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] + - BuildList.where(id: @build_list.extra_build_lists).each do |bl| + %p= link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl - if @build_list.extra_params.present? - .col-md-4.text-right - %h4= t 'activerecord.attributes.build_list.extra_params.label' - .col-md-8 - .clearfix + %tr + %td + %h4= t 'activerecord.attributes.build_list.extra_params.label' + %td + %tr - @build_list.extra_params.each do |k, v| - .col-md-4.text-right= t "activerecord.attributes.build_list.extra_params.#{k}" - .col-md-8= v - .clearfix + %td= t "activerecord.attributes.build_list.extra_params.#{k}" + %td= v - if @build_list.mass_build_id.present? - .col-md-4.text-right= t 'activerecord.attributes.mass_build_id' - .col-md-8= link_to @build_list.mass_build.name, platform_mass_builds_path(@build_list.save_to_platform) - .clearfix + %tr + %td= t 'activerecord.attributes.mass_build_id' + %td= link_to @build_list.mass_build.name, platform_mass_builds_path(@build_list.save_to_platform) - %div{'ng-show' => 'build_list.advisory'} - .col-md-4.text-right= t 'layout.build_lists.attached_advisory' - .col-md-8 + %tr{ 'ng-show' => 'build_list.advisory' } + %td= t 'layout.build_lists.attached_advisory' + %td %a{'ng-href' => '{{build_list.advisory.path}}' } {{build_list.advisory.advisory_id}} - .clearfix - %div{'ng-show' => 'build_list.human_duration'} - %br - .col-md-4.text-right - .col-md-8 {{build_list.human_duration }} - .clearfix + %tr{'ng-show' => 'build_list.human_duration'} + %td + %td {{build_list.human_duration }} - if @build_list.save_to_platform.released - #advisory_block{'ng-show' => 'build_list.can_publish && !build_list.advisory'} - .col-md-4.text-right= label_tag :attach_advisory, t('layout.build_lists.attached_advisory') - .col-md-8 + %tr#advisory_block{'ng-show' => 'build_list.can_publish && !build_list.advisory'} + %td= label_tag :attach_advisory, t('layout.build_lists.attached_advisory') + %td = select_tag :attach_advisory, advisories_select_options(@advisories), 'ng-model' => 'attach_advisory', 'ng-change' => 'attachAdvisoryChanged()' %p.hint_text= t 'layout.advisories.publication_info', update_types: BuildList::RELEASE_UPDATE_TYPES.join(', ') - .clearfix - #advisory_search_block{'ng-show' => 'attach_advisory != "no" && attach_advisory != "new"'} + %tr#advisory_search_block{'ng-show' => 'attach_advisory != "no" && attach_advisory != "new"'} + %td %h3= t 'layout.advisories.search_by_id' - .col-md-4.text-right= label_tag :advisory_search, t('layout.advisories.search_hint') - .col-md-8 - %input#advisory_search{type: 'text', 'ng-model' => 'term', 'ng-keyup' => 'search()'} - %p.hint_text= t 'layout.advisories.advisory_id_info', advisory_format: advisory_id_for_hint - .clearfix + %td + = label_tag :advisory_search, t('layout.advisories.search_hint') + %input#advisory_search{type: 'text', 'ng-model' => 'term', 'ng-keyup' => 'search()'} + %p.hint_text= t 'layout.advisories.advisory_id_info', advisory_format: advisory_id_for_hint + - I18n.t('layout.advisories.banners').keys.each do |key| .info{class: key, 'ng-show' => "search_status == '#{key}'"} %p= t("layout.advisories.banners.#{key}") - #new_advisory_form{'ng-show' => 'attach_advisory == "new"'} - = f.fields_for @build_list.build_advisory do |f| - = render partial: 'advisories/form', locals: {f: f} + #new_advisory_form{'ng-show' => 'attach_advisory == "new"'} + = f.fields_for @build_list.build_advisory do |f| + = render partial: 'advisories/form', locals: {f: f} - #advisory_preview{'ng-show' => 'attach_advisory != "no" && attach_advisory != "new"'} - %h3= t('activerecord.models.advisory') << ' {{advisory.advisory_id}}' + #advisory_preview{'ng-show' => 'attach_advisory != "no" && attach_advisory != "new"'} + %h3= t('activerecord.models.advisory') << ' {{advisory.advisory_id}}' - .col-md-4.text-right= t 'activerecord.attributes.advisory.description' - .col-md-8.descr {{advisory.description}} - .clearfix + = t 'activerecord.attributes.advisory.description' + .descr {{advisory.description}} - .col-md-4.text-right= t 'activerecord.attributes.advisory.references' - .col-md-8.refs {{advisory.references}} - .clearfix + = t 'activerecord.attributes.advisory.references' + .refs {{advisory.references}} - %div{'ng-hide' => 'build_list.extra_build_lists_published'} - .flash_notify - .alert.alert-error= t 'layout.build_lists.publish_with_extra_fail' + %tr{ 'ng-hide' => 'build_list.extra_build_lists_published' } + %td + .flash_notify + .alert.alert-error= t 'layout.build_lists.publish_with_extra_fail' - %div{'ng-show' => 'build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository'} + %tr{ 'ng-show' => 'build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository' } + %td .flash_notify .alert.alert-error= t 'flash.build_list.not_all_build_lists_success' - .col-md-10 - - if can?(:cancel, @build_list) - = link_to t('layout.build_lists.cancel'), cancel_build_list_path(@build_list), - method: :put, data: { confirm: t('layout.confirm') }, class: 'btn btn-primary', - 'ng-show' => 'build_list.can_cancel' - = submit_tag t('layout.publish_again'), - data: { confirm: t("layout.publish_again_warning") }, - name: 'publish', class: 'btn btn-primary', - 'ng-show' => "build_list.can_publish && build_list.status == #{BuildList::BUILD_PUBLISHED}" - = submit_tag t('layout.publish'), - data: { confirm: t('layout.build_lists.tests_failed') }, name: 'publish', class: 'btn btn-primary', - 'ng-show' => "build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status == #{BuildList::TESTS_FAILED}" - = submit_tag t('layout.publish'), - data: { confirm: t('layout.confirm') }, name: 'publish', class: 'btn btn-primary', - 'ng-show' => "build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status != #{BuildList::TESTS_FAILED} && build_list.status != #{BuildList::BUILD_PUBLISHED}" - = link_to t('layout.publish_into_testing'), publish_into_testing_build_list_path(@build_list), - method: :put, data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary', - 'ng-show' => 'build_list.can_publish_into_testing' - - if can?(:reject_publish, @build_list) - = link_to t('layout.reject_publish'), reject_publish_build_list_path(@build_list), - method: :put, data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary', - 'ng-show' => 'build_list.can_reject_publish' - - if can?(:create_container, @build_list) - = link_to t('layout.build_lists.create_container'), - create_container_build_list_path(@build_list), - method: :put, data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary', - 'ng-show' => 'build_list.can_create_container' - - if can? :create, @build_list - = link_to t('layout.build_lists.recreate_build_list'), new_project_build_list_path(@build_list.project, build_list_id: @build_list.id), class: 'btn btn-primary' - .clearfix - %div{'ng-show' => "build_list.status == #{BuildList::BUILD_STARTED}"} - = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } + - if can?(:cancel, @build_list) + = link_to t('layout.build_lists.cancel'), cancel_build_list_path(@build_list), + method: :put, data: { confirm: t('layout.confirm') }, class: 'btn btn-primary', + 'ng-show' => 'build_list.can_cancel' + = submit_tag t('layout.publish_again'), + data: { confirm: t("layout.publish_again_warning") }, + name: 'publish', class: 'btn btn-primary', + 'ng-show' => "build_list.can_publish && build_list.status == #{BuildList::BUILD_PUBLISHED}" + = submit_tag t('layout.publish'), + data: { confirm: t('layout.build_lists.tests_failed') }, name: 'publish', class: 'btn btn-primary', + 'ng-show' => "build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status == #{BuildList::TESTS_FAILED}" + = submit_tag t('layout.publish'), + data: { confirm: t('layout.confirm') }, name: 'publish', class: 'btn btn-primary', + 'ng-show' => "build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status != #{BuildList::TESTS_FAILED} && build_list.status != #{BuildList::BUILD_PUBLISHED}" + = link_to t('layout.publish_into_testing'), publish_into_testing_build_list_path(@build_list), + method: :put, data: { confirm: t('layout.confirm') }, + class: 'btn btn-primary', + 'ng-show' => 'build_list.can_publish_into_testing' + - if can?(:reject_publish, @build_list) + = link_to t('layout.reject_publish'), reject_publish_build_list_path(@build_list), + method: :put, data: { confirm: t('layout.confirm') }, + class: 'btn btn-primary', + 'ng-show' => 'build_list.can_reject_publish' + - if can?(:create_container, @build_list) + = link_to t('layout.build_lists.create_container'), + create_container_build_list_path(@build_list), + method: :put, data: { confirm: t('layout.confirm') }, + class: 'btn btn-primary', + 'ng-show' => 'build_list.can_create_container' + - if can? :create, @build_list + = link_to t('layout.build_lists.recreate_build_list'), new_project_build_list_path(@build_list.project, build_list_id: @build_list.id), class: 'btn btn-primary' + .clearfix + %div{'ng-show' => "build_list.status == #{BuildList::BUILD_STARTED}"} + = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } %hr %h3= t 'layout.build_lists.items_header'