Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions app/views/imports/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<div class="container">
<h1><%= t(".heading") %></h1>

<p class="lead"><%= t(".description") %></p>

<% if @deserializer %>
<p><%= t(".import_type_html", url: @url, object_type: @deserializer.capabilities[:class].model_name.human) %></p>

Expand All @@ -18,15 +16,30 @@
<%= render Components::DoButton.new icon: "download", label: t(".import"), href: imports_path(url: @url), method: :post, variant: "primary" %>
<% else %>

<p><%= t(".import_capabilities") %></p>

<div class="col-8">
<%= form_with url: new_import_path, method: :get, class: "mt-3" do |f| %>
<div class="input-group mb-3">
<%= f.url_field :url, class: "form-control", placeholder: translate(".placeholder"), aria_label: translate(".submit"), value: @url %>
<%= f.submit translate(".submit"), class: "btn btn-primary", name: nil %>
<div class="row">
<div class="col">
<p class="lead"><%= t(".description") %></p>
<p><%= t(".import_capabilities") %></p>
<%= form_with url: new_import_path, method: :get, class: "mt-3" do |f| %>
<div class="input-group mb-3">
<%= f.url_field :url, class: "form-control", placeholder: translate(".placeholder"), aria_label: translate(".submit"), value: @url %>
<%= f.submit translate(".submit"), class: "btn btn-primary", name: nil %>
</div>
<% end %>
</div>
<div class="col col-auto">
<div class="card">
<div class="card-body">
<h5><%= t ".supported_sites" %></h5>
<ul class="list-unstyled">
<li><%= ((SiteSettings.cults3d_api_key.present? && SiteSettings.cults3d_api_username.present?) ? "✅" : "❌") %> <%= t "sites.cults3d" %></li>
<li><%= (SiteSettings.myminifactory_api_key.present? ? "✅" : "❌") %> <%= t "sites.myminifactory" %></li>
<li><%= (SiteSettings.thingiverse_api_key.present? ? "✅" : "❌") %> <%= t "sites.thingiverse" %></li>
</ul>
<%= link_to t(".integration_settings"), integrations_settings_path if policy(:settings).index? %>
</div>
</div>
<% end %>
</div>
</div>

<% end %>
Expand Down
4 changes: 3 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,12 @@ en:
description: From some sites, Manyfold can download models for you with just a link!
heading: Import from a link
import: Import this link
import_capabilities: We can import models, creators and collections from MyMiniFactory, Thingiverse, and Cults3D. Exactly what we can import for your URL will be displayed after you enter it.
import_capabilities: We can import models, creators and collections from various other hosting sites. Exactly what we can import for your URL will be displayed after you enter it.
import_type_html: "<code>%{url}</code> will be added as a new %{object_type}. The following data can be imported automatically:"
integration_settings: Edit integration settings
placeholder: Paste the address of the content you want to import (e.g. https://thingiverse.com/thing:1234)
submit: Import
supported_sites: Supported sites
jobs:
activity:
collection_published:
Expand Down
Loading