Merge pull request #386 from warpc/223-change_build_lists_new_js_handlers
[refs #223] Change js handlers and some inputs logics
This commit is contained in:
commit
e36411aaee
|
@ -38,11 +38,18 @@ $(document).ready(function() {
|
||||||
$('.offset25 input[type="checkbox"]').click(function() {
|
$('.offset25 input[type="checkbox"]').click(function() {
|
||||||
setPlChecked(this, $(this).attr('checked'));
|
setPlChecked(this, $(this).attr('checked'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.build_bpl_ids').click(function() {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function setPlChecked(pointer, checked) {
|
function setPlChecked(pointer, checked) {
|
||||||
pl_cbx = $(pointer).parent().parent().parent().find('input[type="checkbox"].build_bpl_ids');
|
var pl_cbx = $(pointer).parent().parent().parent().find('input[type="checkbox"].build_bpl_ids');
|
||||||
|
var pl_id = pl_cbx.val();
|
||||||
if (checked && !$(pointer).attr('disabled')) {
|
if (checked && !$(pointer).attr('disabled')) {
|
||||||
pl_cbx.attr('checked', 'checked');
|
pl_cbx.attr('checked', 'checked');
|
||||||
|
} else if ($('input[pl_id=' + pl_id + '][checked="checked"]').size() == 0) {
|
||||||
|
pl_cbx.removeAttr('checked');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- platform.repositories.each do |repo|
|
- platform.repositories.each do |repo|
|
||||||
.both
|
.both
|
||||||
= check_box_tag "build_list[include_repos][]", repo.id, repo.name == 'main' || @project.repositories.map(&:id).include?(repo.id), :id => "include_repos_#{repo.id}" # (params[:build_list]||[]).fetch(:include_repos, []).include?(repo.id.to_s)
|
= check_box_tag "build_list[include_repos][]", repo.id, repo.name == 'main' || @project.repositories.map(&:id).include?(repo.id), :id => "include_repos_#{repo.id}", :pl_id => platform.id
|
||||||
= label_tag "include_repos_#{repo.id}", repo.name
|
= label_tag "include_repos_#{repo.id}", repo.name
|
||||||
|
|
|
@ -16,7 +16,10 @@
|
||||||
%h3= t("activerecord.attributes.build_list.arch")
|
%h3= t("activerecord.attributes.build_list.arch")
|
||||||
- Arch.recent.each do |arch|
|
- Arch.recent.each do |arch|
|
||||||
.both
|
.both
|
||||||
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}"
|
- if controller.action_name == 'new'
|
||||||
|
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}", :checked => 'checked'
|
||||||
|
- else
|
||||||
|
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}"
|
||||||
= label_tag "arches_#{arch.id}", arch.name
|
= label_tag "arches_#{arch.id}", arch.name
|
||||||
%h3= t("activerecord.attributes.build_list.pl")
|
%h3= t("activerecord.attributes.build_list.pl")
|
||||||
.lineForm= f.select :pl_id, @project.repositories.collect{|r| ["#{r.platform.name}/#{r.name}", r.platform.id]}
|
.lineForm= f.select :pl_id, @project.repositories.collect{|r| ["#{r.platform.name}/#{r.name}", r.platform.id]}
|
||||||
|
|
Loading…
Reference in New Issue