-
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.
implemented admin auction page, refactor the logic, update ordeable s…
…timulus controller
- Loading branch information
1 parent
41ca969
commit a4b87c7
Showing
27 changed files
with
551 additions
and
303 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
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
20 changes: 20 additions & 0 deletions
20
app/javascript/controllers/form/bundle_checkbox_controller.js
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,20 @@ | ||
// app/javascript/controllers/debounce_controller.js | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ["hiddenField", "checkboxes"]; | ||
|
||
collect_ids() { | ||
if(this.hasCheckboxesTarget == false) return; | ||
|
||
const regx = /\d+/; | ||
this.hiddenFieldTarget.value = ''; | ||
|
||
this.checkboxesTargets.forEach((el) => { | ||
if (el.checked == false) return; | ||
|
||
const element_id = el.id; | ||
this.hiddenFieldTarget.value += ` ${element_id.match(regx)}` | ||
}); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
app/javascript/controllers/form/checkbox_toggle_controller.js
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,16 @@ | ||
// app/javascript/controllers/check_controller.js | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ["enableDeposit", "disableDeposit"]; | ||
|
||
connect() { | ||
this.enableDepositTarget.addEventListener('click', (source) => { | ||
this.disableDepositTarget.checked = false; | ||
}); | ||
|
||
this.disableDepositTarget.addEventListener('click', (source) => { | ||
this.enableDepositTarget.checked = false; | ||
}); | ||
} | ||
} |
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 was deleted.
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,22 @@ | ||
|
||
<%# name_frame_id = dom_id(auction) %> | ||
<tr class="auctions-table-row" data-turbo-frame="auction_<%= auction.id %>"> | ||
<td class="text-center"> | ||
<%= f.check_box :auction_ids, { multiple: true }, auction.id, nil %> | ||
</td> | ||
<td class="auction-domain-name monospace"> | ||
<%= link_to(admin_auction_path(auction.id), target: '_top') do %> | ||
<%= domain_name_with_embedded_colors(auction.domain_name) %> | ||
<% end %> | ||
</td> | ||
<td><%= auction.starts_at %></td> | ||
<td><%= auction.ends_at %></td> | ||
<td class="auction-highest-offer"><%= auction.highest_offer_id.present? ? auction.highest_price : t('.no_price')%></td> | ||
<td class="auction-offers-count"><%= auction.number_of_offers %></td> | ||
<td class="auction-turns-count"><%= auction.turns_count %></td> | ||
<td class="auction-turns-count"><%= auction.starting_price %></td> | ||
<td class="auction-turns-count"><%= auction.slipping_end %></td> | ||
<td class="auction-platform"><%= auction.platform %></td> | ||
<td class="auction-platform"><%= auction.deposit %></td> | ||
<td class="auction-platform"><%= auction.enable_deposit %></td> | ||
</tr> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.