Fix date filter normalization. Add build, freeze, unfreeze confirmation. Refs #2261
This commit is contained in:
parent
c3fce82e9e
commit
6794ca42fb
|
@ -62,8 +62,10 @@ class BuildList::Filter
|
|||
end
|
||||
|
||||
def build_date_from_params(field_name, params)
|
||||
if params["#{field_name.to_s}(1i)"].present? || params["#{field_name.to_s}(2i)"].present? || params["#{field_name.to_s}(3i)"].present?
|
||||
Date.civil(params["#{field_name.to_s}(1i)"].to_i, params["#{field_name.to_s}(2i)"].to_i, params["#{field_name.to_s}(3i)"].to_i)
|
||||
if params["#{field_name}(1i)"].present? || params["#{field_name}(2i)"].present? || params["#{field_name}(3i)"].present?
|
||||
Date.civil((params["#{field_name}(1i)"].presence || Date.today.year).to_i,
|
||||
(params["#{field_name}(2i)"].presence || Date.today.mohth).to_i,
|
||||
(params["#{field_name}(3i)"].presence || Date.today.day).to_i)
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
|
|
@ -59,11 +59,11 @@
|
|||
-#= link_to image_tag("web-app-theme/icons/application_edit.png", :alt => t("layout.edit")) + " " + t("layout.edit"), edit_platform_path(@platform), :class => "button"
|
||||
= link_to image_tag("web-app-theme/icons/cross.png", :alt => t("layout.delete")) + " " + t("layout.delete"), platform_path(@platform), :method => "delete", :class => "button", :confirm => t("layout.platforms.confirm_delete") if can? :delete, @platform
|
||||
- if @platform.released?
|
||||
= link_to t("layout.platforms.unfreeze"), unfreeze_platform_path(@platform), :confirm => I18n.t("layout.platforms.confirm_unfreeze"), :class => "button" if can? :unfreeze, @platform
|
||||
= link_to t("layout.platforms.unfreeze"), unfreeze_platform_path(@platform), :confirm => I18n.t("layout.platforms.confirm_unfreeze"), :method => :post, :class => "button" if can? :unfreeze, @platform
|
||||
- else
|
||||
= link_to t("layout.platforms.freeze"), freeze_platform_path(@platform), :confirm => I18n.t("layout.platforms.confirm_freeze"), :class => "button" if can? :freeze, @platform
|
||||
= link_to t("layout.platforms.freeze"), freeze_platform_path(@platform), :confirm => I18n.t("layout.platforms.confirm_freeze"), :method => :post, :class => "button" if can? :freeze, @platform
|
||||
= link_to "Клонировать", clone_platform_path(@platform), :class => "button" if can? :clone, @platform
|
||||
= link_to t("layout.platforms.build_all"), build_all_platform_path(@platform), :class => "button" if can? :build_all, @platform
|
||||
= link_to t("layout.platforms.build_all"), build_all_platform_path(@platform), :confirm => I18n.t("layout.confirm"), :method => :post, :class => "button" if can? :build_all, @platform
|
||||
|
||||
%a{ :name => "repositories" }
|
||||
.block
|
||||
|
|
|
@ -41,11 +41,11 @@ Rosa::Application.routes.draw do
|
|||
resources :private_users, :except => [:show, :destroy, :update]
|
||||
|
||||
member do
|
||||
get 'freeze'
|
||||
get 'unfreeze'
|
||||
post 'freeze'
|
||||
post 'unfreeze'
|
||||
get 'clone'
|
||||
post 'clone'
|
||||
get 'build_all'
|
||||
post 'build_all'
|
||||
end
|
||||
|
||||
collection do
|
||||
|
|
Loading…
Reference in New Issue