|
3 | 3 | <div class="col-md-12">
|
4 | 4 | <h1 class="display-4"><%= @product.name %></h1>
|
5 | 5 | <hr>
|
6 |
| - <dl class="row"> |
7 |
| - <dt class="col-sm-3"><%= t('activerecord.attributes.product.custom_id') %></dt> |
8 |
| - <dd class="col-sm-9"><%= @product.custom_id %></dd> |
9 |
| - <dt class="col-sm-3"><%= t('activerecord.attributes.product.sku') %>:</dt> |
10 |
| - <dd class="col-sm-9"><%= @product.sku %></dd> |
11 |
| - <dt class="col-sm-3"><%= t('products.price') %>:</dt> |
12 |
| - <dd class="col-sm-9"><%= @product.price %></dd> |
13 |
| - <dt class="col-sm-3"><%= t('products.entry') %>:</dt> |
14 |
| - <dd class="col-sm-9"><%= Services::Product::CountQuantity.call(product: @product, product_command: 'purchase_product') %></dd> |
15 |
| - <dt class="col-sm-3"><%= t('products.exit') %>:</dt> |
16 |
| - <dd class="col-sm-9"><%= Services::Product::CountQuantity.call(product: @product, product_command: 'sale_product') %></dd> |
17 |
| - <dt class="col-sm-3"><%= t('products.balance') %>:</dt> |
18 |
| - <dd class="col-sm-9"><%= Services::Product::CountQuantity.call(product: @product, product_command: 'balance_product') %></dd> |
19 |
| - <dt class="col-sm-3"><%= t('products.rq_code') %></dt> |
20 |
| - <dd class="col-sm-9"><%= image_tag(Services::Product::GenerateQrCode.call(product: @product)) %></dd> |
21 |
| - <dt class="col-sm-3"><%= t('products.image') %>:</dt> |
22 |
| - <dd class="col-sm-9"><%= image_tag(@product.image.attached? ? @product.image : "https://purple-stock.s3-sa-east-1.amazonaws.com/images.png", size: "150") %></dd> |
23 |
| - <dt class="col-sm-3"><%= t('products.highlight') %>:</dt> |
24 |
| - <dd class="col-sm-9"><%= @product.highlight %></dd> |
25 |
| - <dt class="col-sm-3"><%= t('products.category') %>:</dt> |
26 |
| - <dd class="col-sm-9"><%= @product.category.try(:name) %></dd> |
27 |
| - <dt class="col-sm-3"><%= t('products.active') %>:</dt> |
28 |
| - <dd class="col-sm-9"><%= @product.active %></dd> |
29 |
| - </dl> |
| 6 | + <table> |
| 7 | + <!-- What to do with image? <dd class="col-sm-9"><%= image_tag(@product.image.attached? ? @product.image : "https://purple-stock.s3-sa-east-1.amazonaws.com/images.png", size: "150") %></dd> --> |
| 8 | + <tr class="row"> |
| 9 | + <td><%= image_tag(Services::Product::GenerateQrCode.call(product: @product)) %></td> |
| 10 | + <td class="mt-md-5"> |
| 11 | + <table> |
| 12 | + <tr> |
| 13 | + <th class="col"><%= t('activerecord.attributes.product.custom_id') %></th> |
| 14 | + <td class="col"><%= @product.custom_id %></td> |
| 15 | + </tr> |
| 16 | + <tr> |
| 17 | + <th class="col"><%= t('activerecord.attributes.product.sku') %></th> |
| 18 | + <td class="col"><%= @product.sku %></td> |
| 19 | + </tr> |
| 20 | + <tr> |
| 21 | + <th class="col"><%= t('products.price') %></th> |
| 22 | + <td class="col"><%= @product.price %></td> |
| 23 | + </tr> |
| 24 | + <tr> |
| 25 | + <th class="col"><%= t('products.entry') %></th> |
| 26 | + <td class="col"><%= Services::Product::CountQuantity.call(product: @product, product_command: 'purchase_product') %></td> |
| 27 | + </tr> |
| 28 | + <tr> |
| 29 | + <th class="col"><%= t('products.exit') %></th> |
| 30 | + <td class="col"><%= Services::Product::CountQuantity.call(product: @product, product_command: 'sale_product') %></td> |
| 31 | + </tr> |
| 32 | + <tr> |
| 33 | + <th class="col"><%= t('products.balance') %></th> |
| 34 | + <td class="col"><%= Services::Product::CountQuantity.call(product: @product, product_command: 'balance_product') %></td> |
| 35 | + </tr> |
| 36 | + <tr> |
| 37 | + <th class="col"><%= t('products.highlight') %></th> |
| 38 | + <td class="col"><%= @product.highlight %></td> |
| 39 | + </tr> |
| 40 | + <tr> |
| 41 | + <th class="col"><%= t('products.category') %></th> |
| 42 | + <td class="col"><%= @product.category.try(:name) %></td> |
| 43 | + </tr> |
| 44 | + <tr> |
| 45 | + <th class="col"><%= t('products.active') %>:</th> |
| 46 | + <td class="col"><%= @product.active %></td> |
| 47 | + </tr> |
| 48 | + </table> |
| 49 | + </td> |
| 50 | + </tr> |
| 51 | + </table> |
30 | 52 | <%= link_to t('helpers.links.back'), products_path, class: 'btn btn-primary btn-lg' %>
|
31 | 53 | <%= link_to t('.edit', :default => t("helpers.links.edit")),
|
32 | 54 | edit_product_path(@product), :class => 'btn btn-dark btn-lg' %>
|
|
0 commit comments