From 3509fab7e501a96506f8efcac4fd6d32b732915d Mon Sep 17 00:00:00 2001 From: "Robert J. Lang" Date: Sat, 19 Nov 2022 07:28:22 -0800 Subject: [PATCH] Update borg theme to latest version, update PATCHES.md accordingly. --- PATCHES.md | 6 - www/themes/borg/borg.info | 6 +- www/themes/borg/css/base.css | 2 +- www/themes/borg/css/components-nodes.css | 11 ++ www/themes/borg/css/components-views.css | 30 ++- www/themes/borg/css/components.css | 76 ++++++-- www/themes/borg/css/node-project.css | 8 +- www/themes/borg/css/page-front.css | 15 +- www/themes/borg/template.php | 181 +++++++++--------- .../block--views--showcase-block-1.tpl.php | 26 --- www/themes/borg/templates/header.tpl.php | 12 +- .../views-view-grid--showcase.tpl.php | 36 ---- .../borg/templates/views-view-grid.tpl.php | 27 ++- 13 files changed, 226 insertions(+), 210 deletions(-) delete mode 100644 www/themes/borg/templates/block--views--showcase-block-1.tpl.php delete mode 100644 www/themes/borg/templates/views-view-grid--showcase.tpl.php diff --git a/PATCHES.md b/PATCHES.md index d2318fa91..301e441b0 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -7,12 +7,6 @@ Core patches Contrib patches =============== -borg - decrease header icon font size - https://github.com/backdrop-contrib/borg/issues/22 - https://github.com/backdrop-contrib/borg/pull/23.patch - ---- - api - Format @return tags nicely https://github.com/backdrop-ops/api.backdropcms.org/issues/64 https://github.com/backdrop-contrib/api/pull/3.patch diff --git a/www/themes/borg/borg.info b/www/themes/borg/borg.info index 1423d3562..5774d36d5 100644 --- a/www/themes/borg/borg.info +++ b/www/themes/borg/borg.info @@ -28,7 +28,7 @@ ckeditor_stylesheets[] = css/editor.css ; Custom javascript to be added: scripts[] = js/borg.js -; Added by Backdrop CMS packaging script on 2021-07-21 +; Added by Backdrop CMS packaging script on 2022-03-16 project = borg -version = 1.x-1.1.16 -timestamp = 1626899709 +version = 1.x-1.1.18 +timestamp = 1647475205 diff --git a/www/themes/borg/css/base.css b/www/themes/borg/css/base.css index 0a5cf3d31..6e1b965fe 100644 --- a/www/themes/borg/css/base.css +++ b/www/themes/borg/css/base.css @@ -11,7 +11,7 @@ body { line-height: 1.25; margin: 0; padding: 0; - min-width: 300px; + min-width: 320px; } @media (max-width: 48em) { /* 768px @ 16px font size -- MD */ diff --git a/www/themes/borg/css/components-nodes.css b/www/themes/borg/css/components-nodes.css index b584ff491..7ddff28c3 100644 --- a/www/themes/borg/css/components-nodes.css +++ b/www/themes/borg/css/components-nodes.css @@ -115,6 +115,17 @@ label.github-clone-label { margin-left: 0; } } +.node-type-project-module .block-field-node-field-download-count .field-item, +.node-type-project-module .block-field-node-field-download-count .field-label, +.node-type-project-module .block-project-usage-project-usage .usage-total, +.node-type-project-module .block-project-usage-project-usage .usage-label { + display: inline-block; + float: none; +} +.node-type-project-module .block-field-node-field-download-count .field-label, +.node-type-project-module .block-project-usage-project-usage .usage-label { + padding-left: 0.5em; +} /******************************************************************************* * Project Placeholder diff --git a/www/themes/borg/css/components-views.css b/www/themes/borg/css/components-views.css index 9ac37f344..72aeca771 100644 --- a/www/themes/borg/css/components-views.css +++ b/www/themes/borg/css/components-views.css @@ -292,10 +292,12 @@ /******************************************************************************* * Showcase view ******************************************************************************/ -.view-showcase .col { +.view-showcase .col, +.view-showcase .views-row { padding-bottom: 15px; } -.view-showcase .col-inner { +.view-showcase .col-inner, +.view-showcase .fields { background-color: #fff; border: 2px solid #EDEFF0; border-radius: 4px; @@ -322,11 +324,25 @@ } @media (min-width: 34em) { /* 544px @ 16px font size -- SM */ - .view-showcase .col { + .view-showcase .col, + .view-showcase .views-row { padding-bottom: 30px; } } @media (min-width: 48em) { /* 768px @ 16px font size -- MD */ + .view-showcase.view-display-id-page .view-content { + column-count: 2; + -moz-column-count: 2; + -webkit-column-count: 2; + column-gap: 1.875rem; + -moz-column-gap: 1.875rem; + -webkit-column-gap: 1.875rem; + } + .view-showcase.view-display-id-page .views-row { + break-inside: avoid; + page-break-inside: avoid; + -webkit-column-break-inside: avoid; + } .view-showcase .row { padding-top: 15px; padding-bottom: 15px; @@ -342,6 +358,14 @@ } } @media (min-width: 62em) { /* 992px @ 16px font size -- LG */ + .view-showcase.view-display-id-page .view-content { + column-gap: 3.75rem; + -moz-column-gap: 3.75rem; + -webkit-column-gap: 3.75rem; + } + .view-showcase .views-row { + padding-bottom: 60px; + } .view-showcase .row { padding-top: 30px; padding-bottom: 30px; diff --git a/www/themes/borg/css/components.css b/www/themes/borg/css/components.css index d4858deaa..d8f4333f2 100644 --- a/www/themes/borg/css/components.css +++ b/www/themes/borg/css/components.css @@ -16,7 +16,7 @@ a.logo { float: left; width: 40px; box-sizing: border-box; - margin-left: 15px; + margin: 0 15px; } .site-slogan { display: none; @@ -364,7 +364,6 @@ article footer .submitted { padding: 10px 0; } article footer .user-picture { - float: left; margin-right: 15px; } article footer .user-picture img img { @@ -405,10 +404,16 @@ article footer .arrow-down:after { } article footer .submitted { padding: 0; - line-height: 40px; } + article footer.has-picture { + display: table; + min-height: 100px; + } + article footer.has-picture .user-picture, article footer.has-picture .submitted { - line-height: 100px; + display: table-cell; + vertical-align: middle; + min-height: 80px; } article footer .arrow-down { display: block; @@ -419,6 +424,9 @@ article footer .arrow-down:after { article.view-mode-full footer { margin-bottom: 50px; } + article footer p.submitted { + font-size: 1.125rem; /* relative size: 18px; */ + } } /******************************************************************************* @@ -454,6 +462,7 @@ article.comment footer a.permalink { *******************************************************************************/ article .content .field-name-field-tags { padding: 0; + margin-bottom: 0; } .field-name-field-tags { @@ -625,6 +634,9 @@ a.feed-icon { .block-on-the-web-social-links a i { color: #007CBA; } +.l-footer .block-on-the-web-social-links a i { + text-align: left; +} .block-on-the-web-social-links a i:first-child { margin-left: 0; } @@ -817,6 +829,10 @@ body.user-form .page-title { /******************************************************************************* * Login form *******************************************************************************/ +#user-login .help p { + font-size: 1.5rem; /* 24px */ + text-align: center; +} #user-login .form-item { padding: 15px 0; margin: 0; @@ -830,24 +846,25 @@ body.user-form .page-title { #user-login .form-required { display: none; } -#user-login .form-item input { - width: 100%; -} #user-login small { margin: 0 10px; display: block; padding-top: 10px; } -@media (min-width: 34em) { /* 544px */ +@media (min-width: 48em) { /* 768px @ 16px font size -- MD */ #user-login { - max-width: 560px; + max-width: 600px; margin: 0 auto 10em auto; text-align: left; } #user-login .form-item { + padding: 20px 0; display: flex; } + #user-login .password-toggle { + top: -1.5em; + } #user-login .form-item label { text-align: right; width: 215px; @@ -859,6 +876,7 @@ body.user-form .page-title { } #user-login .form-item input { width: 390px; + flex: 1; } #user-login small { display: inline; @@ -892,22 +910,26 @@ body.user-form .page-title { max-width: 600px; margin: 0 auto; } -#user-register-form .form-item { - padding: 15px 0; - display: flex; +#user-register-form .help p { + font-size: 1.5rem; /* 24px */ } #user-register-form fieldset .form-item { padding: 5px 0; margin-bottom: .5em; } #user-register-form .form-item label { - width: 180px; padding-right: 15px; - display: inline-block; + line-height: 2.2em; +} +#user-register-form .field-type-text-long label { + width: auto; +} +#user-register-form .form-type-checkbox label { + line-height: 1.25em; } -#user-register-form .form-item input { +#user-register-form .form-item input[type="text"], +#user-register-form .form-item input[type="email"] { width: 100%; - flex: 1; } #user-register-form #edit-contact { margin: 30px 0; @@ -939,14 +961,30 @@ body.user-form .page-title { color: #666; } -@media (max-width: 580px) { +@media (min-width: 48em) { /* 768px @ 16px font size -- MD */ #user-register-form .form-item { - display: block; + display: flex; padding: 10px 0; margin: 0; } - #user-register-form .form-item label { + #user-register-form .field-type-text-long .form-item, + #user-register-form .form-type-checkbox .form-item { + /* undo flex */ display: block; + padding-bottom: 0; + } + #user-register-form .form-item label { + width: 150px; + } + #user-register-form .form-type-checkbox label { + width: auto; + } + #user-register-form .form-item input[type="text"], + #user-register-form .form-item input[type="email"] { + flex: 1; + } + #user-register-form #edit-contact .form-item input { + flex: none; } } diff --git a/www/themes/borg/css/node-project.css b/www/themes/borg/css/node-project.css index 444c81f7f..d34cad3e7 100644 --- a/www/themes/borg/css/node-project.css +++ b/www/themes/borg/css/node-project.css @@ -233,13 +233,19 @@ article.node-project-release.view-mode-project-search article.view-mode-teaser { .node-project .view-project-release-download-table th, .node-project .view-project-release-download-table td { padding: 5px .8em .0 0; +} +.node-project .view-project-release-download-table th { vertical-align: bottom; } +.node-project .view-project-release-download-table td { + vertical-align: top; +} .node-project .view-project-release-download-table .recommended td:first-child a { display: inline-block; margin: 0 .2em 0 0; } -.node-project .view-project-release-download-table .recommended td:first-child a:after { +.node-project .view-project-release-download-table .recommended td:first-child a:after, +.node-project .view-project-release-download-table .supported td:first-child a:after { content: "\f0ab"; font-family: 'FontAwesome'; display: inline-block; diff --git a/www/themes/borg/css/page-front.css b/www/themes/borg/css/page-front.css index 067c6ea64..6bde16133 100644 --- a/www/themes/borg/css/page-front.css +++ b/www/themes/borg/css/page-front.css @@ -98,16 +98,16 @@ body.front .l-content { } body.front .page-title { - font-size: 400%; - padding-bottom: 18px; + font-size: 250%; margin-bottom: 30px; } - -body.front .node-page h1, -body.front .node-page h2, -body.front .node-page h3 { - text-align: center; +@media (min-width: 48em) { /* 768px @ 16px font size -- MD */ + body.front .page-title { + font-size: 400%; + padding-bottom: 18px; + } } + body.front .node-page ul { -webkit-column-count: 2; -moz-column-count: 2; @@ -119,7 +119,6 @@ body.front .node-page ul { @media (min-width: 48em) { /* 768px @ 16px font size -- MD */ body.front .node-page { margin: 0 auto 80px auto; - text-align: center; padding-right: 15px; } } diff --git a/www/themes/borg/template.php b/www/themes/borg/template.php index 1bb59ef6b..4d421d97a 100644 --- a/www/themes/borg/template.php +++ b/www/themes/borg/template.php @@ -74,6 +74,29 @@ function borg_form_user_profile_form_alter(&$form, &$form_state) { $form['redirect']['#weight'] = 23; } +/** + * Implements hook_form_FORM_ID_alter(). + */ +function borg_form_user_register_form_alter(&$form, &$form_state) { + $help = t('Already have an account?') . ' ' . l(t('Log in instead'), 'user/login') . '.'; + $form['login'] = array( + '#type' => 'help', + '#markup' => $help, + '#weight' => -100, + ); +} + +/** + * Implements hook_form_FORM_ID_alter(). + */ +function borg_form_user_login_alter(&$form, &$form_state) { + $help = t('Don\'t have an account yet?') . ' ' . l(t('Create one now'), 'user/register') . '.'; + $form['login'] = array( + '#type' => 'help', + '#markup' => $help, + '#weight' => -100, + ); +} /******************************************************************************* * Preprocess functions: prepare variables for templates. @@ -182,7 +205,7 @@ function borg_preprocess_layout(&$variables) { */ function borg_preprocess_header(&$variables) { $path = backdrop_get_path('theme', 'borg'); - $variables['inverse_logo'] = theme('image', array('uri' => $path . '/logo-inverse.png')); + $variables['logo'] = theme('image', array('uri' => $path . '/logo-inverse.png')); } /** @@ -280,7 +303,7 @@ function borg_preprocess_node(&$variables){ $footer_links['version']['data'] = backdrop_render($version); // Add the latest release date. - $date = format_date($release->node_created, 'short'); + $date = format_date($release->node_project_release_supported_versions_created, 'short'); $latest = array( '#type' => 'markup', '#markup' => '' . t('Released: @date', array('@date' => $date)) . '', @@ -411,45 +434,49 @@ function borg_preprocess_views_view_row_rss(&$variables) { * @see views-view-grid.tpl.php */ function borg_preprocess_views_view_grid(&$variables) { - $view = $variables['view']; - $cols = $view->style_plugin->options['columns']; - $rows = $variables['rows']; - - // These views have the columns stay wider at smaller screensizes. - $sm_grid_views = array('todo'); - - if (in_array($view->name, $sm_grid_views)) { - $column_classes = array( - 1 => 'col-sm-12', - 2 => 'col-sm-6', - 3 => 'col-sm-4', - 4 => 'col-sm-3', - 5 => 'col-sm-5ths', - 6 => 'col-sm-2', - ); - } - else { - $column_classes = array( - 1 => 'col-md-12', - 2 => 'col-md-6', - 3 => 'col-md-4', - 4 => 'col-md-3', - 5 => 'col-md-5ths', - 6 => 'col-md-2', - ); - } + $view = $variables['view']; + + // Add bootstrap grid instead of legacy table. + if ($view->style_plugin->options['deprecated_table']) { + $cols = $view->style_plugin->options['columns']; + $rows = $variables['rows']; + + // These views have the columns stay wider at smaller screensizes. + $sm_grid_views = array(); // @todo + + if (in_array($view->name, $sm_grid_views)) { + $column_classes = array( + 1 => 'col-sm-12', + 2 => 'col-sm-6', + 3 => 'col-sm-4', + 4 => 'col-sm-3', + 5 => 'col-sm-5ths', + 6 => 'col-sm-2', + ); + } + else { + $column_classes = array( + 1 => 'col-md-12', + 2 => 'col-md-6', + 3 => 'col-md-4', + 4 => 'col-md-3', + 5 => 'col-md-5ths', + 6 => 'col-md-2', + ); + } - $col_class = $column_classes[$cols]; + $col_class = $column_classes[$cols]; - // Apply the radix classes - foreach ($rows as $row_number => $row) { - $variables['row_classes'][$row_number][] = 'row'; - $variables['row_classes'][$row_number][] = 'row-fluid'; - foreach ($rows[$row_number] as $column_number => $item) { - $variables['column_classes'][$row_number][$column_number][] = $col_class; + // Apply the radix classes + foreach ($rows as $row_number => $row) { + $variables['row_classes'][$row_number][] = 'row'; + $variables['row_classes'][$row_number][] = 'row-fluid'; + foreach ($rows[$row_number] as $column_number => $item) { + $variables['column_classes'][$row_number][$column_number][] = $col_class; + } } + $variables['classes'][] = 'container-fluid'; } - $variables['classes'][] = 'container-fluid'; } /** @@ -461,14 +488,14 @@ function borg_preprocess_book_navigation(&$variables) { if ($book_link['mlid']) { // Change the previous link. - if ($prev = borg_book_prev($book_link)) { - $prev_href = url($prev['href']); - backdrop_add_html_head_link(array('rel' => 'prev', 'href' => $prev_href)); - $variables['prev_url'] = $prev_href; - $variables['prev_title'] = check_plain($prev['title']); + if ($previous = _borg_book_prev($book_link)) { + $previous_href = url($previous['href']); + backdrop_add_html_head_link(array('rel' => 'prev', 'href' => $previous_href)); + $variables['prev_url'] = $previous_href; + $variables['prev_title'] = check_plain($previous['title']); } // Change the next link. - if ($next = borg_book_next($book_link)) { + if ($next = _borg_book_next($book_link)) { $next_href = url($next['href']); backdrop_add_html_head_link(array('rel' => 'next', 'href' => $next_href)); $variables['next_url'] = $next_href; @@ -497,13 +524,14 @@ function borg_preprocess_book_navigation(&$variables) { ******************************************************************************/ /** - * Overrides theme_book_prev(). + * Replaces book_prev(). */ -function borg_book_prev($book_link) { +function _borg_book_prev($book_link) { // If the parent is zero, we are at the start of a book. if ($book_link['plid'] == 0) { return NULL; } + $flat = book_get_flat_menu($book_link); // Remove child pages from next/prev links. foreach ($flat as $key => $item) { @@ -512,20 +540,20 @@ function borg_book_prev($book_link) { } } - // Assigning the array to $flat resets the array pointer for use with each(). - $curr = NULL; - do { - $prev = $curr; - list($key, $curr) = each($flat); - } while ($key && $key != $book_link['mlid']); + $current = NULL; + foreach ($flat as $key => $current) { + if ($key != $book_link['mlid']) { + $previous = $current; + } + } - return $prev; + return $previous; } /** - * Overrides theme_book_next(). + * Replaces book_next(). */ -function borg_book_next($book_link) { +function _borg_book_next($book_link) { $flat = book_get_flat_menu($book_link); // Remove child pages from next/prev links. foreach ($flat as $key => $item) { @@ -534,14 +562,10 @@ function borg_book_next($book_link) { } } - // Assigning the array to $flat resets the array pointer for use with each(). - do { - list($key, $curr) = each($flat); - } - while ($key && $key != $book_link['mlid']); - - if ($key == $book_link['mlid']) { - return current($flat); + foreach ($flat as $key => $current) { + if ($key == $book_link['mlid']) { + return current($flat); + } } } @@ -751,39 +775,6 @@ function borg_menu_tree__user_menu($variables) { return $output; } -/** - * Overrides theme_menu_link(). - */ -function borg_menu_link(array $variables) { - $element = $variables['element']; - $sub_menu = ''; - - if ($element['#below']) { - $sub_menu = backdrop_render($element['#below']); - } - - $menu_name = isset($element['#original_link']['menu_name']) ? $element['#original_link']['menu_name'] : NULL; - if ($menu_name === 'main-menu' || $menu_name === 'menu-handbook') { - // If this is the handbook link and we're on a book page, set an active class. - if ($element['#href'] === 'node/1') { - $node = menu_get_object(); - if (isset($node) && isset($node->type) && $node->type === 'book') { - $element['#attributes']['class'][] = 'active'; - } - } - } - - if ($menu_name === 'main-menu' && ($element['#href'] == 'https://forum.backdropcms.org' || - $element['#href'] == 'https://api.backdropcms.org')) { - $title = check_plain($element['#title']); - $element['#title'] = $title . ' '; - $element['#localized_options']['html'] = TRUE; - } - - $output = l($element['#title'], $element['#href'], $element['#localized_options']); - return '' . $output . $sub_menu . "\n"; -} - /** * Overrides theme_feed_icon(). */ diff --git a/www/themes/borg/templates/block--views--showcase-block-1.tpl.php b/www/themes/borg/templates/block--views--showcase-block-1.tpl.php deleted file mode 100644 index fac9d1742..000000000 --- a/www/themes/borg/templates/block--views--showcase-block-1.tpl.php +++ /dev/null @@ -1,26 +0,0 @@ - -
> - - - -

