Newsletters page, with test.
This commit is contained in:
@ -28,11 +28,11 @@ class Menu {
|
||||
);
|
||||
add_submenu_page(
|
||||
'mailpoet',
|
||||
'Settings',
|
||||
'Settings',
|
||||
'Newsletters',
|
||||
'Newsletters',
|
||||
'manage_options',
|
||||
'mailpoet-settings',
|
||||
array($this, 'settings')
|
||||
'mailpoet-newsletters',
|
||||
array($this, 'newsletters')
|
||||
);
|
||||
add_submenu_page(
|
||||
'mailpoet',
|
||||
@ -42,6 +42,14 @@ class Menu {
|
||||
'mailpoet-subscribers',
|
||||
array($this, 'subscribers')
|
||||
);
|
||||
add_submenu_page(
|
||||
'mailpoet',
|
||||
'Settings',
|
||||
'Settings',
|
||||
'manage_options',
|
||||
'mailpoet-settings',
|
||||
array($this, 'settings')
|
||||
);
|
||||
}
|
||||
|
||||
function home() {
|
||||
@ -58,4 +66,9 @@ class Menu {
|
||||
$data = array();
|
||||
echo $this->renderer->render('subscribers.html', $data);
|
||||
}
|
||||
|
||||
function newsletters() {
|
||||
$data = array();
|
||||
echo $this->renderer->render('newsletters.html', $data);
|
||||
}
|
||||
}
|
||||
|
16
tests/acceptance/NewslettersPageCest.php
Normal file
16
tests/acceptance/NewslettersPageCest.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class NewslettersPageCest {
|
||||
|
||||
function _before(AcceptanceTester $I) {
|
||||
$I->login();
|
||||
}
|
||||
|
||||
function iCanSeeTheTitle(AcceptanceTester $I) {
|
||||
$I->amOnPage('/wp-admin/admin.php?page=mailpoet-newsletters');
|
||||
$I->see('Newsletters');
|
||||
}
|
||||
|
||||
function _after(AcceptanceTester $I) {
|
||||
}
|
||||
}
|
26
views/newsletters.html
Normal file
26
views/newsletters.html
Normal file
@ -0,0 +1,26 @@
|
||||
<% extends 'layout.html' %>
|
||||
|
||||
<% block content %>
|
||||
<h1><%= 'Newsletters' %></h1>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
|
||||
// dom loaded
|
||||
$(function() {
|
||||
|
||||
MailPoet.Ajax.post({
|
||||
endpoint: 'newsletters',
|
||||
action: 'get',
|
||||
data: {
|
||||
first_name: 'John'
|
||||
},
|
||||
onSuccess: function(response) {
|
||||
// console.log(response);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% endblock %>
|
Reference in New Issue
Block a user