<% extends 'layout.html' %>

<% block content %>
  <div id="forms_container"></div>

  <div>
    <p class="mailpoet_sending_methods_help help">
      <%= __('<strong>Tip:</strong> check out [link]this list[/link] of form plugins that integrate with MailPoet.')
      |replaceLinkTags('https://kb.mailpoet.com/article/198-list-of-forms-plugins-that-work-with-mailpoet?utm_source=plugin&utm_medium=settings&utm_campaign=helpdocs', {'target': '_blank', id: 'mailpoet_helper_link', 'data-beacon-article': '5953a9720428637ff8d42272'})
      |raw
      %>
    </p>
  </div>

  <script type="text/javascript">
    var mailpoet_listing_per_page = <%= items_per_page %>;
    var mailpoet_segments = <%= json_encode(segments) %>;
    var mailpoet_form_template_selection_url =
      "<%= admin_url('admin.php?page=mailpoet-form-editor-template-selection') %>";
    var mailpoet_form_edit_url =
      "<%= admin_url('admin.php?page=mailpoet-form-editor&id=') %>";
    var mailpoet_beacon_articles = [
      '5fac13f2cff47e00160b8dff',
      '5e43d3ec2c7d3a7e9ae79da9',
      '5e3a166204286364bc94dda4',
      '5e95cc092c7d3a7e9aeae815',
      '58a718a6dd8c8e56bfa7cad6',
      '5d1f468504286369ad8d57ff'
    ];

    var mailpoet_display_nps_poll = <%= json_encode(display_nps_survey) %>;

    <%if display_nps_survey %>
      var mailpoet_display_nps_form = true;
      var mailpoet_premium_active = <%= json_encode(premium_plugin_active) %>;
      var mailpoet_site_url = "<%= site_url %>";
      var mailpoet_current_wp_user = <%= json_encode(current_wp_user) %>;
      var mailpoet_current_wp_user_firstname = '<%= current_wp_user_firstname %>';
      var mailpoet_review_request_illustration_url = '<%= cdn_url('review-request/review-request-illustration.20190815-1427.svg') %>';
      var mailpoet_installed_days_ago = <%= installed_days_ago %>;
    <%endif%>
  </script>
<% endblock %>

<% block translations %>
  <%= localize({
    'pageTitle': __('Forms'),
    'searchLabel': __('Search'),
    'loadingItems': __('Loading forms...'),
    'noItemsFound': __('No forms were found. Why not create a new one?'),
    'selectAllLabel': __('All forms on this page are selected.'),
    'selectedAllLabel': __('All %d forms are selected.'),
    'selectAllLink': __('Select all forms on all pages'),
    'clearSelection': __('Clear selection'),
    'permanentlyDeleted': __('%d forms permanently deleted.'),
    'selectBulkAction': __('Select bulk action'),
    'bulkActions': __('Bulk Actions'),
    'apply': __('Apply'),
    'filter': __('Filter'),
    'emptyTrash': __('Empty Trash'),
    'selectAll': __('Select All'),
    'restore': __('Restore'),
    'deletePermanently': __('Delete Permanently'),

    'status': __('Status'),
    'active': __('Active'),
    'inactive': __('Not Active'),
    'formActivated': __('Your Form is now activated!'),

    'previousPage': __('Previous page'),
    'firstPage': __('First page'),
    'nextPage': __('Next page'),
    'lastPage': __('Last page'),
    'currentPage': __('Current Page'),
    'pageOutOf': __('of'),
    'numberOfItemsSingular': __('1 item'),
    'numberOfItemsMultiple': __('%1$d items'),

    'formName': __('Name'),
    'noName': _x('no name', 'fallback for forms without a name in a form list'),
    'segments': __('Lists'),
    'type': __('Type'),
    'userChoice': __('User choice:'),
    'signups': __('Sign-ups'),
    'updatedAt': __('Modified date'),
    'oneFormTrashed': __('1 form was moved to the trash.'),
    'multipleFormsTrashed': __('%1$d forms were moved to the trash.'),
    'oneFormDeleted': __('1 form was permanently deleted.'),
    'multipleFormsDeleted': __('%1$d forms were permanently deleted.'),
    'oneFormRestored': __('1 form has been restored from the trash.'),
    'multipleFormsRestored': __('%1$d forms have been restored from the trash.'),
    'edit': __('Edit'),
    'duplicate': __('Duplicate'),
    'formDuplicated': __('Form "%1$s" has been duplicated.'),
    'trash': __('Trash'),
    'moveToTrash': __('Move to trash'),
    'new': __('New Form'),
    'placeFormBellowPages': _x('Below pages', 'This is a text on a widget that leads to settings for form placement'),
    'placeFixedBarFormOnPages': _x('Fixed bar', 'This is a text on a widget that leads to settings for form placement - form type is fixed bar'),
    'placeSlideInFormOnPages': _x('Slide–in', 'This is a text on a widget that leads to settings for form placement - form type is slide in'),
    'placePopupFormOnPages': _x('Pop-up', 'This is a text on a widget that leads to settings for form placement - form type is pop-up, it will be displayed on page in a small modal window'),
    'placeFormOthers': _x('Others (widget)', 'Placement of the form using theme widget'),
  }) %>
<% endblock %>

<% block after_javascript %>
<script type="text/javascript">
  jQuery('#mailpoet_helper_link').on('click', function() {
    MailPoet.trackEvent('Forms page > link to doc page');
  });
</script>
<% endblock %>
