<% set csvDescription = __('This file needs to be formatted in a CSV style (comma-separated-values.) Look at some [link]examples on our support site[/link].') %>
<% set csvKBLink = 'http://docs.mailpoet.com/article/126-importing-subscribers-with-csv-files' %>
<% extends 'layout.html' %>
<% block content %>
<div id="mailpoet_subscribers_import" class="wrap">
  <h1 class="title">
    <%= __('Import') %>
    <a class="page-title-action" href="?page=mailpoet-subscribers#/"><%= __('Back to Subscribers') %></a>
  </h1>
  <!-- STEP 1: method selection -->
  <% include 'subscribers/importExport/import/step1.html' %>
  <!-- STEP 2: subscriber data manipulation -->
  <% include 'subscribers/importExport/import/step2.html' %>
  <!-- STEP 3: results -->
  <% include 'subscribers/importExport/import/step3.html' %>
</div>

<%= stylesheet('importExport.css') %>

<script type="text/javascript">
  var
    maxPostSize = '<%= maxPostSize %>',
    maxPostSizeBytes = '<%= maxPostSizeBytes %>',
    importData = {},
    mailpoetColumnsSelect2 = <%= subscriberFieldsSelect2|raw %>,
    mailpoetColumns = <%= subscriberFields|raw %>,
    mailpoetSegments = <%= segments|raw %>,
    // RFC 5322 standard; http://emailregex.com/
    emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
</script>
<% endblock %>

<% block translations %>
<%= localize({
'noMailChimpLists': __('No active lists found'),
'serverError': __('Server error:'),
'select': __('Select', 'Form input type'),
'csvKBLink':  csvKBLink,
'wrongFileFormat': __('Only comma-separated (CSV) file formats are supported.'),
'maxPostSizeNotice': __('Your CSV is over %s and is too big to process. Please split the file into two or more sections.')|replace({'%s': maxPostSize}),
'dataProcessingError': __("Your data could not be processed. Please make sure it is in the correct format."),
'noValidRecords': __('No valid records were found. This file needs to be formatted in a CSV style (comma-separated). Look at some [link]examples on our support site.[/link]'),
'importNoticeSkipped': __('%1$s records had issues and were skipped.'),
'importNoticeInvalid': __('%1$s emails are not valid: %2$s'),
'importNoticeDuplicate': __('%1$s emails appear more than once in your file: %2$s'),
'hideDetails': __('Hide details'),
'showDetails': __('Show more details'),
'segmentSelectionRequired': __('Please select at least one list'),
'addNewList': __('Add new list'),
'addNewField': __('Add new field'),
'addNewColumuserColumnsn': __('Add new list'),
'userColumns': __('User fields'),
'selectedValueAlreadyMatched': __('The selected value is already matched to another field.'),
'confirmCorrespondingColumn': __('Confirm that this field corresponds to the selected field.'),
'columnContainInvalidElement': __('One of the fields contains an invalid email. Please fix it before continuing.'),
'january': __('January'),
'february': __('February'),
'march': __('March'),
'april': __('April'),
'may': __('May'),
'june': __('June'),
'july': __('July'),
'august': __('August'),
'september': __('September'),
'october': __('October'),
'november': __('November'),
'december': __('December'),
'noDateFieldMatch': __("Do not match as a 'date field' if most of the rows for that field return the same error."),
'emptyFirstRowDate': __('First row date cannot be empty.'),
'verifyDateMatch': __('Verify that the date in blue matches the original date.'),
'pm': __('PM'),
'am': __('AM'),
'dateMatchError': __('Error matching date'),
'columnContainsInvalidDate': __('One of the fields contains an invalid date. Please fix before continuing.'),
'listCreateError': __('Error adding a new list:'),
'columnContainsInvalidElement': __('One of the fields contains an invalid email. Please fix before continuing.'),
'customFieldCreateError': __('Custom field could not be created'),
'subscribersCreated': __('%1$s subscribers added to %2$s.'),
'subscribersUpdated': __('%1$s existing subscribers were updated and added to %2$s.')
}) %>
<% endblock %>
