<% extends 'layout.html' %>

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

  <div>
    <p class="mailpoet_sending_methods_help help">
      <%= __('<strong>Tip:</strong> we have a [link]list of plugins[/link] that work with MailPoet if you need fancier forms.')
      |replaceLinkTags('http://beta.docs.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'})
      |raw
      %>
    </p>
  </div>

  <script type="text/javascript">
    var mailpoet_listing_per_page = <%= items_per_page %>;
    var mailpoet_segments = <%= json_encode(segments) %>;
    var mailpoet_form_edit_url =
      "<%= admin_url('admin.php?page=mailpoet-form-editor&id=') %>";
  </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'),

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

    'formName': __('Name'),
    'segments': __('Lists'),
    'userChoice': __('User choice:'),
    'signups': __('Sign-ups'),
    'createdOn': __('Created On'),
    'oneFormTrashed': __('1 form was moved to the trash.'),
    'multipleFormsTrashed': __('%$1d forms were moved to the trash.'),
    'oneFormDeleted': __('1 form was permanently deleted.'),
    'multipleFormsDeleted': __('%$1d forms were permanently deleted.'),
    'oneFormRestored': __('1 form has been restored from the trash.'),
    'multipleFormsRestored': __('%$1d forms have been restored from the trash.'),
    'edit': __('Edit'),
    'duplicate': __('Duplicate'),
    'formDuplicated': __('Form "%$1s" has been duplicated.'),
    'trash': __('Trash'),
    'moveToTrash': __('Move to trash'),
    'new': __('Add New'),
  }) %>
<% endblock %>

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