From da166cf7ebfbe274d7dbb890094bf14d5b22321f Mon Sep 17 00:00:00 2001 From: tl3ilaxu Date: Thu, 4 Feb 2016 14:24:02 +0100 Subject: [PATCH] Make code not horrible --- app/assets/stylesheets/orders.css.scss | 2 ++ app/views/orders/_products_modal.html.haml | 4 ++-- app/views/products/link.html.haml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/orders.css.scss b/app/assets/stylesheets/orders.css.scss index a173404..7c4a3c0 100644 --- a/app/assets/stylesheets/orders.css.scss +++ b/app/assets/stylesheets/orders.css.scss @@ -26,11 +26,13 @@ } button.product { width: 100%; + height: 100px; p { overflow: hidden; text-overflow: ellipsis; } img { + max-height: 70%; max-width: 100%; margin-left: auto; margin-right: auto; diff --git a/app/views/orders/_products_modal.html.haml b/app/views/orders/_products_modal.html.haml index 76690ec..6df19a7 100644 --- a/app/views/orders/_products_modal.html.haml +++ b/app/views/orders/_products_modal.html.haml @@ -11,9 +11,9 @@ #product_buttons.container-fluid - @products.each do |product| .col-md-2{ data: { name: product.name } } - %button.btn.btn-default.product{ data: { product: product.id, dismiss: :modal }, style: "height: 125px" } + %button.btn.btn-default.product{ data: { product: product.id, dismiss: :modal } } %p= product.name - = image_tag product.avatar(:dagschotel), class: "center img-responsive", style: "max-height: 100px" + = image_tag product.avatar(:dagschotel), class: "center img-responsive" .modal-footer %button.btn.btn-default{ data: { dismiss: :modal } } Close diff --git a/app/views/products/link.html.haml b/app/views/products/link.html.haml index 1a6f0cc..21c138e 100644 --- a/app/views/products/link.html.haml +++ b/app/views/products/link.html.haml @@ -6,9 +6,9 @@ - Product.all.each do |product| %tr .col-md-3 - = button_to product_barcodes_path(product), class: "btn btn-default product", data: { product: product.id, dismiss: :modal }, params: { "barcode[code]" => params[:barcode] }, style: "height: 125px;" do + = button_to product_barcodes_path(product), class: "btn btn-default product", data: { product: product.id, dismiss: :modal }, params: { "barcode[code]" => params[:barcode] } do %p= product.name - = image_tag product.avatar(:dagschotel), class: "center img-responsive", style: "max-height: 100px;" + = image_tag product.avatar(:dagschotel), class: "center img-responsive" .col-md-5 %h4 or create a new one = render 'products/form'