From 6483d0a0ca2617701a3d42621b54a042609a4d5b Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Wed, 3 Jul 2024 10:40:35 +0300 Subject: [PATCH 1/2] fix for show action in admin controller of auction --- app/views/admin/auctions/show.html.erb | 26 ++++++++++++++------------ config/routes.rb | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/views/admin/auctions/show.html.erb b/app/views/admin/auctions/show.html.erb index 19c0d3365..92d93ee82 100644 --- a/app/views/admin/auctions/show.html.erb +++ b/app/views/admin/auctions/show.html.erb @@ -1,6 +1,6 @@ <% content_for :title, "#{t('.title')}: #{@auction.domain_name}" %> -
+
<%= component 'common/table', header_collection: [], options: { class: 'js-table-dt dataTable no-footer' } do %> <%= tag.tbody id: "auctions-table-body", class: 'contents' do %> @@ -13,14 +13,14 @@ <%= t('auctions.starts_at') %> <%= tag.td do %> - <%= auction.starts_at %> - <% end @auction.starts_at.present? %> + <%= @auction.starts_at %> + <% end if @auction.starts_at.present? %> <%= t('auctions.ends_at') %> <%= tag.td do %> - <%= auction.ends_at %> - <% end @auction.ends_at.present? %> + <%= @auction.ends_at %> + <% end if @auction.ends_at.present? %> <%- if @auction.offer_from_user(current_user).present? %> @@ -45,13 +45,15 @@ <%= component 'common/table', header_collection:, options: { class: 'js-table-dt' } do %> <%= tag.tbody id: "auctions-table-body", class: 'contents' do %> <%- if @offers.present? %> - - <%= t('offers.price_in_currency', price: offer.price) %> - <%= offer.user&.display_name || t(:deleted_user) %> - <%= I18n.l(offer.created_at) %> - <%= I18n.l(offer.updated_at) %> - <%= link_to t(:versions_name), admin_offer_versions_path(offer), class: "ui button primary" %> - + <% @offers.each do |offer| %> + + <%= t('offers.price_in_currency', price: offer.price) %> + <%= offer.user&.display_name || t(:deleted_user) %> + <%= I18n.l(offer.created_at) %> + <%= I18n.l(offer.updated_at) %> + <%= link_to t(:versions_name), admin_offer_versions_path(offer), class: "ui button primary" %> + + <% end %> <%- else %> <%= t(:no_offers) %> diff --git a/config/routes.rb b/config/routes.rb index b202d82f0..12b250650 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -44,7 +44,7 @@ end namespace :admin, constraints: Constraints::Administrator.new do - resources :auctions, concerns: %i[auditable], except: [:show] do + resources :auctions, concerns: %i[auditable] do collection do post 'bulk_starts_at', to: 'auctions#bulk_starts_at', as: 'bulk_starts_at' post 'apply_auction_participants', to: 'auctions#apply_auction_participants', as: 'apply_auction_participants' From 857b42a223900e648d1a08de6600c35532cb4e03 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Wed, 3 Jul 2024 12:25:48 +0300 Subject: [PATCH 2/2] fixed nil value for starts_at and ends_at in auciton admin show view --- app/views/admin/auctions/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/auctions/show.html.erb b/app/views/admin/auctions/show.html.erb index 92d93ee82..8cabe2a2a 100644 --- a/app/views/admin/auctions/show.html.erb +++ b/app/views/admin/auctions/show.html.erb @@ -1,6 +1,6 @@ <% content_for :title, "#{t('.title')}: #{@auction.domain_name}" %> -
+
<%= component 'common/table', header_collection: [], options: { class: 'js-table-dt dataTable no-footer' } do %> <%= tag.tbody id: "auctions-table-body", class: 'contents' do %>