forked from nanego/my-dcim
-
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.
341610 - Add child block table on #show (nanego#215)
* wip - sites * wip - rooms * feat: add lazy loaded rooms on Sites#show * feat: add lazy loaded islets on RoomsController#show * feat: add lazy loaded bays on IsletsController#show * feat: add lazy loaded frames on BaysController#show * feat: add lazy loaded servers on FramesController#show * style: code cleanup * tests: add tests on HasManyTurboFrameComponent and previews * Fix dropdown in table-responsive --------- Co-authored-by: Maximilien Bausson <[email protected]> Co-authored-by: Nicolas Brousse <[email protected]> Co-authored-by: B_Rass <[email protected]>
- Loading branch information
1 parent
8e18f28
commit 6554073
Showing
22 changed files
with
305 additions
and
199 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# frozen_string_literal: true | ||
|
||
class HasManyTurboFrameComponent < ApplicationComponent | ||
include Turbo::FramesHelper | ||
|
||
erb_template <<~ERB | ||
<%= render CardComponent.new do |c| %> | ||
<% c.with_header do %> | ||
<h3><%= @title %></h3> | ||
<%= link_to @url do %> | ||
<%= t(".see_more") %> | ||
<% end %> | ||
<% end %> | ||
<%= turbo_frame_tag(@frame_id, loading: :lazy, src: @url) do %> | ||
<div class="w-100 d-flex justify-content-center align-items-center gap-3"> | ||
<span><%= t(".loading") %></span> | ||
<span class="spinner-border spinner-border-sm p-4"></span> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
ERB | ||
|
||
def initialize(title, url:, frame_id:) | ||
@title = title | ||
@url = url | ||
@frame_id = frame_id | ||
|
||
super() | ||
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
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
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.