[refs #200] Change build list repos and platforms interface
This commit is contained in:
parent
fcc17c7c0a
commit
f0645be9c5
|
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue