Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/settings/general.page.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@
<tr>
<td class="wfieldname">
<label for="jpcrm_showpoweredby_admin"><?php esc_html_e( 'Show admin credits', 'zero-bs-crm' ); ?>:</label><br />
<?php esc_html_e( 'Show "Powered by Jetpack CRM" footers on backend admin pages.', 'zero-bs-crm' ); ?>
<?php esc_html_e( 'Show the Jetpack and Automattic logos in the footer of backend admin pages.', 'zero-bs-crm' ); ?>
</td>
<td style="width:540px">
<input type="checkbox" class="winput form-control" name="jpcrm_showpoweredby_admin" id="jpcrm_showpoweredby_admin" value="1"<?php echo isset( $settings['showpoweredby_admin'] ) && $settings['showpoweredby_admin'] === 0 ? '' : ' checked="checked"'; ?> />
Expand Down
10 changes: 7 additions & 3 deletions includes/ZeroBSCRM.AdminStyling.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function zeroBSCRM_improvedPostMsgsTransactions( $messages ) {
WordPress Footer Msg
====================================================== */

// } Footer Text
// } Footer Text (left) - Jetpack logo + wordmark, matching the unified Jetpack admin footer
function jpcrm_footer_credit_thanks( $content ) {

// return original text if not on a CRM page
Expand All @@ -194,7 +194,8 @@ function jpcrm_footer_credit_thanks( $content ) {
global $zbs;
$showpoweredby_admin = $zbs->settings->get( 'showpoweredby_admin' ) === 1 ? true : false;
if ( $showpoweredby_admin ) {
return '<span id="footer-thankyou">' . sprintf( __( 'Thank you for using <a href="%s">Jetpack CRM</a>.', 'zero-bs-crm' ), $zbs->urls['home'] ) . '</span>';
$jetpack_logo = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="16" height="16" aria-hidden="true" focusable="false"><path fill="#069e08" d="M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"/></svg>';
return '<span class="jetpack-footer__logo">' . $jetpack_logo . '<span class="jetpack-footer__logo-text">Jetpack</span></span>';
}
##/WLREMOVE

Expand All @@ -203,6 +204,7 @@ function jpcrm_footer_credit_thanks( $content ) {
}
add_filter( 'admin_footer_text', 'jpcrm_footer_credit_thanks' );

// } Footer Text (right) - Automattic "by line" logo, matching the unified Jetpack admin footer
function jpcrm_footer_credit_version( $content ) {

// return original text if not on a CRM page
Expand All @@ -214,7 +216,9 @@ function jpcrm_footer_credit_version( $content ) {
global $zbs;
$showpoweredby_admin = $zbs->settings->get( 'showpoweredby_admin' ) === 1 ? true : false;
if ( $showpoweredby_admin ) {
return sprintf( 'Jetpack CRM v%s', $zbs::VERSION );
$byline_title = esc_attr__( 'An Automattic Airline', 'zero-bs-crm' );
$byline_svg = '<svg role="img" x="0" y="0" viewBox="0 0 935 38.2" height="8" aria-hidden="true" focusable="false" class="jp-automattic-byline-logo"><path d="M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z"/><path d="M37.5 36.7l-4.7-8.9H11.7l-4.6 8.9H0L19.4 0.8H25l19.7 35.9H37.5zM22 7.8l-7.8 15.1h15.9L22 7.8zM82.8 36.7l-23.3-24 -2.3-2.5v26.6h-6.7v-36H57l22.6 24 2.3 2.6V0.8h6.7v35.9H82.8z"/><path d="M719.9 37l-4.8-8.9H694l-4.6 8.9h-7.1l19.5-36h5.6l19.8 36H719.9zM704.4 8l-7.8 15.1h15.9L704.4 8zM733 37V1h6.8v36H733zM781 37c-1.8 0-2.6-2.5-2.9-5.8l-0.2-3.7c-0.2-3.6-1.7-5.1-8.4-5.1h-12.8V37H750V1h19.6c10.8 0 15.7 4.3 15.7 9.9 0 3.9-2 7.7-9 9 7 0.5 8.5 3.7 8.6 7.9l0.1 3c0.1 2.5 0.5 4.3 2.2 6.1V37H781zM778.5 11.8c0-2.6-2.1-5.1-7.9-5.1h-13.8v10.8h14.4c5 0 7.3-2.4 7.3-5.2V11.8zM794.8 37V1h6.8v30.4h28.2V37H794.8zM836.7 37V1h6.8v36H836.7zM886.2 37l-23.4-24.1 -2.3-2.5V37h-6.8V1h6.5l22.7 24.1 2.3 2.6V1h6.8v36H886.2zM902.3 37V1H935v5.6h-26v9.2h20v5.5h-20v10.1h26V37H902.3z"/></svg>';
return '<a class="jetpack-footer__a8c" href="https://jetpack.com/redirect/?source=a8c-about" target="_blank" rel="noopener noreferrer" aria-label="' . $byline_title . '">' . $byline_svg . '</a>';
}
##/WLREMOVE

Expand Down
88 changes: 88 additions & 0 deletions sass/emerald/_jpcrm_footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
body.jpcrm-admin {

// Only restyle the footer when our branded footer content is present. When the
// "powered by" setting is off (or under white label) #wpfooter is left empty and
// keeps its default WordPress appearance.
#wpfooter:has( .jetpack-footer__logo ) {
align-items: center;
background-color: var(--wpds-color-bg-surface-neutral, var(--wpds-color-background-surface-neutral, #fcfcfc));
border-top: var(--wpds-border-width-xs, 1px) solid var(--wpds-color-stroke-surface-neutral-weak, #e4e4e4);
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
font-size: var(--wpds-typography-font-size-md, 13px);
gap: var(--wpds-dimension-gap-xl, 24px);
padding: var(--wpds-dimension-padding-xl, 20px) var(--wpds-dimension-padding-2xl, 24px);

// Wide footer: single row, Automattic by line pushed to the far right.
#footer-upgrade {
margin-inline-start: auto;
}

// WordPress core outputs an empty <div class="clear"> inside #wpfooter;
// as a flex item it would add a trailing gap that pushes the by line off
// the right edge, so drop it out of the layout.
.clear {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to do this? I don't see a element with a clear class that was added.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keen eye! If it stays visible, it becomes a trailing flex item and the gap pushes the Automattic byline 24px off the right edge. So the rule is doing real work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment to make it clear, but we can remove that as well

display: none;
}
}

// Below 782px WordPress core hides #wpfooter (common.css), but the base rule
// above keeps it shown — specificity (1,2,1) vs core's (1,0,0), and no media
// query — which is why these mobile rules are reachable at all. Core's
// `.auto-fold #wpfooter` also leaves a 36px icon-menu margin here (admin-menu.css,
// @media max-width: 960px); drop it so the footer sits flush with the screen edge.
@media ( max-width: 782px ) {

#wpfooter:has( .jetpack-footer__logo ) {
margin: 0;
}
}

// Phones: stack the logo and the Automattic by line onto their own left-aligned
// rows, matching the unified Jetpack footer. Unlike that footer we have no
// middle nav links to force the wrap, so we stack explicitly.
@media ( max-width: 480px ) {

#wpfooter:has( .jetpack-footer__logo ) {

#footer-left,
#footer-upgrade {
flex-basis: 100%;
}

#footer-upgrade {
margin-inline-start: 0;
}
}
}

// Left: Jetpack logo + wordmark.
.jetpack-footer__logo {
align-items: center;
display: inline-flex;
gap: 8px;

svg {
display: block;
flex-shrink: 0;
}
}

.jetpack-footer__logo-text {
color: var(--wpds-color-fg-content-neutral, var(--wpds-color-foreground-content-neutral, #1e1e1e));
font-size: var(--wpds-typography-font-size-md, 13px);
line-height: 1;
}

// Right: Automattic "by line".
a.jetpack-footer__a8c {
align-items: center;
display: inline-flex;

svg {
display: block;
fill: var(--wpds-color-fg-interactive-neutral-weak, var(--wpds-color-foreground-interactive-neutral-weak, #707070));
}
}
}
3 changes: 3 additions & 0 deletions sass/jpcrm-emerald.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
/* top menu */
@use "emerald/jpcrm_top_menu";

/* footer */
@use "emerald/jpcrm_footer";

/* components */
@use "emerald/buttons";
@use "emerald/dashcard";
Expand Down