Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
🐞 Fix search input (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephannv authored Jun 30, 2021
1 parent d413648 commit b2119d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions app/components/games/card_actions_component.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
.dropdown-menu.dropdown-menu-right(aria-labelledby=dropdown_id)
= link_to add_hidden_item_path(item_id: game.id), class: 'dropdown-item', method: :post do
= t('.hide')
- if game.website_url.present?
= link_to game.website_url, class: 'dropdown-item', target: '_blank', rel: 'noopener noreferrer' do
= t('.official_website')
2 changes: 1 addition & 1 deletion app/controllers/games_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ def sort_param
end

def permitted_params
params.permit(:q, :sort)
params.permit(:sort, q: {})
end
end
8 changes: 4 additions & 4 deletions app/lib/items_sorter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ class ItemsSorter
text: I18n.t('games.sort_options.title_asc'),
query: 'items.title ASC'
},
release_date_asc: {
text: I18n.t('games.sort_options.release_date_asc'),
query: 'items.release_date ASC'
},
release_date_desc: {
text: I18n.t('games.sort_options.release_date_desc'),
query: 'items.release_date DESC'
},
release_date_asc: {
text: I18n.t('games.sort_options.release_date_asc'),
query: 'items.release_date ASC'
},
price_asc: {
text: I18n.t('games.sort_options.price_asc'),
query: 'coalesce(prices.discount_amount_cents, prices.regular_amount_cents) ASC NULLS LAST',
Expand Down
1 change: 1 addition & 0 deletions config/locales/pt-BR/components/games.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ pt-BR:
tooltip: Lista de desejos
card_actions_component:
hide: Ocultar
official_website: Site oficial

0 comments on commit b2119d8

Please sign in to comment.