<% extends 'layout.html' %>

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

  <div>
    <p class="mailpoet_sending_methods_help help">
      <% set allowedHtml = {'a': {'href': [], 'target': [], 'id': []}, 'strong': {}} %>
      <%= __('<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'})
      |wpKses(allowedHtml)
      %>
    </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_display_nps_poll = <%= json_encode(display_nps_survey) %>;

    <%if display_nps_survey %>
      var mailpoet_display_nps_form = true;
      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') %>';
    <%endif%>
  </script>

  <%= localize({
    'pageTitle': __('Forms'),
    'searchLabel': __('Search'),
    'loadingItems': __('Loading forms...'),
    'noItemsFound': __('No forms were found. Why not create a new one?'),
    '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'),
    'formSettingsCorrupted': __('Form settings of "%1$s" form are corrupted. Please [link]reconfigure the form in the editor[/link].'),
  }) %>
<% 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 %>
