Skip to content

Commit

Permalink
Update notices for Pod Pages and add another inline notice for Pod Te…
Browse files Browse the repository at this point in the history
…mplates
  • Loading branch information
sc0ttkclark committed Sep 29, 2024
1 parent 86ef953 commit 0d52502
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function register_config() {
'name' => 'code_php_notice',
'type' => 'html',
'html_content' => sprintf(
'<p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p>',
'<div class="pods-ui-notice-admin pods-ui-notice-warning"><p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p></div>',
__( 'PHP detected, this feature is deprecated', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
__( 'Switch to file-based Pod Pages', 'pods' )
Expand Down Expand Up @@ -233,7 +233,7 @@ public function register_config() {
'name' => 'precode_notice',
'type' => 'html',
'html_content' => sprintf(
'<p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p>',
'<div class="pods-ui-notice-admin pods-ui-notice-warning"><p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p></div>',
__( 'Precode detected, this feature is deprecated', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
__( 'Switch to file-based Pod Pages', 'pods' )
Expand Down
14 changes: 7 additions & 7 deletions components/Templates/assets/js/scripts-view_template.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
jQuery( 'document' ).ready( function ( $ ) {
$( "#view_template .inside" ).resizable( {
alsoResize : ".CodeMirror", resize : function () {
if ( typeof htmleditor !== 'undefined' ) {
jQuery('document').ready(function ($) {
$("#view_template .inside").resizable({
alsoResize: ".CodeMirror", resize: function () {
if (typeof htmleditor !== 'undefined') {
htmleditor.refresh();
$( '#view_template .inside,.CodeMirror' ).css( 'width', 'auto' );
$('#view_template .inside,.CodeMirror').css('width', 'auto');
}
}
} );
} );
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
?>
<?php else : ?>
<p><?php esc_html_e( 'Selecting a Pod will allow you to see the list of available magic tags that can be used in your template code.', 'pods' ); ?></p>
<p><strong><?php esc_html_e( 'Example', 'pods' ); ?>: <code>{@field_name}</code></p>
<p><strong><?php esc_html_e( 'Example', 'pods' ); ?>:</strong> <code>{@field_name}</code></p>
<p><?php esc_html_e( 'Save your Pod Template to have the reference update here.', 'pods' ); ?></p>
<?php
endif;
11 changes: 10 additions & 1 deletion components/Templates/includes/element-view_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@
}
?>
<?php if ( $has_php ) : ?>
<?php pods_deprecated( 'Pod Template PHP code has been deprecated, please use WP Templates instead of embedding PHP.', '2.3' ); ?>
<?php
pods_deprecated( 'Pod Template PHP code has been deprecated, please use WP Templates instead of embedding PHP.', '2.3' );

printf(
'<div class="pods-ui-notice-admin pods-ui-notice-warning"><p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p></div>',
__( 'PHP detected, this feature is deprecated', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
__( 'Switch to file-based Pod Pages', 'pods' )
);
?>

<?php if ( PODS_DISABLE_EVAL ) : ?>
<?php
Expand Down
2 changes: 1 addition & 1 deletion ui/styles/dist/pods-form.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/styles/dist/pods.css

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions ui/styles/src/base/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@
}
}

.pods-ui-notice-admin {
background: #fff;
border: 1px solid #c3c4c7;
border-left-width: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
margin: 5px 0 15px;
padding: 1px 12px;

&.pods-ui-notice-error {
border-left-color: #d63638;
}

&.pods-ui-notice-warning {
border-left-color: #dba617;
}

&.pods-ui-notice-success {
border-left-color: #00a32a;
}

p {
margin: .5em 0;
padding: 2px;
}
}

.pods-form-front-success {
color: #4F8A10;
Expand Down

0 comments on commit 0d52502

Please sign in to comment.