From 55342597ac4538799db25b41bd49296c91cdf153 Mon Sep 17 00:00:00 2001 From: nishiki Date: Sun, 10 Jul 2016 11:01:11 +0200 Subject: [PATCH] improve list interface --- lib/mpw/ui/cli.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/mpw/ui/cli.rb b/lib/mpw/ui/cli.rb index 3c8e5a5..5a0eb8e 100644 --- a/lib/mpw/ui/cli.rb +++ b/lib/mpw/ui/cli.rb @@ -160,7 +160,12 @@ class Cli result.each do |item| if group != item.group group = item.group - puts "#{I18n.t('display.group')}: #{group}".yellow + + if group.empty? + puts I18n.t('display.no_group').yellow + else + puts "\n#{group}".yellow + end end print " |_ ".yellow @@ -171,6 +176,8 @@ class Cli i += 1 end + + print "\n" choice = ask(I18n.t('form.select')).to_i if choice >= 1 and choice < i