-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c73208
commit 3ffaa7f
Showing
33 changed files
with
802 additions
and
301 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ["form", "select"] | ||
static values = { | ||
select: String, | ||
} | ||
|
||
|
||
connect() { | ||
this.selectValue = this.selectTarget.value; | ||
} | ||
|
||
save() { | ||
if (confirm("Are you sure?") == true) { | ||
this.formTarget.requestSubmit() | ||
} else { | ||
this.selectTarget.value = this.selectValue; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<tr> | ||
<td><%= user.display_name %></td> | ||
<td><%= user.email %></td> | ||
<td style="text-align: center"> | ||
<label class="o-checkbox" for="with_deposit_participants"> | ||
<%= form.check_box :user_ids, { multiple: true, checked: auction.allow_to_set_bid?(user) }, user.id, nil %> | ||
<div class="o-checkbox__slider round"></div> | ||
</label> | ||
</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<div style='c-table c-table--sortable'> | ||
<h2><%= t('auctions.show.user_list') %></h2> | ||
<%= form_with url: admin_auction_path(@auction), method: :get, | ||
data: { controller: 'form--debounce', form__debounce_target: 'form', | ||
turbo_action: "advance", turbo_frame: "results", | ||
action: 'input->form--debounce#search' } do |form| %> | ||
<div class="c-table__filters"> | ||
<%= form.hidden_field :auction_id, value: auction.id %> | ||
<%= form.search_field :search_string, value: params[:search_string], placeholder: 'Input user name, email or phone number', class: 'c-table__search__input js-table-search-dt' %> | ||
<div> | ||
<label>Show only those who have made a deposit</label> | ||
<label class="o-checkbox" for="with_deposit_participants"> | ||
<%= form.check_box :with_deposit_participants, { data: { name: 'first_checkbox' } }, 1, nil %> | ||
<div class="o-checkbox__slider round"></div> | ||
</label> | ||
</div> | ||
<div> | ||
<label>Show only those who haven't made a deposit</label> | ||
<label class="o-checkbox" for="without_deposit_participants"> | ||
<%= form.check_box :without_deposit_participants, { data: { name: 'second_checkbox' } }, 1, nil %> | ||
<div class="o-checkbox__slider round"></div> | ||
</label> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<div class="content"> | ||
<%= form_with url: apply_auction_participants_admin_auctions_path do |form| %> | ||
<%= form.hidden_field :auction_uuid, value: auction.uuid %> | ||
<div class="c-table__filters"> | ||
<div class="c-table__filters__btns" style='display: flex !important; align-items: center !important; justify-content: space-between !important; width: 100%;'> | ||
<%= form.submit t('auctions.show.apply'), class: 'c-btn c-btn--blue', style: 'padding: 0 30px;' %> | ||
</div> | ||
</div> | ||
|
||
<% header_collection = [ { column: nil, caption: t('offers.price'), options: { class: "" } }, | ||
{ column: nil, caption: 'Email', options: { class: "" } }, | ||
{ column: nil, caption: t('auctions.show.allow'), options: { class: "" } },] %> | ||
|
||
<%= turbo_frame_tag "results" do %> | ||
<!-- Options attributes are used as table attributes --> | ||
<%= component 'common/table', header_collection:, options: { class: 'js-table-dt' } do %> | ||
<!-- "The body of the table also needs to be in the component block, so the component wraps it with the necessary tags." --> | ||
<%= tag.tbody id: "auctions-table-body", class: 'contents' do %> | ||
<%- if @users.present? %> | ||
<% @users.each do |user| %> | ||
<%= render partial: 'deposit_participant', locals: { user: user, form: form, auction: auction } %> | ||
<% end %> | ||
<%- else %> | ||
<tr> | ||
<td colspan="3" style="text-align: center; font-weight: bold; font-size: 1.2rem; padding: 3rem 0 !important;"><%= t(:no_offers) %></td> | ||
</tr> | ||
<%- end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= turbo_frame_tag "results" do %> | ||
<div class="column" style="margin-top:10px; text-align: center;"> | ||
<% if @pagy.pages > 1 %> | ||
<div class="footer"> | ||
<%== pagy_nav(@pagy) %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<%= component 'common/pagy', pagy: @pagy %> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<%= component 'common/hero', title: "#{t('.title')}: #{@auction.domain_name}" %> | ||
<div class="o-container"> | ||
<div class="c-table c-table--sortable" data-controller='form--bundle-checkbox'> | ||
<%= component 'common/table', header_collection: [], options: { class: 'js-table-dt dataTable no-footer' } do %> | ||
<%= tag.tbody id: "auctions-table-body", class: 'contents' do %> | ||
<tr> | ||
<td><strong><%= t('auctions.domain_name') %></strong></td> | ||
<td class="monospace"> | ||
<%= domain_name_with_embedded_colors(@auction.domain_name) %> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><strong><%= t('auctions.starts_at') %></strong></td> | ||
<td><%= I18n.l(@auction.starts_at) if @auction.starts_at.present? %> | ||
</tr> | ||
<tr> | ||
<td><strong><%= t('auctions.ends_at') %></strong></td> | ||
<td><%= I18n.l(@auction.ends_at) if @auction.ends_at.present? %></td> | ||
</tr> | ||
<%- if @auction.offer_from_user(current_user).present? %> | ||
<tr> | ||
<td><strong><%= t('auctions.your_current_price') %></strong></td> | ||
<td><%= @auction.current_price_from_user(current_user) %></td> | ||
</tr> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<div class="c-table__filters__btns" style='padding: 1rem 0; display: flex; justify-content: end;'> | ||
<%= button_to t(:delete), admin_auction_path(@auction), method: :delete, class: "c-btn c-btn--red", form: { data: { turbo_confirm: t(".confirm_delete") } } %> | ||
<%= link_to t(:result_name), admin_result_path(@auction.result), class: "c-btn c-btn--green" if @auction.result %> | ||
<%= link_to t(:versions_name), admin_auction_versions_path(@auction), class: "c-btn c-btn--blue" %> | ||
</div> | ||
|
||
<% header_collection = [ {column: nil, caption: t('offers.price'), options: {}}, | ||
{ column: nil, caption: t('users.display_name'), options: { class: "" } }, | ||
{ column: nil, caption: t(:created_at), options: { class: "" } }, | ||
{ column: nil, caption: t(:updated_at), options: { class: "" } }, | ||
{ column: nil, caption: t(:versions_name), options: { class: "" } }] %> | ||
<%= component 'common/table', header_collection:, options: { class: 'js-table-dt' } do %> | ||
<%= tag.tbody id: "auctions-table-body", class: 'contents' do %> | ||
<%- if @offers.present? %> | ||
<tr class="offers-table-row"> | ||
<td><%= t('offers.price_in_currency', price: offer.price) %></td> | ||
<td><%= offer.user&.display_name || t(:deleted_user) %></td> | ||
<td><%= I18n.l(offer.created_at) %></td> | ||
<td><%= I18n.l(offer.updated_at) %></td> | ||
<td><%= link_to t(:versions_name), admin_offer_versions_path(offer), class: "ui button primary" %></td> | ||
</tr> | ||
<%- else %> | ||
<tr> | ||
<td colspan="5" style="text-align: center; font-weight: bold; font-size: 1.2rem; padding: 3rem 0 !important;"><%= t(:no_offers) %></td> | ||
</tr> | ||
<%- end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if @auction.enable_deposit? %> | ||
<%= render partial: 'deposit_participants', locals: { auction: @auction } %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.