Skip to content

Commit

Permalink
Add some instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed May 1, 2022
1 parent 41cd6f6 commit 5481a45
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
3 changes: 3 additions & 0 deletions friends-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ span#friends_enable_retention_days_line, span#friends_enable_retention_number_li
display: block;
}

ul.friend-suggestions {
margin: 0;
}
ul.friend-suggestions li {
display: inline-block;
margin-right: 1em;
Expand Down
2 changes: 1 addition & 1 deletion friends-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ jQuery( function( $ ) {
search: search
} ).done( function( response ) {
if ( response.data ) {
$( 'tr.friend-suggestions' ).show().find( 'td' ).html( response.data.content ).show();
$( 'tr.friend-suggestions' ).show().find( 'div' ).html( response.data.content ).show();
} else {
$( 'tr.friend-suggestions' ).hide();
}
Expand Down
25 changes: 18 additions & 7 deletions templates/admin/add-friend.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

$quick_subscribe = _x( 'Quick Subscribe', 'button', 'friends' );

$links = get_bookmarks(
array(
'orderby' => 'updated',
Expand Down Expand Up @@ -36,16 +37,26 @@
</p>
</td>
</tr>
<tr class="friend-suggestions" data-nonce="<?php echo esc_attr( wp_create_nonce( 'friends-links' ) ); ?>" style="display: <?php echo empty( $links ) ? 'none' : 'table-row'; ?>">
<tr class="friend-suggestions" data-nonce="<?php echo esc_attr( wp_create_nonce( 'friends-links' ) ); ?>">
<th scope="row"><?php esc_html_e( 'Suggestions', 'friends' ); ?></label></th>
<td>
<?php
if ( ! empty( $links ) ) {
Friends\Friends::template_loader()->get_template_part( 'admin/links', null, array( 'links' => $links ) );
}
?>
<div>
<?php
if ( empty( $links ) ) {
esc_html_e( 'No suggestions available. You can import an OPML.', 'friends' );
} else {
Friends\Friends::template_loader()->get_template_part( 'admin/links', null, array( 'links' => $links ) );
}
?>
</div>
<p class="description" id="friend-suggestions">

<?php
printf(
// translators: %s is a URL.
__( 'You can manage the available suggestions in the <a href="%s">Link Manager</a>.', 'friends' ),
esc_url( self_admin_url( 'link-manager.php' ) )
);
?>
</p>
</td>
</tr>
Expand Down

0 comments on commit 5481a45

Please sign in to comment.