change UI for promotions

This commit is contained in:
phyusin
2017-11-23 18:24:01 +06:30
parent acdefef6db
commit 6a4acb71e8
2 changed files with 19 additions and 17 deletions

View File

@@ -43,19 +43,21 @@
<td>
<% item = MenuItemInstance.find_by_item_instance_code(pro.original_product)%>
<% if item.nil? %>
<%= Product.find_by_item_code(pro.original_product).name rescue "-" %>
<%= Product.find_by_item_code(pro.original_product).name rescue "-" %>
<% else %>
<%= item.menu_item.name rescue "-" %>
- <%= item.item_instance_name rescue "-" %>
<%= item.menu_item.name rescue "-" %>
- <%= item.item_instance_name rescue "-" %>
<% end %>
</td>
<td style="padding: 2px">
<% if Employee.exists?(pro.created_by) %>
<%= Employee.find(pro.created_by).name %>
<% else %>
<%= pro.created_by %>
<% end %>
</td>
<% if Employee.exists?(pro.created_by) %>
<td><%= Employee.find(pro.created_by).name %></td>
<% else %>
<td><%= pro.created_by %></td>
<% end %>
<td><%= pro.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
<td><%= link_to t("views.btn.edit"), edit_settings_promotion_path(pro),:class => 'btn btn-info btn-sm waves-effect' %>
<td><%= link_to t("views.btn.edit"), edit_settings_promotion_path(pro),:class => 'btn btn-primary btn-sm waves-effect' %>
</td>
</tr>
<% end %>