From f0645be9c5ad343cbbaddd77516db6c4eb5882e0 Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Mon, 19 Mar 2012 23:52:46 +0400 Subject: [PATCH] [refs #200] Change build list repos and platforms interface --- app/assets/javascripts/extra/build_list.js | 9 ++++++-- app/views/build_lists/new.html.haml | 25 ++++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/extra/build_list.js b/app/assets/javascripts/extra/build_list.js index 61f4f5b2d..e97f77426 100644 --- a/app/assets/javascripts/extra/build_list.js +++ b/app/assets/javascripts/extra/build_list.js @@ -1,21 +1,26 @@ $(document).ready(function() { $('#build_list_pl_id').change(function() { var platform_id = $(this).val(); - var base_platforms = $('.base_platforms input[type=checkbox]'); + var base_platforms = $('.all_platforms input[type=checkbox].build_bpl_ids'); - $('#include_repos').html($('.preloaded_include_repos .include_repos_' + platform_id).html()); + //$('#include_repos').html($('.preloaded_include_repos .include_repos_' + platform_id).html()); base_platforms.each(function(){ if ($.inArray(platform_id, base_platforms.map(function(){ return $(this).val() }).get()) >= 0) { if ($(this).val() == platform_id) { $(this).attr('checked', 'checked'); $(this).removeAttr('disabled'); + $(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled'); } else { $(this).removeAttr('checked'); $(this).attr('disabled', 'disabled'); + $(this).parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled'); } + $('.additional_pl').parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled'); } else { $(this).removeAttr('disabled'); + $(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled'); + $('.additional_pl').parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled'); } }); }); diff --git a/app/views/build_lists/new.html.haml b/app/views/build_lists/new.html.haml index 6d34bda9d..1dcef99fe 100644 --- a/app/views/build_lists/new.html.haml +++ b/app/views/build_lists/new.html.haml @@ -3,11 +3,22 @@ %h3= t("activerecord.attributes.build_list.project_version") .lineForm= f.select :project_version, @project.versions %h3= t("activerecord.attributes.build_list.bpl") - .base_platforms - - Platform.main.each do |bpl| + .all_platforms + - (Platform.main | @project.platforms).each do |pl| .both - = check_box_tag "bpls[]", bpl.id, (params[:bpls]||[]).include?(bpl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{bpl.id}" - = label_tag "bpls_#{bpl.id}", bpl.name + - if pl.platform_type == 'main' + = check_box_tag "bpls[]", pl.id, (params[:bpls]||[]).include?(pl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{pl.id}" + = label_tag "bpls_#{pl.id}", pl.name + - else + = check_box_tag "", "", :class => "additional_pl", :disabled => :disabled + = label_tag "", pl.name, :class => "additional_pl" + .offset25{:style => 'padding-left: 25px'} + = render 'include_repos', :platform => pl + -#%div{:class => "include_repos_#{p.id}"}= render 'include_repos', :platform => p + -#- Platform.main.each do |bpl| + -# .both + -# = check_box_tag "bpls[]", bpl.id, (params[:bpls]||[]).include?(bpl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{bpl.id}" + -# = label_tag "bpls_#{bpl.id}", bpl.name %h3= t("activerecord.attributes.build_list.update_type") .lineForm= f.select :update_type, BuildList::UPDATE_TYPES %h3= t("activerecord.attributes.build_list.preferences") @@ -30,8 +41,8 @@ %h3= t("activerecord.attributes.build_list.include_repos") #include_repos -.preloaded_include_repos{:style => 'display: none'} - - @project.platforms.each do |p| - %div{:class => "include_repos_#{p.id}"}= render 'include_repos', :platform => p +-#.preloaded_include_repos{:style => 'display: none'} +-# - @project.platforms.each do |p| +-# %div{:class => "include_repos_#{p.id}"}= render 'include_repos', :platform => p = render 'projects/submenu'