- Delete utilities.css (701 lines / 24 KB of Tailwind utility clones) - Add layout.css with admin-stack, admin-row, admin-cluster, admin-grid primitives and gap variants (sm, md, lg, xl) - Add transitions.css import and layout.css import to admin.css entry point - Replace all Tailwind utility classes across 26 admin templates with semantic admin-*/theme-*/page-specific CSS classes - Replace all non-dynamic inline styles with semantic classes - Add ~100 new semantic classes to components.css (analytics, dashboard, order detail, settings, theme editor, generic utilities) - Fix stray text-error → admin-text-error in media.ex - Add missing .truncate definition to admin CSS - Only remaining inline styles are dynamic data values (progress bars, chart dimensions) and one JS.toggle target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
91 lines
2.9 KiB
Plaintext
91 lines
2.9 KiB
Plaintext
<.header>
|
|
{if @live_action == :new,
|
|
do: "Connect to #{@provider.name}",
|
|
else: "#{@provider.name} settings"}
|
|
</.header>
|
|
|
|
<div class="admin-form-narrow">
|
|
<%= if @live_action == :new do %>
|
|
<p class="admin-section-desc">
|
|
{@provider.name} is a print-on-demand service that prints and ships products for you.
|
|
Connect your account to automatically import your products into your shop.
|
|
</p>
|
|
|
|
<div class="admin-callout">
|
|
<p class="admin-callout-title">Get your API key from {@provider.name}:</p>
|
|
<ol class="admin-callout-list">
|
|
<li>
|
|
<a href={@provider.login_url} target="_blank" rel="noopener" class="admin-link">
|
|
Log in to {@provider.name}
|
|
</a>
|
|
(or <a href={@provider.signup_url} target="_blank" rel="noopener" class="admin-link">create a free account</a>)
|
|
</li>
|
|
<li :for={step <- @provider.setup_steps}>
|
|
{raw(step)}
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
<% end %>
|
|
|
|
<.form for={@form} id="provider-form" phx-change="validate" phx-submit="save">
|
|
<input type="hidden" name="provider_connection[provider_type]" value={@provider_type} />
|
|
|
|
<.input
|
|
field={@form[:api_key]}
|
|
type="password"
|
|
label={"#{@provider.name} API key"}
|
|
placeholder={
|
|
if @live_action == :edit,
|
|
do: "Leave blank to keep current key",
|
|
else: "Paste your key here"
|
|
}
|
|
autocomplete="off"
|
|
/>
|
|
|
|
<div class="admin-inline-group">
|
|
<button
|
|
type="button"
|
|
class="admin-btn admin-btn-outline admin-btn-sm"
|
|
phx-click="test_connection"
|
|
disabled={@testing}
|
|
>
|
|
<.icon
|
|
name={if @testing, do: "hero-arrow-path", else: "hero-signal"}
|
|
class={if @testing, do: "size-4 animate-spin", else: "size-4"}
|
|
/>
|
|
{if @testing, do: "Checking...", else: "Check connection"}
|
|
</button>
|
|
|
|
<%= if @test_result do %>
|
|
<%= case @test_result do %>
|
|
<% {:ok, _info} -> %>
|
|
<span class="admin-status-success">
|
|
<.icon name="hero-check-circle" class="size-4" />
|
|
Connected to {connection_name(@test_result) || @provider.name}
|
|
</span>
|
|
<% {:error, reason} -> %>
|
|
<span class="admin-status-error">
|
|
<.icon name="hero-x-circle" class="size-4" />
|
|
{format_error(reason)}
|
|
</span>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%= if @live_action == :edit do %>
|
|
<.input field={@form[:enabled]} type="checkbox" label="Connection enabled" />
|
|
<% end %>
|
|
|
|
<div class="admin-form-actions">
|
|
<.button type="submit" disabled={@testing}>
|
|
{if @live_action == :new,
|
|
do: "Connect to #{@provider.name}",
|
|
else: "Save changes"}
|
|
</.button>
|
|
<.link navigate={~p"/admin/providers"} class="admin-btn admin-btn-ghost">
|
|
Cancel
|
|
</.link>
|
|
</div>
|
|
</.form>
|
|
</div>
|