small refactoring build lists controller

This commit is contained in:
Alexander Machehin 2013-07-31 21:10:00 +06:00
parent eb184a8156
commit 029273328c
1 changed files with 8 additions and 20 deletions

View File

@ -122,36 +122,24 @@ class Projects::BuildListsController < Projects::BaseController
end end
@build_list.publisher = current_user @build_list.publisher = current_user
if @build_list.publish message = @build_list.publish ? 'success' : 'fail'
redirect_to :back, :notice => t('layout.build_lists.publish_success') redirect_to :back, :notice => t("layout.build_lists.publish_#{message}")
else
redirect_to :back, :notice => t('layout.build_lists.publish_fail')
end
end end
def reject_publish def reject_publish
@build_list.publisher = current_user @build_list.publisher = current_user
if @build_list.reject_publish message = @build_list.reject_publish ? 'success' : 'fail'
redirect_to :back, :notice => t('layout.build_lists.reject_publish_success') redirect_to :back, :notice => t("layout.build_lists.reject_publish_#{message}")
else
redirect_to :back, :notice => t('layout.build_lists.reject_publish_fail')
end
end end
def create_container def create_container
if @build_list.publish_container message = @build_list.publish_container ? 'success' : 'fail'
redirect_to :back, :notice => t('layout.build_lists.create_container_success') redirect_to :back, :notice => t("layout.build_lists.create_container_#{message}")
else
redirect_to :back, :notice => t('layout.build_lists.create_container_fail')
end
end end
def cancel def cancel
if @build_list.cancel message = @build_list.cancel ? 'will_be_canceled' : 'cancel_fail'
redirect_to :back, :notice => t('layout.build_lists.will_be_canceled') redirect_to :back, :notice => t("layout.build_lists.#{message}")
else
redirect_to :back, :notice => t('layout.build_lists.cancel_fail')
end
end end
def log def log