58 lines
1.9 KiB
Plaintext
58 lines
1.9 KiB
Plaintext
- act = controller.action_name.to_sym
|
|
div ng-controller = 'ProjectFormController' ng-cloak = 'true'
|
|
= f.input :name
|
|
= f.input :github_organization
|
|
|
|
- if [:new, :create].include? act
|
|
= render 'owner', f: f
|
|
|
|
= f.input :visibility,
|
|
collection: project_visibility_options,
|
|
include_blank: false
|
|
|
|
= f.input :is_package, as: :boolean,
|
|
input_html: { 'ng-model' => 'project.is_package',
|
|
'ng-change' => 'project.publish_i686_into_x86_64 = false' }
|
|
|
|
= f.input :architecture_dependent, as: :boolean,
|
|
wrapper_html: { 'ng-show' => 'project.is_package' }
|
|
|
|
- unless [:new, :create].include? act
|
|
= f.input :publish_i686_into_x86_64, as: :boolean,
|
|
wrapper_html: { 'ng-show' => 'project.is_package' },
|
|
input_html: { 'ng-model' => 'project.publish_i686_into_x86_64' }
|
|
|
|
- if [:edit, :update].include? act
|
|
= f.hidden_field :maintainer_id, value: @project.maintainer_id
|
|
|
|
.form-group ng-show = 'project.is_package'
|
|
label.control-label.col-sm-3= Project.human_attribute_name :maintainer
|
|
|
|
.col-sm-9
|
|
input.form-control.typeahead[
|
|
type = 'text'
|
|
data-ajax = autocomplete_maintainers_path(@project)
|
|
ng-disabled = 'loading'
|
|
data-id = '#project_maintainer_id'
|
|
value = @project.maintainer.try(:fullname) ]
|
|
|
|
- if [:new, :create].include? act
|
|
= f.input :srpm, as: :file
|
|
|
|
.form-group
|
|
.col-sm-offset-3.col-sm-9
|
|
= submit_button_tag
|
|
|
|
- content_for :additional_scripts do
|
|
javascript:
|
|
RosaABF.controller('ProjectFormController', ['$scope', function($scope) {
|
|
$scope.project = {
|
|
is_package: #{@project.is_package},
|
|
publish_i686_into_x86_64: #{@project.publish_i686_into_x86_64}
|
|
}
|
|
$scope.owner = '#{@who_owns}';
|
|
$scope.OwnerChanged = function() {
|
|
var tmp = $scope.owner;
|
|
}
|
|
}]);
|