diff --git a/app/controllers/family_merchants_controller.rb b/app/controllers/family_merchants_controller.rb index b2b0e317e..e06e623ea 100644 --- a/app/controllers/family_merchants_controller.rb +++ b/app/controllers/family_merchants_controller.rb @@ -6,6 +6,7 @@ class FamilyMerchantsController < ApplicationController # Show all merchants for this family @family_merchants = Current.family.merchants.alphabetically + @provider_merchants = Current.family.assigned_merchants.where(type: "ProviderMerchant").alphabetically render layout: "settings" end diff --git a/app/views/family_merchants/_family_merchant.html.erb b/app/views/family_merchants/_family_merchant.html.erb index bc69a25fb..cb546e098 100644 --- a/app/views/family_merchants/_family_merchant.html.erb +++ b/app/views/family_merchants/_family_merchant.html.erb @@ -1,20 +1,22 @@ <%# locals: (family_merchant:) %> -
-
- <% if family_merchant.logo_url %> -
- <%= image_tag family_merchant.logo_url, class: "w-8 h-8 rounded-full" %> -
- <% else %> - <%= render partial: "shared/color_avatar", locals: { name: family_merchant.name, color: family_merchant.color } %> - <% end %> + + +
+ <% if family_merchant.logo_url %> +
+ <%= image_tag family_merchant.logo_url, class: "w-8 h-8 rounded-full" %> +
+ <% else %> + <%= render partial: "shared/color_avatar", locals: { name: family_merchant.name, color: family_merchant.color } %> + <% end %> -

- <%= family_merchant.name %> -

-
-
+

+ <%= family_merchant.name %> +

+
+ + <%= render DS::Menu.new do |menu| %> <% menu.with_item(variant: "link", text: "Edit", href: edit_family_merchant_path(family_merchant), icon: "pencil", data: { turbo_frame: "modal" }) %> <% menu.with_item( @@ -25,5 +27,5 @@ method: :delete, confirm: CustomConfirm.for_resource_deletion(family_merchant.name)) %> <% end %> -
-
+ + diff --git a/app/views/family_merchants/_provider_merchant.html.erb b/app/views/family_merchants/_provider_merchant.html.erb new file mode 100644 index 000000000..1d222d5ea --- /dev/null +++ b/app/views/family_merchants/_provider_merchant.html.erb @@ -0,0 +1,24 @@ +<%# locals: (provider_merchant:) %> + + + +
+ <% if provider_merchant.logo_url %> +
+ <%= image_tag provider_merchant.logo_url, class: "w-8 h-8 rounded-full" %> +
+ <% else %> +
+ <%= provider_merchant.name&.first&.upcase || "?" %> +
+ <% end %> + +

+ <%= provider_merchant.name %> +

+
+ + + <%= provider_merchant.source&.titleize %> + + diff --git a/app/views/family_merchants/index.html.erb b/app/views/family_merchants/index.html.erb index 1ca1e9404..df047726f 100644 --- a/app/views/family_merchants/index.html.erb +++ b/app/views/family_merchants/index.html.erb @@ -9,33 +9,80 @@ ) %> -
- <% if @family_merchants.any? %> -
-
-

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

- · -

<%= @family_merchants.count %>

-
+
+
+
+

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

+ · +

<%= @family_merchants.count %>

+
-
-
- <%= render partial: "family_merchants/family_merchant", collection: @family_merchants, spacer_template: "shared/ruler" %> + <% if @family_merchants.any? %> +
+
+ + + + + + + + + <%= render partial: "family_merchants/family_merchant", collection: @family_merchants %> + +
<%= t(".table.merchant") %><%= t(".table.actions") %>
-
- <% else %> -
-
-

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

+ <% else %> +
+
+

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

- <%= render DS::Link.new( - text: t(".new"), - icon: "plus", - href: new_family_merchant_path, - frame: :modal - ) %> + <%= render DS::Link.new( + text: t(".new"), + icon: "plus", + href: new_family_merchant_path, + frame: :modal + ) %> +
+
+ <% end %> +
+ +
+
+

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

+ · +

<%= @provider_merchants.count %>

+
+ +
+
+ <%= icon "info", class: "w-5 h-5 text-link mt-0.5 flex-shrink-0" %> +

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

- <% end %> + + <% if @provider_merchants.any? %> +
+
+ + + + + + + + + <%= render partial: "family_merchants/provider_merchant", collection: @provider_merchants %> + +
<%= t(".table.merchant") %><%= t(".table.source") %>
+
+
+ <% else %> +
+

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

