Files
manyfold/app/views/settings/integrations.html.erb

25 lines
1.6 KiB
ERB

<h3><%= t(".heading") %></h3>
<p class='lead'>
<%= t(".description") %>
</p>
<%= form_with url: settings_path, method: :patch do |form| %>
<%= Accordion(title: [t("sites.cults3d"), ((SiteSettings.cults3d_api_key.present? && SiteSettings.cults3d_api_username.present?) ? "✅" : "❌")].join(" "), id: "cults3d-integration") do %>
<div class="tabular-form">
<%= text_input_row form, "integrations[cults3d_api_username]", label: t(".cults3d_api_username.label"), value: SiteSettings.cults3d_api_username, help: t(".cults3d_api_username.help_html") %>
<%= text_input_row form, "integrations[cults3d_api_key]", label: t(".cults3d_api_key.label"), value: SiteSettings.cults3d_api_key, help: t(".cults3d_api_key.help_html") %>
</div>
<% end %>
<%= Accordion(title: [t("sites.myminifactory"), (SiteSettings.myminifactory_api_key.present? ? "✅" : "❌")].join(" "), id: "mmf-integration") do %>
<div class="tabular-form">
<%= text_input_row form, "integrations[myminifactory_api_key]", label: t(".myminifactory_api_key.label"), value: SiteSettings.myminifactory_api_key, help: t(".myminifactory_api_key.help_html") %>
</div>
<% end %>
<%= Accordion(title: [t("sites.thingiverse"), (SiteSettings.thingiverse_api_key.present? ? "✅" : "❌")].join(" "), id: "thingiverse-integration") do %>
<div class="tabular-form">
<%= text_input_row form, "integrations[thingiverse_api_key]", label: t(".thingiverse_api_key.label"), value: SiteSettings.thingiverse_api_key, help: t(".thingiverse_api_key.help_html") %>
</div>
<% end %>
<%= render "submit", form: form %>
<% end %>