Merge pull request #323 from warpc/200-new_build_repos_rules

[Refs #200] Move some fields to rights part of the form. Hide empty platform. Fix checkbox checking on build list form.
This commit is contained in:
Vladimir Sharshov 2012-03-21 05:17:23 -07:00
commit 81d18b5337
2 changed files with 18 additions and 26 deletions

View File

@ -11,15 +11,21 @@ $(document).ready(function() {
$(this).attr('checked', 'checked');
$(this).removeAttr('disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
if ($(this).parent().find('.offset25 label').text() == 'main') {
$(this).parent().find('.offset25 input[type="checkbox"]').attr('checked', 'checked');
}
} else {
$(this).removeAttr('checked');
$(this).attr('disabled', 'disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('checked');
}
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
} else {
$(this).removeAttr('disabled');
$(this).removeAttr('checked');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('checked');
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
}
});

View File

@ -5,20 +5,20 @@
%h3= t("activerecord.attributes.build_list.bpl")
.all_platforms
- Platform.main.each do |pl|
.both
- if pl.platform_type == 'main'
- if pl.repository_ids.size > 0
.both
= 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
.offset25{:style => 'padding-left: 25px'}
= render 'include_repos', :platform => pl
%section.right
%h3= t("activerecord.attributes.build_list.arch")
- Arch.recent.each do |arch|
.both
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}"
= label_tag "arches_#{arch.id}", arch.name
%h3= t("activerecord.attributes.build_list.pl")
.lineForm= f.select :pl_id, @project.repositories.collect{|r| ["#{r.platform.name}/#{r.name}", r.platform.id]}
%h3= t("activerecord.attributes.build_list.update_type")
.lineForm= f.select :update_type, BuildList::UPDATE_TYPES
%h3= t("activerecord.attributes.build_list.preferences")
@ -30,19 +30,5 @@
= f.label :build_requires
%br
= f.submit t("layout.projects.build_button")
%section.right
%h3= t("activerecord.attributes.build_list.arch")
- Arch.recent.each do |arch|
.both
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}"
= label_tag "arches_#{arch.id}", arch.name
%h3= t("activerecord.attributes.build_list.pl")
.lineForm= f.select :pl_id, @project.repositories.collect{|r| ["#{r.platform.name}/#{r.name}", r.platform.id]}
-# %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
= render 'projects/submenu'