<%= ts("Import New Work") %> <%= link_to_help 'work-import'%>
<% import = true %>
<%= error_messages_for :work %>
<%= ts("Please note! Fanfiction.net, Wattpad.com, and Quotev.com do not allow imports from their sites.") %>
<%= ts("You might find the #{ link_to(ts("Import FAQ"), archive_faqs_path + "/posting-and-editing#importwork") } useful.").html_safe %>
<% if @unposted %>
<%= link_to ts('Restore From Last Unposted Draft?'), url_for(action: :new, load_unposted: true) %>
<% end %>
<%= link_to( ts("Post New Work Instead?"),
{ url: { controller: :works, action: :new, import: false } },
:href => url_for(controller: :works, action: :new, import: nil)) %>
<%= form_tag url_for(controller: :works, action: :import), :class => "import work verbose post" do %>
<%= ts("Works URLs") %>
<%= label_tag "urls", ts("URLs") + "*" %>
<%= text_area_tag "urls", @urls ? @urls.join("\n") : "", rows: 20, cols: 90, "aria-describedby" => "url-field-description" %>
<%= label_tag :language_id, ts("Choose a language") + "*" %>
<%= link_to_help "languages-help" %>
<%= ts("Please select a language") %>
<%= options_for_select(language_options_for_select(sorted_languages, "id"), @language_id) %>
<%= label_tag "encoding", ts("Set custom encoding") %> <%= link_to_help "encoding-help" %>
<%= select_tag "encoding", options_for_select([''] + Encoding.name_list.sort) %>
<%= ts("Import as") %>
<%= radio_button_tag "import_multiple", "works", true %>
<%= label_tag "import_multiple_works",
ts("Works (limit of %{max})",
max: current_user.archivist ? ArchiveConfig.IMPORT_MAX_WORKS_BY_ARCHIVIST : ArchiveConfig.IMPORT_MAX_WORKS) %>
<%= radio_button_tag "import_multiple", "chapters" %>
<%= label_tag "import_multiple_chapters",
ts("Chapters in a single work (limit of %{max})",
max: ArchiveConfig.IMPORT_MAX_CHAPTERS) %>
<% if current_user.archivist %>
<%= label_tag ts("Archiving for others") %>
<%= check_box_tag "importing_for_others" %>
<%= label_tag "importing_for_others", ts("Import for others ONLY with permission") %>
<%= label_tag "external_author_name", ts("Author Name") + "*" %>
<%= text_field_tag_original "external_author_name" %>
<%= label_tag "external_author_email", ts("Author Email Address") + "*" %>
<%= text_field_tag_original "external_author_email" %>
<%= label_tag "external_coauthor_name", ts("Co-Author Name") %>
<%= text_field_tag_original "external_coauthor_name" %>
<%= label_tag "external_coauthor_email", ts("Co-Author Email Address") %>
<%= text_field_tag_original "external_coauthor_email" %>
<% end %>
<%= ts("Preferences") %>
<%= check_box_tag "post_without_preview" %>
<%= label_tag "post_without_preview", ts("Post without previewing.") %>
<%= ts("Override tags and notes") %>
<%= check_box_tag "override_tags", 1, false, class: "toggle_formfield", id: "override_tags-options-show" %>
<%= label_tag "override_tags-options-show",
ts("Set the following tags and/or notes on all works, overriding whatever the importer finds in the content.") %>
<%= t("works.permissions.privacy") %>
<%= t("works.permissions.privacy") %>
<%= check_box_tag "restricted" %>
<%= label_tag "restricted", t("works.permissions.visibility.import_works_restricted") %>
<%= link_to_help "registered-users" %>
<%= render :partial => 'work_form_tags', locals: { include_blank: true, import: true } %>
<%= label_tag :notes, ts("Notes") %>
<%= label_tag :notes, ts("Notes at the beginning") %>
<%= text_area_tag :notes, nil, class: "observe_textlength" %>
<%= generate_countdown_html(".notes", ArchiveConfig.NOTES_MAX) %>
<%= ts("Submit") %>
<%= t(".post_notice_html",
content_policy_link: link_to(t(".content_policy"), content_path),
tos_faq_link: link_to(t(".tos_faq"), tos_faq_path(anchor: "content_faq"))) %>
<%= submit_tag ts("Import") %>
<% end %>
<%= content_for :footer_js do %>
<%= javascript_tag do %>
$j(document).ready(function(){
$j(".toggle_formfield").click(function() {
var targetId = $j(this).attr("id").replace("-show", "");
toggleFormField(targetId);
});
})
<% end %>
<% end %>