Skip to content

Commit

Permalink
Shipment/order shipping status markup update.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Nov 6, 2024
1 parent 9ac1c68 commit 38c3fe4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions assets/css/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ table.wc-gzd-shipments-shipping-rules {
border-radius: 3px;
display: inline-flex;
white-space: nowrap;
max-width: 100%;

&.status-draft, &.status-processing, &.status-requested, &.status-partially-shipped, &.status-partially-delivered, &.status-open, &.status-partially-returned {
background: #f8dda7;
Expand All @@ -653,6 +654,11 @@ table.wc-gzd-shipments-shipping-rules {
background: #f8dda7;
color: #94660c;
}

> span {
overflow: hidden;
text-overflow: ellipsis;
}
}

a.button.wc-gzd-shipment-action-button {
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/views/html-order-shipment-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<div class="panel-title panel-title-inner title-spread panel-inner panel-order-return-title <?php echo ( empty( $returns ) ? 'hide-default' : '' ); ?>">
<h2 class="order-returns-title"><?php echo esc_html_x( 'Returns', 'shipments', 'woocommerce-germanized-shipments' ); ?></h2>
<span class="order-return-status status-<?php echo esc_attr( $order_shipment->get_return_status() ); ?>"><?php echo esc_html( wc_gzd_get_shipment_order_return_status_name( $order_shipment->get_return_status() ) ); ?></span>
<mark class="order-return-status status-<?php echo esc_attr( $order_shipment->get_return_status() ); ?>"><span><?php echo esc_html( wc_gzd_get_shipment_order_return_status_name( $order_shipment->get_return_status() ) ); ?></span></mark>
</div>

<?php if ( ! empty( $returns ) ) : ?>
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/views/html-order-shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="shipment-header title-spread">
<div class="left">
<h3><?php printf( esc_html_x( '%1$s #%2$s', 'shipment admin title', 'woocommerce-germanized-shipments' ), esc_html( wc_gzd_get_shipment_label_title( $shipment->get_type() ) ), esc_html( $shipment->get_shipment_number() ) ); ?></h3>
<span class="shipment-status shipment-type-<?php echo esc_attr( $shipment->get_type() ); ?>-status status-<?php echo esc_attr( $shipment->get_status() ); ?>"><?php echo esc_html( wc_gzd_get_shipment_status_name( $shipment->get_status() ) ); ?></span>
<mark class="shipment-status shipment-type-<?php echo esc_attr( $shipment->get_type() ); ?>-status status-<?php echo esc_attr( $shipment->get_status() ); ?>"><span><?php echo esc_html( wc_gzd_get_shipment_status_name( $shipment->get_status() ) ); ?></span></mark>
</div>

<div class="right">
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/views/html-order-shipments.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div class="panel-title title-spread panel-inner">
<h2 class="order-shipments-title"><?php echo esc_html_x( 'Shipments', 'shipments', 'woocommerce-germanized-shipments' ); ?></h2>
<span class="order-shipping-status status-<?php echo esc_attr( $order_shipment->get_shipping_status() ); ?>"><?php echo esc_html( wc_gzd_get_shipment_order_shipping_status_name( $order_shipment->get_shipping_status() ) ); ?></span>
<mark class="order-shipping-status status-<?php echo esc_attr( $order_shipment->get_shipping_status() ); ?>"><span><?php echo esc_html( wc_gzd_get_shipment_order_shipping_status_name( $order_shipment->get_shipping_status() ) ); ?></span></mark>
</div>

<div class="notice-wrapper panel-inner"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ public static function render_order_columns( $column, $post_id ) {

if ( $shipment_order = wc_gzd_get_shipment_order( $the_order ) ) {
$shipping_status = $shipment_order->get_shipping_status();
$status_html = '<span class="order-shipping-status status-' . esc_attr( $shipping_status ) . '">' . esc_html( wc_gzd_get_shipment_order_shipping_status_name( $shipping_status ) ) . '</span>';
$status_html = '<mark class="order-shipping-status status-' . esc_attr( $shipping_status ) . '"><span>' . esc_html( wc_gzd_get_shipment_order_shipping_status_name( $shipping_status ) ) . '</span></mark>';

if ( in_array( $shipping_status, array( 'shipped', 'partially-shipped' ), true ) && $shipment_order->get_shipments() ) {
if ( $last_shipment = $shipment_order->get_last_shipment_with_tracking() ) {
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ public function column_address( $shipment ) {
* @param Shipment $shipment The current shipment object.
*/
public function column_status( $shipment ) {
echo '<span class="shipment-status shipment-type-' . esc_attr( $shipment->get_type() ) . '-status status-' . esc_attr( $shipment->get_status() ) . '">' . esc_html( wc_gzd_get_shipment_status_name( $shipment->get_status() ) ) . '</span>';
echo '<mark class="shipment-status shipment-type-' . esc_attr( $shipment->get_type() ) . '-status status-' . esc_attr( $shipment->get_status() ) . '"><span>' . esc_html( wc_gzd_get_shipment_status_name( $shipment->get_status() ) ) . '</span></mark>';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ public static function json_search_orders() {
}

private static function get_order_status_html( $order_shipment ) {
$status_html = '<span class="order-shipping-status status-' . esc_attr( $order_shipment->get_shipping_status() ) . '">' . wc_gzd_get_shipment_order_shipping_status_name( $order_shipment->get_shipping_status() ) . '</span>';
$status_html = '<mark class="order-shipping-status status-' . esc_attr( $order_shipment->get_shipping_status() ) . '"><span>' . wc_gzd_get_shipment_order_shipping_status_name( $order_shipment->get_shipping_status() ) . '</span></mark>';

return $status_html;
}
Expand Down Expand Up @@ -1090,7 +1090,7 @@ private static function get_global_order_status_html( $order ) {
}

private static function get_order_return_status_html( $order_shipment ) {
$status_html = '<span class="order-return-status status-' . esc_attr( $order_shipment->get_return_status() ) . '">' . wc_gzd_get_shipment_order_return_status_name( $order_shipment->get_return_status() ) . '</span>';
$status_html = '<mark class="order-return-status status-' . esc_attr( $order_shipment->get_return_status() ) . '"><span>' . wc_gzd_get_shipment_order_return_status_name( $order_shipment->get_return_status() ) . '</span></mark>';

return $status_html;
}
Expand Down

0 comments on commit 38c3fe4

Please sign in to comment.