#258: removed project_modify_view.js
This commit is contained in:
parent
3cd88dfb25
commit
f92c700662
|
@ -1,30 +0,0 @@
|
|||
Rosa.Views.ProjectModifyView = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
_.bindAll(this, 'checkboxClick');
|
||||
|
||||
this.$checkbox_wrapper = $('#niceCheckbox1');
|
||||
this._$checkbox = this.$checkbox_wrapper.children('#project_is_package').first();
|
||||
this.$maintainer_form = $('#maintainer_form');
|
||||
this.$publish_form = $('#publish_form');
|
||||
this._$publish_checkbox = this.$publish_form.find('#project_publish_i686_into_x86_64').first();
|
||||
|
||||
this.$checkbox_wrapper.on('click', this.checkboxClick);
|
||||
},
|
||||
|
||||
checkboxClick: function() {
|
||||
if (this._$checkbox.is(':checked')) {
|
||||
this.$maintainer_form.slideDown();
|
||||
this.$publish_form.slideDown();
|
||||
} else {
|
||||
this.$maintainer_form.slideUp();
|
||||
this.$publish_form.slideUp();
|
||||
if (this._$publish_checkbox.is(':checked')) {
|
||||
changeCheck(this.$publish_form.find('.niceCheck-main'));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
this.checkboxClick();
|
||||
}
|
||||
});
|
|
@ -1,12 +1,13 @@
|
|||
- act = controller.action_name.to_sym
|
||||
- if [:new, :create].include? act
|
||||
%div{'ng-controller' => 'ProjectFromController'}
|
||||
- if [:new, :create].include? act
|
||||
.leftlist= f.label :name
|
||||
.rightlist= f.text_field :name, :class => 'text_field', :disabled => f.object.try(:persisted?)
|
||||
.both
|
||||
.leftlist= f.label :description
|
||||
.rightlist= f.text_area :description, :class => 'text_field', :cols => 80
|
||||
.both
|
||||
- if [:new, :create].include? act
|
||||
.leftlist= f.label :description
|
||||
.rightlist= f.text_area :description, :class => 'text_field', :cols => 80
|
||||
.both
|
||||
- if [:new, :create].include? act
|
||||
.leftlist= f.label :owner
|
||||
.rightlist
|
||||
= label_tag t("activerecord.attributes.project.who_owns.me")
|
||||
|
@ -20,8 +21,8 @@
|
|||
= hidden_field_tag :who_owns, :me
|
||||
.both
|
||||
|
||||
.leftlist= f.label :visibility
|
||||
.rightlist
|
||||
.leftlist= f.label :visibility
|
||||
.rightlist
|
||||
=# f.select :visibility, Project::VISIBILITIES
|
||||
- Project::VISIBILITIES.each do |visibility|
|
||||
= f.radio_button :visibility, visibility, :class => 'niceRadio'
|
||||
|
@ -30,23 +31,21 @@
|
|||
- else
|
||||
= image_tag("lock.png")
|
||||
= t("activerecord.attributes.project.visibilities.#{visibility}")
|
||||
.both
|
||||
.leftlist
|
||||
.both
|
||||
.leftlist
|
||||
\
|
||||
.rightlist
|
||||
.check
|
||||
%span#niceCheckbox1.niceCheck-main= f.check_box :is_package
|
||||
.rightlist
|
||||
.check= f.check_box :is_package, 'ng-model' => 'project.is_package', 'ng-change' => 'project.publish_i686_into_x86_64 = false'
|
||||
.forcheck= f.label :is_package
|
||||
.both
|
||||
- unless [:new, :create].include? act
|
||||
#publish_form{:class => @project.publish_i686_into_x86_64 ? '' : 'hidden'}
|
||||
.check
|
||||
%span.niceCheck-main= f.check_box :publish_i686_into_x86_64
|
||||
#publish_form{'ng-show' => 'project.is_package'}
|
||||
.check= f.check_box :publish_i686_into_x86_64, 'ng-model' => 'project.publish_i686_into_x86_64'
|
||||
.forcheck= f.label :publish_i686_into_x86_64
|
||||
.both
|
||||
|
||||
.both
|
||||
- if [:edit, :update].include? act
|
||||
.both
|
||||
- if [:edit, :update].include? act
|
||||
.leftlist= f.label :default_branch
|
||||
.rightlist
|
||||
= f.select :default_branch,
|
||||
|
@ -54,7 +53,7 @@
|
|||
:name, :name, @project.default_branch),
|
||||
:class => 'sel80', :id => 'branch_selector'
|
||||
.both
|
||||
#maintainer_form{:class => @project.is_package ? '' : 'hidden'}
|
||||
#maintainer_form{'ng-show' => 'project.is_package'}
|
||||
= f.hidden_field :maintainer_id, :value => @project.maintainer_id
|
||||
.leftlist
|
||||
= f.label :maintainer
|
||||
|
@ -65,15 +64,19 @@
|
|||
autocomplete_maintainers_path(@project.owner, @project),
|
||||
:id_element => '#project_maintainer_id',
|
||||
:placeholder => @project.maintainer.fullname
|
||||
- if [:new, :create].include? act
|
||||
- if [:new, :create].include? act
|
||||
.leftlist= f.label :srpm
|
||||
.rightlist= f.file_field :srpm, :class => 'file_field'
|
||||
.both
|
||||
.leftlist
|
||||
.leftlist
|
||||
\
|
||||
.rightlist= submit_tag t('layout.save'), :class => 'button', :data => {'disable-with' => t('layout.saving')}
|
||||
.both
|
||||
.rightlist= submit_tag t('layout.save'), :class => 'button', :data => {'disable-with' => t('layout.saving')}
|
||||
.both
|
||||
|
||||
:javascript
|
||||
$(function() {
|
||||
( new Rosa.Views.ProjectModifyView ).render();
|
||||
});
|
||||
RosaABF.controller('ProjectFromController', ['$scope', function($scope) {
|
||||
$scope.project = {
|
||||
is_package: #{@project.is_package},
|
||||
publish_i686_into_x86_64: #{@project.publish_i686_into_x86_64}
|
||||
}
|
||||
}]);
|
Loading…
Reference in New Issue