Merge pull request #475 from mailpoet/uniform_listings

bulk actions / pagination and customizable limit per page for all
This commit is contained in:
Tautvidas Sipavičius
2016-05-16 13:37:14 +03:00
10 changed files with 238 additions and 146 deletions

View File

@ -71,6 +71,14 @@ const messages = {
} }
}; };
const bulk_actions = [
{
name: 'trash',
label: MailPoet.I18n.t('trash'),
onSuccess: messages.onTrash
}
];
const item_actions = [ const item_actions = [
{ {
name: 'edit', name: 'edit',
@ -158,14 +166,15 @@ const FormList = React.createClass({
</h1> </h1>
<Listing <Listing
limit={ mailpoet_listing_per_page }
location={ this.props.location } location={ this.props.location }
params={ this.props.params } params={ this.props.params }
messages={ messages } messages={ messages }
search={ false } search={ false }
limit={ 1000 }
endpoint="forms" endpoint="forms"
onRenderItem={ this.renderItem } onRenderItem={ this.renderItem }
columns={ columns } columns={ columns }
bulk_actions={ bulk_actions }
item_actions={ item_actions } item_actions={ item_actions }
/> />
</div> </div>

View File

@ -733,6 +733,7 @@ define(
{ search } { search }
<div className="tablenav top clearfix"> <div className="tablenav top clearfix">
<ListingBulkActions <ListingBulkActions
count={ this.state.count }
bulk_actions={ bulk_actions } bulk_actions={ bulk_actions }
selection={ this.state.selection } selection={ this.state.selection }
selected_ids={ this.state.selected_ids } selected_ids={ this.state.selected_ids }
@ -795,6 +796,7 @@ define(
</table> </table>
<div className="tablenav bottom"> <div className="tablenav bottom">
<ListingBulkActions <ListingBulkActions
count={ this.state.count }
bulk_actions={ bulk_actions } bulk_actions={ bulk_actions }
selection={ this.state.selection } selection={ this.state.selection }
selected_ids={ this.state.selected_ids } selected_ids={ this.state.selected_ids }

View File

@ -292,6 +292,7 @@ define(
</h1> </h1>
<Listing <Listing
limit={ mailpoet_listing_per_page }
params={ this.props.params } params={ this.props.params }
endpoint="newsletters" endpoint="newsletters"
onRenderItem={this.renderItem} onRenderItem={this.renderItem}

View File

@ -88,6 +88,14 @@ const messages = {
} }
}; };
const bulk_actions = [
{
name: 'trash',
label: MailPoet.I18n.t('trash'),
onSuccess: messages.onTrash
}
];
const item_actions = [ const item_actions = [
{ {
name: 'edit', name: 'edit',
@ -218,14 +226,15 @@ const SegmentList = React.createClass({
</h1> </h1>
<Listing <Listing
limit={ mailpoet_listing_per_page }
location={ this.props.location } location={ this.props.location }
params={ this.props.params } params={ this.props.params }
messages={ messages } messages={ messages }
search={ false } search={ false }
limit={ 1000 }
endpoint="segments" endpoint="segments"
onRenderItem={ this.renderItem } onRenderItem={ this.renderItem }
columns={ columns } columns={ columns }
bulk_actions={ bulk_actions }
item_actions={ item_actions } item_actions={ item_actions }
/> />
</div> </div>

262
composer.lock generated
View File

@ -251,16 +251,16 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v5.2.14", "version": "v5.2.15",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "e774bc9152de85547336e22b8926189e582ece95" "reference": "d0186171b28af4f06ac2ad8a84a8f3d6cbc3ba6c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e774bc9152de85547336e22b8926189e582ece95", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/d0186171b28af4f06ac2ad8a84a8f3d6cbc3ba6c",
"reference": "e774bc9152de85547336e22b8926189e582ece95", "reference": "d0186171b28af4f06ac2ad8a84a8f3d6cbc3ba6c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -271,8 +271,7 @@
"phpunit/phpunit": "4.7.*" "phpunit/phpunit": "4.7.*"
}, },
"suggest": { "suggest": {
"league/oauth2-client": "Needed for XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication"
"league/oauth2-google": "Needed for Gmail XOAUTH2"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -308,7 +307,7 @@
} }
], ],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2015-11-01 10:15:28" "time": "2016-05-10 18:39:36"
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",
@ -494,16 +493,16 @@
}, },
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
"version": "v5.4.1", "version": "v5.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/swiftmailer/swiftmailer.git", "url": "https://github.com/swiftmailer/swiftmailer.git",
"reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" "reference": "d8db871a54619458a805229a057ea2af33c753e8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/d8db871a54619458a805229a057ea2af33c753e8",
"reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", "reference": "d8db871a54619458a805229a057ea2af33c753e8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -543,7 +542,7 @@
"mail", "mail",
"mailer" "mailer"
], ],
"time": "2015-06-06 14:19:39" "time": "2016-05-01 08:45:47"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
@ -606,16 +605,16 @@
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/translation.git",
"reference": "b7b4ebadd2b5e614ff7d2d6fc63e0ed0578909c7" "reference": "d60b8e076d22953aabebeebda53bf334438e7aca"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/b7b4ebadd2b5e614ff7d2d6fc63e0ed0578909c7", "url": "https://api.github.com/repos/symfony/translation/zipball/d60b8e076d22953aabebeebda53bf334438e7aca",
"reference": "b7b4ebadd2b5e614ff7d2d6fc63e0ed0578909c7", "reference": "d60b8e076d22953aabebeebda53bf334438e7aca",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -666,7 +665,7 @@
], ],
"description": "Symfony Translation Component", "description": "Symfony Translation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-02 09:49:18" "time": "2016-03-25 01:40:30"
}, },
{ {
"name": "tburry/pquery", "name": "tburry/pquery",
@ -785,16 +784,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "codeception/codeception", "name": "codeception/codeception",
"version": "2.1.7", "version": "2.1.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Codeception/Codeception.git", "url": "https://github.com/Codeception/Codeception.git",
"reference": "65971b0dee4972710365b6102154cd412a9bf7b1" "reference": "f3daa61f0f11c531b33eb3623ab0daa599d88a79"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/65971b0dee4972710365b6102154cd412a9bf7b1", "url": "https://api.github.com/repos/Codeception/Codeception/zipball/f3daa61f0f11c531b33eb3623ab0daa599d88a79",
"reference": "65971b0dee4972710365b6102154cd412a9bf7b1", "reference": "f3daa61f0f11c531b33eb3623ab0daa599d88a79",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -862,7 +861,7 @@
"functional testing", "functional testing",
"unit testing" "unit testing"
], ],
"time": "2016-03-12 01:15:25" "time": "2016-04-15 02:56:43"
}, },
{ {
"name": "codeception/verify", "name": "codeception/verify",
@ -899,16 +898,16 @@
}, },
{ {
"name": "codegyre/robo", "name": "codegyre/robo",
"version": "0.7.1", "version": "0.7.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Codegyre/Robo.git", "url": "https://github.com/Codegyre/Robo.git",
"reference": "1f4e0621fdc37521e2eaca67f33d1c4e240dc7d8" "reference": "9982edecb19f59420031dd9855b0d31e861b8b68"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Codegyre/Robo/zipball/1f4e0621fdc37521e2eaca67f33d1c4e240dc7d8", "url": "https://api.github.com/repos/Codegyre/Robo/zipball/9982edecb19f59420031dd9855b0d31e861b8b68",
"reference": "1f4e0621fdc37521e2eaca67f33d1c4e240dc7d8", "reference": "9982edecb19f59420031dd9855b0d31e861b8b68",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -950,7 +949,7 @@
} }
], ],
"description": "Modern task runner", "description": "Modern task runner",
"time": "2016-02-25 19:28:51" "time": "2016-04-13 20:14:17"
}, },
{ {
"name": "doctrine/instantiator", "name": "doctrine/instantiator",
@ -1051,16 +1050,16 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "6.1.1", "version": "6.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" "reference": "d094e337976dff9d8e2424e8485872194e768662"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662",
"reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", "reference": "d094e337976dff9d8e2424e8485872194e768662",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1076,7 +1075,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "6.1-dev" "dev-master": "6.2-dev"
} }
}, },
"autoload": { "autoload": {
@ -1109,7 +1108,7 @@
"rest", "rest",
"web service" "web service"
], ],
"time": "2015-11-23 00:47:50" "time": "2016-03-21 20:02:09"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
@ -1164,16 +1163,16 @@
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "1.2.3", "version": "1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b" "reference": "31382fef2889136415751badebbd1cb022a4ed72"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b", "url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72",
"reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b", "reference": "31382fef2889136415751badebbd1cb022a4ed72",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1218,7 +1217,7 @@
"stream", "stream",
"uri" "uri"
], ],
"time": "2016-02-18 21:54:00" "time": "2016-04-13 19:56:01"
}, },
{ {
"name": "henrikbjorn/lurker", "name": "henrikbjorn/lurker",
@ -1976,16 +1975,16 @@
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
"version": "1.3.5", "version": "1.3.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" "reference": "2292b116f43c272ff4328083096114f84ea46a56"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2292b116f43c272ff4328083096114f84ea46a56",
"reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", "reference": "2292b116f43c272ff4328083096114f84ea46a56",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2022,7 +2021,7 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"time": "2016-02-26 18:40:46" "time": "2016-05-04 07:59:13"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
@ -2231,16 +2230,16 @@
}, },
{ {
"name": "symfony/browser-kit", "name": "symfony/browser-kit",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/browser-kit.git", "url": "https://github.com/symfony/browser-kit.git",
"reference": "dde849a0485b70a24b36f826ed3fb95b904d80c3" "reference": "e07127ac31230b30887c2dddf3708d883d239b14"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/dde849a0485b70a24b36f826ed3fb95b904d80c3", "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e07127ac31230b30887c2dddf3708d883d239b14",
"reference": "dde849a0485b70a24b36f826ed3fb95b904d80c3", "reference": "e07127ac31230b30887c2dddf3708d883d239b14",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2284,20 +2283,20 @@
], ],
"description": "Symfony BrowserKit Component", "description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-01-27 11:34:55" "time": "2016-03-04 07:55:57"
}, },
{ {
"name": "symfony/config", "name": "symfony/config",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/config.git", "url": "https://github.com/symfony/config.git",
"reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19" "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19", "url": "https://api.github.com/repos/symfony/config/zipball/edbbcf33cffa2a85104fc80de8dc052cc51596bb",
"reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19", "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2337,20 +2336,20 @@
], ],
"description": "Symfony Config Component", "description": "Symfony Config Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-22 16:12:45" "time": "2016-04-20 18:52:26"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04" "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/2ed5e2706ce92313d120b8fe50d1063bcfd12e04", "url": "https://api.github.com/repos/symfony/console/zipball/34a214710e0714b6efcf40ba3cd1e31373a97820",
"reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04", "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2397,20 +2396,20 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-28 16:24:34" "time": "2016-04-28 09:48:42"
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/css-selector.git", "url": "https://github.com/symfony/css-selector.git",
"reference": "6605602690578496091ac20ec7a5cbd160d4dff4" "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/6605602690578496091ac20ec7a5cbd160d4dff4", "url": "https://api.github.com/repos/symfony/css-selector/zipball/65e764f404685f2dc20c057e889b3ad04b2e2db0",
"reference": "6605602690578496091ac20ec7a5cbd160d4dff4", "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2450,20 +2449,20 @@
], ],
"description": "Symfony CssSelector Component", "description": "Symfony CssSelector Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-01-27 05:14:46" "time": "2016-03-04 07:55:57"
}, },
{ {
"name": "symfony/dom-crawler", "name": "symfony/dom-crawler",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/dom-crawler.git", "url": "https://github.com/symfony/dom-crawler.git",
"reference": "981c8edb4538f88ba976ed44bdcaa683fce3d6c6" "reference": "49b588841225b205700e5122fa01911cabada857"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/981c8edb4538f88ba976ed44bdcaa683fce3d6c6", "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/49b588841225b205700e5122fa01911cabada857",
"reference": "981c8edb4538f88ba976ed44bdcaa683fce3d6c6", "reference": "49b588841225b205700e5122fa01911cabada857",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2506,20 +2505,20 @@
], ],
"description": "Symfony DomCrawler Component", "description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-28 16:24:34" "time": "2016-04-12 18:09:53"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
"reference": "78c468665c9568c3faaa9c416a7134308f2d85c3" "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3", "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8",
"reference": "78c468665c9568c3faaa9c416a7134308f2d85c3", "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2566,20 +2565,20 @@
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-01-27 05:14:19" "time": "2016-05-03 18:59:18"
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "65cb36b6539b1d446527d60457248f30d045464d" "reference": "dee379131dceed90a429e951546b33edfe7dccbb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/65cb36b6539b1d446527d60457248f30d045464d", "url": "https://api.github.com/repos/symfony/filesystem/zipball/dee379131dceed90a429e951546b33edfe7dccbb",
"reference": "65cb36b6539b1d446527d60457248f30d045464d", "reference": "dee379131dceed90a429e951546b33edfe7dccbb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2615,20 +2614,20 @@
], ],
"description": "Symfony Filesystem Component", "description": "Symfony Filesystem Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-22 15:02:30" "time": "2016-04-12 18:01:21"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "623bda0abd9aa29e529c8e9c08b3b84171914723" "reference": "c54e407b35bc098916704e9fd090da21da4c4f52"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/623bda0abd9aa29e529c8e9c08b3b84171914723", "url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52",
"reference": "623bda0abd9aa29e529c8e9c08b3b84171914723", "reference": "c54e407b35bc098916704e9fd090da21da4c4f52",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2664,20 +2663,20 @@
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-01-27 05:14:46" "time": "2016-03-10 11:13:05"
}, },
{ {
"name": "symfony/form", "name": "symfony/form",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/form.git", "url": "https://github.com/symfony/form.git",
"reference": "25b71aec36879b4a84c2ea06603dbe7498b31f06" "reference": "922807a06e25c0c6e06b86f83ffe4710080a8b2e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/form/zipball/25b71aec36879b4a84c2ea06603dbe7498b31f06", "url": "https://api.github.com/repos/symfony/form/zipball/922807a06e25c0c6e06b86f83ffe4710080a8b2e",
"reference": "25b71aec36879b4a84c2ea06603dbe7498b31f06", "reference": "922807a06e25c0c6e06b86f83ffe4710080a8b2e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2738,20 +2737,20 @@
], ],
"description": "Symfony Form Component", "description": "Symfony Form Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-28 15:05:09" "time": "2016-04-28 09:59:09"
}, },
{ {
"name": "symfony/intl", "name": "symfony/intl",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/intl.git", "url": "https://github.com/symfony/intl.git",
"reference": "cafee6f65148dab9058cdb6de5631222aca820d0" "reference": "a602fe5a36cfc6367c5495b38a88c443570e75da"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/intl/zipball/cafee6f65148dab9058cdb6de5631222aca820d0", "url": "https://api.github.com/repos/symfony/intl/zipball/a602fe5a36cfc6367c5495b38a88c443570e75da",
"reference": "cafee6f65148dab9058cdb6de5631222aca820d0", "reference": "a602fe5a36cfc6367c5495b38a88c443570e75da",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2813,20 +2812,20 @@
"l10n", "l10n",
"localization" "localization"
], ],
"time": "2016-02-23 15:16:06" "time": "2016-04-01 06:34:33"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
"reference": "d1e6e9182d9e5af6367bf85175e708f8b4a828c0" "reference": "5e4a8ee6e823428257f2002f6daf52de854d8384"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/d1e6e9182d9e5af6367bf85175e708f8b4a828c0", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5e4a8ee6e823428257f2002f6daf52de854d8384",
"reference": "d1e6e9182d9e5af6367bf85175e708f8b4a828c0", "reference": "5e4a8ee6e823428257f2002f6daf52de854d8384",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2867,7 +2866,7 @@
"configuration", "configuration",
"options" "options"
], ],
"time": "2016-01-21 09:05:51" "time": "2016-05-09 18:12:35"
}, },
{ {
"name": "symfony/polyfill-intl-icu", "name": "symfony/polyfill-intl-icu",
@ -2929,16 +2928,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "dfecef47506179db2501430e732adbf3793099c8" "reference": "53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/dfecef47506179db2501430e732adbf3793099c8", "url": "https://api.github.com/repos/symfony/process/zipball/53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb",
"reference": "dfecef47506179db2501430e732adbf3793099c8", "reference": "53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2974,20 +2973,20 @@
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-02 13:44:19" "time": "2016-04-14 15:30:28"
}, },
{ {
"name": "symfony/property-access", "name": "symfony/property-access",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/property-access.git", "url": "https://github.com/symfony/property-access.git",
"reference": "f138bcc0cdaf6a6aba99ecab20d235b394f46eba" "reference": "d9deeca5d2f0dffd90f9547d3d9a2007bd6ee61b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/f138bcc0cdaf6a6aba99ecab20d235b394f46eba", "url": "https://api.github.com/repos/symfony/property-access/zipball/d9deeca5d2f0dffd90f9547d3d9a2007bd6ee61b",
"reference": "f138bcc0cdaf6a6aba99ecab20d235b394f46eba", "reference": "d9deeca5d2f0dffd90f9547d3d9a2007bd6ee61b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3034,20 +3033,20 @@
"property path", "property path",
"reflection" "reflection"
], ],
"time": "2016-02-13 09:23:44" "time": "2016-04-20 18:53:54"
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/routing.git", "url": "https://github.com/symfony/routing.git",
"reference": "ae38e64bae52753c0f4a1a6583f5ba9bb2b742ab" "reference": "0d814e0c1dc07cb688ca2298bbf7b32ace80cee1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/ae38e64bae52753c0f4a1a6583f5ba9bb2b742ab", "url": "https://api.github.com/repos/symfony/routing/zipball/0d814e0c1dc07cb688ca2298bbf7b32ace80cee1",
"reference": "ae38e64bae52753c0f4a1a6583f5ba9bb2b742ab", "reference": "0d814e0c1dc07cb688ca2298bbf7b32ace80cee1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3109,20 +3108,20 @@
"uri", "uri",
"url" "url"
], ],
"time": "2016-02-04 13:53:00" "time": "2016-05-03 12:21:46"
}, },
{ {
"name": "symfony/twig-bridge", "name": "symfony/twig-bridge",
"version": "v2.8.3", "version": "v2.8.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/twig-bridge.git", "url": "https://github.com/symfony/twig-bridge.git",
"reference": "ba898e4714734948dc00c4d776e1d6be165ff8c4" "reference": "789ffb6f63574d8d5573520ba12156f5c395fcd5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/ba898e4714734948dc00c4d776e1d6be165ff8c4", "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/789ffb6f63574d8d5573520ba12156f5c395fcd5",
"reference": "ba898e4714734948dc00c4d776e1d6be165ff8c4", "reference": "789ffb6f63574d8d5573520ba12156f5c395fcd5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3134,7 +3133,7 @@
"symfony/console": "~2.8|~3.0.0", "symfony/console": "~2.8|~3.0.0",
"symfony/expression-language": "~2.4|~3.0.0", "symfony/expression-language": "~2.4|~3.0.0",
"symfony/finder": "~2.3|~3.0.0", "symfony/finder": "~2.3|~3.0.0",
"symfony/form": "~2.8", "symfony/form": "~2.8.4",
"symfony/http-kernel": "~2.8|~3.0.0", "symfony/http-kernel": "~2.8|~3.0.0",
"symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-intl-icu": "~1.0",
"symfony/routing": "~2.2|~3.0.0", "symfony/routing": "~2.2|~3.0.0",
@ -3190,20 +3189,20 @@
], ],
"description": "Symfony Twig Bridge", "description": "Symfony Twig Bridge",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-22 15:02:30" "time": "2016-03-30 10:37:34"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.0.3", "version": "v3.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c" "reference": "0047c8366744a16de7516622c5b7355336afae96"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c", "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96",
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c", "reference": "0047c8366744a16de7516622c5b7355336afae96",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3239,7 +3238,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-23 15:16:06" "time": "2016-03-04 07:55:57"
}, },
{ {
"name": "twig/extensions", "name": "twig/extensions",
@ -3344,23 +3343,23 @@
}, },
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
"version": "v2.2.0", "version": "v2.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/vlucas/phpdotenv.git", "url": "https://github.com/vlucas/phpdotenv.git",
"reference": "9caf304153dc2288e4970caec6f1f3b3bc205412" "reference": "63f37b9395e8041cd4313129c08ece896d06ca8e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/9caf304153dc2288e4970caec6f1f3b3bc205412", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/63f37b9395e8041cd4313129c08ece896d06ca8e",
"reference": "9caf304153dc2288e4970caec6f1f3b3bc205412", "reference": "63f37b9395e8041cd4313129c08ece896d06ca8e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.9" "php": ">=5.3.9"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8|^5.0" "phpunit/phpunit": "^4.8 || ^5.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -3375,7 +3374,7 @@
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"BSD" "BSD-3-Clause-Attribution"
], ],
"authors": [ "authors": [
{ {
@ -3385,13 +3384,12 @@
} }
], ],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
"homepage": "http://github.com/vlucas/phpdotenv",
"keywords": [ "keywords": [
"dotenv", "dotenv",
"env", "env",
"environment" "environment"
], ],
"time": "2015-12-29 15:10:30" "time": "2016-04-15 10:48:49"
} }
], ],
"aliases": [], "aliases": [],

