Merge branch 'master' into 242-restart_last_build_list

This commit is contained in:
Alexander Machehin 2013-08-01 17:05:59 +06:00
commit 07fc241938
6 changed files with 13 additions and 11 deletions

View File

@ -1,31 +1,31 @@
RosaABF.factory("ApiProject", ['$resource', function($resource) {
var ProjectResource = $resource(
'/:owner/:project',
'/:owner/:project?format=json',
{owner: '@project.owner.uname', project: '@project.name'},
{
tags: {
url: '/:owner/:project/tags',
url: '/:owner/:project/tags.json',
method: 'GET',
isArray : false
},
branches: {
url: '/:owner/:project/branches',
url: '/:owner/:project/branches.json',
method: 'GET',
isArray : false
},
delete_branch: {
url: '/:owner/:project/branches/:ref',
url: '/:owner/:project/branches/:ref.json',
method: 'DELETE',
isArray : false
},
restore_branch: {
url: '/:owner/:project/branches/:ref', // ?sha=<sha>
url: '/:owner/:project/branches/:ref.json', // ?sha=<sha>
method: 'PUT',
isArray : false
},
create_branch: {
url: '/:owner/:project/branches', // ?new_ref=<new_ref>&from_ref=<from_ref>
url: '/:owner/:project/branches.json', // ?new_ref=<new_ref>&from_ref=<from_ref>
method: 'POST',
isArray : false
}

View File

@ -1,7 +1,7 @@
RosaABF.factory("ApiPullRequest", ['$resource', function($resource) {
var PullRequestResource = $resource(
'/:owner/:project/pull_requests/:serial_id',
'/:owner/:project/pull_requests/:serial_id.json',
{
owner: '@pull_request.to_ref.project.owner_uname',
project: '@pull_request.to_ref.project.name',
@ -13,7 +13,7 @@ RosaABF.factory("ApiPullRequest", ['$resource', function($resource) {
isArray : false
},
merge: {
url: '/:owner/:project/pull_requests/:serial_id/merge',
url: '/:owner/:project/pull_requests/:serial_id/merge.json',
method: 'PUT',
isArray: false
}

View File

@ -13,6 +13,7 @@ $(document).ready(function() {
var extra_repos = $('.autocomplete-form.extra_repositories');
updateExtraReposAndBuildLists(platform_id);
updatedDefaultArches(selected_option);
$('.autocomplete-form table tbody').empty();
if (build_platform.size() == 0) {
all_repositories.removeAttr('disabled');
@ -21,7 +22,6 @@ $(document).ready(function() {
extra_repos.show();
} else {
all_repositories.attr('disabled', 'disabled');
updatedDefaultArches(selected_option);
extra_repos.hide();
var parent = build_platform.parent();
parent.find('input').removeAttr('disabled');

View File

@ -27,7 +27,7 @@ module BuildListsHelper
{
:publish_without_qa => r.publish_without_qa? ? 1 : 0,
:platform_id => r.platform.id,
:default_arches => r.platform.platform_arch_settings.by_default.pluck(:arch_id).join(' ')
:default_arches => (r.platform.platform_arch_settings.by_default.pluck(:arch_id).presence || Arch.where(:name => Arch::DEFAULT).pluck(:id)).join(' ')
}
]
end

View File

@ -1,5 +1,7 @@
# -*- encoding : utf-8 -*-
class Arch < ActiveRecord::Base
DEFAULT = %w[i586 x86_64]
has_many :build_lists, :dependent => :destroy
validates :name, :presence => true, :uniqueness => true

View File

@ -16,7 +16,7 @@
%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) || (controller.action_name == 'new' && %w(i586 x86_64).include?(arch.name)), :id => "arches_#{arch.id}"
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s) || (controller.action_name == 'new' && Arch::DEFAULT.include?(arch.name)), :id => "arches_#{arch.id}"
= label_tag "arches_#{arch.id}", arch.name
%h3= t('activerecord.attributes.build_list.update_type')
- selected = params[:build_list].try(:fetch, :update_type) ? {:selected => params[:build_list][:update_version]} : {}