Skip to content

Commit

Permalink
Merge pull request #509 from herbdool/issue-508
Browse files Browse the repository at this point in the history
Issue #508: clean up Review Order styles
  • Loading branch information
bugfolder authored Nov 11, 2024
2 parents b1aad97 + 9e4b840 commit d0a72f1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 50 deletions.
29 changes: 3 additions & 26 deletions uc_cart/css/uc_cart.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
* Styles for uc_cart module.
*/

.order-review-table {
font-size: .9em;
line-height: 1.4em;
margin: auto;
width: auto;
}

.order-review-table td {
padding-bottom: 0.7em;
padding-top: 0.7em;
vertical-align: top;
border: none;
}
Expand All @@ -21,27 +12,18 @@
border: none;
}

.order-review-table .pane-title-row td {
padding-bottom: 0.4em;
padding-top: 0.4em;
}

.order-review-table .pane-title-row {
background-color: #ddd;
font-weight: bold;
padding: .5em 1em;
text-align: center;
}

.order-review-table .title-col {
font-weight: bold;
padding-left: 3em; /* LTR */
text-align: right; /* LTR */
white-space: nowrap;
}

.order-review-table .data-col {
padding-right: 3em; /* LTR */
text-align: right;
}

.order-review-table .row-border-top {
Expand All @@ -57,14 +39,9 @@
border: solid 1px #999;
}

.order-review-table .review-button-row td {
padding-top: 1em;
text-align: right; /* LTR */
}

.order-review-table .review-button-row div,
.order-review-table .review-button-row form {
.review-button-row {
display: inline;
text-align: right; /* LTR */
}

/* I cannot testify for any of the data below.. it's a hodge podge. */
Expand Down
75 changes: 51 additions & 24 deletions uc_cart/uc_cart.pages.inc
Original file line number Diff line number Diff line change
Expand Up @@ -479,45 +479,72 @@ function theme_uc_cart_checkout_review($variables) {

backdrop_add_css(backdrop_get_path('module', 'uc_cart') . '/css/uc_cart.css');

$output = '<div id="review-instructions">' . filter_xss_admin(config_get('uc_cart.settings', 'uc_checkout_review_instructions')) . '</div>';
$build['review'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('order-review')),
);

$output .= '<table class="order-review-table">';
$build['review']['review_instructions'] = array(
'#type' => 'help',
'#markup' => filter_xss_admin(config_get('uc_cart.settings', 'uc_checkout_review_instructions')),
);

foreach ($panes as $title => $data) {
$output .= '<tr class="pane-title-row">';
$output .= '<td colspan="2">' . $title . '</td>';
$output .= '</tr>';
$identifier = backdrop_html_class($title);
$build['review'][$identifier] = array(
'#type' => 'fieldset',
'#title' => $title,
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#attributes' => array(
'class' => array(
$identifier,
)),
);
if (is_array($data)) {
foreach ($data as $row) {
if (is_array($row)) {
if (isset($row['border'])) {
$border = ' class="row-border-' . $row['border'] . '"';
$rows = array();
foreach ($data as $item) {
$row = [];
if (is_array($item)) {
if (isset($item['border'])) {
$row['class'][] = 'row-border-' . $item['border'];
}
else {
$border = '';
}
$output .= '<tr' . $border . '>';
$output .= '<td class="title-col">' . $row['title'] . ':</td>';
$output .= '<td class="data-col">' . $row['data'] . '</td>';
$output .= '</tr>';
$row['data']['title'] = array(
'data' => $item['title'],
'class' => array('title-col'),
);
$row['data']['body'] = array(
'data' => $item['data'],
'class' => array('data-col'),
);
}
else {
$output .= '<tr><td colspan="2">' . $row . '</td></tr>';
$row['data']['body'] = $item;
}
$rows[] = $row;
}
}
else {
$output .= '<tr><td colspan="2">' . $data . '</td></tr>';
$build['review'][$identifier]['markup'] = array(
'#markup' => $data,
);
}
$build['review'][$identifier]['table'] = array(
'#theme' => 'table',
'#rows' => $rows,
'#attributes' => array(
'class' => array('order-review-table'),
),
);
}

$output .= '<tr class="review-button-row">';
$output .= '<td colspan="2">' . backdrop_render($form) . '</td>';
$output .= '</tr>';

$output .= '</table>';
$build['review']['actions'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('review-button-row')),
);
$build['review']['actions']['review_actions'] = $form;

return $output;
return backdrop_render($build);
}

/**
Expand Down

0 comments on commit d0a72f1

Please sign in to comment.