diff --git a/app/views/imports/_import_option.html.erb b/app/views/imports/_import_option.html.erb new file mode 100644 index 000000000..b7c73ffa7 --- /dev/null +++ b/app/views/imports/_import_option.html.erb @@ -0,0 +1,37 @@ +<%# locals: (type:, label:, icon_name: nil, icon_bg_class: nil, icon_text_class: nil, enabled:, disabled_message: nil, button_class: "flex items-center justify-between p-4 group cursor-pointer w-full", image: nil) %> +
  • + <% if enabled %> + <%= button_to imports_path(import: { type: type }), class: button_class, data: { turbo: false } do %> +
    + <% if image %> + <%= image_tag(image, alt: "#{label} logo", class: "w-8 h-8 rounded-md") %> + <% else %> +
    + <%= icon(icon_name, color: "current") %> +
    + <% end %> + <%= label %> +
    + <%= icon("chevron-right") %> + <% end %> + <% else %> +
    +
    + <% if image %> + <%= image_tag(image, alt: "#{label} logo", class: "w-8 h-8 rounded-md") %> + <% else %> +
    + <%= icon(icon_name, color: "current") %> +
    + <% end %> +
    + <%= label %> + <%= disabled_message %> +
    +
    + <%= icon("lock", size: "sm", class: "text-secondary") %> +
    + <% end %> + + <%= render "shared/ruler" %> +
  • diff --git a/app/views/imports/new.html.erb b/app/views/imports/new.html.erb index 45ff29415..0b8c1a490 100644 --- a/app/views/imports/new.html.erb +++ b/app/views/imports/new.html.erb @@ -2,6 +2,9 @@ <% dialog.with_header(title: t(".title"), subtitle: t(".description")) %> <% dialog.with_body do %> + <% has_accounts = Current.family.accounts.any? %> + <% requires_account_message = t(".requires_account") %> +

    <%= t(".sources") %>