Merge pull request #995 from mailpoet/welcome-tab-update

Welcome tab update [MAILPOET-979]
This commit is contained in:
mrcasual
2017-07-17 07:17:26 -04:00
committed by GitHub
4 changed files with 81 additions and 14 deletions

View File

@@ -117,6 +117,21 @@ About page styles that may differ across WP versions.
h3
margin-top: 0
.feature-section
&.one-col
width: 700px
margin: 0 auto
text-align: center
& > a.button
margin-top: 2em
&.one-col-left
width: 700px
margin: 0 auto
h2.mailpoet-feature-top
margin: 50px auto
.lead-description ~ p
margin-top: 3em
.feature-section
h4
margin: 1.4em 0 0.6em 0

View File

@@ -340,7 +340,7 @@ class Menu {
$readme_file = Env::$path . '/readme.txt';
if(is_readable($readme_file)) {
$changelog = Readme::parseChangelog(file_get_contents($readme_file), 2);
$changelog = Readme::parseChangelog(file_get_contents($readme_file), 1);
if($changelog) {
$data['changelog'] = $changelog;
}

View File

@@ -10,9 +10,12 @@
</style>
<div class="wrap mailpoet-about-wrap">
<h1><%= __('Welcome to MailPoet') %> <%= settings.version %></h1>
<h1><%= __('Greetings, humans.') %></h1>
<p class="about-text"><%= __("Thank you for helping us test and improve this new version of MailPoet. You're one of our extra-special beta testers. We really appreciate your help!") %>
<p class="about-text"><%= __('Thanks for using MailPoet! We really appreciate all of your love, affection, [link]and (good) plugin reviews.[/link]')
|replaceLinkTags('https://wordpress.org/support/plugin/wysija-newsletters/reviews/', {'target' : '_blank'})
|raw
%>
</p>
<div class="mailpoet-logo"><img src="<%= image_url('welcome_template/mailpoet-logo.png') %>" alt="MailPoet Logo" /></div>
@@ -21,8 +24,8 @@
<a href="admin.php?page=mailpoet-update" class="nav-tab nav-tab-active"><%= __("What's New") %></a>
</h2>
<div id="mailpoet-changelog" clas="feature-section one-col">
<h2><%= __("List of Changes") %></h2>
<div id="mailpoet-changelog" class="feature-section one-col-left">
<h2 class="mailpoet-feature-top"><%= __('List of Changes') %></h2>
<% if changelog %>
<% for item in changelog %>
<h3><%= item.version %></h3>
@@ -31,23 +34,51 @@
<li><%= change %></li>
<% endfor %>
</ul>
<br>
<% endfor %>
<% else %>
<p style="text-align: center"><%= __("See readme.txt for a changelog.") %></p>
<p style="text-align: center"><%= __('See readme.txt for a changelog.') %></p>
<% endif %>
<a class="button button-secondary" href="https://wordpress.org/plugins/mailpoet/#developers" target="_blank"><%= __('View all changes') %> &rarr;</a>
</div>
<hr>
<div clas="feature-section one-col">
<br>
<p style="text-align: center"><a class="button button-primary" href="admin.php?page=mailpoet-newsletters"><%= __("Awesome! Now, take me to MailPoet") %> &rarr;</a> <a class="button button-secondary" href="https://wordpress.org/plugins/mailpoet/#developers" target="_blank"><%= __("View all changes") %> &rarr;</a></p>
<% if(not settings.analytics.enabled) %>
<div class="feature-section one-col">
<h2><%= __('Do Your Part to Make MailPoet Better') %></h2>
<div class="lead-description">
<label>
<input type="checkbox" id="mailpoet_analytics_enabled" value="1">&nbsp;
<%= __('Yes, share my data anonymously.') %>
</label>
</div>
<p><%= __("By sharing your data with us, you can help us understand what our users like (and don't like).") %>
<%= __('We use it to prioritize and develop new plugin features.') %><br>
<%= __('Share your data to help shape the future of MailPoet! [link]Read more.[/link]')
|replaceLinkTags('http://docs.mailpoet.com/article/36-share-your-data', {'target' : '_blank'})
|raw
%>
</div>
<hr>
<% endif %>
<div class="feature-section one-col">
<h2><%= __('Care to Give Your Opinion?') %></h2>
<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/9780744.js"></script>
<noscript><a href="http://polldaddy.com/poll/9780744/">How likely is it that you would MailPoet to a friend or colleague?</a></noscript>
</div>
<hr>
<div class="feature-section one-col">
<a class="button button-primary" href="admin.php?page=mailpoet-newsletters"><%= __('Awesome! Now, take me to MailPoet') %> &rarr;</a>
</div>
</div>
<script type="text/javascript">
jQuery(function($) {
$(function() {
@@ -56,7 +87,25 @@
{'MailPoet Free version': window.mailpoet_version}
);
});
$('#mailpoet_analytics_enabled').on('click', function() {
var is_enabled = $(this).is(':checked') ? true : '';
MailPoet.Ajax.post({
api_version: window.mailpoet_api_version,
endpoint: 'settings',
action: 'set',
data: {
analytics: { enabled: (is_enabled)}
}
}).fail((response) => {
if (response.errors.length > 0) {
MailPoet.Notice.error(
response.errors.map((error) => { return error.message; }),
{ scroll: true }
);
}
});
})
});
</script>
<% endblock %>

View File

@@ -19,9 +19,12 @@
</style>
<div class="wrap mailpoet-about-wrap">
<h1><%= __('Welcome to MailPoet') %> <%= settings.version %></h1>
<h1><%= __('Greetings, humans.') %></h1>
<p class="about-text"><%= __("Thank you for helping us test and improve this new version of MailPoet. You're one of our extra-special beta testers. We really appreciate your help!") %>
<p class="about-text"><%= __('Thanks for using MailPoet! We really appreciate all of your love, affection, [link]and (good) plugin reviews.[/link]')
|replaceLinkTags('https://wordpress.org/support/plugin/wysija-newsletters/reviews/', {'target' : '_blank'})
|raw
%>
</p>
<div class="mailpoet-logo"><img src="<%= image_url('welcome_template/mailpoet-logo.png') %>" alt="<%= __('MailPoet Logo') %>" /></div>