Skip to content

Commit

Permalink
Merge ebb67e0 into 412c24c
Browse files Browse the repository at this point in the history
  • Loading branch information
sarken committed Jan 31, 2014
2 parents 412c24c + ebb67e0 commit b78d885
Showing 1 changed file with 73 additions and 78 deletions.
151 changes: 73 additions & 78 deletions app/views/works/new_import.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%= link_to ts("please let us know"), new_feedback_report_path %>
<%= ts("so we can improve this tool!") %>
</p>
<p>You might find the <a href="http://archiveofourown.org/archive_faqs/9">Import <abbr title="frequently asked questions">FAQ</abbr></a> useful.</p>
<p><%= ts("You might find the ") %><%= link_to ts("Import FAQ"), archive_faqs_path + "/9" %><%= ts(" useful.") %></p>
</div>

<!--/descriptions-->
Expand All @@ -30,85 +30,80 @@
</ul>

<!-- This partial renders a form for importing a work from an existing URL -->



<div class="import work post">
<%= form_tag url_for(:controller => :works, :action => :import) do %>
<fieldset>
<legend><%= ts("Works URLs") %></legend>
<dl>
<dt class="required"><%= label_tag "urls", ts("URLs") %></dt>
<dd><%= text_area_tag "urls", @urls ? @urls.join("\n") : "", :rows => 20, :cols => 90 %>
<p class="footnote">URLs for existing work(s) or for the chapters of a single work; <strong>one URL per line</strong>.</p>
</dd>
<dt>
<%= label_tag "encoding", ts("Set custom encoding") %> <%= link_to_help "encoding-help" %></dt>
<dd><%= select_tag "encoding", options_for_select([''] + Encoding.name_list.sort) %></dd>
<dt>Preferences</dt>
<dd>
<ul>
<li><%= 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) %>
</li>
<li><%= 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) %>
</li>

<% if current_user.archivist %>
<li>
<%= check_box_tag "importing_for_others" %>
<%= label_tag "importing_for_others", ts("Import for others ONLY with permission") %>
</li>
<li>
<%= text_field_tag_original "external_author_name" %>
<%= label_tag "external_author_name", ts("Author Name") %>
</li>
<li>
<%= text_field_tag_original "external_author_email" %>
<%= label_tag "external_author_email", ts("Author Email Address") %>
</li>
<li>
<%= text_field_tag_original "external_coauthor_name" %>
<%= label_tag "external_coauthor_name", ts("Co-Author Name") %>
</li>
<li>
<%= text_field_tag_original "external_coauthor_email" %>
<%= label_tag "external_coauthor_email", ts("Co-Author Email Address") %>
</li>
<% end %>

<li>
<%= check_box_tag "post_without_preview" %>
<% if current_user.archivist %>
<%= label_tag "post_without_preview", ts("Post without previewing (STRONGLY recommended if importing for others!)") %>
<% else %>
<%= label_tag "post_without_preview", ts("Post without previewing.") %>
<% end %>
</li>

<li>
<%= check_box_tag "restricted" %>
<%= label_tag "restricted", ts("Lock all imports to registered users only.") %>
</li>
<%= form_tag url_for(:controller => :works, :action => :import), :class => "import work post" do %>
<fieldset>
<legend><%= ts("Works URLs") %></legend>
<dl>
<dt class="required"><%= label_tag "urls", ts("URLs") + "*" %></dt>
<dd><%= text_area_tag "urls", @urls ? @urls.join("\n") : "", :rows => 20, :cols => 90 %>
<p class="footnote"><%= ts("URLs for existing work(s) or for the chapters of a single work; ") %><strong><%= ts("one URL per line.") %></strong></p>
</dd>
<dt><%= label_tag "encoding", ts("Set custom encoding") %> <%= link_to_help "encoding-help" %></dt>
<dd><%= select_tag "encoding", options_for_select([''] + Encoding.name_list.sort) %></dd>
<dt><%= ts("Import as") %></dt>
<dd>
<ul>
<li>
<%= 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) %>
</li>
<li>
<%= 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) %>
</li>
</ul>
</dd>
<% if current_user.archivist %>
<dt><%= check_box_tag "importing_for_others" %></dt>
<dd>
<%= label_tag "importing_for_others", ts("Import for others ONLY with permission") %>
<fieldset>
<dl>
<dt class="required"><%= label_tag "external_author_name", ts("Author Name") + "*" %></dt>
<dd><%= text_field_tag_original "external_author_name" %></dd>
<dt class="required"><%= label_tag "external_author_email", ts("Author Email Address") + "*" %></dt>
<dd><%= text_field_tag_original "external_author_email" %></dd>
<dt><%= label_tag "external_coauthor_name", ts("Co-Author Name") %></dt>
<dd><%= text_field_tag_original "external_coauthor_name" %></dd>
<dt><%= label_tag "external_coauthor_email", ts("Co-Author Email Address") %></dt>
<dd><%= text_field_tag_original "external_coauthor_email" %></dd>
</dl>
</fieldset>
</dd>
<% end %>

<dt><%= ts("Preferences") %></dt>
<dd>
<ul>
<li>
<%= check_box_tag "post_without_preview" %>
<% if current_user.archivist %>
<%= label_tag "post_without_preview", ts("Post without previewing (STRONGLY recommended if importing for others!)") %>
<% else %>
<%= label_tag "post_without_preview", ts("Post without previewing.") %>
<% end %>
</li>
<li>
<%= check_box_tag "restricted" %>
<%= label_tag "restricted", ts("Lock all imports to registered users only.") %>
</li>
<li>
<%= check_box_tag "override_tags" %>
<%= label_tag "override_tags", ts("Set the following tags on all stories, overriding whatever the importer finds.") %>
</li>
</ul>
</dd>
</dl>
</fieldset>

<li>
<%= check_box_tag "override_tags" %>
<%= label_tag "override_tags", ts("Set the following tags on all stories, overriding whatever the importer finds.") %>
</li>
</ul>
</dd>
</dl>
</fieldset>
<%= render :partial => 'work_form_tags', :locals => {:include_blank => true} %>

<%= render :partial => 'work_form_tags', :locals => {:include_blank => true} %>

<fieldset>
<legend><%= "Submit" %></legend>
<p class="submit actions">
<%= submit_tag ts("Import") %>
</p>
</fieldset>
<fieldset>
<legend><%= ts("Submit") %></legend>
<p class="submit actions">
<%= submit_tag ts("Import") %>
</p>
</fieldset>

<% end %>
</div>

0 comments on commit b78d885

Please sign in to comment.