rosa-build/app/views/projects/_form.html.haml

60 lines
2.8 KiB
Plaintext
Raw Normal View History

- act = controller.action_name.to_sym
- if [:new, :create].include? act
.leftlist= f.label :name, t("activerecord.attributes.project.name"), :class => :label
.rightlist= f.text_field :name, :class => 'text_field', :disabled => f.object.try(:persisted?)
.both
.leftlist= f.label :description, t("activerecord.attributes.project.description"), :class => :label
.rightlist= f.text_area :description, :class => 'text_field', :cols => 80
.both
- if ['new', 'create'].include? controller.action_name
.leftlist= f.label :owner_id, t("activerecord.attributes.project.owner"), :class => :label
.rightlist
= label_tag t("activerecord.attributes.project.who_owns.me")
- if Group.can_own_project(current_user).count > 0
= radio_button_tag :who_owns, 'me', @who_owns == :me #{}.merge( (@who_owns == :me) ? {:checked => 'checked'} : {} )
- puts @who_owns.inspect
- puts @who_owns == :group
= label_tag t("activerecord.attributes.project.who_owns.group")
= radio_button_tag :who_owns, 'group', @who_owns == :group #{}.merge( (@who_owns == :group) ? {:checked => 'checked'} : {} )
-# TODO: Make our own select_box helper with new design, blackjack and bitches!
= select_tag :owner_id, options_for_select( Group.can_own_project(current_user) )
- else
= hidden_field_tag :who_owns, :me
.both
-#- if [:new, :create].include? act
-# .leftlist= f.label :category_id, t("activerecord.attributes.project.category_id"), :class => :label
-# .rightlist= f.grouped_collection_select :category_id, Category.roots, :children, :name, :id, :name, :include_blank => true
-# .both
.leftlist= f.label :visibility, t("activerecord.attributes.project.visibility"), :class => :label
.rightlist
=# f.select :visibility, Project::VISIBILITIES
- Project::VISIBILITIES.each do |visibility|
= f.radio_button :visibility, visibility, :class => 'niceRadio'
- if visibility == 'open'
= image_tag("unlock.png")
- else
= image_tag("lock.png")
= t("activerecord.attributes.project.visibilities.#{visibility}")
.both
- if [:edit, :update].include? act
.leftlist= t("activerecord.attributes.project.default_branch")
.rightlist= f.select :default_branch, options_from_collection_for_select(@project.branches, :name, :name, @project.default_branch), :class => 'sel80', :id => 'branch_selector'
.both
- if [:edit, :update].include? act
.leftlist
\ 
.rightlist
.check
%span#niceCheckbox1.niceCheck-main= f.check_box :is_rpm#, :class => 'niceCheckbox1'
.forcheck= t("activerecord.attributes.project.is_rpm")
.both
.both
- if [:new, :create].include? act
.leftlist= f.label :srpm, t("activerecord.attributes.project.srpm"), :class => :label
.rightlist= f.file_field :srpm, :class => 'file_field'
.both
.leftlist
\ 
.rightlist= submit_tag t("layout.save"), :class => 'button'
.both