[refs #893] move regenerate button to block

This commit is contained in:
Alexander Machehin 2013-02-13 23:22:00 +06:00
parent 07710e2b23
commit 2e1a297f83
1 changed files with 8 additions and 5 deletions

View File

@ -1,18 +1,21 @@
- if ['edit', 'update'].exclude? controller.action_name
.leftlist= f.label :name, t("activerecord.attributes.repository.name"), :class => :label
.rightlist= f.text_field :name, :class => 'text_field'
- elsif can? :regenerate_metadata, @repository
.leftlist
.rightlist
= link_to t("layout.repositories.regenerate_metadata"), regenerate_metadata_platform_repository_path(@platform, @repository),
:method => :put, :confirm => t('layout.confirm'), :class => :button
.leftlist= f.label :description, t("activerecord.attributes.repository.description"), :class => :label
.rightlist= f.text_field :description, :class => 'text_field'
.leftlist= f.label :publish_without_qa, t("activerecord.attributes.repository.publish_without_qa"), :class => :label
.rightlist= f.check_box :publish_without_qa, :class => 'check_box'
.both
.hr
- if ['edit', 'update'].include?(controller.action_name) && can?(:regenerate_metadata, @repository)
.leftlist= t('layout.repositories.regenerate_metadata')
.rightlist
= link_to t('layout.repositories.regenerate_metadata').split.first, regenerate_metadata_platform_repository_path(@platform, @repository),
:method => :put, :confirm => t('layout.confirm'), :class => :button
.hr{:style => 'padding-bottom:20px;'}
.both
.button_block