View File

@ -46,7 +46,7 @@ class Menu {
$this->assets_url . '/img/menu_icon.png', $this->assets_url . '/img/menu_icon.png',
30 30
); );
add_submenu_page( $newsletters_page = add_submenu_page(
'mailpoet', 'mailpoet',
$this->setPageTitle(__('Newsletters')), $this->setPageTitle(__('Newsletters')),
__('Newsletters'), __('Newsletters'),
@ -57,7 +57,19 @@ class Menu {
'newsletters' 'newsletters'
) )
); );
add_submenu_page(
// add limit per page to screen options
add_action('load-'.$newsletters_page, function() {
add_screen_option('per_page', array(
'label' => _x(
'Number of newsletters per page',
'newsletters per page (screen options)'
),
'option' => 'mailpoet_newsletters_per_page'
));
});
$forms_page = add_submenu_page(
'mailpoet', 'mailpoet',
$this->setPageTitle(__('Forms')), $this->setPageTitle(__('Forms')),
__('Forms'), __('Forms'),
@ -68,6 +80,17 @@ class Menu {
'forms' 'forms'
) )
); );
// add limit per page to screen options
add_action('load-'.$forms_page, function() {
add_screen_option('per_page', array(
'label' => _x(
'Number of forms per page',
'forms per page (screen options)'
),
'option' => 'mailpoet_forms_per_page'
));
});
$subscribers_page = add_submenu_page( $subscribers_page = add_submenu_page(
'mailpoet', 'mailpoet',
$this->setPageTitle(__('Subscribers')), $this->setPageTitle(__('Subscribers')),
@ -90,7 +113,7 @@ class Menu {
)); ));
}); });
add_submenu_page( $segments_page = add_submenu_page(
'mailpoet', 'mailpoet',
$this->setPageTitle(__('Segments')), $this->setPageTitle(__('Segments')),
__('Segments'), __('Segments'),
@ -101,6 +124,18 @@ class Menu {
'segments' 'segments'
) )
); );
// add limit per page to screen options
add_action('load-'.$segments_page, function() {
add_screen_option('per_page', array(
'label' => _x(
'Number of segments per page',
'segments per page (screen options)'
),
'option' => 'mailpoet_segments_per_page'
));
});
add_submenu_page( add_submenu_page(
'mailpoet', 'mailpoet',
$this->setPageTitle( __('Settings')), $this->setPageTitle( __('Settings')),
@ -318,14 +353,7 @@ class Menu {
function subscribers() { function subscribers() {
$data = array(); $data = array();
// listing: limit per page $data['items_per_page'] = $this->getLimitPerPage('subscribers');
$listing_per_page = get_user_meta(
get_current_user_id(), 'mailpoet_subscribers_per_page', true
);
$data['per_page'] = (!empty($listing_per_page))
? (int)$listing_per_page
: Listing\Handler::DEFAULT_LIMIT_PER_PAGE;
$data['segments'] = Segment::getSegmentsWithSubscriberCount(); $data['segments'] = Segment::getSegmentsWithSubscriberCount();
$data['custom_fields'] = array_map(function($field) { $data['custom_fields'] = array_map(function($field) {
@ -350,11 +378,14 @@ class Menu {
function segments() { function segments() {
$data = array(); $data = array();
$data['items_per_page'] = $this->getLimitPerPage('segments');
echo $this->renderer->render('segments.html', $data); echo $this->renderer->render('segments.html', $data);
} }
function forms() { function forms() {
$data = array(); $data = array();
$data['items_per_page'] = $this->getLimitPerPage('forms');
$data['segments'] = Segment::findArray(); $data['segments'] = Segment::findArray();
echo $this->renderer->render('forms.html', $data); echo $this->renderer->render('forms.html', $data);
@ -365,6 +396,7 @@ class Menu {
$data = array(); $data = array();
$data['items_per_page'] = $this->getLimitPerPage('newsletters');
$data['segments'] = Segment::getSegmentsWithSubscriberCount(); $data['segments'] = Segment::getSegmentsWithSubscriberCount();
$data['settings'] = Setting::getAll(); $data['settings'] = Setting::getAll();
$data['roles'] = $wp_roles->get_names(); $data['roles'] = $wp_roles->get_names();
@ -438,4 +470,17 @@ class Menu {
$title $title
); );
} }
function getLimitPerPage($model = null) {
if($model === null) {
return Listing\Handler::DEFAULT_LIMIT_PER_PAGE;
}
$listing_per_page = get_user_meta(
get_current_user_id(), 'mailpoet_'.$model.'_per_page', true
);
return (!empty($listing_per_page))
? (int)$listing_per_page
: Listing\Handler::DEFAULT_LIMIT_PER_PAGE;
}
} }

View File

@ -4,6 +4,7 @@
<div id="forms_container"></div> <div id="forms_container"></div>
<script type="text/javascript"> <script type="text/javascript">
var mailpoet_listing_per_page = <%= items_per_page %>;
var mailpoet_segments = <%= json_encode(segments) %>; var mailpoet_segments = <%= json_encode(segments) %>;
var mailpoet_form_edit_url = var mailpoet_form_edit_url =
"<%= admin_url('admin.php?page=mailpoet-form-editor&id=') %>"; "<%= admin_url('admin.php?page=mailpoet-form-editor&id=') %>";
@ -29,6 +30,13 @@
'selectAll': __('Select All'), 'selectAll': __('Select All'),
'restore': __('Restore'), 'restore': __('Restore'),
'deletePermanently': __('Delete Permanently'), 'deletePermanently': __('Delete Permanently'),
'previousPage': __('Previous page'),
'firstPage': __('First page'),
'nextPage': __('Next page'),
'lastPage': __('Last page'),
'currentPage': __('Current Page'),
'pageOutOf': __('of'),
'numberOfItems': __('%$1d items'), 'numberOfItems': __('%$1d items'),
'formName': __('Name'), 'formName': __('Name'),

View File

@ -4,6 +4,7 @@
<div id="newsletters_container"></div> <div id="newsletters_container"></div>
<script type="text/javascript"> <script type="text/javascript">
var mailpoet_listing_per_page = <%= items_per_page %>;
var mailpoet_segments = <%= json_encode(segments) %>; var mailpoet_segments = <%= json_encode(segments) %>;
var mailpoet_settings = <%= json_encode(settings) %>; var mailpoet_settings = <%= json_encode(settings) %>;
var mailpoet_lists = <%= json_encode(lists) %>; var mailpoet_lists = <%= json_encode(lists) %>;
@ -31,6 +32,7 @@
'restore': __('Restore'), 'restore': __('Restore'),
'deletePermanently': __('Delete Permanently'), 'deletePermanently': __('Delete Permanently'),
'showMoreDetails': __('Show more details'), 'showMoreDetails': __('Show more details'),
'previousPage': __('Previous page'), 'previousPage': __('Previous page'),
'firstPage': __('First page'), 'firstPage': __('First page'),
'nextPage': __('Next page'), 'nextPage': __('Next page'),

View File

@ -2,6 +2,10 @@
<% block content %> <% block content %>
<div id="segments_container"></div> <div id="segments_container"></div>
<script type="text/javascript">
var mailpoet_listing_per_page = <%= items_per_page %>;
</script>
<% endblock %> <% endblock %>
<% block translations %> <% block translations %>
@ -11,6 +15,9 @@
'loadingItems': __('Loading segments...'), 'loadingItems': __('Loading segments...'),
'noItemsFound': __('No segments found.'), 'noItemsFound': __('No segments found.'),
'permanentlyDeleted': __('%d segments permanently deleted.'), 'permanentlyDeleted': __('%d segments permanently deleted.'),
'selectBulkAction': __('Select bulk action'),
'bulkActions': __('Bulk Actions'),
'apply': __('Apply'),
'name': __('Name'), 'name': __('Name'),
'description': __('Description'), 'description': __('Description'),
'segmentUpdated': __('Segment successfully updated!'), 'segmentUpdated': __('Segment successfully updated!'),
@ -36,10 +43,19 @@
'edit': __('Edit'), 'edit': __('Edit'),
'trash': __('Trash'), 'trash': __('Trash'),
'emptyTrash': __('Empty Trash'), 'emptyTrash': __('Empty Trash'),
'selectAll': __('Select All'),
'restore': __('Restore'), 'restore': __('Restore'),
'deletePermanently': __('Delete Permanently'), 'deletePermanently': __('Delete Permanently'),
'save': __('Save'), 'save': __('Save'),
'previousPage': __('Previous page'),
'firstPage': __('First page'),
'nextPage': __('Next page'),
'lastPage': __('Last page'),
'currentPage': __('Current Page'),
'pageOutOf': __('of'),
'numberOfItems': __('%$1d items'), 'numberOfItems': __('%$1d items'),
'segmentDescriptionTip': __('For your own use and never shown to your subscribers.'), 'segmentDescriptionTip': __('For your own use and never shown to your subscribers.'),
'backToList': __('Back to list') 'backToList': __('Back to list')
}) %> }) %>

View File

@ -4,7 +4,7 @@
<div id="subscribers_container"></div> <div id="subscribers_container"></div>
<script type="text/javascript"> <script type="text/javascript">
var mailpoet_listing_per_page = <%= per_page %>; var mailpoet_listing_per_page = <%= items_per_page %>;
var mailpoet_segments = <%= json_encode(segments) %>; var mailpoet_segments = <%= json_encode(segments) %>;
var mailpoet_custom_fields = <%= json_encode(custom_fields) %>; var mailpoet_custom_fields = <%= json_encode(custom_fields) %>;
var mailpoet_month_names = <%= json_encode(month_names) %>; var mailpoet_month_names = <%= json_encode(month_names) %>;
@ -33,6 +33,7 @@
'trash': __('Trash'), 'trash': __('Trash'),
'deletePermanently': __('Delete Permanently'), 'deletePermanently': __('Delete Permanently'),
'showMoreDetails': __('Show more details'), 'showMoreDetails': __('Show more details'),
'previousPage': __('Previous page'), 'previousPage': __('Previous page'),
'firstPage': __('First page'), 'firstPage': __('First page'),
'nextPage': __('Next page'), 'nextPage': __('Next page'),
@ -40,6 +41,7 @@
'currentPage': __('Current Page'), 'currentPage': __('Current Page'),
'pageOutOf': __('of'), 'pageOutOf': __('of'),
'numberOfItems': __('%$1d items'), 'numberOfItems': __('%$1d items'),
'email': __('E-mail'), 'email': __('E-mail'),
'firstname': __('Firstname'), 'firstname': __('Firstname'),
'lastname': __('Lastname'), 'lastname': __('Lastname'),