Specify table#listing_orders and be as generic as possible for table

This commit is contained in:
Jean-Baptiste Bellet
2022-12-01 15:03:14 +01:00
parent 727e6d4966
commit 64d467ce39
3 changed files with 33 additions and 23 deletions

View File

@@ -20,7 +20,8 @@
= t(".no_note_present")
%td.actions
= link_to '', '', class: 'edit-note icon_link icon-edit no-text with-tip', data: { action: 'edit' }, title: Spree.t('edit')
- if @order.note.present?
= link_to '', '', class: 'delete-note icon_link icon-trash no-text with-tip', data: { action: 'remove' }, title: Spree.t('delete')
.flex
= link_to '', '', class: 'edit-note icon_link icon-edit no-text with-tip', data: { action: 'edit' }, title: Spree.t('edit')
- if @order.note.present?
= link_to '', '', class: 'delete-note icon_link icon-trash no-text with-tip', data: { action: 'remove' }, title: Spree.t('delete')

View File

@@ -70,8 +70,9 @@
%td.actions
- if can?(:update, shipment) && !shipment.canceled?
= link_to '', '', :class => 'save-tracking icon_link icon-ok no-text with-tip', :data => { 'shipment-number' => shipment.number, :action => 'save' }, :title => I18n.t('actions.save')
= link_to '', '', :class => 'cancel-tracking icon_link icon-cancel no-text with-tip', :data => { :action => 'cancel' }, :title => I18n.t('actions.cancel')
.flex
= link_to '', '', :class => 'save-tracking icon_link icon-ok no-text with-tip', :data => { 'shipment-number' => shipment.number, :action => 'save' }, :title => I18n.t('actions.save')
= link_to '', '', :class => 'cancel-tracking icon_link icon-cancel no-text with-tip', :data => { :action => 'cancel' }, :title => I18n.t('actions.cancel')
%tr.show-tracking.total
%td{ :colspan => "5" }

View File

@@ -1,8 +1,6 @@
/* Overide tables.scss app/webpacker/css/admin/components/tables.scss */
table thead th,
table thead th.actions,
table thead td.actions {
table thead th {
background-color: $v2-medium-light-grey;
border: none;
color: $v2-blue;
@@ -15,24 +13,23 @@ table thead td.actions {
}
}
table tr:not([class*="state"]) {
th:first-child,
td:first-child {
border-left: none;
}
}
table tbody tr {
&:first-child th,
&:first-child td {
border-top: none; // Don't show the top border of the first row
}
td:not(:first-child) {
border-left: none; // Only show left border on the first cells, as it indicates the order state by its color
}
td {
border-bottom: none; // By default, do not show the border of the cells
border-right: none;
border-top: none;
border: none;
border-bottom: 2px solid $v2-medium-light-grey;
&.actions {
border-bottom: 2px solid $v2-medium-light-grey !important; // needs to be important because of already defined with important
}
> .flex {
display: flex;
column-gap: 10px;
@@ -78,11 +75,22 @@ table td.actions {
}
}
table#listing_orders td {
// When the table is the listing of orders, we need to increase the height of the cells
padding: 20px 0;
table#listing_orders {
thead th.actions,
thead td.actions {
background-color: $v2-medium-light-grey;
}
td {
// When the table is the listing of orders, we need to increase the height of the cells
padding: 20px 0;
&.actions {
padding-left: 20px;
&.actions {
padding-left: 20px;
border-bottom: 2px solid $v2-medium-light-grey !important; // needs to be important because of already defined with important
}
&:not(:first-child) {
border-left: none; // Only show left border on the first cells, as it indicates the order state by its color
}
}
}