From 5e9bd1760664834256bea4a2d6bf170b2570b94e Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Mon, 20 Feb 2023 22:33:42 +0100 Subject: [PATCH] group order make 'current orders' more obvious --- app/views/group_orders/_switch_order.html.haml | 15 ++++++++------- config/locales/en.yml | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/group_orders/_switch_order.html.haml b/app/views/group_orders/_switch_order.html.haml index 76443524..9fbe15ee 100644 --- a/app/views/group_orders/_switch_order.html.haml +++ b/app/views/group_orders/_switch_order.html.haml @@ -1,9 +1,10 @@ -- orders = Order.open.started.reject{ |order| order == current_order } +- orders = Order.open.started - unless orders.empty? - %h2= t '.title' - %ul.unstyled + %ul.nav.nav-pills.nav-stacked + .nav-header= t '.title' - orders.each do |order| - %li - = link_to_ordering(order, 'data-confirm_switch_order' => true) - - if order.ends - = t '.remaining', remaining: time_ago_in_words(order.ends) + %li( class='#{ order == current_order ? "active" : ""}' + data-toggle='tooltip' + data-placement='left' + title='#{t('.remaining', remaining: time_ago_in_words(order.ends))}') + = link_to_ordering(order, 'data-confirm_switch_order' => true){ order.ends ? order.name : order.name } diff --git a/config/locales/en.yml b/config/locales/en.yml index 59e94385..53c2cfca 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1101,7 +1101,7 @@ en: sum: Sum title: Your order result for %{order} switch_order: - remaining: "%{remaining} remaining" + remaining: "%{remaining} until order closes" title: Current orders update: error_general: The order couldn’t be updated due to a bug.