Skip to content

Commit fd62cb4

Browse files
committed
Add help panel to import to show which sites are supported and configured
1 parent 960cad8 commit fd62cb4

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

app/views/imports/new.html.erb

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<div class="container">
22
<h1><%= t(".heading") %></h1>
33

4-
<p class="lead"><%= t(".description") %></p>
5-
64
<% if @deserializer %>
75
<p><%= t(".import_type_html", url: @url, object_type: @deserializer.capabilities[:class].model_name.human) %></p>
86

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

21-
<p><%= t(".import_capabilities") %></p>
22-
23-
<div class="col-8">
24-
<%= form_with url: new_import_path, method: :get, class: "mt-3" do |f| %>
25-
<div class="input-group mb-3">
26-
<%= f.url_field :url, class: "form-control", placeholder: translate(".placeholder"), aria_label: translate(".submit"), value: @url %>
27-
<%= f.submit translate(".submit"), class: "btn btn-primary", name: nil %>
19+
<div class="row">
20+
<div class="col">
21+
<p class="lead"><%= t(".description") %></p>
22+
<p><%= t(".import_capabilities") %></p>
23+
<%= form_with url: new_import_path, method: :get, class: "mt-3" do |f| %>
24+
<div class="input-group mb-3">
25+
<%= f.url_field :url, class: "form-control", placeholder: translate(".placeholder"), aria_label: translate(".submit"), value: @url %>
26+
<%= f.submit translate(".submit"), class: "btn btn-primary", name: nil %>
27+
</div>
28+
<% end %>
29+
</div>
30+
<div class="col col-auto">
31+
<div class="card">
32+
<div class="card-body">
33+
<h5><%= t ".supported_sites" %></h5>
34+
<ul class="list-unstyled">
35+
<li><%= ((SiteSettings.cults3d_api_key.present? && SiteSettings.cults3d_api_username.present?) ? "✅" : "❌") %> <%= t "sites.cults3d" %></li>
36+
<li><%= (SiteSettings.myminifactory_api_key.present? ? "✅" : "❌") %> <%= t "sites.myminifactory" %></li>
37+
<li><%= (SiteSettings.thingiverse_api_key.present? ? "✅" : "❌") %> <%= t "sites.thingiverse" %></li>
38+
</ul>
39+
<%= link_to t(".integration_settings"), integrations_settings_path if policy(:settings).index? %>
40+
</div>
2841
</div>
29-
<% end %>
42+
</div>
3043
</div>
3144

3245
<% end %>

config/locales/en.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,12 @@ en:
704704
description: From some sites, Manyfold can download models for you with just a link!
705705
heading: Import from a link
706706
import: Import this link
707-
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.
707+
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.
708708
import_type_html: "<code>%{url}</code> will be added as a new %{object_type}. The following data can be imported automatically:"
709+
integration_settings: Edit integration settings
709710
placeholder: Paste the address of the content you want to import (e.g. https://thingiverse.com/thing:1234)
710711
submit: Import
712+
supported_sites: Supported sites
711713
jobs:
712714
activity:
713715
collection_published:

0 commit comments

Comments
 (0)