+
+ <% end %> +
diff --git a/config/locales/views/merchants/ca.yml b/config/locales/views/merchants/ca.yml index fa7e46708..2fd2d5db0 100644 --- a/config/locales/views/merchants/ca.yml +++ b/config/locales/views/merchants/ca.yml @@ -14,9 +14,19 @@ ca: empty: Encara no hi ha comerços new: Nou comerç title: Comerços + family_title: Comerços familiars + family_empty: Encara no hi ha comerços familiars + provider_title: Comerços del proveïdor + provider_empty: Encara no hi ha comerços del proveïdor vinculats a aquesta família + provider_read_only: Els comerços del proveïdor se sincronitzen automàticament amb les institucions connectades. No es poden editar aquí. + table: + merchant: Comerç + actions: Accions + source: Origen merchant: confirm_accept: Elimina el comerç - confirm_body: Segur que vols eliminar aquest comerç? Si l'elimines, es desvincularan totes les transaccions associades i pot afectar els teus informes. + confirm_body: Segur que vols eliminar aquest comerç? Si l'elimines, es desvincularan + totes les transaccions associades i pot afectar els teus informes. confirm_title: Vols eliminar el comerç? delete: Elimina el comerç edit: Edita el comerç diff --git a/config/locales/views/merchants/de.yml b/config/locales/views/merchants/de.yml index a3dafb8c8..2efbc7dc5 100644 --- a/config/locales/views/merchants/de.yml +++ b/config/locales/views/merchants/de.yml @@ -14,9 +14,19 @@ de: empty: Noch keine Händler vorhanden new: Neuer Händler title: Händler + family_title: Händler der Familie + family_empty: Noch keine Händler der Familie vorhanden + provider_title: Anbieter-Händler + provider_empty: Noch keine Anbieter-Händler mit dieser Familie verbunden + provider_read_only: Anbieter-Händler werden von deinen verbundenen Institutionen synchronisiert. Sie können hier nicht bearbeitet werden. + table: + merchant: Händler + actions: Aktionen + source: Quelle merchant: confirm_accept: Händler löschen - confirm_body: Bist du sicher dass du diesen Händler löschen möchtest Das Entfernen dieses Händlers wird alle zugehörigen Transaktionen trennen und kann deine Auswertungen beeinflussen + confirm_body: Bist du sicher, dass du diesen Händler löschen möchtest? Das Entfernen dieses Händlers + wird alle zugehörigen Transaktionen trennen und kann deine Auswertungen beeinflussen. confirm_title: Händler löschen delete: Händler löschen edit: Händler bearbeiten diff --git a/config/locales/views/merchants/en.yml b/config/locales/views/merchants/en.yml index fab034ceb..4f48c9c21 100644 --- a/config/locales/views/merchants/en.yml +++ b/config/locales/views/merchants/en.yml @@ -14,6 +14,15 @@ en: empty: No merchants yet new: New merchant title: Merchants + family_title: Family merchants + family_empty: No family merchants yet + provider_title: Provider merchants + provider_empty: No provider merchants linked to this family yet + provider_read_only: Provider merchants are synced from your connected institutions. They cannot be edited here. + table: + merchant: Merchant + actions: Actions + source: Source merchant: confirm_accept: Delete merchant confirm_body: Are you sure you want to delete this merchant? Removing this merchant diff --git a/config/locales/views/merchants/es.yml b/config/locales/views/merchants/es.yml index 9a4933b49..f769dfea1 100644 --- a/config/locales/views/merchants/es.yml +++ b/config/locales/views/merchants/es.yml @@ -14,9 +14,19 @@ es: empty: Aún no hay comercios new: Nuevo comercio title: Comercios + family_title: Comercios familiares + family_empty: Aún no hay comercios familiares + provider_title: Comercios del proveedor + provider_empty: Ningún comercio del proveedor vinculado a esta familia todavía + provider_read_only: Los comercios del proveedor se sincronizan desde tus instituciones conectadas. No se pueden editar aquí. + table: + merchant: Comercio + actions: Acciones + source: Origen merchant: confirm_accept: Eliminar comercio - confirm_body: ¿Estás seguro de que deseas eliminar este comercio? Eliminar este comercio desvinculará todas las transacciones asociadas y puede afectar a tus informes. + confirm_body: ¿Estás seguro de que deseas eliminar este comercio? Eliminar este comercio + desvinculará todas las transacciones asociadas y puede afectar a tus informes. confirm_title: ¿Eliminar comercio? delete: Eliminar comercio edit: Editar comercio diff --git a/config/locales/views/merchants/nb.yml b/config/locales/views/merchants/nb.yml index 941951f46..c26372b8c 100644 --- a/config/locales/views/merchants/nb.yml +++ b/config/locales/views/merchants/nb.yml @@ -1,27 +1,36 @@ ---- -nb: - family_merchants: - create: - error: 'Feil ved oppretting av forhandler: %{error}' - success: Ny forhandler opprettet vellykket - destroy: - success: Forhandler slettet vellykket - edit: - title: Rediger forhandler - form: - name_placeholder: Forhandlernavn - index: - empty: Ingen forhandlere ennå - new: Ny forhandler - title: Forhandlere - merchant: - confirm_accept: Slett forhandler - confirm_body: Er du sikker på at du vil slette denne forhandleren? Fjerning av denne forhandleren - vil fjerne koblingen til alle tilknyttede transaksjoner og kan påvirke rapporteringen din. - confirm_title: Slett forhandler? - delete: Slett forhandler - edit: Rediger forhandler - new: - title: Ny forhandler - update: +--- +nb: + family_merchants: + create: + error: 'Feil ved oppretting av forhandler: %{error}' + success: Ny forhandler opprettet vellykket + destroy: + success: Forhandler slettet vellykket + edit: + title: Rediger forhandler + form: + name_placeholder: Forhandlernavn + index: + empty: Ingen forhandlere ennå + new: Ny forhandler + title: Forhandlere + family_title: Familieforhandlere + family_empty: Ingen familieforhandlere ennå + provider_title: Leverandørforhandlere + provider_empty: Ingen leverandørforhandlere er koblet til denne familien ennå + provider_read_only: Leverandørforhandlere synkroniseres fra dine tilkoblede institusjoner. De kan ikke redigeres her. + table: + merchant: Forhandler + actions: Handlinger + source: Kilde + merchant: + confirm_accept: Slett forhandler + confirm_body: Er du sikker på at du vil slette denne forhandleren? Fjerning av denne forhandleren + vil fjerne koblingen til alle tilknyttede transaksjoner og kan påvirke rapporteringen din. + confirm_title: Slett forhandler? + delete: Slett forhandler + edit: Rediger forhandler + new: + title: Ny forhandler + update: success: Forhandler oppdatert vellykket \ No newline at end of file diff --git a/config/locales/views/merchants/ro.yml b/config/locales/views/merchants/ro.yml index 6eb87f607..6f4887818 100644 --- a/config/locales/views/merchants/ro.yml +++ b/config/locales/views/merchants/ro.yml @@ -14,6 +14,15 @@ ro: empty: Niciun comerciant încă new: Comerciant nou title: Comercianți + family_title: Comercianți ai familiei + family_empty: Încă nu există comercianți ai familiei + provider_title: Comercianți furnizor + provider_empty: Niciun comerciant furnizor asociat încă acestei familii + provider_read_only: Comercianții furnizor sunt sincronizați din instituțiile tale conectate. Nu pot fi editați aici. + table: + merchant: Comerciant + actions: Acțiuni + source: Sursă merchant: confirm_accept: Șterge comerciantul confirm_body: Ești sigur că vrei să ștergi acest comerciant? Eliminarea acestui comerciant diff --git a/config/locales/views/merchants/tr.yml b/config/locales/views/merchants/tr.yml index 689a448a8..eeea835ba 100644 --- a/config/locales/views/merchants/tr.yml +++ b/config/locales/views/merchants/tr.yml @@ -14,9 +14,19 @@ tr: empty: "Henüz satıcı yok" new: "Yeni satıcı" title: "Satıcılar" + family_title: "Aile satıcıları" + family_empty: "Henüz aile satıcısı yok" + provider_title: "Sağlayıcı satıcıları" + provider_empty: "Bu aileye bağlı sağlayıcı satıcısı yok" + provider_read_only: "Sağlayıcı satıcılar bağlı olduğunuz kurumlarla otomatik olarak eşitlenir. Burada düzenlenemezler." + table: + merchant: "Satıcı" + actions: "İşlemler" + source: "Kaynak" merchant: confirm_accept: "Satıcıyı sil" - confirm_body: "Bu satıcıyı silmek istediğinizden emin misiniz? Satıcıyı kaldırmak, ilişkili tüm işlemlerin bağlantısını kaldıracak ve raporlamanızı etkileyebilir." + confirm_body: "Bu satıcıyı silmek istediğinizden emin misiniz? Satıcıyı kaldırmak + ilişkili tüm işlemlerin bağlantısını kaldıracak ve raporlamanızı etkileyebilir." confirm_title: "Satıcı silinsin mi?" delete: "Satıcıyı sil" edit: "Satıcıyı düzenle"