Skip to content

Commit

Permalink
Move record actions outside of filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Carbis committed Jun 27, 2016
1 parent 591ce49 commit 71e6ac1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
19 changes: 15 additions & 4 deletions classes/class-list-table.php
Expand Up @@ -57,9 +57,6 @@ function extra_tablenav( $which ) {
if ( 'top' === $which ) { if ( 'top' === $which ) {
echo $this->filters_form(); // xss ok echo $this->filters_form(); // xss ok
} }
if ( 'bottom' === $which ) {
echo $this->record_actions_form(); // xss ok
}
} }


function no_items() { function no_items() {
Expand Down Expand Up @@ -840,7 +837,18 @@ function record_actions_form() {
} }
echo '</select></div>'; echo '</select></div>';
wp_nonce_field( 'stream_record_actions_nonce', 'stream_record_actions_nonce' ); wp_nonce_field( 'stream_record_actions_nonce', 'stream_record_actions_nonce' );

printf( '<input type="hidden" name="page" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'page' ) ) );
printf( '<input type="hidden" name="date_predefined" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'date_predefined' ) ) );
printf( '<input type="hidden" name="date_from" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'date_from' ) ) );
printf( '<input type="hidden" name="date_to" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'date_to' ) ) );
printf( '<input type="hidden" name="user_id" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'user_id' ) ) );
printf( '<input type="hidden" name="connector" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'connector' ) ) );
printf( '<input type="hidden" name="context" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'context' ) ) );
printf( '<input type="hidden" name="action" value="%s">', esc_attr( wp_stream_filter_input( INPUT_GET, 'action' ) ) );

printf( '<input type="submit" name="" id="record-actions-submit" class="button" value="%s">', esc_attr__( 'Apply', 'stream' ) ); printf( '<input type="submit" name="" id="record-actions-submit" class="button" value="%s">', esc_attr__( 'Apply', 'stream' ) );
echo '<div class="clear"></div>';


return ob_get_clean(); return ob_get_clean();
} }
Expand All @@ -850,9 +858,12 @@ function display() {


echo '<form method="get" action="' . esc_url( $url ) . '" id="record-filter-form">'; echo '<form method="get" action="' . esc_url( $url ) . '" id="record-filter-form">';
echo $this->filter_search(); // xss ok echo $this->filter_search(); // xss ok

parent::display(); parent::display();
echo '</form>'; echo '</form>';

echo '<form method="get" action="' . esc_url( $url ) . '" id="record-actions-form">';
echo $this->record_actions_form(); // xss ok
echo '</form>';
} }


function display_tablenav( $which ) { function display_tablenav( $which ) {
Expand Down
14 changes: 12 additions & 2 deletions ui/css/admin.css
Expand Up @@ -4,8 +4,13 @@
padding-top: 6px; padding-top: 6px;
} }


.toplevel_page_wp_stream .tablenav.bottom .button { .toplevel_page_wp_stream #record-actions-form {
margin-right: 6px; margin-top: -32px;
}

.toplevel_page_wp_stream #record-actions-form .button {
margin-left: 6px;
float: left;
} }


.toplevel_page_wp_stream .tablenav .actions { .toplevel_page_wp_stream .tablenav .actions {
Expand Down Expand Up @@ -482,6 +487,11 @@
} }


@media screen and ( max-width: 782px ) { @media screen and ( max-width: 782px ) {
.toplevel_page_wp_stream #record-actions-form {
margin-top: 0;
margin-bottom: 35px;
}

.wp_stream_settings .stream-exclude-list td, .wp_stream_settings .stream-exclude-list td,
.wp_stream_network_settings .stream-exclude-list td, .wp_stream_network_settings .stream-exclude-list td,
.wp_stream_default_settings .stream-exclude-list td { .wp_stream_default_settings .stream-exclude-list td {
Expand Down
4 changes: 2 additions & 2 deletions ui/js/exclude.js
Expand Up @@ -129,7 +129,7 @@ jQuery( function( $ ) {
} }
}, },
templateResult: function( object ) { templateResult: function( object ) {
var $result = $( '<div>' ).text( object.text ); var $result = $( '<div>' ).text( object.text );


if ( 'undefined' !== typeof object.icon && object.icon ) { if ( 'undefined' !== typeof object.icon && object.icon ) {
$result.prepend( $( '<img src="' + object.icon + '" class="wp-stream-select2-icon">' ) ); $result.prepend( $( '<img src="' + object.icon + '" class="wp-stream-select2-icon">' ) );
Expand All @@ -148,7 +148,7 @@ jQuery( function( $ ) {
return $result; return $result;
}, },
templateSelection: function( object ) { templateSelection: function( object ) {
var $result = $( '<div>' ).text( object.text ); var $result = $( '<div>' ).text( object.text );


if ( $.isNumeric( object.id ) && object.text.indexOf( 'icon-users' ) < 0 ) { if ( $.isNumeric( object.id ) && object.text.indexOf( 'icon-users' ) < 0 ) {
$result.append( $( '<i class="icon16 icon-users"></i>' ) ); $result.append( $( '<i class="icon16 icon-users"></i>' ) );
Expand Down

0 comments on commit 71e6ac1

Please sign in to comment.