mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 13:57:52 +00:00
add color when display an item
This commit is contained in:
parent
f5b98de4c1
commit
298a020e35
1 changed files with 19 additions and 11 deletions
|
@ -197,19 +197,27 @@ class Cli
|
||||||
# Display an item in the default format
|
# Display an item in the default format
|
||||||
# @args: item -> an array with the item information
|
# @args: item -> an array with the item information
|
||||||
def display_item(item)
|
def display_item(item)
|
||||||
puts '--------------------'
|
puts '--------------------'.cyan
|
||||||
puts "Id: #{item['id']}"
|
print 'Id: '.cyan
|
||||||
puts "#{I18n.t('display.name')}: #{item['name']}"
|
puts item['id']
|
||||||
puts "#{I18n.t('display.group')}: #{item['group']}"
|
print "#{I18n.t('display.name')}: ".cyan
|
||||||
puts "#{I18n.t('display.server')}: #{item['host']}"
|
puts item['name']
|
||||||
puts "#{I18n.t('display.protocol')}: #{item['protocol']}"
|
print "#{I18n.t('display.group')}: ".cyan
|
||||||
puts "#{I18n.t('display.login')}: #{item['login']}"
|
puts item['group']
|
||||||
puts "#{I18n.t('display.password')}: #{item['password']}"
|
print "#{I18n.t('display.server')}: ".cyan
|
||||||
puts "#{I18n.t('display.port')}: #{item['port']}"
|
puts item['host']
|
||||||
puts "#{I18n.t('display.comment')}: #{item['comment']}"
|
print "#{I18n.t('display.protocol')}: ".cyan
|
||||||
|
puts item['protocol']
|
||||||
|
print "#{I18n.t('display.login')}: ".cyan
|
||||||
|
puts item['login']
|
||||||
|
print "#{I18n.t('display.password')}: ".cyan
|
||||||
|
puts item['password']
|
||||||
|
print "#{I18n.t('display.port')}: ".cyan
|
||||||
|
puts item['port']
|
||||||
|
print "#{I18n.t('display.comment')}: ".cyan
|
||||||
|
puts item['comment']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Form to add a new item
|
# Form to add a new item
|
||||||
def add
|
def add
|
||||||
row = []
|
row = []
|
||||||
|
|
Loading…
Reference in a new issue