update menu import/export ui

This commit is contained in:
Aung Myo
2018-03-21 10:30:28 +06:30
parent f51d193d47
commit 9db3ec07cc
4 changed files with 20 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
wb = xlsx_package.workbook
wb.styles do |s|
date = s.add_style(:format_code => "yyyy-mm-dd", :border => Axlsx::STYLE_THIN_BORDER)
time_format = wb.styles.add_style :format_code => 'hh:mm:ss'
wrap_text = s.add_style :sz => 11,
:alignment => { :horizontal => :left,:vertical => :center ,
:wrap_text => true}
@@ -43,7 +44,7 @@ wb.styles do |s|
wb.add_worksheet(name: "Menu") do |sheet|
sheet.add_row %w( id name is_active valid_days valid_time_from valid_time_to created_by ), :style=>header_text
@settings_menus.each do |menu|
sheet.add_row [ menu.id, menu.name, menu.is_active, menu.valid_days, menu.valid_time_from,menu.valid_time_to, menu.created_by], :style=>[wrap_text]
sheet.add_row [ menu.id, menu.name, menu.is_active, menu.valid_days, menu.valid_time_from,menu.valid_time_to, menu.created_by], :style=>[wrap_text,time_format]
end
end