-
Notifications
You must be signed in to change notification settings - Fork 0
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
1ca5444
commit b3bfdc6
Showing
12 changed files
with
147 additions
and
32 deletions.
There are no files selected for viewing
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
5 changes: 5 additions & 0 deletions
5
app/controllers/invoice_details/linkpay_informations_controller.rb
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,5 @@ | ||
class InvoiceDetails::LinkpayInformationsController < ParentController | ||
def show | ||
@info = Invoice.find(params[:id])&.linkpay_info | ||
end | ||
end |
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 |
---|---|---|
@@ -1,29 +1,108 @@ | ||
<div class="container mx-auto"> | ||
<div class='flex flex-row'> | ||
<div> | ||
|
||
<%= form_with url: invoice_creators_path, | ||
method: :get, | ||
data: { controller: 'debounce', | ||
debounce_target: 'form', | ||
turbo_action: "advance", | ||
turbo_frame: "results", | ||
action: 'input->debounce#search' | ||
} do |form| %> | ||
<%= form.search_field :invoice_number, value: params[:invoice_number], | ||
class: 'w-full pl-3 pr-10 py-2 border-2 border-gray-200 rounded-xl hover:border-gray-300 focus:outline-none focus:border-blue-500 transition-colors mb-7 bg-white', | ||
placeholder: 'Type by invoice' %> | ||
|
||
<div class="flex flex-row items-center justify-evenly bg-gray-200 p-4 m-4"> | ||
|
||
<div> | ||
<%= form.select :status, Invoice.statuses, {include_blank: 'Invoice status' }, { class: 'border-0 px-3 py-3 placeholder-gray-300 text-gray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full ease-linear transition-all duration-150'} %> | ||
</div> | ||
|
||
<%= form.hidden_field :sort, value: params[:sort], data: { sort_link_target: "sort"} %> | ||
<%= form.hidden_field :direction, value: params[:direction], data: { sort_link_target: "direction"} %> | ||
|
||
<div class="w-full sm:w-1/2 pt-6 sm:pl-4 text-center mx-10" | ||
data-controller="range-slider" | ||
data-range-slider-min-value="<%= @min_amount %>" | ||
data-range-slider-max-value="<%= @max_amount %>" | ||
style="width: 250px;"> | ||
|
||
<div data-range-slider-target="slider"></div> | ||
|
||
<%= form.hidden_field :min_amount, | ||
value: params[:min_amount] || @min_amount, | ||
data: { range_slider_target: "currentMin" } %> | ||
|
||
<%= form.hidden_field :max_amount, | ||
value: params[:max_amount] || @max_amount, | ||
data: { range_slider_target: "currentMax" } %> | ||
|
||
<div class="bottom-0 text-sm font-medium text-gray-500"> | ||
Invoice amount | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<%= form.select :per_page, options_for_select([5, 10, 25, 50, 100], | ||
selected: params[:per_page]), { }, { class: 'border-0 px-3 py-3 placeholder-gray-300 text-gray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full ease-linear transition-all duration-150'} %> | ||
</div> | ||
|
||
<div class='flex items-baseline justify-start'> | ||
<p class="text-sm text-gray-700"> | ||
Total pages: | ||
<span class="font-medium"><%= @pagy.pages %></span> | ||
</p> | ||
<%= form.number_field :page, | ||
class: 'w-full px-2 py-2 border-2 border-gray-200 rounded-xl hover:border-gray-300 focus:outline-none focus:border-blue-500 transition-colors bg-white w-64' %> | ||
</div> | ||
|
||
</div> | ||
<% end %> | ||
|
||
<div class='flex flex-row justify-end'> | ||
<%= link_to 'New Invoice', new_invoice_creator_path, | ||
class: 'h-10 py-2 my-1 px-4 border border-transparent text-sm font-semibold rounded-md text-white bg-violet-700 hover:bg-violet-800 transition duration-150 ease-in-out shadow-md cursor-pointer' %> | ||
</div> | ||
|
||
<div> | ||
<table class="min-w-full mt-6"> | ||
<thead> | ||
<tr> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">Invoice number</th> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">Status</th> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">transaction_amount</th> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">Linkpay URL</th> | ||
</tr> | ||
</thead> | ||
<tbody id="invoices"> | ||
<% @invoices.each do |invoice| %> | ||
<tr> | ||
<td class="px-6 py-1 border-b border-gray-200"><%= invoice.invoice_number %></td> | ||
<td class="px-6 py-1 border-b border-gray-200"><%= invoice.status %></td> | ||
<td class="px-6 py-1 border-b border-gray-200"><%= invoice.transaction_amount %></td> | ||
<td class="px-6 py-1 border-b border-gray-200 break-all"><%= invoice.everypay_response["linkpay"] if invoice.everypay_response.present? %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<%= turbo_frame_tag "results" do %> | ||
<table class="min-w-full mt-6"> | ||
<thead> | ||
<tr> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">Invoice number</th> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">Status</th> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">transaction_amount</th> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">Linkpay Info</th> | ||
<th class="px-6 py-1 border-b border-gray-200 bg-gray-50 text-left text-xs text-gray-500 uppercase">Everypay Response Info</th> | ||
</tr> | ||
</thead> | ||
<tbody id="invoices"> | ||
<%= turbo_frame_tag "modal" %> | ||
<% @invoices.each do |invoice| %> | ||
<tr> | ||
<td class="px-6 py-1 border-b border-gray-200"><%= invoice.invoice_number %></td> | ||
<td class="px-6 py-1 border-b border-gray-200"><%= invoice.status %></td> | ||
<td class="px-6 py-1 border-b border-gray-200"><%= invoice.transaction_amount %></td> | ||
<td class="px-6 py-1 break-all border-b border-gray-200"> | ||
<%= link_to invoice_details_linkpay_information_path(invoice), class: 'w-6 h-6 p-2 rounded-full bg-blue-300 hover:bg-blue-500 text-black border-gray-300 flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black text-center', data: { turbo_frame: 'modal' } do %> | ||
<i class="fa-solid fa-info"></i> | ||
<% end %> | ||
</td> | ||
<td class="px-6 py-1 break-all border-b border-gray-200"> | ||
<%= link_to invoice_details_everypay_response_path(invoice), class: 'w-6 h-6 p-2 rounded-full bg-blue-300 hover:bg-blue-500 text-black border-gray-300 flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black text-center', data: { turbo_frame: 'modal' } do %> | ||
<i class="fa-solid fa-info"></i> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<% if @pagy.pages > 1 %> | ||
<div class="footer text-center mt-2"> | ||
<%== pagy_nav(@pagy) %> | ||
</div> | ||
<% end %> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<%= render 'shared/modal', title: 'Linkpay Informations' do %> | ||
<%= JSON.pretty_generate(@info) %> | ||
<% end %> |
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
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,5 @@ | ||
class AddLinkpayInfoToInvoices < ActiveRecord::Migration[7.0] | ||
def change | ||
add_column :invoices, :linkpay_info, :jsonb, default: {}, null: true | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.