- - - -
- -
-
diff --git a/www/themes/borg/templates/header.tpl.php b/www/themes/borg/templates/header.tpl.php index cb6bf5e77..377acdba2 100644 --- a/www/themes/borg/templates/header.tpl.php +++ b/www/themes/borg/templates/header.tpl.php @@ -19,16 +19,18 @@ * - $menu: The menu for the header (if any), as an HTML string. */ ?> - - - +backdrop - + + + + +
diff --git a/www/themes/borg/templates/views-view-grid--showcase.tpl.php b/www/themes/borg/templates/views-view-grid--showcase.tpl.php deleted file mode 100644 index cfee9255a..000000000 --- a/www/themes/borg/templates/views-view-grid--showcase.tpl.php +++ /dev/null @@ -1,36 +0,0 @@ - - -

- -
> - $columns): ?> -
> - $item): ?> - -
> -
- -
-
- - -
- -
diff --git a/www/themes/borg/templates/views-view-grid.tpl.php b/www/themes/borg/templates/views-view-grid.tpl.php index e90832666..eaf100561 100644 --- a/www/themes/borg/templates/views-view-grid.tpl.php +++ b/www/themes/borg/templates/views-view-grid.tpl.php @@ -19,14 +19,27 @@

+ +
> - $columns): ?> -
> - $item): ?> -
> - -
- + $row): ?> +
> +
+ + + +
> + $columns): ?> +
> + $item): ?> +
> + +
+ +
+ +
+