-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new boards with Turbo Streams
- Loading branch information
Showing
6 changed files
with
58 additions
and
43 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,31 @@ | ||
<div id= <%= dom_id(board) %> class="col-3 my-3"> | ||
<div class="card border border-primary-grey-200"> | ||
<%= turbo_frame_tag dom_id(board, :edit) do %> | ||
<div class="card-header bg-primary-grey-200"> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<h5 class="card-title mb-0"> | ||
<%= link_to board.name, board, data: { turbo_frame: '_top'}, class: 'link-underline link-underline-opacity-0' %> | ||
</h5> | ||
<div class="d-flex gap-2"> | ||
<%= link_to edit_board_path(board), class: 'text-default' do %> | ||
<i class="fa-solid fa-pencil text-primary-dark-600"></i> | ||
<% end %> | ||
<%= link_to board, data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'text-danger' do %> | ||
<i class="fa-solid fa-trash text-primary-dark-600"></i> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
<div class="card-body bg-primary-grey-100"> | ||
<div class="card-text"> | ||
<p> | ||
<%= "Columns: #{board.board_columns.size}" %> | ||
</p> | ||
<p> | ||
<%= "Cards: #{board.board_columns.joins(:cards).count}" %> | ||
</p> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<%= turbo_stream.append 'boards' do %> | ||
<%= render 'boards/board', board: @board %> | ||
<% end %> | ||
<%= turbo_stream.update dom_id(Board.new) do %> | ||
<%= link_to 'New Board', new_board_path, class: 'btn btn-outline-primary' %> | ||
<% 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,7 +1,7 @@ | ||
<h1 class="text-primary-dark-500">New Board</h1> | ||
|
||
<div class="row w-100 justify-content-center mt-3"> | ||
<div class="col-6"> | ||
<%= turbo_frame_tag dom_id(@board) do %> | ||
<%= render 'form' %> | ||
</div> | ||
<% end %> | ||
</div> |