diff --git a/app/components/common/action_button/component.html.erb b/app/components/common/action_button/component.html.erb
new file mode 100644
index 000000000..e66940943
--- /dev/null
+++ b/app/components/common/action_button/component.html.erb
@@ -0,0 +1,13 @@
+<% if @type == 'close' %>
+ <%= link_to @href, class: "c-btn #{colorize} c-btn--icon", **@options do %>
+
+ <% end %>
+<% elsif @type == 'edit' %>
+ <%= link_to @href, class: "c-btn #{colorize} c-btn--icon", **@options do %>
+
+ <% end %>
+<% elsif @type == 'delete' %>
+ <%= button_to @href, class: "c-btn #{colorize} c-btn--icon", **@options do %>
+
+ <% end %>
+<% end %>
diff --git a/app/components/common/action_button/component.rb b/app/components/common/action_button/component.rb
new file mode 100644
index 000000000..685102e3f
--- /dev/null
+++ b/app/components/common/action_button/component.rb
@@ -0,0 +1,31 @@
+module Common
+ module ActionButton
+ class Component < ApplicationViewComponent
+ attr_reader :type, :href, :color, :options
+
+ def initialize(type:, href:, color: 'ghost', options: {})
+ super
+
+ @type = type
+ @href = href
+ @color = color
+ @options = options
+ end
+
+ def colorize
+ colors_hash[color]
+ end
+
+ def colors_hash
+ {
+ 'blue-secondary' => 'c-btn--blue-secondary',
+ 'green' => 'c-btn--green',
+ 'blue' => 'c-btn--blue',
+ 'orange' => 'c-btn--orange',
+ 'black' => 'c-btn--black',
+ 'ghost' => 'c-btn--ghost'
+ }
+ end
+ end
+ end
+end
diff --git a/app/components/common/buttons/button_to/component.html.erb b/app/components/common/buttons/button_to/component.html.erb
index 3819abdf0..227c778ab 100644
--- a/app/components/common/buttons/button_to/component.html.erb
+++ b/app/components/common/buttons/button_to/component.html.erb
@@ -1,7 +1,7 @@
<% if content.present? %>
- <%= button_to @href, class: "c-btn--icon c-btn #{colorize}", data: { **@data_attributes }, target: @target, method: @method, form: { **form_attributes } do %>
+ <%= button_to @href, class: "c-btn--icon c-btn #{colorize}", **@options do %>
<%= content %>
<% end %>
<% else %>
- <%= button_to @link_title, @href, class: "c-login__button c-btn #{colorize}", data: { **@data_attributes }, target: @target, method: @method, form: { **form_attributes } %>
+ <%= button_to @title_caption, @href, class: "c-login__button c-btn #{colorize}", **@options%>
<% end %>
diff --git a/app/components/common/buttons/button_to/component.rb b/app/components/common/buttons/button_to/component.rb
index 6db442541..9a5544207 100644
--- a/app/components/common/buttons/button_to/component.rb
+++ b/app/components/common/buttons/button_to/component.rb
@@ -2,18 +2,15 @@ module Common
module Buttons
module ButtonTo
class Component < ApplicationViewComponent
- attr_reader :title_caption, :href, :data_attributes, :color, :target, :method, :form_attributes
+ attr_reader :title_caption, :href, :color, :options
- def initialize(title_caption:, href:, data_attributes: {}, color: 'blue-secondary', target: '_top', method: :post, form_attributes: {})
+ def initialize(href:, title_caption: nil, color: 'blue-secondary', options: {})
super
@title_caption = title_caption
@href = href
- @data_attributes = data_attributes
- @target = target
@color = color
- @method = method
- @form_attributes = form_attributes
+ @options = options
end
def colorize
diff --git a/app/components/common/form/checkbox/component.html.erb b/app/components/common/form/checkboxes/checkbox_with_label/component.html.erb
similarity index 69%
rename from app/components/common/form/checkbox/component.html.erb
rename to app/components/common/form/checkboxes/checkbox_with_label/component.html.erb
index e30a43751..5d33f6813 100644
--- a/app/components/common/form/checkbox/component.html.erb
+++ b/app/components/common/form/checkboxes/checkbox_with_label/component.html.erb
@@ -1,5 +1,5 @@
<%= @label_title %>
- <%= @form.check_box @attribute, class: 'o-checkbox-sample' %>
+ <%= @form.check_box @attribute, class: 'o-checkbox-sample', **@options %>
diff --git a/app/components/common/form/checkboxes/checkbox_with_label/component.rb b/app/components/common/form/checkboxes/checkbox_with_label/component.rb
new file mode 100644
index 000000000..903ba31ff
--- /dev/null
+++ b/app/components/common/form/checkboxes/checkbox_with_label/component.rb
@@ -0,0 +1,20 @@
+module Common
+ module Form
+ module Checkboxes
+ module CheckboxWithLabel
+ class Component < ApplicationViewComponent
+ attr_reader :label_title, :form, :attribute, :options
+
+ def initialize(label_title:, form:, attribute:, options: {})
+ super
+
+ @label_title = label_title
+ @form = form
+ @attribute = attribute
+ @options = options
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/common/form/checkboxes/rounded_checkbox/component.html.erb b/app/components/common/form/checkboxes/rounded_checkbox/component.html.erb
new file mode 100644
index 000000000..2f9021b4f
--- /dev/null
+++ b/app/components/common/form/checkboxes/rounded_checkbox/component.html.erb
@@ -0,0 +1,2 @@
+<%= @form.check_box @attribute, @options %>
+
<%= form_with model: @invoice, url: invoice_path(@invoice.uuid), data: { controller: 'form--debounce', action: 'change->form--debounce#search', form__debounce_target: 'form' } do |f| %>
+ <%= component 'common/form/label', form: f, attribute: :billing_profile_id, title: t('billing_profiles_name') %>
<%= component 'common/form/dropdown_input', form: f, attribute: :billing_profile_id,
enum: options_for_select(BillingProfile.where(user_id: invoice.user_id).pluck(:name, :id), current_billing_profile),
- label: t('billing_profiles_name') %>
-
- <%#= f.submit %>
+ first_options: { include_blank: false } %>
<% end %>
diff --git a/app/components/pages/auction/auction_action_button/component.html.erb b/app/components/pages/auction/auction_action_button/component.html.erb
index fded4a7c0..bc9a11491 100644
--- a/app/components/pages/auction/auction_action_button/component.html.erb
+++ b/app/components/pages/auction/auction_action_button/component.html.erb
@@ -7,7 +7,7 @@
<% else %>
<%# if need to create new offer for english auction %>
<%= component 'common/links/link_button', link_title: deposit_value[:link_title], href: new_auction_english_offer_path(auction_uuid: auction.uuid),
- color: deposit_value[:color], data_attributes: { turbo_frame: 'modal' } %>
+ color: deposit_value[:color], options: { data: { turbo_frame: 'modal' } } %>
<% end %>
<% else %>
@@ -18,7 +18,7 @@
<% else %>
<%# if need to create new offer for blind auction %>
<%= component 'common/links/link_button', link_title: t('auctions.bid'), href: new_auction_offer_path(auction_uuid: auction.uuid),
- color: 'green', data_attributes: { turbo_frame: 'modal' } %>
+ color: 'green', options: { data: { turbo_frame: 'modal' } } %>
<% end %>
<% end %>
diff --git a/app/components/pages/auction/auction_action_button/edit_and_remove_blind_offer/component.html.erb b/app/components/pages/auction/auction_action_button/edit_and_remove_blind_offer/component.html.erb
index 7e35c50d8..97d99a731 100644
--- a/app/components/pages/auction/auction_action_button/edit_and_remove_blind_offer/component.html.erb
+++ b/app/components/pages/auction/auction_action_button/edit_and_remove_blind_offer/component.html.erb
@@ -1,10 +1,10 @@
<%= component 'common/links/link_button', link_title: nil, href: edit_offer_path(@auction.users_offer_uuid),
- color: 'ghost', data_attributes: { turbo_frame: 'modal' } do %>
+ color: 'ghost', options: { data: { turbo_frame: 'modal' } } do %>
<% end %>
- <%= component 'common/buttons/button_to', title_caption: nil, href: offer_path(@auction.offer_from_user(@user).uuid), color: 'ghost', method: :delete,
- form_attributes: { data: { turbo_confirm: t(".confirm_delete") } } do %>
+ <%= component 'common/buttons/button_to', title_caption: nil, href: offer_path(@auction.offer_from_user(@user).uuid), color: 'ghost',
+ options: { method: :delete, form: { data: { turbo_confirm: t(".confirm_delete") } } } do %>
<% end %>
diff --git a/app/components/pages/auction/auction_action_button/edit_english_offer/component.html.erb b/app/components/pages/auction/auction_action_button/edit_english_offer/component.html.erb
index 3fa76e540..f35ad3610 100644
--- a/app/components/pages/auction/auction_action_button/edit_english_offer/component.html.erb
+++ b/app/components/pages/auction/auction_action_button/edit_english_offer/component.html.erb
@@ -1,6 +1,6 @@
<%= component 'common/links/link_button', link_title: nil, href: edit_english_offer_path(@auction.users_offer_uuid),
- color: 'ghost', data_attributes: { turbo_frame: 'modal' } do %>
+ color: 'ghost', options: { data: { turbo_frame: 'modal' } } do %>
<% end %>
diff --git a/app/views/invoices/_outstanding_invoices.html.erb b/app/components/pages/invoices/outstanding_invoices/component.html.erb
similarity index 69%
rename from app/views/invoices/_outstanding_invoices.html.erb
rename to app/components/pages/invoices/outstanding_invoices/component.html.erb
index ad0c9f77c..ec1f235e1 100644
--- a/app/views/invoices/_outstanding_invoices.html.erb
+++ b/app/components/pages/invoices/outstanding_invoices/component.html.erb
@@ -25,15 +25,8 @@
-
-
- <% header_collection = [{ column: nil, caption: t('invoices.item'), options: { class: "" } },
- { column: nil, caption: t('invoices.due_date'), options: { class: "" } },
- { column: nil, caption: t('invoices.total'), options: { class: "" } },
- { column: nil, caption: 'Tegevused', options: { class: "u-text-center-l" } },
- ] %>
- <%= component 'common/table', header_collection:, options: { class: '' } do %>
+ <%= component 'common/table', header_collection: issued_invoice_table_headers, options: { class: '' } do %>
<% @issued_invoices.each do |invoice| %>
@@ -46,14 +39,10 @@
<% end %>
+
- <% header_collection = [{ column: nil, caption: t('invoices.item'), options: { class: "" } },
- { column: nil, caption: t('invoices.due_date'), options: { class: "" } },
- { column: nil, caption: t('invoices.total'), options: { class: "" } },
- { column: nil, caption: 'Tegevused', options: { class: "u-text-center-l" } },
- ] %>
- <%= component 'common/table', header_collection:, options: { class: '' } do %>
+ <%= component 'common/table', header_collection: overdue_invoice_table_headers, options: { class: '' } do %>
<% @cancelled_payable_invoices.each do |invoice| %>
<%= link_to invoice&.items&.first&.name, invoice_path(invoice.uuid), title: "Invoice", data: { turbo_frame: 'modal' }, style: "color: black;" %>
@@ -67,12 +56,7 @@
- <% header_collection = [{ column: nil, caption: t('invoices.item'), options: { class: "" } },
- { column: nil, caption: t('invoices.due_date'), options: { class: "" } },
- { column: nil, caption: t('invoices.total'), options: { class: "" } },
- { column: nil, caption: 'Tegevused', options: { class: "u-text-center-l" } },
- ] %>
- <%= component 'common/table', header_collection:, options: { class: '' } do %>
+ <%= component 'common/table', header_collection: cancel_invoice_table_headers, options: { class: '' } do %>
<% @cancelled_expired_invoices.each do |invoice| %>
<%= link_to invoice&.items&.first&.name, invoice_path(invoice.uuid), title: "Invoice", data: { turbo_frame: 'modal' }, style: "color: black;" %>
diff --git a/app/components/pages/invoices/outstanding_invoices/component.rb b/app/components/pages/invoices/outstanding_invoices/component.rb
new file mode 100644
index 000000000..47f189b25
--- /dev/null
+++ b/app/components/pages/invoices/outstanding_invoices/component.rb
@@ -0,0 +1,47 @@
+module Pages
+ module Invoices
+ module OutstandingInvoices
+ class Component < ApplicationViewComponent
+ attr_reader :issued_invoices, :cancelled_payable_invoices, :cancelled_expired_invoices,
+ :unpaid_invoices_count
+
+ def initialize(issued_invoices:, cancelled_payable_invoices:, cancelled_expired_invoices:,
+ unpaid_invoices_count:)
+ super
+
+ @issued_invoices = issued_invoices
+ @cancelled_payable_invoices = cancelled_payable_invoices
+ @cancelled_expired_invoices = cancelled_expired_invoices
+ @unpaid_invoices_count = unpaid_invoices_count
+ end
+
+ def issued_invoice_table_headers
+ # NB! if you want make columns as sortable, don't forget to wrap the table content within the turbo_frame_tag
+ # with the name "results". The name "results" is assigned as a value for the orderable Stimulus controller
+ # in the table component.
+ [{ column: nil, caption: t('invoices.item'), options: { class: '' } },
+ { column: nil, caption: t('invoices.due_date'), options: { class: '' } },
+ { column: nil, caption: t('invoices.total'), options: { class: '' } },
+ { column: nil, caption: 'Tegevused',
+ options: { class: 'u-text-center-l' } }]
+ end
+
+ def overdue_invoice_table_headers
+ [{ column: nil, caption: t('invoices.item'), options: { class: '' } },
+ { column: nil, caption: t('invoices.due_date'), options: { class: '' } },
+ { column: nil, caption: t('invoices.total'), options: { class: '' } },
+ { column: nil, caption: 'Tegevused',
+ options: { class: 'u-text-center-l' } }]
+ end
+
+ def cancel_invoice_table_headers
+ [{ column: nil, caption: t('invoices.item'), options: { class: '' } },
+ { column: nil, caption: t('invoices.due_date'), options: { class: '' } },
+ { column: nil, caption: t('invoices.total'), options: { class: '' } },
+ { column: nil, caption: 'Tegevused',
+ options: { class: 'u-text-center-l' } }]
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/pages/invoices/paid_invoices/component.html.erb b/app/components/pages/invoices/paid_invoices/component.html.erb
new file mode 100644
index 000000000..e2c67398c
--- /dev/null
+++ b/app/components/pages/invoices/paid_invoices/component.html.erb
@@ -0,0 +1,48 @@
+
+
<%= t('invoices.paid') %>
+
+
+
+ <%= t('invoices.paid') %> (<%= @paid_invoices.count %>)
+
+
+ <%= t('invoices.paid_deposit_title') %> (<%= @deposit_paid.count %>)
+
+
+
+
+
+
+
+ <%= component 'common/table', header_collection: paid_invoices_headers, options: { class: '' } do %>
+ <% @paid_invoices.each do |invoice| %>
+
+ <%= link_to invoice&.items&.first&.name, invoice_path(invoice.uuid), title: "Invoice", data: { turbo_frame: 'modal' }, style: "color: black;" %>
+ <%= I18n.l(invoice.due_date) %>
+ <%= invoice.total %>
+ <%= link_to t('invoices.show_invoice'), invoice_path(invoice.uuid), class: "c-btn c-btn--ghost js-modal-toggle", title: "Invoice", data: { turbo_frame: 'modal' } %>
+
+ <% end %>
+ <% end %>
+
+
+
+
+
+ <%= component 'common/table', header_collection: deposit_paid_headers, options: { class: '' } do %>
+ <% @deposit_paid.each do |deposit| %>
+
+ <%= deposit.created_at.strftime("%Y-%m-%d") %>
+ <%= deposit.auction.deposit %>
+ <%= deposit.auction.domain_name %>
+ <%= component 'common/badgets', status: deposit.status %> <%#= t("invoices.paid_deposit.#{deposit.status}") %>
+ <%= deposit.refund_time %>
+
+ <% end %>
+ <% end %>
+
+
+
+
+
+
diff --git a/app/components/pages/invoices/paid_invoices/component.rb b/app/components/pages/invoices/paid_invoices/component.rb
new file mode 100644
index 000000000..0b80e30b9
--- /dev/null
+++ b/app/components/pages/invoices/paid_invoices/component.rb
@@ -0,0 +1,31 @@
+module Pages
+ module Invoices
+ module PaidInvoices
+ class Component < ApplicationViewComponent
+ attr_reader :paid_invoices, :deposit_paid
+
+ def initialize(paid_invoices:, deposit_paid:)
+ super
+
+ @paid_invoices = paid_invoices
+ @deposit_paid = deposit_paid
+ end
+
+ def paid_invoices_headers
+ [{ column: nil, caption: t('invoices.item'), options: { class: '' } },
+ { column: nil, caption: t('invoices.due_date'), options: { class: '' } },
+ { column: nil, caption: t('invoices.total'), options: { class: '' } },
+ { column: nil, caption: 'Tegevused', options: { class: 'u-text-center-l' } }]
+ end
+
+ def deposit_paid_headers
+ [{ column: nil, caption: t('invoices.paid_deposit.date'), options: { class: '' } },
+ { column: nil, caption: t('invoices.paid_deposit.sum'), options: { class: '' } },
+ { column: nil, caption: t('invoices.paid_deposit.auction_name'), options: { class: '' } },
+ { column: nil, caption: t('invoices.paid_deposit.status'), options: { class: '' } },
+ { column: nil, caption: t('invoices.paid_deposit.refund_time'), options: { class: '' } }]
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/pages/offers/blind_auction_offer_table/component.html.erb b/app/components/pages/offers/blind_auction_offer_table/component.html.erb
new file mode 100644
index 000000000..fcd6f3c54
--- /dev/null
+++ b/app/components/pages/offers/blind_auction_offer_table/component.html.erb
@@ -0,0 +1,10 @@
+ <%= component 'common/table', header_collection: header_collection, options: { class: 'table--black' } do %>
+ <%= tag.tbody do %>
+
+ <%= @offer.auction.domain_name %>
+ 2<%= I18n.l(@offer.auction.ends_at) %>
+ <%= t('offers.price_in_currency', price: @offer.price) %>
+ <%= t('offers.price_in_currency', price: @offer.total) %>
+
+ <% end %>
+ <% end %>
diff --git a/app/components/pages/offers/blind_auction_offer_table/component.rb b/app/components/pages/offers/blind_auction_offer_table/component.rb
new file mode 100644
index 000000000..beb62d87c
--- /dev/null
+++ b/app/components/pages/offers/blind_auction_offer_table/component.rb
@@ -0,0 +1,22 @@
+module Pages
+ module Offers
+ module BlindAuctionOfferTable
+ class Component < ApplicationViewComponent
+ attr_reader :offer
+
+ def initialize(offer:)
+ super
+
+ @offer = offer
+ end
+
+ def header_collection
+ [{ column: nil, caption: t('auctions.domain_name'), options: { class: '' } },
+ { column: nil, caption: t('auctions.ends_at'), options: { class: '' } },
+ { column: nil, caption: t('offers.price'), options: { class: '' } },
+ { column: nil, caption: t('offers.total'), options: { class: '' } }]
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/pages/offers/english_auction_offer_table/component.html.erb b/app/components/pages/offers/english_auction_offer_table/component.html.erb
new file mode 100644
index 000000000..f98d1e885
--- /dev/null
+++ b/app/components/pages/offers/english_auction_offer_table/component.html.erb
@@ -0,0 +1,58 @@
+
+
+
+
<%= t('offers.overview') %>
+ <%= component 'common/table', header_collection: overview_table_headers, options: { class: 'table--black' } do %>
+ <%= tag.tbody do %>
+
+ <%= @offer.auction.domain_name %>
+ 2<%= I18n.l(@offer.auction.ends_at) %>
+ <%= t('offers.price_in_currency', price: @offer.price) %>
+ <%= t('offers.price_in_currency', price: @offer.total) %>
+
+ <% end %>
+ <% end %>
+
+
+
+
+
+
+
+
+
+
<%= t('offers.show.participants_title') %>
+ <%= component 'common/table', header_collection: bidder_table_headers, options: { class: '' } do %>
+ <%= tag.tbody do %>
+ <% @offer.auction.offers.order(updated_at: :desc).each do |offer| %>
+
+
+ <%= offer&.billing_profile&.user_id == current_user.id ? "#{offer.username} (You)" : offer.username %>
+
+ <%= t('offers.price_in_currency', price: offer.price) %>
+ <%= I18n.l(offer.updated_at) %>
+
+ <% end %>
+ <% end %>
+ <% end %>
+
+
+
<%= t('offers.show.deposit_title') %>
+ <%= component 'common/table', header_collection: deposit_payment_table_headers, options: { class: '' } do %>
+ <%= tag.tbody do %>
+ <% @offer.auction.domain_participate_auctions.each do |d| %>
+
+
+ <%= d.user.display_name %>
+
+ <%= I18n.l(d.created_at) %>
+
+ <% end %>
+ <% end %>
+ <% end %>
+
+
+
+
+
+
diff --git a/app/components/pages/offers/english_auction_offer_table/component.rb b/app/components/pages/offers/english_auction_offer_table/component.rb
new file mode 100644
index 000000000..8ffe57b8d
--- /dev/null
+++ b/app/components/pages/offers/english_auction_offer_table/component.rb
@@ -0,0 +1,33 @@
+module Pages
+ module Offers
+ module EnglishAuctionOfferTable
+ class Component < ApplicationViewComponent
+ attr_reader :offer
+
+ def initialize(offer:)
+ super
+
+ @offer = offer
+ end
+
+ def overview_table_headers
+ [{ column: nil, caption: t('auctions.domain_name'), options: { class: '' } },
+ { column: nil, caption: t('auctions.ends_at'), options: { class: '' } },
+ { column: nil, caption: t('offers.price'), options: { class: '' } },
+ { column: nil, caption: t('offers.total'), options: { class: '' } }]
+ end
+
+ def bidder_table_headers
+ [{ column: nil, caption: t('offers.show.participants'), options: { class: '' } },
+ { column: nil, caption: t('offers.show.your_last_offer'), options: { class: '' } },
+ { column: nil, caption: t('offers.show.offers_time'), options: { class: '' } }]
+ end
+
+ def deposit_payment_table_headers
+ [{ column: nil, caption: t('offers.show.deposit_participants'), options: { class: '' } },
+ { column: nil, caption: t('offers.show.offers_time'), options: { class: '' } }]
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/pages/offers/offers_table/component.html.erb b/app/components/pages/offers/offers_table/component.html.erb
new file mode 100644
index 000000000..69cae5e0f
--- /dev/null
+++ b/app/components/pages/offers/offers_table/component.html.erb
@@ -0,0 +1,31 @@
+
+
+
+ <%= form_with url: offers_path,
+ method: :get, data: { controller: 'form--debounce form--filter',
+ form__debounce_target: 'form',
+ form__filter_target: 'form',
+ turbo_action: "advance",
+ turbo_frame: "results",
+ action: 'input->form--debounce#search'
+ } do |f| %>
+
+ <%# TODO: Add filter and search feature %>
+
+ <% end %>
+
+
+
+
+ <%= turbo_frame_tag "results" do %>
+
+
+ <%= component 'common/table', header_collection: header_collection, options: { class: 'js-table-dt dataTable no-footer' } do %>
+
+ <%= render @offers %>
+ <% end %>
+ <% end %>
+
+
diff --git a/app/components/pages/offers/offers_table/component.rb b/app/components/pages/offers/offers_table/component.rb
new file mode 100644
index 000000000..48f930aa8
--- /dev/null
+++ b/app/components/pages/offers/offers_table/component.rb
@@ -0,0 +1,26 @@
+module Pages
+ module Offers
+ module OffersTable
+ class Component < ApplicationViewComponent
+ attr_reader :offers
+
+ def initialize(offers:)
+ super
+
+ @offers = offers
+ end
+
+ def header_collection
+ [{ column: 'auctions.domain_name', caption: t('auctions.domain_name'), options: { class: 'sorting' } },
+ { column: 'auctions.platform', caption: 'Tüüp', options: { class: 'sorting' } },
+ { column: 'price', caption: t('.your_last_offer'), options: { class: 'sorting' } },
+ { column: nil, caption: t('offers.total'), options: { class: '' } },
+ { column: 'auctions.ends_at', caption: t('auctions.ends_at'),
+ options: { class: 'sorting' } },
+ { column: nil, caption: t('result_name'), options: {} },
+ { column: nil, caption: t('auctions.offer_actions'), options: {} }]
+ end
+ end
+ end
+ end
+end
diff --git a/app/controllers/payment_orders_controller.rb b/app/controllers/payment_orders_controller.rb
index 9933cc9e6..234d58dea 100644
--- a/app/controllers/payment_orders_controller.rb
+++ b/app/controllers/payment_orders_controller.rb
@@ -25,38 +25,6 @@ def show
@payment_order.callback_url = callback_payment_order_url(@payment_order.uuid)
end
- # # ANY /payment_orders/aa450f1a-45e2-4f22-b2c3-f5f46b5f906b/return
- # def return
- # @payment_order = PaymentOrder.find_by!(uuid: params[:uuid])
-
- # if @payment_order.paid?
- # respond_to do |format|
- # format.html do
- # redirect_to invoices_path, notice: t('.already_paid') and return
- # end
-
- # format.json { render json: @payment_order.errors, status: :unprocessable_entity and return }
- # end
- # end
-
- # @payment_order.update!(response: params.to_unsafe_h)
-
- # ResultStatusUpdateJob.perform_later
-
- # respond_to do |format|
- # if @payment_order.mark_invoice_as_paid
- # format.html { redirect_to invoices_path, notice: successful_update_notice }
- # format.json { redirect_to invoices_path, notice: successful_update_notice }
- # else
- # format.html do
- # redirect_to invoices_path,
- # notice: t('.not_successful')
- # end
- # format.json { render json: @payment_order.errors, status: :unprocessable_entity }
- # end
- # end
- # end
-
# POST /payment_orders/aa450f1a-45e2-4f22-b2c3-f5f46b5f906b/callback
def callback
render status: :ok, json: { status: 'ok' }
@@ -76,12 +44,6 @@ def create_params
params.require(:payment_order).permit(:user_id, :invoice_id, :invoice_ids, :type)
end
- # def successful_update_notice
- # invoice_ids = @payment_order.invoices.map(&:number).join(', ')
- # return t('.bulk_update', ids: invoice_ids) if @payment_order.invoices.count > 1
- # t(:updated)
- # end
-
def authorize_user
authorize! :read, PaymentOrder
authorize! :create, PaymentOrder
diff --git a/app/views/auctions/_auction.html.erb b/app/views/auctions/_auction.html.erb
index 13e1f21e3..44fb0d0ac 100644
--- a/app/views/auctions/_auction.html.erb
+++ b/app/views/auctions/_auction.html.erb
@@ -28,7 +28,7 @@
<% if user %>
<%= component 'pages/auction/auction_action_button', user: user, auction: auction, updated: updated %>
<% else %>
- <%= component 'common/links/link_button', link_title: t('auctions.bid'), href: new_user_session_path, color: 'green', target: '_top' %>
+ <%= component 'common/links/link_button', link_title: t('auctions.bid'), href: new_user_session_path, color: 'green', options: { target: '_top' } %>
<% end %>
diff --git a/app/views/billing_profiles/_billing_info.html.erb b/app/views/billing_profiles/_billing_info.html.erb
index bec2b7abb..1d810f705 100644
--- a/app/views/billing_profiles/_billing_info.html.erb
+++ b/app/views/billing_profiles/_billing_info.html.erb
@@ -9,9 +9,7 @@
<% end %>
- <%= link_to edit_billing_profile_path(billing_profile.uuid), data: { turbo_frame: dom_id(billing_profile) }, class: "c-btn c-btn--ghost c-btn--icon js-edit-modal-toggle" do %>
-
- <% end %>
+ <%= component 'common/action_button', type: 'edit', href: edit_billing_profile_path(billing_profile.uuid), options: { data: { turbo_frame: dom_id(billing_profile) }} %>
-<% end %>
\ No newline at end of file
+<% end %>
diff --git a/app/views/billing_profiles/index.html.erb b/app/views/billing_profiles/index.html.erb
index 76d630f1f..f712323dd 100644
--- a/app/views/billing_profiles/index.html.erb
+++ b/app/views/billing_profiles/index.html.erb
@@ -1,6 +1,5 @@
<%= component 'common/hero', title: t('.title') %>
-
@@ -17,8 +16,9 @@
- <%= link_to t('billing_profiles.new.title'), new_billing_profile_path, class: "c-btn c-btn--green", data: { turbo_frame: 'new_billing_profile' } %>
+ <%= component 'common/links/link_button', link_title: t('billing_profiles.new.title'), href: new_billing_profile_path,
+ color: 'green', options: { data: { turbo_frame: 'new_billing_profile' } } %>
-
+
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb
index ae781b7ea..8bfdc5d7a 100644
--- a/app/views/devise/passwords/edit.html.erb
+++ b/app/views/devise/passwords/edit.html.erb
@@ -5,20 +5,25 @@
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "o-card" }) do |f| %>
<%= f.hidden_field :reset_password_token %>
<%= t(:change_your_password) %>
+
+ <%# TODO: Resolve the problem of nested label components %>
<%= f.label :password do %>
<%= t('.new_password') %>
<% if @minimum_password_length %>
(<%= t('.min_characters', min_chars: @minimum_password_length ) %>)
<% end %>
<% end %>
- <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
+
+ <%= component 'common/form/password_field', form: f, attribute: :password, options: { autofocus: true, autocomplete: "new-password" } %>
- <%= f.label :password_confirmation, t('.confirm_new_password') %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ <%= component 'common/form/label', form: f, attribute: :password_confirmation, title: t('.confirm_new_password') %>
+ <%= component 'common/form/password_field', form: f, attribute: :password_confirmation, options: { autocomplete: "off" } %>
- <%= f.submit t(:submit), class: 'c-btn c-btn--green', data: { turbo: false } %>
+
+ <%= component 'common/form/form_button', form: f, color: 'green', btn_title: t(:submit), options: { data: { turbo: false } } %>
+
<%= link_to t(:sign_in), new_user_session_path, class: "o-link u-mb-8" %>
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index 96fe31a95..74cfae58a 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -10,7 +10,7 @@
- <%= component 'common/buttons/button_to', title_caption: t(:sign_in), href: "/auth/tara", color: 'blue-secondary', data_attributes: { turbo: false } %>
+ <%= component 'common/buttons/button_to', title_caption: t(:sign_in), href: "/auth/tara", color: 'blue-secondary', options: { data: { turbo: false } } %>
<%= render partial: 'svg/id_auth' %>
@@ -20,20 +20,20 @@
<%= t('.sign_in_with_password') %>
<%= form_for resource, as: resource_name, url: session_path(resource_name), html: { class: 'c-login__form' } do |f| %>
- <%= component 'common/form/email_field', form: f, attribute: :email,
- options: { autocomplete: 'email', autofocus: true, label_caption: t('users.email') } %>
+ <%= component 'common/form/label', form: f, attribute: :email, title: t('users.email') %>
+ <%= component 'common/form/email_field', form: f, attribute: :email, options: { autocomplete: 'email', autofocus: true } %>
- <%= component 'common/form/password_field', form: f, attribute: :password,
- options: { autocomplete: 'password', autofocus: true, label_caption: t('users.password') } %>
+ <%= component 'common/form/label', form: f, attribute: :password, title: t('users.password') %>
+ <%= component 'common/form/password_field', form: f, attribute: :password, options: { autocomplete: 'password', autofocus: true } %>
- <%= component 'common/form/form_button', form: f, btn_title: t(:sign_in), data_turbo: false %>
+ <%= component 'common/form/form_button', form: f, btn_title: t(:sign_in), options: { data: { turbo: false } } %>
<%= component 'common/links/link_button', link_title: t('users.index.create_an_account'), href: new_user_path, color: 'ghost' %>
- <%= component 'common/form/checkbox', label_title: t('users.remember_me'), form: f, attribute: :remember_me if devise_mapping.rememberable? %>
+ <%= component 'common/form/checkboxes/checkbox_with_label', label_title: t('users.remember_me'), form: f, attribute: :remember_me if devise_mapping.rememberable? %>
<%= link_to t('devise.shared.links.forgot_your_password'),
diff --git a/app/views/english_offers/edit.html.erb b/app/views/english_offers/edit.html.erb
index 57b1de4ab..9a91b97e5 100644
--- a/app/views/english_offers/edit.html.erb
+++ b/app/views/english_offers/edit.html.erb
@@ -1,19 +1,6 @@
<%= turbo_stream_from "auctions_offer_#{@auction.id}" %>
<%= turbo_frame_tag "modal" do %>
-
<%= component 'modals/change_offer', offer: @offer, auction: @auction, autobider: @autobider, update: true, current_user: current_user, captcha_required: true, show_checkbox_recaptcha: @show_checkbox_recaptcha %>
-
-
-
- <%#= component 'modals/change_offer_po' %>
-
-
-
- <%#= component 'modals/edit_offer', offer: @offer, auction: @auction, autobider: @autobider %>
-
-
-
- <%#= component 'modals/delete_offer' %>
<% end %>
diff --git a/app/views/english_offers/new.html.erb b/app/views/english_offers/new.html.erb
index bcd625cba..f8d29d19a 100644
--- a/app/views/english_offers/new.html.erb
+++ b/app/views/english_offers/new.html.erb
@@ -1,25 +1,10 @@
<%= turbo_stream_from "auctions_offer_#{@offer.auction.id}" %>
<%= turbo_frame_tag "modal" do %>
-
<% if @auction.allow_to_set_bid?(current_user) %>
<%= component 'modals/change_offer', offer: @offer, auction: @auction, autobider: @autobider, update: false, current_user: current_user, captcha_required: true, show_checkbox_recaptcha: @show_checkbox_recaptcha %>
<% else %>
<%= component 'modals/deposit', auction: @auction, current_user: current_user, captcha_required: true, show_checkbox_recaptcha: @show_checkbox_recaptcha %>
<% end %>
-
-
-
-
-
- <%#= component 'modals/change_offer_po' %>
-
-
-
- <%#= component 'modals/edit_offer' %>
-
-
-
- <%#= component 'modals/delete_offer' %>
<% end %>
diff --git a/app/views/english_offers/show.html.erb b/app/views/english_offers/show.html.erb
index 61fbe6396..d2f102ab8 100644
--- a/app/views/english_offers/show.html.erb
+++ b/app/views/english_offers/show.html.erb
@@ -1,67 +1,2 @@
<%= component 'common/hero', title: @offer.auction.domain_name %>
-
-
-
-
<%= t('offers.overview') %>
- <% header_collection = [{ column: nil, caption: t('auctions.domain_name'), options: { class: "" } },
- { column: nil, caption: t('auctions.ends_at'), options: { class: "" } },
- { column: nil, caption: t('offers.price'), options: { class: "" } },
- { column: nil, caption: t('offers.total'), options: { class: "" } }] %>
- <%= component 'common/table', header_collection:, options: { class: 'table--black' } do %>
- <%= tag.tbody do %>
-
- <%= @offer.auction.domain_name %>
- 2<%= I18n.l(@offer.auction.ends_at) %>
- <%= t('offers.price_in_currency', price: @offer.price) %>
- <%= t('offers.price_in_currency', price: @offer.total) %>
-
- <% end %>
- <% end %>
-
-
-
-
-
-
-
-
-
<%= t('offers.show.participants_title') %>
- <% header_collection = [{ column: nil, caption: t('offers.show.participants'), options: { class: "" } },
- { column: nil, caption: t('offers.show.your_last_offer'), options: { class: "" } },
- { column: nil, caption: t('offers.show.offers_time'), options: { class: "" } }] %>
- <%= component 'common/table', header_collection:, options: { class: '' } do %>
- <%= tag.tbody do %>
- <% @offer.auction.offers.order(updated_at: :desc).each do |offer| %>
-
-
- <%= offer&.billing_profile&.user_id == current_user.id ? "#{offer.username} (You)" : offer.username %>
-
- <%= t('offers.price_in_currency', price: offer.price) %>
- <%= I18n.l(offer.updated_at) %>
-
- <% end %>
- <% end %>
- <% end %>
-
-
-
<%= t('offers.show.deposit_title') %>
- <% header_collection = [{ column: nil, caption: t('offers.show.deposit_participants'), options: { class: "" } },
- { column: nil, caption: t('offers.show.offers_time'), options: { class: "" } }] %>
- <%= component 'common/table', header_collection:, options: { class: '' } do %>
- <%= tag.tbody do %>
- <% @offer.auction.domain_participate_auctions.each do |d| %>
-
-
- <%= d.user.display_name %>
-
- <%= I18n.l(d.created_at) %>
-
- <% end %>
- <% end %>
- <% end %>
-
-
-
-
-
-
+<%= component 'pages/offers/english_auction_offer_table', offer: @offer %>
diff --git a/app/views/histories/index.html.erb b/app/views/histories/index.html.erb
index 1f78bd954..a7ab14ad5 100644
--- a/app/views/histories/index.html.erb
+++ b/app/views/histories/index.html.erb
@@ -1,3 +1,5 @@
+<%# TODO: Make as auctuion index page %>
+
<% content_for :hero do %>
<%= t(:finished) %>
diff --git a/app/views/invoices/_paid_invoices.html.erb b/app/views/invoices/_paid_invoices.html.erb
deleted file mode 100644
index 33515807a..000000000
--- a/app/views/invoices/_paid_invoices.html.erb
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
<%= t('invoices.paid') %>
-
-
-
- <%= t('invoices.paid') %> (<%= @paid_invoices.count %>)
-
-
- <%= t('invoices.paid_deposit_title') %> (<%= @deposit_paid.count %>)
-
-
-
-
-
-
-
- <% header_collection = [{ column: nil, caption: t('invoices.item'), options: { class: "" } },
- { column: nil, caption: t('invoices.due_date'), options: { class: "" } },
- { column: nil, caption: t('invoices.total'), options: { class: "" } },
- { column: nil, caption: 'Tegevused', options: { class: "u-text-center-l" } },
- ] %>
- <%= component 'common/table', header_collection:, options: { class: '' } do %>
- <% @paid_invoices.each do |invoice| %>
-
- <%= link_to invoice&.items&.first&.name, invoice_path(invoice.uuid), title: "Invoice", data: { turbo_frame: 'modal' }, style: "color: black;" %>
- <%= I18n.l(invoice.due_date) %>
- <%= invoice.total %>
- <%= link_to t('invoices.show_invoice'), invoice_path(invoice.uuid), class: "c-btn c-btn--ghost js-modal-toggle", title: "Invoice", data: { turbo_frame: 'modal' } %>
-
- <% end %>
- <% end %>
-
-
-
-
-
- <% header_collection = [{ column: nil, caption: t('invoices.paid_deposit.date'), options: { class: "" } },
- { column: nil, caption: t('invoices.paid_deposit.sum'), options: { class: "" } },
- { column: nil, caption: t('invoices.paid_deposit.auction_name'), options: { class: "" } },
- { column: nil, caption: t('invoices.paid_deposit.status'), options: { class: "" } },
- { column: nil, caption: t('invoices.paid_deposit.refund_time'), options: { class: "" } }
- ] %>
- <%= component 'common/table', header_collection:, options: { class: '' } do %>
- <% @deposit_paid.each do |deposit| %>
-
- <%= deposit.created_at.strftime("%Y-%m-%d") %>
- <%= deposit.auction.deposit %>
- <%= deposit.auction.domain_name %>
- <%= component 'common/badgets', status: deposit.status %> <%#= t("invoices.paid_deposit.#{deposit.status}") %>
- <%= deposit.refund_time %>
-
- <% end %>
- <% end %>
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/views/invoices/index.html.erb b/app/views/invoices/index.html.erb
index 12a54fa2e..b2bb45668 100644
--- a/app/views/invoices/index.html.erb
+++ b/app/views/invoices/index.html.erb
@@ -1,7 +1,7 @@
<%= component 'common/hero', title: t('.title') %>
-
- <%= render 'outstanding_invoices' %>
- <%= render 'paid_invoices' %>
+ <%= component 'pages/invoices/outstanding_invoices', issued_invoices: @issued_invoices, cancelled_payable_invoices: @cancelled_payable_invoices,
+ cancelled_expired_invoices: @cancelled_expired_invoices, unpaid_invoices_count: @unpaid_invoices_count %>
+ <%= component 'pages/invoices/paid_invoices', paid_invoices: @paid_invoices, deposit_paid: @deposit_paid %>
diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb
index 66ba97a9c..dc14c07a6 100644
--- a/app/views/notifications/index.html.erb
+++ b/app/views/notifications/index.html.erb
@@ -3,7 +3,7 @@
- <%= button_to t('notifications.read_all'), mark_as_read_notifications_path, method: :patch, class: 'c-btn c-btn--orange' %>
+ <%= component 'common/buttons/button_to', title_caption: t('notifications.read_all'), href: mark_as_read_notifications_path, color: 'orange', options: { method: :patch } %>
<%= t('notifications.unreaded_notifications') %> (<%= @unread_notifications&.count %>)
diff --git a/app/views/offers/_offer.html.erb b/app/views/offers/_offer.html.erb
index ee0084968..7595fcf86 100644
--- a/app/views/offers/_offer.html.erb
+++ b/app/views/offers/_offer.html.erb
@@ -1,3 +1,4 @@
+<%# TODO: Move to component and all logic should be in represent part %>
<% if offer.auction.english? %>
@@ -29,13 +30,11 @@
<%- if offer.result %>
- <%= link_to t('offers.index.claim_your_domain'), result_path(offer.result.uuid), class: "c-btn c-btn--green", data: { turbo_frame: 'modal' } %>
+ <%= component 'common/links/link_button', link_title: t('offers.index.claim_your_domain'), href: result_path(offer.result.uuid), color: 'green', options: { data: { turbo_frame: 'modal' } } %>
<%- else %>
- <% unless offer.auction.english? || offer.auction.finished? %>
- <%= link_to offer_delete_path(offer_uuid: offer.uuid), class: "c-btn c-btn--ghost c-btn--icon", data: { turbo_frame: 'modal' } do %>
-
- <% end %>
- <% end %>
+ <%= component 'common/links/link_button', href: offer_delete_path(offer_uuid: offer.uuid), color: 'ghost', options: { data: { turbo_frame: 'modal' } } do %>
+
+ <% end unless offer.auction.english? || offer.auction.finished? %>
<% end %>
diff --git a/app/views/offers/delete.html.erb b/app/views/offers/delete.html.erb
index 51a39c29d..3ab51e9cd 100644
--- a/app/views/offers/delete.html.erb
+++ b/app/views/offers/delete.html.erb
@@ -1,18 +1,5 @@
<%= turbo_frame_tag "modal" do %>
-
- <%#= component 'modals/change_offer' %>
-
-
-
<%= component 'modals/delete_offer', offer: @offer %>
-
-
-
- <%#= component 'modals/edit_offer' %>
-
-
-
- <%#= component 'modals/delete_offer' %>
<% end %>
diff --git a/app/views/offers/edit.html.erb b/app/views/offers/edit.html.erb
index d285360d8..241f0b2c1 100644
--- a/app/views/offers/edit.html.erb
+++ b/app/views/offers/edit.html.erb
@@ -1,18 +1,5 @@
<%= turbo_frame_tag "modal" do %>
-
- <%#= component 'modals/change_offer' %>
-
-
-
<%= component 'modals/change_offer_po', offer: @offer, auction: @offer.auction, update: true, current_user: current_user, captcha_required: true, show_checkbox_recaptcha: @show_checkbox_recaptcha %>
-
-
-
- <%#= component 'modals/edit_offer' %>
-
-
-
- <%#= component 'modals/delete_offer' %>
<% end %>
diff --git a/app/views/offers/index.html.erb b/app/views/offers/index.html.erb
index aaaeea961..e2d467307 100644
--- a/app/views/offers/index.html.erb
+++ b/app/views/offers/index.html.erb
@@ -1,43 +1,3 @@
<%= component 'common/hero', title: t(:my_offers) %>
-
-
-
-<% header_collection = [{ column: 'auctions.domain_name', caption: t('auctions.domain_name'), options: { class: "sorting" } },
- { column: 'auctions.platform', caption: 'Tüüp', options: { class: "sorting" } },
- { column: 'price', caption: t('.your_last_offer'), options: { class: "sorting" } },
- { column: nil, caption: t('offers.total'), options: { class: "" } },
- { column: 'auctions.ends_at', caption: t('auctions.ends_at'), options: { class: "sorting" } },
- { column: nil, caption: t('result_name'), options: {} },
- { column: nil, caption: t('auctions.offer_actions'), options: {} },
- ] %>
-
-
- <%= form_with url: offers_path,
- method: :get, data: { controller: 'form--debounce form--filter',
- form__debounce_target: 'form',
- form__filter_target: 'form',
- turbo_action: "advance",
- turbo_frame: "results",
- action: 'input->form--debounce#search'
- } do |f| %>
-
- <% end %>
-
-
-
-
- <%= turbo_frame_tag "results" do %>
-
-
- <%= component 'common/table', header_collection:, options: { class: 'js-table-dt dataTable no-footer' } do %>
-
- <%= render @offers %>
- <% end %>
- <% end %>
-
-
-
+<%= component 'pages/offers/offers_table', offers: @offers %>
<%= component 'common/pagy', pagy: @pagy %>
-
diff --git a/app/views/offers/new.html.erb b/app/views/offers/new.html.erb
index ee7797ab1..ea8d30d25 100644
--- a/app/views/offers/new.html.erb
+++ b/app/views/offers/new.html.erb
@@ -1,18 +1,5 @@
<%= turbo_frame_tag "modal" do %>
-
- <%#= component 'modals/change_offer' %>
-
-
-
<%= component 'modals/change_offer_po', offer: @offer, auction: @auction, update: false, current_user: current_user, captcha_required: true, show_checkbox_recaptcha: @show_checkbox_recaptcha %>
-
-
-
- <%#= component 'modals/edit_offer' %>
-
-
-
- <%#= component 'modals/delete_offer' %>
<% end %>
diff --git a/app/views/offers/show.html.erb b/app/views/offers/show.html.erb
index fdb8a2995..251d02d2a 100644
--- a/app/views/offers/show.html.erb
+++ b/app/views/offers/show.html.erb
@@ -3,23 +3,6 @@
<%= t('offers.overview') %>
- <% header_collection = [{ column: nil, caption: t('auctions.domain_name'), options: { class: "" } },
- { column: nil, caption: t('auctions.ends_at'), options: { class: "" } },
- { column: nil, caption: t('offers.price'), options: { class: "" } },
- { column: nil, caption: t('offers.total'), options: { class: "" } }] %>
- <%= component 'common/table', header_collection:, options: { class: 'table--black' } do %>
- <%= tag.tbody do %>
-
- <%= @offer.auction.domain_name %>
- 2<%= I18n.l(@offer.auction.ends_at) %>
- <%= t('offers.price_in_currency', price: @offer.price) %>
- <%= t('offers.price_in_currency', price: @offer.total) %>
-
- <% end %>
- <% end %>
+ <%= component 'pages/offers/blind_auction_offer_table', offer: @offer %>
-
-
-
-
diff --git a/app/views/phone_confirmations/_form.html.erb b/app/views/phone_confirmations/_form.html.erb
index 952596d1d..00c61fbe9 100644
--- a/app/views/phone_confirmations/_form.html.erb
+++ b/app/views/phone_confirmations/_form.html.erb
@@ -2,8 +2,8 @@
- <%= f.label :confirmation_code %>
- <%= f.text_field :confirmation_code %>
+ <%= component 'common/form/label', form: f, attribute: :confirmation_code %>
+ <%= component 'common/form/text_field', form: f, attribute: :confirmation_code %>
diff --git a/app/views/svg/_trash.html.erb b/app/views/svg/_trash.html.erb
new file mode 100644
index 000000000..2d65f7674
--- /dev/null
+++ b/app/views/svg/_trash.html.erb
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
index d32b1b004..87d38eec8 100644
--- a/app/views/users/_form.html.erb
+++ b/app/views/users/_form.html.erb
@@ -11,28 +11,28 @@
+
<%= t('users.show.settings') %>
@@ -54,32 +55,45 @@
<%= t('common.webpush_modal.webpush_title') %>: <%= t('yes') %>
+
+ <%# ======== TODO: Fixed the problem with nested label component ======= %>
<%= f.label :daily_summary, class: 'o-checkbox' do %>
- <%= f.check_box :daily_summary, data: {
+ <%= component 'common/form/checkboxes/rounded_checkbox', form: f, attribute: :daily_summary,
+ options: {
controller: 'form--checkbox-autosubmit', form__checkbox_autosubmit_target: 'checkbox',
- form__checkbox_autosubmit_url_value: user_path(user.uuid), action: 'change->form--checkbox-autosubmit#submit' } %>
-
+ form__checkbox_autosubmit_url_value: user_path(user.uuid), action: 'change->form--checkbox-autosubmit#submit'
+ }
+ %>
<% end %>
+ <%# ===================== %>
+
<%= t('users.show.daily_summary') %>: <%= @user.daily_summary ? t('yes') : t('no') %>
+
<%= t('users.terms_and_conditions_link') %>
+
+
- <% if user.persisted? || (user.signed_in_with_identity_document? && user.encrypted_password.blank?) %>
-
<%= t('.new_password') %>
- <% else %>
-
<%= t('users.password') %>
- <% end %>
+
+ <% user.persisted? || (user.signed_in_with_identity_document? && user.encrypted_password.blank?) ? t('.new_password') : t('users.password') %>
+
+
+
- <%= f.label :password_confirmation, t('users.password_confirmation') %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ <%= component 'common/form/label', form: f, attribute: :password_confirmation, title: t('users.password_confirmation') %>
+ <%= component 'common/form/password_field', form: f, attribute: :password_confirmation, options: { autocomplete: "off" } %>
+
<% if user.persisted? && !user.signed_in_with_identity_document? %>
Kinnita muudatused
<%= t('.we_need_your_password') %>
- <%= f.label :current_password, t('users.current_password') %>
- <%= f.password_field :current_password, autocomplete: "off" %>
+ <%= component 'common/form/label', form: f, attribute: :current_password, title: t('users.current_password') %>
+ <%= component 'common/form/password_field', form: f, attribute: :current_password, options: { autocomplete: "off" } %>
<% end %>
- <%= link_to t(:cancel), '#', class: "c-btn c-btn--ghost c-account__btn", data: { turbo_frame: 'user_info' } %>
- <%= f.button class: "c-btn c-btn--green c-account__btn u-ml-16" do %><%= t(:submit) %><% end %>
+ <%= component 'common/links/link_button', link_title: t(:cancel), href: '#', color: 'ghost', options: { data: { turbo_frame: 'user_info' } } %>
+ <%= component 'common/form/form_button', form: f, btn_title: t(:submit) %>
+
<% end %>
<% end %>
diff --git a/app/views/users/_sign_up_form.html.erb b/app/views/users/_sign_up_form.html.erb
index 70f56a358..7c7146e3a 100644
--- a/app/views/users/_sign_up_form.html.erb
+++ b/app/views/users/_sign_up_form.html.erb
@@ -1,90 +1,83 @@
-
+
+
<%= t('users.edit.contact_data') %>
+
+ <%= component 'common/form/label', form: f, attribute: :email, title: t('users.email') %>
+ <%= component 'common/form/email_field', form: f, attribute: :email, options: { autocomplete: 'email', autofocus: true } %>
+
+
+ <%= component 'common/form/label', form: f, attribute: :mobile_phone, title: t('users.mobile_phone') %>
+ <%= component 'common/form/telephone_field', form: f, attribute: :mobile_phone, options: { autofocus: true, autocomplete: "off", placeholder: "+372xxxxxxxx" } %>
+
+
+ <%= component 'common/form/label', form: f, attribute: :given_names, title: t('users.given_names') %>
+ <%= component 'common/form/text_field', form: f, attribute: :given_names, options: { autofocus: true } %>
+
+
+ <%= component 'common/form/label', form: f, attribute: :surname, title: t('users.surname') %>
+ <%= component 'common/form/text_field', form: f, attribute: :surname, options: { autofocus: true } %>
+
+
-
-
<%= t('users.edit.contact_data') %>
-
- <%= f.label :email, t('users.email') %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
-
- <%= f.label :mobile_phone, t('users.mobile_phone') %>
- <%= f.telephone_field :mobile_phone, autofocus: true, autocomplete: "off", placeholder: "+372xxxxxxxx" %>
-
-
- <%= f.label :given_names, t('users.given_names') %>
- <%= f.text_field :given_names, autofocus: true %>
-
-
- <%= f.label :surname, t('users.surname') %>
- <%= f.text_field :surname, autofocus: true %>
-
-
- <%= f.password_field :password, autocomplete: "off" %>
-
<%= t('users.form.password_requirements', minimum: @minimum_password_length) if @minimum_password_length %>
-
-
- <%= f.label :password_confirmation, t('users.password_confirmation') %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
-
-
+
+
+
<%= t('auth.tara.form.data_from_identity_document') %>
+
diff --git a/app/views/users/_user_info.html.erb b/app/views/users/_user_info.html.erb
index 0e56e360f..3b64e1019 100644
--- a/app/views/users/_user_info.html.erb
+++ b/app/views/users/_user_info.html.erb
@@ -3,12 +3,11 @@
<%= @user.display_name %>
-
+
<%= tag.a href: edit_user_path(uuid: @user.uuid), data: { turbo_frame: 'user_info' } do %>
<% end %>
-
diff --git a/app/views/wishlist_items/_editable.html.erb b/app/views/wishlist_items/_editable.html.erb
index 00b6eed33..e4ffa37fd 100644
--- a/app/views/wishlist_items/_editable.html.erb
+++ b/app/views/wishlist_items/_editable.html.erb
@@ -17,19 +17,22 @@
<%= form_for wishlist_item, url: wishlist_item_path(uuid: wishlist_item.uuid), method: :patch do |f| %>
- <%= f.number_field :price, min: 5, step: "0.01", placeholder: item.price %>
+ <%= component 'common/form/number_field', form: f, attribute: :price, options: { min: 5, step: "0.01", placeholder: item.price } %>
+ <%# TODO: NEED TO MOVE TO COMPONENT %>
<%= f.button class: "c-btn c-btn--ghost c-btn--icon", data: { turbo_frame: 'wishlist_table' } do %>
-
+
+
+
+
<% end %>
+
<% end %>
- <%= link_to '#', class: "c-btn c-btn--ghost c-btn--icon js-edit-modal-toggle", data: { turbo_frame: 'wishlist_table' } do %>
-
- <% end %>
+ <%= component 'common/action_button', type: 'close', href: '#', options: { data: { turbo_frame: 'wishlist_table' } } %>
@@ -42,13 +45,9 @@
- <%= link_to edit_wishlist_item_path(item.uuid), class: "c-btn c-btn--ghost c-btn--icon js-edit-modal-toggle", data: { turbo_frame: 'wishlist_table' } do %>
-
- <% end %>
- <%= button_to wishlist_item_path(item.uuid), method: :delete, form: { data: { turbo_confirm: t(".confirm_delete") } },
- class: "c-btn c-btn--ghost c-btn--icon js-modal-delete-toggle", target: '_top' do %>
-
- <% end %>
+ <%= component 'common/action_button', type: 'edit', href: edit_wishlist_item_path(item.uuid), options: { data: { turbo_frame: 'wishlist_table' } } %>
+ <%= component 'common/action_button', type: 'delete', href: wishlist_item_path(item.uuid),
+ options: { method: :delete, form: { data: { turbo_confirm: t(".confirm_delete") } }, target: '_top' } %>
diff --git a/app/views/wishlist_items/_wishlist_items.html.erb b/app/views/wishlist_items/_wishlist_items.html.erb
index cdd9774e7..9d25baac3 100644
--- a/app/views/wishlist_items/_wishlist_items.html.erb
+++ b/app/views/wishlist_items/_wishlist_items.html.erb
@@ -16,13 +16,9 @@
<%= wishlist_item.price %> €
- <%= link_to edit_wishlist_item_path(wishlist_item.uuid), class: "c-btn c-btn--ghost c-btn--icon js-edit-modal-toggle", data: { turbo_frame: 'wishlist_table' } do %>
-
- <% end %>
- <%= button_to wishlist_item_path(wishlist_item.uuid), method: :delete, form: { data: { turbo_confirm: t(:are_you_sure) } },
- class: "c-btn c-btn--ghost c-btn--icon js-modal-delete-toggle", target: '_top' do %>
-
- <% end %>
+ <%= component 'common/action_button', type: 'edit', href: edit_wishlist_item_path(wishlist_item.uuid), options: { data: { turbo_frame: 'wishlist_table' } } %>
+ <%= component 'common/action_button', type: 'delete', href: wishlist_item_path(wishlist_item.uuid),
+ options: { method: :delete, form: { data: { turbo_confirm: t(:are_you_sure) } } } %>
<% end %>
diff --git a/app/views/wishlist_items/index.html.erb b/app/views/wishlist_items/index.html.erb
index 50e14d7cb..0b8b3e89b 100644
--- a/app/views/wishlist_items/index.html.erb
+++ b/app/views/wishlist_items/index.html.erb
@@ -39,8 +39,8 @@
<%= form_with model: @wishlist_item, url: wishlist_items_path do |f| %>
<%= f.hidden_field :user_id, value: @wishlist_item.user_id %>
- <%= f.text_field :domain_name, placeholder: t('auctions.domain_name'), data: { action: 'input->wishlist#domainCheck'} %>
- <%= f.button t(:submit), class: "c-btn c-btn--green c-wishlist__btn", id: "wishlist_item_form_commit", data: { turbo: false } %>
+ <%= component 'common/form/text_field', form: f, attribute: :domain_name, options: { placeholder: t('auctions.domain_name'), data: { action: 'input->wishlist#domainCheck'} } %>
+ <%= component 'common/form/form_button', form: f, btn_title: t(:submit), options: { data: { turbo: false }, id: "wishlist_item_form_commit" } %>
<% end %>