This repository was archived by the owner on Jul 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add breadcrumbs support across application #1897
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b9f1faf
Add breadcrumbs support across application
Shpigford e648c6a
Potential fix for tests
Shpigford c2fc4bb
Simplify breadcrumbs implementation
Shpigford c01feb4
Refactor page header and breadcrumbs rendering
Shpigford 62cdfb5
Add fallback breadcrumbs rendering to settings layout
Shpigford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ def picker | |
| end | ||
|
|
||
| private | ||
|
|
||
| def budget_create_params | ||
| params.require(:budget).permit(:start_date) | ||
| end | ||
|
|
||
This file contains hidden or 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,13 @@ | ||
| module Breadcrumbable | ||
| extend ActiveSupport::Concern | ||
|
|
||
| included do | ||
| before_action :set_breadcrumbs | ||
| end | ||
|
|
||
| private | ||
| # The default, unless specific controller or action explicitly overrides | ||
| def set_breadcrumbs | ||
| @breadcrumbs = [ [ "Home", root_path ], [ controller_name.titleize, nil ] ] | ||
| end | ||
| end | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ def clear_filter | |
| end | ||
|
|
||
| private | ||
|
|
||
| def search_params | ||
| cleaned_params = params.fetch(:q, {}) | ||
| .permit( | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| <%# locals: (breadcrumbs:) %> | ||
|
|
||
| <nav class="flex items-center gap-2 mb-6"> | ||
| <button data-action="sidebar#toggle" class="w-9 h-9 inline-flex rounded-lg items-center justify-center hover:bg-gray-100 cursor-pointer"> | ||
| <%= icon("panel-left", color: "gray") %> | ||
| </button> | ||
|
|
||
| <% breadcrumbs.each_with_index do |(name, path), index| %> | ||
| <% if index > 0 %> | ||
| <%= icon("chevron-right", color: "gray", size: "sm") %> | ||
| <% end %> | ||
|
|
||
| <% if path.present? && index < breadcrumbs.size - 1 %> | ||
| <%= link_to name, path, class: "text-sm text-gray-500 font-medium" %> | ||
| <% elsif index == breadcrumbs.size - 1 %> | ||
| <span class="text-gray-900 font-medium text-sm"><%= name %></span> | ||
| <% else %> | ||
| <span class="text-sm text-gray-500 font-medium"><%= name %></span> | ||
| <% end %> | ||
| <% end %> | ||
| </nav> |
This file contains hidden or 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,11 @@ | ||
| <%# This partial renders the page header with title and optional subtitle %> | ||
| <header class="space-y-6"> | ||
| <% if local_assigns[:title].present? %> | ||
| <div class="space-y-1"> | ||
| <h1 class="text-3xl font-medium text-gray-900"><%= title %></h1> | ||
| <% if local_assigns[:subtitle].present? %> | ||
| <p class="text-gray-500"><%= subtitle %></p> | ||
| <% end %> | ||
| </div> | ||
| <% end %> | ||
| </header> |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.